My attempt at a random map generator
Moderator: Forum Moderators
My attempt at a random map generator
I've tried to do a little random map generator, and here is the first totally working prototype (as : I don't have to modify the result map to play it).
The code is currently a mess (only a few French comments, all class members are public and all parameters are hard coded), but I should be able to clean it up now that I know it is working. Also, the generated map aren't very balanced since there's almost never sand and swamp, the grassland is very scarce and keeps can start in water .
As for the example map, I had to generate 3 maps to get it. I playtested with Loyalists against Undead AI (supposed to be at my disavantage since the terrain is very rugged in the map) and it was played (and I won).
The code is currently a mess (only a few French comments, all class members are public and all parameters are hard coded), but I should be able to clean it up now that I know it is working. Also, the generated map aren't very balanced since there's almost never sand and swamp, the grassland is very scarce and keeps can start in water .
As for the example map, I had to generate 3 maps to get it. I playtested with Loyalists against Undead AI (supposed to be at my disavantage since the terrain is very rugged in the map) and it was played (and I won).
so is the point of this to get a better generator than we currently have?
its probably a good idea, since the current one is not that good. and the example map looks relatively balanced.
its probably a good idea, since the current one is not that good. and the example map looks relatively balanced.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm
This generator does look pretty cool, and nicely coded. And of course, since it conforms with the map editing interface, it can be pretty easily 'dropped' into the game
Although...
David
Although...
Alot of people seem to think this, but I'm not sure what they don't like about the current one that is reasonable to fixturin wrote: since the current one is not that good
David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
IMHO when you have it near Inland it has way too many mountains, when you have it on Island it has way too much water, and when you have it in between you basically get mountains right next to water.Dave wrote:Alot of people seem to think this, but I'm not sure what they don't like about the current one that is reasonable to fixturin wrote: since the current one is not that good
David
maybe there is a way to get better maps, in which case the default settings should probably be changed.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm
It's not meant to be better, just different. I haven't studied the actual RMG, but mine does generate the map one "cluster" at a time. Each cluster can have very different properties. This will allow having archipelago styles map (medium sized island in a bunch of water) or to normalize the density of villages in the area near each player. Its disavantages will the huge amount of config files needed, but since I plan to use WML for this, I could take advantage of macros.turin wrote:so is the point of this to get a better generator than we currently have?
its probably a good idea, since the current one is not that good. and the example map looks relatively balanced.
Thanks . As for nicely coded, there's surely many improvements in that aspect as I'm an autodidact in C++ (I learned Java at University). Also, I would have to remove all those floating-point calculation if you want to put it in the game (that wouldn't be that hard actually).Dave wrote:This generator does look pretty cool, and nicely coded. And of course, since it conforms with the map editing interface, it can be pretty easily 'dropped' into the game
The current one is not bad, but he does have some flaws. Two of them are the possibility of having some players favored in number of villages and the possibility of starting in bad (snow) terrain. I plan to avoid those in my generator by guaranting the density of villages and by forbidding snow/deep water in players' clusters. But since it will fall in the config file, it shouldn't be that bad...Dave wrote: Although...
Alot of people seem to think this, but I'm not sure what they don't like about the current one that is reasonable to fixturin wrote: since the current one is not that good
David
Also, I dislike the way the starting positions are decided by putting each player in his favorite terrain (elves in forest,...). My plan about it would be the tell the RMG in advance which faction will be each player and build the cluster accordingly.
Anyway, only time will tell how it will turn out ...
There is no real need to remove them, unless you are doing really silly things with it. And by the looks of your code, you don't. There already are floating-point computations in the game.Dobob wrote:Also, I would have to remove all those floating-point calculation if you want to put it in the game
well, IIRC the map is generated before the players choose their factions... so you can't really tell the RMG in advance what terrain will favor the faction since the faction has not been decided yetDobob wrote: Also, I dislike the way the starting positions are decided by putting each player in his favorite terrain (elves in forest,...). My plan about it would be the tell the RMG in advance which faction will be each player and build the cluster accordingly.
Fight key loggers: write some perl using vim
Version 0.1
Here my 0.1 (Baby Step) of the RMG.
All of the hard coded data now reside in a WML config file (ranmap.cfg). The format used is a little bulky, but that's what macros are for .
The config file in the tar.gz is just an example and could get some improvement, but the format should be clear enough for people to play with it. Also, I didn't test alot, but I've seen that the generator put a lot more forest/mountains when map size/# clusters is large, and there're surely many others problems.
Anyway, the generator contains all of its main features, and could be used to generate playable maps.
All of the hard coded data now reside in a WML config file (ranmap.cfg). The format used is a little bulky, but that's what macros are for .
The config file in the tar.gz is just an example and could get some improvement, but the format should be clear enough for people to play with it. Also, I didn't test alot, but I've seen that the generator put a lot more forest/mountains when map size/# clusters is large, and there're surely many others problems.
Anyway, the generator contains all of its main features, and could be used to generate playable maps.
Version 0.2 - Roads
Okay, not much feedback on the last version, isn't it?
Well, I've added roads between each touching clusters, which guarantee at least on passage between each player keep. This also include bridges and cave paths (examples of them are respectively in file bridges.cfg and caves.cfg).
Note : to use the generator, you must use (example) "ranmap mixed.cfg map" to produce a map in the file "map" using the rules of the file "mixed.cfg".
The bridges are giving some problems, as it's frequent that you get a big group of bridges in all directions, but that's not too bad, since it also allows ground troups to go fighting near the water.
As for the code, I must tell that it's messier than ever before . So I'll surely have to clean it up for next version (and also add comments).
Edit : I'm ashamed of myself, the "many bridges in a spot" problem seem to be solved by changing the += from line 453 to a -=. I was doing potential backward, making the road love going in the water...
Edit Bis : resolved the problem in the attached file.
Well, I've added roads between each touching clusters, which guarantee at least on passage between each player keep. This also include bridges and cave paths (examples of them are respectively in file bridges.cfg and caves.cfg).
Note : to use the generator, you must use (example) "ranmap mixed.cfg map" to produce a map in the file "map" using the rules of the file "mixed.cfg".
The bridges are giving some problems, as it's frequent that you get a big group of bridges in all directions, but that's not too bad, since it also allows ground troups to go fighting near the water.
As for the code, I must tell that it's messier than ever before . So I'll surely have to clean it up for next version (and also add comments).
Edit : I'm ashamed of myself, the "many bridges in a spot" problem seem to be solved by changing the += from line 453 to a -=. I was doing potential backward, making the road love going in the water...
Edit Bis : resolved the problem in the attached file.
- Attachments
-
- ranmap-0.2.tar.gz
- Another step toward totally messed code...
- (34.04 KiB) Downloaded 554 times
Last edited by Dobob on November 25th, 2004, 2:13 pm, edited 1 time in total.
Well, ...
I posted the new version of my RMG 3 days ago and no one has dowloaded it...
It's not a good sign, isn't it ?
I would simply like feedback on how the maps generated are looking (after solving the little bug), and if the WML is simple enough to understand without having the full list of keywords.
I posted the new version of my RMG 3 days ago and no one has dowloaded it...
It's not a good sign, isn't it ?
I would simply like feedback on how the maps generated are looking (after solving the little bug), and if the WML is simple enough to understand without having the full list of keywords.