UGO
Civilization Fanatics' Center  

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.

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Map Scripts

Notices

Reply
 
Thread Tools
Old Feb 17, 2009, 06:37 PM   #1
cephalo
Emperor
 
cephalo's Avatar
 
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,425
[Map Script] PerfectWorld2.py

Hi Folks!

This map script for vanilla Civ4,Warlords, BtS and most mods based on Civ4 generates a random, earth-like map, usually with a 'New World' with no starting locations that can only be reached with ocean going technology. Landforms are created using a random heightfield and a plate tectonic scheme. Climate is simulated using the interaction between the landforms and geostrophic winds. Though great pains are taken to semi-accurately simulate landforms and climate, the goal must be to make unpredictible, beautiful looking maps that are fun to play on.

Download the file here from the downloads database.

This script is a rebuilt version of my first map script, PerfectWorld v. 1.13. As this version is almost a complete rewrite, and is quite different from previous versions, I will keep version 1.13 available from it's original thread.

To use this map, put it in your Civilization 4\PublicMaps folder, not in your My Documents\My Games\Civilization 4\PublicMaps folder.

-- Map Options --
New World Rules:
Start in Old World(Default): Reserves some continents to act as a new world
Start Anywhere: Disables the new world functionality

Pangaea Rules:
Break Pangaeas(Default): Breaks up Pangaeas with a simulated meteor shower.
Allow Pangaeas: Allow pangaeas to exist. Keep in mind that this will likely eliminate any 'New World' as well.

-- Summary of creation process: --
First, a random heightfield is created using midpoint displacement. The resulting altitudes are then modified by a plate tectonics scheme that grows random plates and raises the altitudes near the plate borders to create mountain ranges and island chains.

In generating the plot types from a heightmap, I had found that using peaks for high altitude and land for less altitude created large clusters of peaks, surrounded by a donut of hills, surrounded again by a donut of land. This looked absolutely terrible for Civ, so I made it such that peaks and hills are determined by altitude *differences* rather than by absolute altitude. This approach looks much better and more natural.

The terrain generator gives the other needed visual cues to communicate altitude. Since air temperature gets colder with altitude, the peaks will be plots of ice and tundra, even near the equator, if the altitude is high enough. Prevailing winds, temperature and rainfall are all simulated in the terrain generator. You will notice that the deserts and rainforests are where they should be, as well as rain shadows behind mountain ranges.

Rivers and lakes are also generated from the heightmap and follow accurate drainage paths, although with such a small heightmap some randomness needs to be thrown in to prevent rivers from being merely straight lines.

Map bonuses are placed following the XML Rules but slightly differently than the default implimentation to better accomodate this map script.

I've always felt that the most satisfying civ games are the ones that provide a use for those explorers and caravels. Though the map generator does not explicitly create a 'New World', it will take advantage of any continents that can serve that purpose. No starting locations will be placed on these continents. Therefore, the likelyhood of a significant new world is very high, but not guaranteed. It might also come in the form of multiple smaller 'New Worlds' rather than a large continent.

Enjoy!

Here are some screenshots to illustrate some of the features of PerfectWorld2.

Here is a typical map overview, using the same random seed value to generate three different sized maps. Dual, Standard, and Huge.


Here is an example of how PerfectWorld2 creates an illusion of altitude differences. On the left you can see an area of high mountain peaks covered in snow. As you look to the right you can follow the rivers as they flow into the ocean through lower, warmer altitudes.


Rivers follow accurate drainage paths governed by the altitudes of each map square. Rivers in PerfectWorld2 are longer and more natural looking compared with previous versions. Here is a typical example.


The climate model simulates weather patterns caused by geostrophic and monsoon winds. Here is a picture of how high mountains can cause a 'rain shadow' effect by blocking moisture coming in from the ocean.


Version History
2.05 - Made maps of standard size and below a bit smaller. Changed the way I remove jungle to prevent excessive health problems. Tiles in FC on differen continents have zero value. Tiles on different continents will not be boosted with resources or hills. Water tiles have zero value for non-coastal cities. Water tiles will not be boosted with resources for non-coastal cities, land tiles will be boosted instead. (lookout Sid's Sushi!)

2.04 - Changed many percent values to be a percent of land tiles rather than total map tiles for easier, more predictable adjustment. Ensured a minimum number of hills in a starting fat cross. Disabled the normalizeRemovePeaks function a replaced it with a maximum peaks in FC function. Added bonus resources to FC depending on player handicap. Added a value bonus for cities placed on river sides.

2.03 - Fixed an initialization problem related to Blue Marble. Added some enhanced error handling to help me track down some of the intermittant bugs that still remain.

2.02 - Fixed some problems with monsoons that were creating strange artifacts near the tropics. Added an exponential curve to heat loss due to altitude, so that jungles can appear more readily without crawling to inappropriate latitudes.

2.01 - Changed the way I handled a vanilla version difference. Added toroidal and flat map options. Made tree amount more easily adjustable. Added a variable to tune the level of resource bonuses. Changed the rules for fixing tundra/ice next to desert. Added altitude noise to the plate map to improve island chains. Added a variable to control heat loss due to high altitude. Implimented a new interleaved bonus placement scheme so that bonuses are placed individually in random order, rather than all of each bonus type at once. Brought back the meteor code from PerfectWorld 1 and eliminated the east/west continent divide.

2.0 - Rebuilt the landmass and climate model using the FaireWeather.py for Colonization map script engine. Improved the river system. Fixed some old bugs.
Attached Thumbnails
Click image for larger version

Name:	PW2altitude.jpg
Views:	15530
Size:	129.4 KB
ID:	204210   Click image for larger version

Name:	PW2RainShadow.jpg
Views:	15496
Size:	122.1 KB
ID:	204211   Click image for larger version

Name:	PW2River.jpg
Views:	15541
Size:	137.5 KB
ID:	204212   Click image for larger version

Name:	Sizes.jpg
Views:	15710
Size:	117.1 KB
ID:	204213  
__________________
Rich Marinaccio
PerfectWorld.py Map script for Civ4/Warlords/BtS
Creation.py Map script for Fall from Heaven 2
SpiralGalaxy.py Map script for Final Frontier
Gross National Happiness Mod for BtS
FaireWeather.py for Colonization

Last edited by cephalo; Nov 04, 2009 at 06:28 PM.
cephalo is offline   Reply With Quote
Old Feb 17, 2009, 06:47 PM   #2
RPG
Prince
 
RPG's Avatar
 
Join Date: Jan 2007
Location: Cambridge
Posts: 367
Well done! Those screen shots look absolutely beautiful and I cannot wait to try this out.
RPG is offline   Reply With Quote
Old Feb 17, 2009, 07:49 PM   #3
Ambreville
Deity
 
Ambreville's Avatar
 
Join Date: Sep 2006
Location: Windy City USA
Posts: 2,122
Looks very interesting. I'd like to run this with Fall from Heaven 2. Do you know by any chance if it happens to be compatible?
Ambreville is offline   Reply With Quote
Old Feb 17, 2009, 08:09 PM   #4
cephalo
Emperor
 
cephalo's Avatar
 
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,425
Quote:
Originally Posted by Ambreville View Post
Looks very interesting. I'd like to run this with Fall from Heaven 2. Do you know by any chance if it happens to be compatible?
It should be yes. If not, then I made a mistake somewhere. Seven05 is also making a FFH specific map script using the FaireWeather engine also. Check the maps and modmod forum in the FFH section.
__________________
Rich Marinaccio
PerfectWorld.py Map script for Civ4/Warlords/BtS
Creation.py Map script for Fall from Heaven 2
SpiralGalaxy.py Map script for Final Frontier
Gross National Happiness Mod for BtS
FaireWeather.py for Colonization
cephalo is offline   Reply With Quote
Old Feb 17, 2009, 11:39 PM   #5
RulerOfDaPeople
Emperor
 
RulerOfDaPeople's Avatar
 
Join Date: Mar 2007
Posts: 1,389
Haha, Sweet! Just in time for my next multi-mega-civs game!
RulerOfDaPeople is offline   Reply With Quote
Old Feb 18, 2009, 03:24 AM   #6
Jean Elcard
The Flavournator
 
Jean Elcard's Avatar
 
Join Date: Feb 2006
Location: Leipzig, Germany
Posts: 995
And here it is! Thanks for all your time you put into this.

EDIT: I hope you don't object if I bundle this up with FlavourMod for FfH again?
__________________
Member of the Fall Further team [forum] - Solo projects: BTS: Culturally Linked Starts, FFH: FlavourMod 2.8.2 for Fall from Heaven 0.41j
Jean Elcard is offline   Reply With Quote
Old Feb 18, 2009, 03:33 AM   #7
RulerOfDaPeople
Emperor
 
RulerOfDaPeople's Avatar
 
Join Date: Mar 2007
Posts: 1,389
It's a beautiful map. I'm not sure I like the random tundra and ice hills sections in the middle of perfectly good temperate forrest regions though.

I like how the map seems to automatically adjust the size of it's landmass/continents based on how many civs you have chosen to be in a game. I started a game with 24 civs and it generated a nice map just enough room for 4-5 cities for everybody (Except 2 civs that got screwed on their random start, which happened to be on tiney islands. But one of those was Tokugawa. I'm sure the mercantile won't mind though )

In quick short simple terms, what's the main difference in this one from Perfect World1?
RulerOfDaPeople is offline   Reply With Quote
Old Feb 18, 2009, 08:19 AM   #8
cephalo
Emperor
 
cephalo's Avatar
 
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,425
Quote:
Originally Posted by Jean Elcard View Post
And here it is! Thanks for all your time you put into this.

EDIT: I hope you don't object if I bundle this up with FlavourMod for FfH again?
No objections, buuut there's gotta be some bugs in here. Too much new stuff.
__________________
Rich Marinaccio
PerfectWorld.py Map script for Civ4/Warlords/BtS
Creation.py Map script for Fall from Heaven 2
SpiralGalaxy.py Map script for Final Frontier
Gross National Happiness Mod for BtS
FaireWeather.py for Colonization
cephalo is offline   Reply With Quote
Old Feb 18, 2009, 08:27 AM   #9
cephalo
Emperor
 
cephalo's Avatar
 
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,425
Quote:
Originally Posted by RulerOfDaPeople View Post
It's a beautiful map. I'm not sure I like the random tundra and ice hills sections in the middle of perfectly good temperate forrest regions though.
High mountains! Those are high mountains!

Quote:
Originally Posted by RulerOfDaPeople View Post
I like how the map seems to automatically adjust the size of it's landmass/continents based on how many civs you have chosen to be in a game. I started a game with 24 civs and it generated a nice map just enough room for 4-5 cities for everybody (Except 2 civs that got screwed on their random start, which happened to be on tiney islands. But one of those was Tokugawa. I'm sure the mercantile won't mind though )
No adjustments of the kind you mentioned. Does that mean the map is too big for a normal game? Nobody should be starting on tiny islands, I'd like a screenshot if that's the case because that's a bug.

Quote:
Originally Posted by RulerOfDaPeople View Post
In quick short simple terms, what's the main difference in this one from Perfect World1?
Faster, more thorough climate generator. Better rivers. Better smaller maps. More tuning variables for different effects (but that's more of a modding thing). Most of the changes are under the hood I guess.

I'm hoping that it is a better map script, but it's kinda like getting a new haircut. It may well be a more fashionable haircut, but if you aren't used to it it can be kinda disconcerting.
__________________
Rich Marinaccio
PerfectWorld.py Map script for Civ4/Warlords/BtS
Creation.py Map script for Fall from Heaven 2
SpiralGalaxy.py Map script for Final Frontier
Gross National Happiness Mod for BtS
FaireWeather.py for Colonization
cephalo is offline   Reply With Quote
Old Feb 18, 2009, 08:39 AM   #10
Burned
Chieftain
 
Join Date: Feb 2009
Posts: 17
Great maps. But I'd like fiddle a little with ressources, too scarce for me.
Is there a way to get this sort of change through your bonus placer in the script, or should I learn how to rewrite this whole part ?
I tried to play frankenstein with others scripts bonus placers sewed to yours, but of course it didn't work.

Last edited by Burned; Feb 18, 2009 at 08:43 AM.
Burned is offline   Reply With Quote
Old Feb 18, 2009, 09:20 AM   #11
cephalo
Emperor
 
cephalo's Avatar
 
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,425
Quote:
Originally Posted by Burned View Post
Great maps. But I'd like fiddle a little with ressources, too scarce for me.
Is there a way to get this sort of change through your bonus placer in the script, or should I learn how to rewrite this whole part ?
I tried to play frankenstein with others scripts bonus placers sewed to yours, but of course it didn't work.
By scarce you mean normal correct? If resources are really scarce there might be a problem. There should be alot of bonuses, just as much as the factory maps and maybe more.
__________________
Rich Marinaccio
PerfectWorld.py Map script for Civ4/Warlords/BtS
Creation.py Map script for Fall from Heaven 2
SpiralGalaxy.py Map script for Final Frontier
Gross National Happiness Mod for BtS
FaireWeather.py for Colonization
cephalo is offline   Reply With Quote
Old Feb 18, 2009, 09:26 AM   #12
Ambreville
Deity
 
Ambreville's Avatar
 
Join Date: Sep 2006
Location: Windy City USA
Posts: 2,122
Quote:
Originally Posted by cephalo View Post
It should be yes. If not, then I made a mistake somewhere. Seven05 is also making a FFH specific map script using the FaireWeather engine also. Check the maps and modmod forum in the FFH section.
Yes, it does work very well in fact! Great map! Thanks!

Would it be possible to make sure Brigit gets placed on a new world spot?
Ambreville is offline   Reply With Quote
Old Feb 18, 2009, 09:34 AM   #13
cephalo
Emperor
 
cephalo's Avatar
 
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,425
Quote:
Originally Posted by Ambreville View Post
Yes, it does work very well in fact! Great map! Thanks!

Would it be possible to make sure Brigit gets placed on a new world spot?
Well, I would have to make a FFH specific version for that. Seven05 is making a very similar map specifically for FFH so I don't wanna step on his toes. In my experience with PW1 though, I have found that using a 'new world' with FFH will get so ridiculously full of animals and barbarians that it's almost unplayable. When no one is around to kill them they breed and breed and breed.
__________________
Rich Marinaccio
PerfectWorld.py Map script for Civ4/Warlords/BtS
Creation.py Map script for Fall from Heaven 2
SpiralGalaxy.py Map script for Final Frontier
Gross National Happiness Mod for BtS
FaireWeather.py for Colonization
cephalo is offline   Reply With Quote
Old Feb 18, 2009, 10:33 AM   #14
Burned
Chieftain
 
Join Date: Feb 2009
Posts: 17
What's a factory map ?
Well, in any case, the maps are playable since ressources seems equally scarce for all players. But there is a clear difference with the big and small maps I usually play.
I just took these screens, from the two first maps generated.
This one is a Big and Small, the total of the bonuses around the starting locations of the three players is 20, with each time at least two food ressources that can be joined directly or by moving the colon in a adjacent case.
Spoiler:

This one is a PerfectWorld 2. the total is 9, and one food ressource in each starting location's fat cross.
Spoiler:
Burned is offline   Reply With Quote
Old Feb 18, 2009, 10:59 AM   #15
cephalo
Emperor
 
cephalo's Avatar
 
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,425
Quote:
Originally Posted by Burned View Post
What's a factory map ?
Well, in any case, the maps are playable since ressources seems equally scarce for all players. But there is a clear difference with the big and small maps I usually play.
I just took these screens, from the two first maps generated.
This one is a Big and Small, the total of the bonuses around the starting locations of the three players is 20, with each time at least two food ressources that can be joined directly or by moving the colon in a adjacent case.
By factory map I mean the ones that come with the game.

By looking at these screen shots, I don't see anything obviously broken, but let me explain a little how the starting plot function works that is different than other maps.

The starting plots in the PW2 screens are very good starts with lots of grassland, which is somewhat rare on this map. The quality of the starting plot is measured by not only the fat cross but also the fat cross of any likely city spots you are likely to build first by virtue of path distance. The starting plot 'sweetener' code will give bonuses depending on the relative strength and expandability of each players starting plot. If you look at all the starting plots on a map, you should see some players in weaker positions with a lot of bonuses in their fat cross. If you don't see that, there might be a bug. Check your PythonErr.log file to see if something has failed.

EDT: actually this would be more obvious on a larger map with more players. On this small map, those three players are starting roughly equally, so that might be why there's no sweetening.
__________________
Rich Marinaccio
PerfectWorld.py Map script for Civ4/Warlords/BtS
Creation.py Map script for Fall from Heaven 2
SpiralGalaxy.py Map script for Final Frontier
Gross National Happiness Mod for BtS
FaireWeather.py for Colonization

Last edited by cephalo; Feb 18, 2009 at 11:16 AM.
cephalo is offline   Reply With Quote
Old Feb 18, 2009, 11:20 AM   #16
Burned
Chieftain
 
Join Date: Feb 2009
Posts: 17
There's no log recently modified. I understand that this is not a bug, it's the way the ressources are normally implanted in your mapscript.
My request was simply based on a personnal preference - as i like the way the landmasses appear in perfectworld, i like all the couloured or shiny ressources that appear in others maps.
Burned is offline   Reply With Quote
Old Feb 18, 2009, 11:26 AM   #17
cephalo
Emperor
 
cephalo's Avatar
 
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,425
Quote:
Originally Posted by Burned View Post
There's no log recently modified. I understand that this is not a bug, it's the way the ressources are normally implanted in your mapscript.
My request was simply based on a personnal preference - as i like the way the landmasses appear in perfectworld, i like all the couloured or shiny ressources that appear in others maps.
You might try commenting out the addBonuses and setStartingPlots functions near the bottom of the script. That will cause it to use the default routines. On small maps, that might be ok, but on larger maps you might find things to be grossly unfair and also the smaller islands won't have resources.
__________________
Rich Marinaccio
PerfectWorld.py Map script for Civ4/Warlords/BtS
Creation.py Map script for Fall from Heaven 2
SpiralGalaxy.py Map script for Final Frontier
Gross National Happiness Mod for BtS
FaireWeather.py for Colonization
cephalo is offline   Reply With Quote
Old Feb 18, 2009, 11:37 AM   #18
Burned
Chieftain
 
Join Date: Feb 2009
Posts: 17
Ok. Thanks for these scripts anyway.
Burned is offline   Reply With Quote
Old Feb 19, 2009, 07:12 AM   #19
Ambreville
Deity
 
Ambreville's Avatar
 
Join Date: Sep 2006
Location: Windy City USA
Posts: 2,122
Got a number of Python errors while starting a new game.

Spoiler:
Traceback (most recent call last):

File "PerfectWorld2", line 4528, in generatePlotTypes

File "PerfectWorld2", line 1883, in initialize

File "PerfectWorld2", line 2459, in generateContinentMap

File "PerfectWorld2", line 2778, in PrintAreaMap

File "CvUtil", line 110, in write

RuntimeError: unidentifiable C++ exception
ERR: Python function generatePlotTypes failed, module PerfectWorld2
Traceback (most recent call last):

File "PerfectWorld2", line 4584, in addRivers

File "PerfectWorld2", line 4636, in placeRiversInPlot

AttributeError: RiverMap instance has no attribute 'NE'
ERR: Python function addRivers failed, module PerfectWorld2
Traceback (most recent call last):

File "PerfectWorld2", line 4961, in addLakes

AttributeError: RiverMap instance has no attribute 'flowMap'
ERR: Python function addLakes failed, module PerfectWorld2
Traceback (most recent call last):

File "PerfectWorld2", line 5091, in assignStartingPlots

File "PerfectWorld2", line 3613, in SetStartingPlots

File "PerfectWorld2", line 3772, in setupOldWorldAreaList

AttributeError: ContinentMap instance has no attribute 'newWorldID'
ERR: Python function assignStartingPlots failed, module PerfectWorld2
Ambreville is offline   Reply With Quote
Old Feb 19, 2009, 08:58 AM   #20
cephalo
Emperor
 
cephalo's Avatar
 
Join Date: Jul 2007
Location: Missouri, USA
Posts: 1,425
Quote:
Originally Posted by Ambreville View Post
Got a number of Python errors while starting a new game.
The unidentified C++ error happens once in a while. I have no idea what it could be since it's quite rare and I can't reproduce it. If you get it frequently, let me know. The rest of the errors are all caused by the first.
__________________
Rich Marinaccio
PerfectWorld.py Map script for Civ4/Warlords/BtS
Creation.py Map script for Fall from Heaven 2
SpiralGalaxy.py Map script for Final Frontier
Gross National Happiness Mod for BtS
FaireWeather.py for Colonization
cephalo is offline   Reply With Quote
Reply

Bookmarks

Tags
map script, perfectworld2

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Map Scripts > [Map Script] PerfectWorld2.py

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Map script]Creation.py for FFH2 cephalo FfH2 Modmods, Scenarios, and Maps 420 Nov 21, 2009 09:26 AM
[Map Script] PerfectWorld.py cephalo Civ4 - Map Scripts 625 Oct 30, 2009 12:00 PM
[Map Script] SpiralGalaxy.py for Final Frontier cephalo Civ4 - Map Scripts 46 Aug 02, 2009 08:37 PM
[Map Script] NewWorld.py SevenSpirits Civ4 - Map Scripts 12 Jan 25, 2009 10:40 AM
[Map Script]SpiralGalaxy.py for Final Frontier cephalo Civ4 BTS - Official Mods & Scenarios 0 Feb 12, 2008 07:16 PM



All times are GMT -6. The time now is 12:45 PM.


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
This site is copyright © 2000 - 2009, Civilization Fanatics' Center.
Support CFC: Amazon.com | EB Games | Amazon UK | Amazon DE | Amazon CA | Amazon FR