SFTtech / openage

Free (as in freedom) open source clone of the Age of Empires II engine 🚀
http://openage.dev
Other
12.73k stars 1.12k forks source link

Terrain generation and Random Map Scripting (RMS) #65

Open TheJJ opened 10 years ago

TheJJ commented 10 years ago

openage needs random map generation.

For that we probably need two approaches:

The important part is the configurable RMS generator.

janisozaur commented 10 years ago

keep in mind that system-provided rand() are not portable in a sense that each system can provide it's own (p)rng. implementation of own prng would likely be required. have a look at lcamtuf's paper for inspiration: http://lcamtuf.coredump.cx/oldtcp/tcpseq.html

mic-e commented 10 years ago

A deterministic random number generator that is synced across all multiplayer clients is absolutely essential, of course. De-syncs were the main issue during age2's development. Map seeds and game session seeds would be an essential step.

franciscod commented 9 years ago

RNG here #191

detrumi commented 9 years ago

A good starting point would be parsing the .rms files which generate the random maps (they can be found in the Random folder in the original game folder). Most of the commands used there could be extended to infinite maps, though we obviously want normal maps to work as well. I'd like to gradually implement the commands found in the .rms files, and compare the resulting maps with the original game.

We now have a perlin noise generator in python, and the RNG in c++. Where should the map generation itself live? Maybe parse the .rms files in python, and generate the map itself in c++?

Some other points:

So, let me recap my main questions:

franciscod commented 9 years ago

Maybe we could generate a random map in AoE2, then save the game, and after thta load the terrain data from the savegame. These guys could help us in "decompiling" (I'm not sure if we need this) the running binary so we can get more info about the generation.

detrumi commented 9 years ago

We don't really need to exactly replicate the original generation, it just has to be at least as good, if not better.

edit: I misunderstood your comment. Yeah, looking at the savegame would help if it wasn't clear what is being generated, but I expect that just looking at the map with fog of war turned off will be enough.

TheJJ commented 7 years ago

http://exupero.org/hazard/post/islands/ https://github.com/exupero/islands

TheJJ commented 5 years ago

https://flafla2.github.io/2014/08/09/perlinnoise.html

simonsan commented 4 years ago

Pretty interesting stuff how to generate fair map seeds while staying with the so loved randomness of AoE.

Dire Straits is built using a different process than a typical AoE2 map in order to generate unpredictable geography while validating each map with a computer program to keep things fair for both teams. For more information about how to create maps like this, including the source code for all the programs used, see this guide:

https://web.archive.org/web/20200418033040/https://docs.google.com/document/d/1E_Si9iXmzUqFuptkW-8F6XdmoxDXNUG36XIhnh86krU/edit

Dire Straits & creating random RM maps.pdf

simonsan commented 4 years ago

Documentation and utilities for writing Age of Empires II: DE random map scripts https://github.com/hungarian-notation/rms-toolkit