czinn / cloudy-sword

Turn-based arena battle game, written in JavaScript + Node.js.
4 stars 0 forks source link

Map generation #2

Closed czinn closed 10 years ago

czinn commented 10 years ago

Procedurally generating maps that aren't just random tiles. All walkable tiles should be connected. Symmetrical maps would be a bonus. Supporting various sizes is also a bonus.

ghost commented 10 years ago

What if we have a file stores maps, something like

010002011101

etc -snip- where 0 is like the empty block, etc

and we can parse it, or generate new maps

czinn commented 10 years ago

Hard coding maps is another option.

sockss commented 10 years ago

I feel like having procedural generation would be awesome, while having a string like zombiekiller mentioned would be nice, too. This could allow you to import and export maps via a hexadecimal string or what have you.

Maybe we could have values attached to each tile, like, 1 for walkable, 2 for walls, 3 for water, etc. And then have maps generated from tile (0,0++) and then at the end of that row, generate tiles (1,0++) so on and so forth.

czinn commented 10 years ago

Just loading maps from files would be pretty easy to code, though it still leaves the problem of having to design the maps in the first place. tile.js contains tile id numbers for each tile, which is how they'd be referenced in the configuration file (though they'd have to be comma separated, since there might end up being more than 10 tiles).

If we do go the procedurally generated map route, there are many possible algorithms. For example, Perlin noise, cellular automata, or random walks. We could also make algorithms that generate maps in a specific way with specific properties (like, make the map are normal tiles, add a "river" of water tiles, and put walls symmetrically on both sides of the map).

sockss commented 10 years ago

I'm reading into the algorithms you linked now. I believe Gupti has been working on some map generation related things, but I'm not sure exactly what - maybe he has an idea?

czinn commented 10 years ago

Gupti currently has dibs on actually implementing map generation; he probably has some ideas about how he wants to do it.