Overview
Hello again, everyone! I've added another fun little work-in-progress toy to my larger space exploration epic to go along with my Galaxy Generator and Endless Ships! toys. This one I'm calling Station Run!, as it's your basic run-and-gun platformer. Highlights of this toy include procedurally-generated levels and fast, fluid player controls.
Your objective is simple: travel down through all ten levels on a randomly-generated space station to claim victory. Keep running into robots to claim defeat.
Controls
Arrow keys: movement
X: jump/jetpack (double-tap for maximum boost)
O: shoot
down+X: drop down from catwalks
up: enter door/interact
Use the left/right/up arrow keys to aim.
Shooting while moving decreases accuracy.
Shooting while standing still will hold your position.
Falls will not injure the player (yet!)
Robots will injure the player
Commentary
If you've played around with the other toys in this project, you've noticed a heavy theme on procedural generation, and Station Run! is no different. The big fun thing here is the procedurally-generated levels: given a single numeric seed, I can deterministically build large, randomized, engaging stations with multiple levels to explore. At the heart of the level-generation function is Prim's algorithm, a shortest-path graph traversal algorithm that translates neatly to a grid-based model:
- Create a random sized grid of "rooms"
- Assign each room a random number as its weight
- Pick a room to start with
- Using Prims algorithm, find the lowest-weight immediate neighbor to the currently connected rooms and connect it
- Continue until all rooms are connected
Once the rooms have been built, we can add some polish: introduce some randomness to the size and shape of the rooms, add some catwalk platforms for variety, and ensure that there are no unrecoverable drops by adding catwalks where there's too much vertical space. Then, add a bunch of dumb ol' malfunctioning robots to shoot at.
I'm planning to tie this toy into the larger game by generating one or more space stations at different planets for the player to explore. Some stations will be big and hostile, like the one in this toy; others will be small and have shops for the player to explore; still others will be attached to randomly generated missions that the player will be able to discover and accept.
Procedural generation is fun!
[Please log in to post a comment]