Basically, I'm planning on making a simulator in BYOND that simulates a country as it goes through history. Think Dwarf Fortress pre-embark.
Thus, I want to have some kind of complex world generation (Again, think DF), that includes generating random deserts, forests, mountain and everything.
The closest to world generation my competence in DM allows, is randomly selecting icon states when the world is created, and what I'm looking for is... Well, a tad more complex.
I also need some way to save the whole world, including locations of mobs and objects and everything when the player logs out.
I don't mind if the generation takes a while, that's okay. I just need a suggestion on how to do this. Anybody? o:
ID:154944
![]() Nov 1 2011, 8:28 am
|
|
![]() Nov 1 2011, 9:40 am
|
|
I believe Swapmaps could easily handle this.
|
I see. I thought of using it, but I'm not really used to using libraries so I though I'd look here for opinions.
Anyways, thanks. |
SwapMaps is not needed for this, I'm rather recommend the DMM_Suit, however what you requested is easily possible via the use of a nested while() loop that runs across both the world.maxx and world.maxy
|
I looked into DMM_Suit before Swapmaps, but I couldn't really figure out what it was supposed to do. I'm not a super advanced coder, I do most of my stuff with looooots of simple lines to make something advanced.
However, how would I be able to generate a whole world of a random shape with a simple while() proc? Wouldn't I just end up with a ton of grass tiles cluttered over a water background with a sand tile in between? D: I'm not really skilled in theory like this, got any example? |
I'm actually going to make a blog post about this, since the arrival of Minecraft, I'm sure many games would like some kind of article on world generation. But like I said, this could take me a few days to write up.
|
Shaoni wrote:
Basically, I'm planning on making a simulator in BYOND that simulates a country as it goes through history. Think Dwarf Fortress pre-embark. I've done something similar in a previous project of mine: Conquest. For world generation, what I did was I used a 3D cellular automaton (Other methods like a plasma fractal would work too) to generate a heightmap for the world. Then I would generate a temperature map and a moisture map: my temperature map was more or less a function of altitude and latitude per cell, and my moisture map was a function of altitude and sea level per cell. From the heightmap, temperature map, and moisture map, I selected a climate per cell and used the climate to place graphics and determine cell interactions. You can simulate erosion and have the erosion affect your moisture per cell, but unless your maps are relatively high in resolution, these things will not affect your generated world very much. Simulating a country is a bit more complex, as you may need some social, political, and macroeconomic models to dictate the behavior and changes for the country. |