Random Map Generator
From TedTycoon.co.uk
The Random Map Generator has been one of my biggest and longest projects that I have done. The Random Map Generator is a library that can load Random Map Scripts and generate a random Populous map. There are currently 5 different versions of the generator, some in different languages and some different versions. It has been implemented in four different matchmakers and RMSEdit.
Contents |
Version 1
The first version of the generator loaded a script which gave instructions on how many islands to place, the height (or water) of the islands and where the islands would be placed. The generator would then place all the islands down and then do a final smooth of the land to make it nice. The RMGs of version 1 were made over a period of years. The C++ version was the final DLL that would be used in other programs and had many efficiency improvements on it.
VB6
My first original random map generator was written in VB6 in late 2006.
C++
When creating large maps, VB6 was struggling to make the maps at a good enough speed which was causing problems. It was also intended to be implemented in the Populous Reincarnated matchmaker. As VB6 wasn't very reliable and required many libraries that players would not have by default the generator was converted to C++. This was when I learnt C++ as I had no experience with it, the RMG was my first application I wrote in it. The program was a DLL file which could be called my any other program by passing the allocated memory for the dat and hdr files that the RMG would write over and the script file string. The final version of this was eventually implemented in the Populous Reincarnated matchmaker in 2009 after multiple problems. It is also used in the final version of RMSEdit.
VB.NET
A NET Framework version was also written in VB.NET. This was used in the first version of RMSEdit, my Matchmaker and the Populous Resurrection matchmaker. This version was more slower then the C++ version but faster than the VB6 version after a few adjustments.
Version 2
Version 2 was originally written in C++ which added many more features to the generator and had a much more advanced script similar to the Age of Empires II random map scripts. The scripts would allow islands to be created separately as proper islands that you could set many parameters on using fixed numbers or percentages. The generator would then create the island by placing the correct number of RMG islands and then place the wildmen and trees on for that island only.
Objects were also placed in a more efficient way where instead of trying multiple random numbers to find a valid spot. A new system was created where every tile on the map is validated on height, steepness and distance away from other objects and player reincarnation sites. The RMG would then choose a random tile out of the valid tiles. This allowed parameters such as minimum and maximum distance away from coast, players and stone heads. It also stopped trees from being placed on slopes and allowed huts etc. to automatically be placed around the players equally.
After while it was converted to CSharp so I was able to do more stuff with the RMG and make it more object orientated. Version 2 was used in Entyo Matchmaker.
Version 3
This is currently the latest version. Much of the code is from the second version of the RMG. The major change is that the scripts are now written in LUA. This allows scripts to be complex enough to create more sophisticated maps which can be based on a number of decisions. Scripts can contain math, user functions and comparisions to add more randomisation to the map. It can also reduce faults by detecting them and fixing them if they occur.
See Also
| ||||||||||||||||||||||||||
