The Toy Universe: Simple World Generation
August 9, 2013
Posted by on
So far we’ve thrown together a quick system for making star maps. The main feature we have so far is that we make them with a pseudo-random method, so we don’t have to hand-craft our universe or keep up with all of it its data and nuances. But it can get distracting. Our tool for exploring imaginary universes doubles as a tool for exploring some recreational mathematics– and the danger here is that the math is liable to get more interesting than any game we might want to design!
Another problem is… I’m setting up an environment for exploratory game design– but that’s just hipster talk for saying that I don’t know what I want to do, yet. So this week’s feature is… a really simple system for making design sequences on the fly. All we do is… make our star map as usual. We’ve got a list of hexes with “stuff” in it. And each hex has it’s own function defined that will return the exact same sequence of numbers every time we call it– usually about two hundred numbers given how we rigged this up. The first number is used to determine system-presence, but we’ll the next few in the series to sketch out what the place is like.
The main feature I added here was to allow the user to define arrays interactively. These are just lists of descriptors that aren’t too different from the tables you roll on in role playing games. Once the user has set up the arrays… he picks out the ones he wants to combine… and he evaluates them for each world. Here’s a sample run to illustrate what I mean:
> l 4 6
> d 0 3500
Making dots between 0 and 3500.
Found world in 0101 with seed 7714: 2872
Found world in 0106 with seed 5063: 0553
Found world in 0201 with seed 8309: 3444
Found world in 0203 with seed 8095: 1164
Found world in 0205 with seed 9344: 2674
Found world in 0302 with seed 0102: 0361
Found world in 0303 with seed 5565: 2079
Found world in 0401 with seed 1231: 3131
Found world in 0405 with seed 6222: 1476
Found world in 0406 with seed 5263: 2084
> defarray mods mercantile idle sketchy decadent
> defarray types water desert forest lava paradise mountain city
> evaluate mods types
0101 sketchy paradise
0106 mercantile city
0201 decadent paradise
0203 sketchy paradise
0205 idle lava
0302 decadent paradise
0303 decadent desert
0401 decadent city
0405 sketchy lava
0406 idle paradise
Okay… it works… but it needs work. I had this idea that “idle” worlds would have low-productivity or something– maybe it would factor into an economic game or something. But that one is just dumb. Of course, thanks to my nifty tool, all I’d have to do is back up and replace it with something better. I wouldn’t even have to recompile. (I won’t have to fool with a database, either.) I could also add in more tables and recombine them in different ways. This is a really simple system… but just looking at the problems with it, I’m starting to get some ideas. Which was the whole idea in the first place….
The code for this post is here.