| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
Welcome to Civilization Fanatics' Center. You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#181 | |
|
Deity
Join Date: May 2006
Location: Where animals hop not run
Posts: 2,048
|
@Cephalo
Quote:
@PTM Thanks for the info on start location. The revdcm version doesn't change any of that code. Only solution for now is to play the RevDCM mod below with the default number of civilizations and let the barbarian code spawn new civilizations over time. Works well. Note that the perfect world script in the RevDCM download is not as up to date as the one on this forum. Cheers.
__________________
Joint modder of the RevolutionDCM mod for BTS Last edited by glider1; Mar 29, 2009 at 07:13 PM. |
|
|
|
|
|
|
#182 | |
|
Warlord
Join Date: Feb 2009
Posts: 181
|
Quote:
|
|
|
|
|
|
|
#183 | |
|
Emperor
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,804
|
Quote:
I have a few promising ideas to try yet that might work perfectly.
__________________
Rich Marinaccio PerfectWorldDF world creator for Dwarf Fortress ------ FaireWeather.py for Colonization PerfectWorld.py Map script for Civ4/Warlords/BtS --- Gross National Happiness Mod for BtS Creation.py Map script for Fall from Heaven 2 SpiralGalaxy.py Map script for Final Frontier |
|
|
|
|
|
|
#184 |
|
Emperor
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,804
|
I did it!! Hey, I have a rather exciting story to tell about how I solved this problem. Well, maybe it's not that exciting and I'm just nerdy. Anyway, the problem is just how does one break a pangaea continent with a minimal number of meteors programmatically? Basically you want to detect where the thinnest choke points are and throw a meteor at them, hoping to divide the big continent into two.
In PW1 I found chokepoints by drawing a circle around a point, and checked each square in the circles progression for water on opposite points on the circle and also land on opposite points. Then I sorted all the choke points I found by distance to the geographic center of the continent, pick the one closest to the center and put my meteor there. This method worked ok, but there were many meteors that were thrown unnecessarily at the exterior limbs of continents. The center of a continent was not always close to the place where the meteors needed to go. In worst case scenarios much of the land was destroyed before a satisfactory division of continents appeared. In PW1 all this happend after climate generation so the large oceans created by the meteors had no effect on the climate. Fortunately, I was able to tune certain variables so that the meteor scheme worked pretty well almost all the time. The continent shapes in PW1 just happened to avoid worst case behavior mostly by luck. When I tried to apply this scheme to PW2, I ran into some problems. First of all, I really wanted any oceans created to effect the climate properly, and that meant that I had to throw the meteors before I generated the climate. That meant that I had to work with the heightmap on a different size than the final map, so I could not use 'coast' tiles to test if I had really broken the pangaea or not. Further complicating the situation was the new toroidal option. It is much harder to break up a pangaea that can connect in every direction. I initially just turned the meteor code off when using toroidal, because it failed more times than it worked. When you look at a pangaea map, the human eye can instantly see where the meteors need to go, so why couldn't I make it happen programatically? It was driving me nuts. So last week I googled and wikepediad and googled again, and I found an interesting article about something called 'betweeness centrality'. After looking further I found an efficient algorithm, invented by Ulrik Brandes, for determining betweeness centrality over a network. But hold on, finding betweeness centrality involves calculating all shortest paths from each continent square to every other continent square. Obviously that's way too much processing overhead, and it was because I tried it anyway just to see what the results would be like. I let the computer run all night and it still wasn't finished, so I never even got to see if I was on to something. All was not lost though! I decided to drastically cut the processing time by approximating the continent shape at a much lower resolution, and with four connected neighbors instead of eight. So instead of evaluating the paths to every continent square, I was evaluating every 5th one in the x and y directions. So instead of my network looking like this: Code:
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX Code:
X...X... ........ ........ X...X... ........ This reduced the proccessing time enough to be faster than the old way, and it works perfectly without fail. I still have some minor polishing but hopefully the new version will be released tonight. It even works on toroidal!
__________________
Rich Marinaccio PerfectWorldDF world creator for Dwarf Fortress ------ FaireWeather.py for Colonization PerfectWorld.py Map script for Civ4/Warlords/BtS --- Gross National Happiness Mod for BtS Creation.py Map script for Fall from Heaven 2 SpiralGalaxy.py Map script for Final Frontier Last edited by cephalo; Mar 30, 2009 at 03:16 PM. |
|
|
|
|
|
#185 |
|
Emperor
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,804
|
Ok, it's up! Give it a try.
I changed the way bonus placement is done so that bonuses are placed individually instead of all of one type at once. This virtually eliminates the crowding problems when you increase the amount of resources placed. Also there's a variable now to increase bonuses called BonusBonus.
__________________
Rich Marinaccio PerfectWorldDF world creator for Dwarf Fortress ------ FaireWeather.py for Colonization PerfectWorld.py Map script for Civ4/Warlords/BtS --- Gross National Happiness Mod for BtS Creation.py Map script for Fall from Heaven 2 SpiralGalaxy.py Map script for Final Frontier |
|
|
|
|
|
#186 |
|
Just Another Bob
Join Date: Jan 2003
Location: Middle of Nowhere
Posts: 927
|
Do you think "betweeness centrality" can be used to make the actual AI understand choke points better?
|
|
|
|
|
|
#187 | |
|
Emperor
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,804
|
Quote:
I did those for tower placement on the Erebus.py mapscript for Fall from Heaven.
__________________
Rich Marinaccio PerfectWorldDF world creator for Dwarf Fortress ------ FaireWeather.py for Colonization PerfectWorld.py Map script for Civ4/Warlords/BtS --- Gross National Happiness Mod for BtS Creation.py Map script for Fall from Heaven 2 SpiralGalaxy.py Map script for Final Frontier |
|
|
|
|
|
|
#188 | |
|
Ruler. Visionary. Pimp.
Join Date: Apr 2008
Posts: 1,176
|
Quote:
EDIT: Never mind, I got it. But I still want to know how to change the dimensions back to the 2:1 ratio.
__________________
Last edited by Ramesses; Mar 30, 2009 at 07:26 PM. |
|
|
|
|
|
|
#189 | |
|
Just Another Bob
Join Date: Jan 2003
Location: Middle of Nowhere
Posts: 927
|
Quote:
|
|
|
|
|
|
|
#190 |
|
Warlord
Join Date: Feb 2009
Posts: 181
|
Nice! Now to give it a try
|
|
|
|
|
|
#191 | |
|
Emperor
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,804
|
Quote:
Then change the entries in getGridSize function to a 2:1 ratio. Multiply these values by 4 to get the actual map dimensions. These can be anything you want except the largest one cannot be larger than hmHeight and hmWidth. (The heightmap only shrinks, it doesn't grow, so the final maps must be the same size or smaller)
__________________
Rich Marinaccio PerfectWorldDF world creator for Dwarf Fortress ------ FaireWeather.py for Colonization PerfectWorld.py Map script for Civ4/Warlords/BtS --- Gross National Happiness Mod for BtS Creation.py Map script for Fall from Heaven 2 SpiralGalaxy.py Map script for Final Frontier |
|
|
|
|
|
|
#192 | |
|
Emperor
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,804
|
Quote:
Fortunately, once the game starts the map usually doesn't change much, so you would only have to calculate it once.
__________________
Rich Marinaccio PerfectWorldDF world creator for Dwarf Fortress ------ FaireWeather.py for Colonization PerfectWorld.py Map script for Civ4/Warlords/BtS --- Gross National Happiness Mod for BtS Creation.py Map script for Fall from Heaven 2 SpiralGalaxy.py Map script for Final Frontier |
|
|
|
|
|
|
#193 |
|
WM junkie
Join Date: Dec 2005
Location: Seyda Neen, Vvardenfell
Posts: 7,090
|
simply awesome job on the new version. it's almost unbelievable how good it is
I did notice an oddity though, check attached screenshot. map is small size, break pangeas, cylindrical wrap. notice the straight line of desert very near to the south pole. aside from that, toroidal works perfectly! having a strip of ice cut the map in two looks terrible though. Seven05 made the ice more likely to clump in the central section of the map in his ErebusContinent mapscript, and it looks great, you should check that out it even changes the climate slightly near the pole, so that the central section of the map is colder ( snow ) , and it gets progressively hotter as you move to the left/right ( snow -> tundra ) . it looks really realistic, aside from the fact that there's only one pole instead of two of course ![]() actually, this should probably work nicely even with cylindrical and flat wraps. last thing: jungles seem kinda uncommon, increasing their number a little bit couldn't hurt. glider1's version had overdone that imho, but something between his and what we have now should work nicely. THANK YOU!
__________________
" Sheelba does what Charadon't " - Senethro Last edited by [to_xp]Gekko; Feb 17, 2013 at 11:17 AM. |
|
|
|
|
|
#194 |
|
Emperor
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,804
|
For the next version I'll introduce some erosion. The problem with jungle right now is that the land tends to leap out of the ocean where the high altitude is too cold to support jungle. There are almost no near sea level flatlands on most maps.
__________________
Rich Marinaccio PerfectWorldDF world creator for Dwarf Fortress ------ FaireWeather.py for Colonization PerfectWorld.py Map script for Civ4/Warlords/BtS --- Gross National Happiness Mod for BtS Creation.py Map script for Fall from Heaven 2 SpiralGalaxy.py Map script for Final Frontier |
|
|
|
|
|
#195 |
|
Grand King of Apes
Join Date: Apr 2004
Location: In the heart of the Bavarian Forest
Posts: 450
|
Wow, the results of this mapscript are astonishing! Good work cephalo.
What would be additionally nice is a numbergenerator in the main menu of Civ, so that i can input a number for this map and if it's a good map, i can use this map in different sizes etc. by just typing its number. I hope you know what i mean.
__________________
Für jedes scheinbare Zeichen, jedes vergebliche Wunder gibt es eine einfache, rationale Erklärung, die ohne das Übernatürliche auskommt. Vielleicht keine so schöne, poetische, wie sie der Wunderglauben bietet. Vielleicht eine, die anzunehmen weniger befriedigend ist. Aber nicht der Glaube an das Übernatürliche hat die Menschheit zu den Sternen gebracht. Sondern das unerschütterliche Vertrauen in die Prinzipien der Ratio. -- Tatjana Krieger / H. T. Kautz Visit Osy's Fantastic Creation Corner Profiles: Spore | Xfire |
|
|
|
|
|
#196 |
|
Prince
Join Date: Dec 2006
Posts: 531
|
I didn't notice any errors in the PythonErr.log file in Vanilla.
I did notice this in PythonDbg.log: Code:
No room at all found for BONUS_DRAMA!!! No room at all found for BONUS_MUSIC!!! No room at all found for BONUS_MOVIES!!!
__________________
If you want to succeed in the world, you don't have to be much cleverer than other people. You just have to be one day earlier. -- Leo Szilard |
|
|
|
|
|
#197 |
|
Deity
Join Date: May 2006
Location: Where animals hop not run
Posts: 2,048
|
Creativity and imagination at work. Great stuff Cephalo! This proves to me that "nerdy" computer science is still an art form. And an excellent question by BobTheT about whether this algorithm could be used by the AI. I wish Cephalo could contribute to a better AI project. I'm sure Jdog and Yakk would enjoy it!!
Cheers.
__________________
Joint modder of the RevolutionDCM mod for BTS |
|
|
|
|
|
#198 | ||
|
Ruler. Visionary. Pimp.
Join Date: Apr 2008
Posts: 1,176
|
Not to be a nag, Cephalo, but your instructions weren't really detailed enough.
Quote:
This was the section I changed. Code:
mc.hmWidth = newWidth
mc.hmHeight = newHeight
self.heightMap = newHeightMap
Anyway, I changed it to: Code:
#mc.hmWidth = newWidth
#mc.hmHeight = newHeight
mc.hmWidth = 161
mc.hmHeight = 80
self.heightMap = newHeightMap
Quote:
Code:
WorldSizeTypes.WORLDSIZE_DUEL: (12,8), WorldSizeTypes.WORLDSIZE_TINY: (16,10), WorldSizeTypes.WORLDSIZE_SMALL: (22,14), WorldSizeTypes.WORLDSIZE_STANDARD: (26,16), WorldSizeTypes.WORLDSIZE_LARGE: (32,20), WorldSizeTypes.WORLDSIZE_HUGE: (36,24) Code:
WorldSizeTypes.WORLDSIZE_DUEL: (16,8), WorldSizeTypes.WORLDSIZE_TINY: (20,10), WorldSizeTypes.WORLDSIZE_SMALL: (28,14), WorldSizeTypes.WORLDSIZE_STANDARD: (32,16), WorldSizeTypes.WORLDSIZE_LARGE: (40,20), WorldSizeTypes.WORLDSIZE_HUGE: (48,24)
__________________
|
||
|
|
|
|
|
#199 |
|
Prince
Join Date: Dec 2006
Posts: 531
|
@Ramesses, the first set of lines you want to change is
Code:
#Height and Width of main climate and height maps. This does not #reflect the resulting map size. Both dimensions( + 1 if wrapping in #that dimension = False) must be evenly divisble by self.hmMaxGrain self.hmWidth = 144 self.hmHeight = 97
__________________
If you want to succeed in the world, you don't have to be much cleverer than other people. You just have to be one day earlier. -- Leo Szilard |
|
|
|
|
|
#200 | |
|
Ruler. Visionary. Pimp.
Join Date: Apr 2008
Posts: 1,176
|
Quote:
EDIT: Hooray, it works. Thanks for your help.
__________________
Last edited by Ramesses; Mar 31, 2009 at 08:52 PM. |
|
|
|
|
![]() |
| Bookmarks |
| Tags |
| map script, perfectworld2 |
|
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Map script]Creation.py for FFH2 | cephalo | FfH2 Modmods, Scenarios, and Maps | 421 | Jul 16, 2010 06:56 AM |
| [Map Script] SpiralGalaxy.py for Final Frontier | cephalo | Civ4 - Map Scripts | 48 | Apr 24, 2010 03:40 PM |
| [Map Script] PerfectWorld.py | cephalo | Civ4 - Map Scripts | 625 | Oct 30, 2009 11:00 AM |
| [Map Script] NewWorld.py | SevenSpirits | Civ4 - Map Scripts | 12 | Jan 25, 2009 09:40 AM |
| [Map Script]SpiralGalaxy.py for Final Frontier | cephalo | Civ4 BTS - Official Mods & Scenarios | 0 | Feb 12, 2008 06:16 PM |