|
MapGen
Mar 6, 2012 13:45:03 GMT -5
Post by gp1628 on Mar 6, 2012 13:45:03 GMT -5
In some ways it seems this would be easier than the MapGens we got for Dom3. And for now it would be even more necessary. At the moment we can have a random map for a server game. OR we can have a map with random events. But we cant have a random map with random events until we get a MapGen EDIT: Link to mtadd's python script github.com/mtadd/coe3-mapgen/zipball/master
|
|
|
MapGen
Mar 6, 2012 16:20:37 GMT -5
Post by vladikus on Mar 6, 2012 16:20:37 GMT -5
It would be cool to have a wiki-type event list that plugged into this random map generator (reminiscent of Dungeon Crawl allowing players to add speech for monsters). Although, I think some approval system would need to be implemented so that there weren't a bunch of overwhelming or obnoxious/useless events.
|
|
|
MapGen
Mar 14, 2012 16:02:46 GMT -5
Post by mtadd on Mar 14, 2012 16:02:46 GMT -5
Here's an early alpha of a map generator I've started working on. It'll create a landmass, draw coastlines, generate mountains and hills, and drop some settlements and mines on the map. It also comes with handy command line switches to tweak the generator. By default, it'll generate a coem file, as well as give you a rough ASCII view before attempting to view it in the coe3 map editor. Once I get other terrains working, I'll give a more detailed writeup of how it works under the hood, but there's nothing really tricky going on inside, so dive on in, take a look, and by all means, make improvements. Link to the python (v2) script hereUsage summary: Usage: mapgen [options]
Conquest of Elysium 3 random map generator. Default values for options given in parentheses.
Options: --version show program's version number and exit -h, --help show this help message and exit -q, --quiet --mapw=WIDTH Map width in squares (50) --maph=HEIGHT Map height in squares (36) --file=FILE Filename of map (map.coem) -m MODE, --mode=MODE SHOW,GEN (GEN)
Generation (GEN) mode parameters: --border=INT Sea border width (2). Set to 0 for all land map --sea-prob=PROB Probability for seeding land vs sea. (45) --carve-steps=STEPS Number of generations to shape land (5) --carve-r=INT R value for carve (5) --coast --no-coast --hill-steps=STEPS Number of generations to shape hills (3) --hill-prob=PROB Probability for seeding hills/mtn on land (40) --resource-prob=PROB Probability for creating cities/mines/etc. (10)
Example: ./mapgen -m GEN --border=2 --sea-prob=40 Map: map.coem ################################################## ################ccccc############################# ###cccccccc####cc+..cccccc###############cccc##### ##ccn...+.cc##ccnnnnn..+.cc#############cc..cc#### ##c........c##cn+++^^n....cc############c+...c#### ##c...nnn..c##cn^M+^^n...n+c########ccccc....c#### ##c..n^M^nnc##cn^^^^c.++..+c#cccc##cc..n^^Mn.c#### ##cc.nM^M^.ccccn^MM+cc+....ccc..cc#c..n^^M^^ncc### ###c.n^+M^n.cc..n^^+c....nccc....c#cc.n^M^^^n+c### ###c.n^M^Mn.+...nM+^n..+..ccc.nn.cc#ccnM^^^^n.cc## ###c..n^M^^n....n^Mn....nnccnn^+n.cccc.n^MM^Mn.c## ###c+..nn^^^n.nn+M^nn.nn^M^^^^+^+n.cc+.n^^++^^+c## ###cc...nMMM^n+^^^^^^M^+^MM^^^^^^^^nn+n+^^^M^+cc## ###cc...nM^^^+nnM^^^MM^+^^^M^MM^^M^^^+n^^^^^^nc### ###cnn.+nn^MM..n^^M+^^^^^MMMM^+^^M^M^M+^+n+nn.c### ###cnn.+..nnn+nM^M^^++^^M^++M^^^M^^M^^M^n.n...cc## ##ccM^n+.....n^^M^+nMM^^^^+++^^^^^+^^^^^...+...c## ##cnM^^n...n.nM^M^..n+^MMcccM^^^^^^^M^^^n.....+c## ##cn+^+^^+n..n^^n.+..n^^^c#cn^+M^+MM^M^^nnnnn..c## #ccn.^^^^^Mn+.n+.....n^^+cccM^^^^^^+^^^^nnn^Mn.c## #c...n^+^^+n......+..nMn..n^^MM+^^^^MM^n..n^M^.c## #c..+n^^^^^^+n......n+^n..^^^^M^^^^^^nn...n^^^+c## #cc..n^^^M^^^n.....n^^Mnnn^^^+^^^^M^+n...nnM^n.c## ##c..n^+^^M^^^n..+..+M^^^M^^^^+++nnnnn.n+.n^^^.c## ##cc..^M^^^MMM^nn..+n+^+MMnn.......nnMnn+nMM^^.c## ###c..nn^nn.+n^++...nnM^^^n..n..+...nM^^+MMMMM.c## ###cc...nn..++^^^n..n+^+^^n..........nM^^^M^++nc## ####ccc..nn..n^^^^nnn^^^M^+M^nnn..+...n^^^^Mn+.cc# ######ccnnnnnn^^Mnn+n^^MM+M+^+M+......n^^^Mn+.n.c# ######cc.nnn^+Mn+n+nccn^M^^^^^^n..++...n^Mn..nn.c# #####cc.nn..nM^nnnncccc+MM++n+nn.......nnn..n^n+c# #####c......nn^n^^n.c#c.nnnn............n+..n^n.c# #####cn+.......nnnn.c#cc.++..cccc.n+.ccc...n^^n.c# #####cc...ccc....+.cc##ccc..cc##cc..cc#ccc.nnnncc# ######ccccc#cccccccc#####cccc####cccc####ccccccc## ##################################################
Legend: Plain . Coast c Sea # Hill n Mountain ^ Impassable Mountain M Farms/Cities/Ports/Mines +
|
|
|
MapGen
Mar 14, 2012 17:22:45 GMT -5
Post by mtadd on Mar 14, 2012 17:22:45 GMT -5
|
|
|
MapGen
Mar 14, 2012 18:04:39 GMT -5
Post by gp1628 on Mar 14, 2012 18:04:39 GMT -5
The game is willing to do a lot of the map work when the map loads. It will try to find proper terrain to convert into farms and mines and coastal cities etc etc if the addfancyterrain command is added to the .coem file This is a map called AndAgain which I made to be very replayable. This is how the center of it looks in the map editor. www.coe-3.com/~gandalf/CoE3/replayable.JPGand this is one of the edges of the map in the editor www.coe-3.com/~gandalf/CoE3/outer.JPGThe white ? is tile 35 and the red ? is tile 99 Quote from the Map Manual So the outer edge is all octopussy with lots of finger peninsulas that have the appropriate terrains so the map can place people there. Then the middle is lots of ? to get a different terrain layout every time its played. Then a big blob of impassable mountains in a bit of a maze. And the maze is sprinkled with the red ?? so that rare sites appear there. In the VERY center is an open spot where a goal can be placed or events written in. Having a VERY powerful AI there works well. If you want to try playing this map a few times, here it is.... www.coe-3.com/~gandalf/AndAgain.coemThe reason I mention all this is that a workable MapGen to be able to add AIs and maybe some random events would ONLY need to have a coastline. If the middle is all 35's that would be playable. Then later maybe a switch to scatter some 99's. Maybe some of the items that the map will not fill in automatically such as impassable mountains and rivers.
|
|
|
MapGen
Mar 14, 2012 19:19:02 GMT -5
Post by mtadd on Mar 14, 2012 19:19:02 GMT -5
> ./mapgen.py -f ~/.coe3/coe3.app/Contents/Resources/maps/map.coem --mapw=40 --maph=28 --sea-prob=35 --resource-prob=5 --random-prob=90 --random-radius=12 --rare-prob=33 --rare-radius=5 --border=2 --hill-steps=0 --tree-steps=0 Map: /Users/mtadd/.coe3/coe3.app/Contents/Resources/maps/map.coem ######################################## ######################################## ###cccc###########ccccccccccc###ccccc### ##cc..ccc#ccccccccc??????+..cc#cc...cc## ##c.....ccc...?.???????????..ccc.....c## ##c..........???????..??????+..+.....c## ##c........+??.?+..??.???????++.....cc## ##c..+...+.??????????????.?.??.....cc### ##c........????????????????????+.ccc#### ##c...+...??????.???!?.??????.?.cc###### ##c......????????.?!?????????.??c####### ##cc.....?.??????!?.!?!?.??????.cccccc## ###c....+?????????!!!???!????.?ccc...c## ###cc....??????+!!?.????!??????ccc...cc# ####c...??????.!!!???????????????.....c# ####c....??.????????!.??!????.??...+..c# ####cc...??.????????!?!??????.??......c# #####c...?.???.??????!??!???????+...+cc# #####c.+..???????.????!!????????.....c## ####cc....????????????????????.......c## ###cc.....?.+????????.??????.??......c## ###c.......???????????????.???.......c## ###c........?????.???????????........c## ###c..........?????.????????........cc## ###cc.........???.???.?????....+ccccc### ####ccc...cc...cc????.ccccc...ccc####### ######ccccccccccccccccc###ccccc######### ########################################
setting hill-steps and tree-steps to 0 prevents mountains and forests from being generated, so you just get plains with a coastline. Updated version here
|
|
|
MapGen
Mar 14, 2012 19:49:56 GMT -5
Post by gp1628 on Mar 14, 2012 19:49:56 GMT -5
Looking good! Now if we can get the coastline tiles to line up then I think we have everything to get a randomly generated game setup.
|
|
|
MapGen
Mar 15, 2012 9:04:11 GMT -5
Post by mtadd on Mar 15, 2012 9:04:11 GMT -5
Latest version guarantees that the shape of the coastline matches the current set of coastline tiles. Also, refactored the biome generation algorithm to facilitate putting more of its parameterization in the command line.
|
|
|
MapGen
Mar 28, 2012 17:28:50 GMT -5
Post by mtadd on Mar 28, 2012 17:28:50 GMT -5
I've put an alpha of my Trial By Fire scenario generator written in python 2.7 on github. Assuming you know how to use python, you can give it a try via this zip file, or get involved and fork it at github. INSTALL INSTRUCTIONS Unzip the file above, or clone the repository. On my mac, I added a symbolic link to the game package into the project directory (cd <coe3-mapgen>; ln -s /Applications/coe3.app coe3.app). If you need to make changes to mapgen.py, trials.py or run_coe3 to get it working for other platforms, just send me a pull request in github, and I'll incorporate the changes (or post them here in this thread). USER GUIDE Try running trials.py without arguments (it accepts a trial number on the command line). This will generate a .coem file (or for Political Tribulations, download it if you're got curl in your path). and save it to the current directory. It supports the following options: Usage: trials.py [options] <trial number>
Conquest of Elysium 3 - Trial By Fire scenario map generator. Default values for options given in parentheses.
Options: --version show program's version number and exit -h, --help show this help message and exit -d MAPDIR, --mapdir=MAPDIR Game map directory -r, --rungame
Trial Numbers: 1) You're Just a Commoner 2) A Little Disagreement 3) Eye for an Eye Justice 4) A Part of the Tribe 5) The Justice League 6) The Legions of Doom 7) Flawless Victory 8) Anti-Progress 9) The Witch Hunter 10) Sorcerer in the Middle 11) Bring Out Your Dead 12) Save the Peons 13) Political Tribulations 14) Seven Levels of Hell 15) Disposing of a Despot 16) An Absolute Bash 17) One Against the World trials.py uses mapgen.py, which will generate a basic map with coastlines, forests, and mountains. It'll set the "addfancyterrain" map command, which the game will use to populate the other terrain features. The game run script starts the game with --commoncause --clusterstart and/or --society command line options depending upon the respective scenario requirements, but I'm uncertain at this point if this actually does anything when --loadmap command line option is set. run_coe3 also processes an additional command line option -p which specifies a prefix for the gamelog, and sets the --graphs option (though with --loadmap, you can't currently view graphs in-game until the game is over). coe3graph.py is a modified version of a someone's script mentioned in the Desura forums (q.v.) for creating score graphs using python+matplotlib directly from the gamelog data. My changes clean up the interaction, as well as stylize the graphs to be more like those in Ilwinter games. Note that the algorithms used for map generation are most likely different than the official game. But are fairly straightforward to understand. I primarily utilize iterations of a cellular automata on a random seed described here to shape the land, mountains, and forests. The coastline generation algorithm is robust too, so the code should be a good starting point for making your own map/terrain generators.
|
|
|
MapGen
Mar 28, 2012 23:40:58 GMT -5
Post by vladikus on Mar 28, 2012 23:40:58 GMT -5
Works fantastic on linux. Very well done, thanks so much--I used it to complete a trial and everything was smooth sailing. Really, I'm impressed. Here is a sample of the map after I won along with the console version for anyone' s interest (I really like the shape of the map as well as the fact that there are bodies of water in the middle of the map--actually, I like the generator you made a ton!) The image stretches the forum borders way too far, so here is a link to the image: filebox.vt.edu/users/dduckett/CoE/mtadd_generator.png
|
|
|
MapGen
Mar 29, 2012 0:58:33 GMT -5
Post by mtadd on Mar 29, 2012 0:58:33 GMT -5
I'm glad you enjoy it. I'm so happy too that there wasn't any problems on linux as well. Score 1 point for Python. If you've any suggestions, don't hesitate to make suggestions, or share your contributions.
Some things I want to verify are the impact of the command line switches when using --loadmap, specifically --society, --commoncause, and --clusterstart. (the last two should be easy to verify with some of the particular scenarios we have).
A couple aesthetic touches to the map would be to get rid of some of those long straight lines near the edge of the map. Additionally, there's a constraint currently that it generates one contiguous land mass. It might be neat to use the 1 square island terrains, and perhaps allowing some small islands off the coast, though I'd need to test to see if the game won't randomly place starting citadels off the main island.
|
|
|
MapGen
Mar 29, 2012 1:14:36 GMT -5
Post by mtadd on Mar 29, 2012 1:14:36 GMT -5
Oh, and rivers...still need to do rivers.
|
|
|
MapGen
Mar 29, 2012 8:46:16 GMT -5
Post by gp1628 on Mar 29, 2012 8:46:16 GMT -5
There is an island tile 98 which the game does not use. And there is a ferry tile 96 which looks like little boats but acts like land. Both could be used to attack sections of the map. Also if you place them strategically then the game happening to place a coastal port in the right place can create a land-bridge that wasnt there. Its hard to explain but on my maps where I have the coastlines looking like many-armed octopuses (long peninsulas) there is always a way to get from one to the other by land, with occassional ways across the water due to the game placing ports on each shore.
I like the internal oceans also. But we need to watch out. The water capable nations already had some strong tactical advantage. High Cultist, Pale Ones, Water Warlock for example can already make strategic use of coasts, lakes, and rivers. Is there an option to not have internal oceans?
And I dont carefully read as well as I should. Is there anything for making use of Impassable Mountains? I like creating almost mazes in the middle of my maps. The random placement of mountains, lakes, rivers within the maze can make them even more interesting. And I also tend to use tile 99 scattered in the center so the random placement of highly defended locations amid the maze can also create interesting choke points.
|
|
|
MapGen
Mar 30, 2012 15:26:59 GMT -5
Post by vladikus on Mar 30, 2012 15:26:59 GMT -5
Hm, I downloaded the update to the generator, but now when I run trials.py and enter a number, the game will create a map, but when finished I get an error: "***Input must be a number between 1 and 18." The map successfully is created, but it doesn't set players and so on. I don't know much python, but I am investigating the code some...
|
|
|
MapGen
Mar 30, 2012 16:46:50 GMT -5
Post by mtadd on Mar 30, 2012 16:46:50 GMT -5
I posted an update which should resolve the issue. Sorry about that.
|
|