The Quick 'N' Dirty Galaxy Generator builds off of my my Quick 'N' Dirty Planet Generator by adding procedurally generated planets, routes, names, and governments to create a nice, compact little galaxy to explore. Right now, it's just a toy, but you can probably see where I'm planning to go with this!
Version 0.2 update: Saving Things!
- Added auto-saving and auto-loading of the galaxy and the current state of your exploration. Reload your browser and pick right back up where you left off!
- Fixed a bug where the same governments and government colors were chosen over and over
- Fixed a bug where governments could take over the capitals of other governments during generation
- Added "new galaxy" button
The save functionality is both simple and nifty: basically, just poke all the values I want to save in sequence to general memory with poke, write this memory in chunks to the cart data using peek and dset, then reverse the process to load. You can store a surprising amount of data this way!
Map feels a bit flat, compared to the pseudo 3D of the planets.
Even if it's just circles and lines, having the coordinate be 3D and give the possibility to rotate the 3D map would be pretty cool.
The pico8 32 colors palette has a lot of greens, that can be used to make a gradient. Using tlines with green gradient with brighter in the front and darker in the back could help sell the 3Dness of the map, even if it's really just circles and (t)lines in the end. Just a thought. If you need the tokens for the actual game play, that should be the priority.
I might add some parallax background to the map, but I'm inclined to keep it 2D for a few reasons, token count not being the least of them. I've always liked the look of 3D maps, but I've never really liked the function of them–they always feel clunky and trickier to visualize and navigate than a simple 2D projection. (I'm lookin' at you, Starfield. 😐) All that said, I do like the idea of using a tline to fake the routes, that's a clever and lightweight hack. I might look into trying to pack that in here, though I'd probably stick to the greyscale to minimize palette juggling. Thanks!
I've already burned a lot of tokens on the map and planet rendering (along with half my sprites and map space), and I've got a lot more I'd like to cram into this cart, so I'm likely to pull more out of this than I'd like to put in. That said: the main routines that generate the data for the map and planets are both reasonably compact and entirely deterministic, which will be extremely useful when it comes time to load a saved game.
I still have some cleanup to do here–for example, I forgot to shuffle the government types, and I've noticed that the territory-building algorithm can take over other capitals, which is behavior I want to avoid. It's still a fun start, though!
Aw, thank you! It's a simple Diamond-Square algorithm with some normalization and creative gradient application. (I'm still not thrilled with it, there are some obvious artifacts, but it's good enough for now!)
I love playing with the intersection between pure procedural generation and manual intervention. With the right nudges, you can develop some really interesting stuff!
Also, I forgot to give a shout-out to @Meep in the original post, who did the legwork of extracting PICO-8's RNG into code, which is what's letting me do deterministic generation efficiently and effectively.
Thank you, @Meep!
[Please log in to post a comment]