Skip to content

Vanilla placement#97

Closed
aquanight wants to merge 3 commits into
blkerby:mainfrom
aquanight:vanilla-placement
Closed

Vanilla placement#97
aquanight wants to merge 3 commits into
blkerby:mainfrom
aquanight:vanilla-placement

Conversation

@aquanight
Copy link
Copy Markdown
Contributor

Adds ability to restrict location of items to their vanilla positions - i.e. "map-only" randomization.

@blkerby
Copy link
Copy Markdown
Owner

blkerby commented Aug 26, 2024

I did some testing on Hard/Tame settings and didn't get a successful generation; in most cases it failed from reaching the 2000 attempt limit. Also got this panic one time:

[2024-08-26T00:44:01.953Z INFO  maprando_web::web::randomize] Random seed=3469723904, max_attempts_per_map=1, max_map_attempts=2000, difficulty=DifficultyConfig { name: Some("Hard"), tech: ["canAwakenZebes", "canBombHorizontally", "canCameraManip", "canCarefulJump", "canCeilingClip", "canConsecutiveWalljump", "canCrossRoomJumpIntoWater", "canCrouchJump", "canDelayedWalljump", "canDisableEquipment", "canDodgeWhileShooting", "canDownBack", "canDownGrab", "canEscapeEnemyGrab", "canGateGlitch", "canGravityJump", "canHeatRun", "canHeroShot", "canHitbox", "canHorizontalDamageBoost", "canHorizontalShinespark", "canHyperGateShot", "canIBJ", "canIframeSpikeJump", "canJumpIntoIBJ", "canLateralMidAirMorph", "canManageReserves", "canMidAirMorph", "canMidairShinespark", "canMochtroidIceClimb", "canMockball", "canNeutralDamageBoost", "canOffScreenSuperShot", "canPlayInSand", "canPowerBombMidIBJ", "canPreciseGrapple", "canPreciseWalljump", "canPseudoScrew", "canResetFallSpeed", "canShinechargeMovement", "canShinespark", "canSnailClimb", "canSpaceJumpWaterBounce", "canSpecialBeamAttack", "canSpringBallBounce", "canSpringBallJumpMidAir", "canStaggeredWalljump", "canStopOnADime", "canSuitlessLavaDive", "canSuitlessMaridia", "canSunkenTileWideWallClimb", "canTrickySpringBallJump", "canTrickyUseFrozenEnemies", "canTrivialMidAirMorph", "canTrivialUseFrozenEnemies", "canTurnaroundSpinJump", "canTwoTileSqueeze", "canUseEnemies", "canUseFrozenEnemies", "canUseGrapple", "canUseSpeedEchoes", "canWallJumpInstantMorph", "canWalljump", "canWaterShineCharge", "canXRayCeilingClip", "canXRayStandUp", "canXRayWaitForIFrames"], notable_strats: ["Alcatraz Escape", "Aqueduct Snail Clip", "Back-Side Botwoon Fight with Charge and Wave", "Big Pink Off Screen Super Block", "Big Pink Return Through Crumble Blocks", "Blue Brin E-Tank Return Through Crumble Blocks", "Blue Brinstar E-Tank Ceiling Damage Boost", "Botwoon Hallway Mochtroid Ice Clip", "Bubble Mountain Damage Boost", "Crab Tunnel Suitless Green Gate Glitch", "Croc Speedway Reverse Spark", "Crumble Shaft Top Item Frozen Sova", "Double Chamber Walljump Climb Using the Kamer", "Draygon Grapple Kill", "Early Supers Mockball", "East Pants Room Puyo Clip", "Etecoon E-Tank Beetom Clip", "Golden Torizo Horizontal Bomb Jump", "Green Hill Zone Wall Jump to Top Right Door", "HiJump E-Tank Return Through Crumble Blocks", "Moat SpringBall Bounce", "Mother Brain Ice Zebetite Skip", "Mother Brain Speed Zebetite Skip", "Pink Hopper Reverse Gate Glitch", "Red Tower Hero Shot", "Reverse Tourian Escape Room 4 Dodge While Climbing", "Shaktool Room Reverse", "Suitless Botwoon Kill", "Upper Norfair Farming Room Gate Glitch With Farming"], shine_charge_tiles: 20.0, heated_shine_charge_tiles: 24.0, shinecharge_leniency_frames: 60, speed_ball_tiles: 35.0, progression_rate: Uniform, random_tank: true, spazer_before_plasma: true, stop_item_placement_early: false, item_pool: [(ETank, 14), (Missile, 46), (PowerBomb, 10), (ReserveTank, 4), (Super, 10)], starting_items: [], item_placement_style: Forced, item_location_restriction: Vanilla, item_priority_strength: Moderate, item_priorities: [ItemPriorityGroup { name: "Early", items: ["Bombs", "Charge", "ETank", "Grapple", "HiJump", "Ice", "Morph", "Plasma", "PowerBomb", "ReserveTank", "Spazer", "SpeedBooster", "SpringBall", "Super", "Wave", "XRayScope"] }, ItemPriorityGroup { name: "Default", items: ["ScrewAttack", "SpaceJump", "WallJump"] }, ItemPriorityGroup { name: "Late", items: ["Gravity", "Varia"] }], semi_filler_items: [], filler_items: [Missile, Nothing, Charge, ETank, Ice, Plasma, PowerBomb, ReserveTank, Spazer, Super, Wave, XRayScope], early_filler_items: [ETank], resource_multiplier: 1.5, gate_glitch_leniency: 14, door_stuck_leniency: 2, escape_timer_multiplier: 1.4, phantoon_proficiency: 0.5, draygon_proficiency: 0.5, ridley_proficiency: 0.5, botwoon_proficiency: 0.5, mother_brain_proficiency: 0.5, supers_double: true, mother_brain_fight: Skip, escape_movement_items: true, escape_refill: true, escape_enemies_cleared: true, mark_map_stations: true, room_outline_revealed: true, transition_letters: true, door_locks_size: Large, item_markers: ThreeTiered, item_dot_change: Fade, all_items_spawn: true, acid_chozo: true, buffed_drops: true, fast_elevators: true, fast_doors: true, fast_pause_menu: true, respin: true, infinite_space_jump: true, momentum_conservation: true, objectives: [Kraid, Phantoon, Draygon, Ridley], doors_mode: Ammo, start_location_mode: Ship, save_animals: No, early_save: true, area_assignment: Standard, wall_jump: Vanilla, etank_refill: Vanilla, maps_revealed: Partial, map_station_reveal: Full, energy_free_shinesparks: false, vanilla_map: false, ultra_low_qol: false, skill_assumptions_preset: Some("Hard"), item_progression_preset: None, quality_of_life_preset: Some("Max"), debug_options: None }
...
[2024-08-26T00:44:02.715Z INFO  maprando_web::web::randomize] Attempt 188/2000: Map seed=3583516293, door randomization seed=3467153718, item placement seed=3371607008
[2024-08-26T00:44:02.715Z INFO  maprando::randomize] [attempt 188] Item precedence: [HiJump, Bombs, SpringBall, Wave, ETank, Grapple, Super, SpeedBooster, ScrewAttack, SpaceJump, ReserveTank, Spazer, WallJump, Morph, Gravity, Plasma, Charge, XRayScope, Varia, Ice, PowerBomb, Missile, Nothing]
[2024-08-26T00:44:02.716Z INFO  maprando::randomize] [attempt 188] Beginning vanilla placement attempt
[2024-08-26T00:44:02.716Z INFO  maprando::randomize] [attempt 188] Placing [SpeedBooster], []
[2024-08-26T00:44:02.716Z INFO  maprando::randomize] [attempt 188] SpeedBooster in tier 2 (of 3)
[2024-08-26T00:44:02.717Z INFO  maprando::randomize] [attempt 188] step=1, bireachable=4, reachable=4, placed=1, collected=1
[2024-08-26T00:44:02.717Z INFO  maprando::randomize] [attempt 188] Beginning vanilla placement attempt
[2024-08-26T00:44:02.718Z INFO  maprando::randomize] [attempt 188] Placing [Varia], []
[2024-08-26T00:44:02.718Z INFO  maprando::randomize] [attempt 188] Varia in tier 2 (of 3)
[2024-08-26T00:44:02.718Z INFO  maprando::randomize] [attempt 188] step=2, bireachable=5, reachable=5, placed=3, collected=3
[2024-08-26T00:44:02.719Z INFO  maprando::randomize] [attempt 188] Beginning vanilla placement attempt
[2024-08-26T00:44:02.720Z INFO  maprando::randomize] [attempt 188] Exhausted key item placement attempts
[2024-08-26T00:44:02.720Z INFO  maprando::randomize] [attempt 188] step=3, bireachable=5, reachable=13, placed=4, collected=4
[2024-08-26T00:44:02.721Z INFO  maprando::randomize] [attempt 188] Beginning vanilla placement attempt
thread 'actix-rt|system:0|arbiter:0' panicked at maprando/src/randomize.rs:3110:52:
index out of bounds: the len is 1 but the index is 1
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: maprando::randomize::Randomizer::select_key_items
   4: maprando::randomize::Randomizer::step
   5: maprando::randomize::Randomizer::randomize
   6: <maprando_web::web::randomize::randomize as actix_web::service::HttpServiceFactory>::register::randomize::{{closure}}
   7: actix_web::handler::handler_service::{{closure}}::{{closure}}
   8: <actix_web::resource::Resource<T> as actix_web::service::HttpServiceFactory>::register::{{closure}}::{{closure}}
   9: <actix_service::map_err::MapErrFuture<A,Req,F,E> as core::future::future::Future>::poll
  10: actix_http::h1::dispatcher::InnerDispatcher<T,S,B,X,U>::poll_response
  11: <actix_http::h1::dispatcher::Dispatcher<T,S,B,X,U> as core::future::future::Future>::poll
  12: tokio::runtime::task::raw::poll
  13: tokio::task::local::LocalSet::tick
  14: tokio::task::local::LocalSet::run_until::{{closure}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

The idea behind this PR is interesting, but I'm not sure if it makes sense to support in the randomizer at this point in time:

  • The failure rate seems extremely high. Other settings like Ammo doors also increase failure rate but not nearly to the same extent as what we're seeing here.
  • High failure rate means it would be common for users to encounter errors when trying to generate seeds. Increasing the failure limit could help some with that, but then generation would become slow and use a lot of CPU, potentially risking of the health of the service for other users.
  • The high failure rate is likely to translate into a tiny effective map pool when using Ship start.
  • The maintenance costs are likely to be substantial. The item placement logic is already a fairly thorny part of the code, and this feature would significantly add to its complexity, increasing the risk of problems later on.

This is an interesting experiment though. To me it's looking like vanilla placement makes the randomization overly constrained. Even if the failure rate could be improved, I'm not convinced that it would play very well with other item progression settings, i.e. it's probably going to interfere a lot with their intended effects.

@blkerby blkerby closed this Sep 7, 2024
@aquanight aquanight deleted the vanilla-placement branch September 26, 2025 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants