View Full Version : [MapScript] ScenarioMap


Vadus
Mar 23, 2009, 05:24 AM
Hi Folks,

one of the things, disturbing me most in civ4 ( there are not much ), is, that it is not possible to play a world map with random resources and a random set of civilizations, each of one starting at its correct starting location. ( e.g. Rome in Italy ) Basically, I wanted to play the world map like in Civ 2, and guess what: I've done it now ! ;)

I've created a map script, which is parsing a WBS-MapFile and creates this map while starting a new game. You can choose any Civilization and will have randomly located resources on this map.

Besides this MapScript you need a .properties file in the PublicMaps Folder of your BtS install location. In this properties file, the path to the WBS-File, which is parsed by the script, must be defined. Also all starting locations of the civilizations are stored in the properties file.

Additionally the size of the map must be given, since this information is needed by civ4 before the user choses this map script to play with.

As a first package I'm delivering the MapScript , a World Map ( standard size ) and the according .properties file for this Map.

Installation
1. Extract the files from zip
2. Put the ScenarioWorld.py, all .properties files and the wordbuildersave files into your PublicMaps directory of your BtS installation.
3. Check a .properties file and adjust the path to the wbs file, if you want to place it anywhere else like in a mod folder or something.

Play
Start a new game and choose the ScenarioWorld MapScript. All settings about the map can be ignored, since we are creating the map from the according wbs file. But you can adjust the number of players by selecting different map sizes from tiny to huge..

Troubleshoot
1. Nothing happens while initializing the map: Probably the wbs file is not found by the map script. Edit the .properties file and enter the absolute path to the Vadus_World.wbs file .

Credits
I've found the World_Map somewhere here. I think it was from originally created by vladstrutzu ( http://forums.civfanatics.com/showthread.php?t=234938 ) . I did a lot of adjustments like Europe is much bigger now.. You should try to play Vadus_World.wbs as a Scenario, too.

Version 2
After selecting the world size, you can pick a map from all prepared maps with starting locations (see screenshot)
Thanks to Fullerene for another map with starting locations (EarthEvolution). It is included in the version 2 package

Attached are two game starts from map VadusWorld and one from the regular Earth map. As you can see, the civilizations are chosen randomly but have their correct start locations:

Vadus
Mar 23, 2009, 05:49 AM
TODO

1. Add some options at the menu like: random features yes/no , random bonuses yes/no , random starting locations yes/no

2. Update or rework the river-parse algorithm. It is the most difficult thing to find all tiles in a map, which are belonging to one river. In civ4 each river has an ID , for enabling trade roads on that river, I guess. So, I had to find out, which river tiles are belonging to one and the same river to give this river an ID in the end. This, however is not working as good as it should be. My current solution is working fine for simple rivers, which have no crossings with other rivers. But if there are river crossings, it is getting difficult. If anyone is motivated to help be with a good working river parse algorithm, please post ;)

Izanaki
Mar 25, 2009, 07:06 PM
Hey there, I really liked the idea of this script but couldn't get it to work.

I tried extracting it to both the "Documents/My Games/Beyond the Sword/PublicMaps" folder and the game's install folder.
I also tried editing the properties file and edited the savefile link to link to the map file any way I could think of; "PublicMaps\Vadus_World.CivBeyondSwordWBSave" "Vadus_World.CivBeyondSwordWBSave" or "C:\...\PublicMaps\Vadus_World.CivBeyondSwordWBSave" but none of them worked.

Every time I run the script the whole map is just flat grassland with small a small forest around every player's spawn.

208292

The Scenario works on it's own without the script though.

JEELEN
Mar 26, 2009, 12:21 AM
That's the wrong spot: stick with the standard PublicMaps folder (Firaxis/Civ4/BtS/PublicMaps).

I really like this idea.:thumbsup: (Also, the bigger Europe is a nice feature.)

Vadus
Mar 26, 2009, 01:30 PM
Hey there, I really liked the idea of this script but couldn't get it to work.

I tried extracting it to both the "Documents/My Games/Beyond the Sword/PublicMaps" folder and the game's install folder.
I also tried editing the properties file and edited the savefile link to link to the map file any way I could think of; "PublicMaps\Vadus_World.CivBeyondSwordWBSave" "Vadus_World.CivBeyondSwordWBSave" or "C:\...\PublicMaps\Vadus_World.CivBeyondSwordWBSave" but none of them worked.

Every time I run the script the whole map is just flat grassland with small a small forest around every player's spawn.

208292

The Scenario works on it's own without the script though.

Hi Izanaki,

where did you place the ScenarioWorld.py and ScenarioWorld.properties ? They should be located in the PublicMaps directory of your BtS install location, so e.g. C:\Program Files\Civ\BeyondTheSword\PublicMaps . It doesn't really matter where Vadus_World.wbs is located since the path to this file is correct in the .properties File. You might put Vadus_World.wbs also into C:\Program Files\Civ\BeyondTheSword\PublicMaps and edit the path in ScenarioWorld.properties to C:\Program Files\Civ\BeyondTheSword\PublicMaps\Vadus_World.ci v4worldbuildersave ( I hope the file ending here is correct )
If this doesn't work either, I appreciate it, if you could switch on all logging possibilities in your Civ4.ini file and post your pythonErr.log from C:\Documents and Settings\...\MyGames\BeyondTheSword\logs

Izanaki
Mar 26, 2009, 11:39 PM
Hi Izanaki

I forgot to mention I'm running the Steam version of Civilization, which could be a likely explanation for the script not working, as the file structure is a little different and different folders are in different locations.

I got it working now by making the paths in both the .properties and python files link directly to their target files (i.e. C:\Steam\steamapps\common\sid meier's civilization iv beyond the sword\PublicMaps\x). The problem was that the script wasn't finding the properties file, as far as I can tell.

Tholish
Mar 27, 2009, 04:57 AM
This can be done to any scenario.

BeginMap
grid width=60
grid height=73
top latitude=90
bottom latitude=-90
wrap X=1
wrap Y=1
world size=WORLDSIZE_STANDARD
climate=CLIMATE_TEMPERATE
sealevel=SEALEVEL_MEDIUM
num plots written=4380
num signs written=0
Randomize Resources=true
EndMap

Vadus
Mar 28, 2009, 05:49 PM
oh, nice to know.

but I wanted correct start positions and the choise between all civs on an earth map, too

GarretSidzaka
Apr 19, 2009, 04:17 PM
we covered this in the modcast episode 32 :goodjob:

Vadus
May 08, 2009, 03:54 PM
uhm.. where ? :shifty:
we covered this in the modcast episode 32 :goodjob:

Ohma
May 15, 2009, 01:31 PM
Awesome work there. Thank you so much, I've always thought it was weird that there wasn't a map like that which came with the game, and the whole map editing process in Civ 4 has always been too much of a hassle for me to feel like putting up with figuring out how to make one myself until now.

That said, would it be rude of me to ask what I'd need to alter and/or remove from the python file to keep the script from randomizing resources?

Vadus
May 16, 2009, 11:36 AM
That said, would it be rude of me to ask what I'd need to alter and/or remove from the python file to keep the script from randomizing resources?

Hey, I'm happy, if some people chooses my work to start new development. So you just want random resources in a map ? you can have this like Tholish said:


This can be done to any scenario.

BeginMap
grid width=60
grid height=73
top latitude=90
bottom latitude=-90
wrap X=1
wrap Y=1
world size=WORLDSIZE_STANDARD
climate=CLIMATE_TEMPERATE
sealevel=SEALEVEL_MEDIUM
num plots written=4380
num signs written=0
Randomize Resources=true
EndMap

Ohma
May 16, 2009, 12:26 PM
Hey, I'm happy, if some people chooses my work to start new development. So you just want random resources in a map ? you can have this like Tholish said:


Naw, I mean how would I alter the python script for the ScenarioMap to disable the randomization of resources. I like the idea of finally being able to play on an Earth map in Civ 4 which is similar to the way 2's worked, but for now at least I'd like the map itself to be unaltered.

I would be trying to do this on my own but...I don't have the slightest idea where to start since I know nothing about python, and I don't feel that I could actually put the effort necessary into learning how to do this, in no small part because as far as I can tell it seems like it should be a fairly simple alteration.

Vadus
May 17, 2009, 08:06 AM
yes, in this case you should do some adjustments in the FeatureGenerator of this map script. At this spot, you set the features (bonuses, resources) of the wbs map file instead of generating them randomly

Ohma
May 17, 2009, 12:44 PM
yes, in this case you should do some adjustments in the FeatureGenerator of this map script. At this spot, you set the features (bonuses, resources) of the wbs map file instead of generating them randomly

Uh...could you be a bit more detailed? Do I just copy and paste the plot info from the WBS file into the python script? If so then where exactly in the FeatureGenerator portion? Does anything else need to be changed or will that alone do it?

Fierabras
Jun 02, 2009, 11:08 AM
There seems to be a slight error in the English starting position in Scenarioworld.properties


CIVILIZATION_ENGLAND=39,40


That's the channel on the Vadus_world.wbs. The correct location for the English is:


CIVILIZATION_ENGLAND=39,41

EMT
Aug 19, 2009, 09:14 PM
Excuse me, I wonder if I could get permission to adapt this mapscript to work with a different map, and also to work with CIV Gold? I'm overeager to do it, but of course, gotta ask first. :goodjob:

[EC]immortal7
Aug 20, 2009, 11:20 AM
I'm still trying to figure out how to disable randomization of resources.

EMT
Aug 20, 2009, 01:36 PM
immortal7;8380968']I'm still trying to figure out how to disable randomization of resources.

Same with me, I also want to disable the terrain morphing whenever a civ is nearby. Whenever the Incas show up in game, the Peruvian Andes disappear, or the Appalachians when playing as America. It's frustrating. :crazyeye:

Fullerene
Aug 26, 2009, 03:32 AM
Hi, I have already adapted this great script to work with different maps with no random resources etc.

check out:http://www.civearth.com/components/com_fireboard/uploaded/files/custom-402d2a6a6420e3b2a8f4fd4cea7a9677.zip

Vadus
Feb 13, 2010, 10:16 AM
Same with me, I also want to disable the terrain morphing whenever a civ is nearby. Whenever the Incas show up in game, the Peruvian Andes disappear, or the Appalachians when playing as America. It's frustrating. :crazyeye:

Hi EMT

well yes, I mentioned this behaviour before. Civ is performing this terrain changes somewhere in the C part of code. And because my mapscript should work with any plain version of civ, I can not touch the c code.

@Fullerene: nice work ! :)

The Capo
Feb 13, 2010, 11:44 PM
This is pretty sweet. I have a few questions though...

I would like this to work with my mod, I have added a few civs to this mod and would like to know how easy it is to modify to accomodate the new civs.

One of these civs is Polynesia, is there a way I can alter this map a little to make Hawaii bigger and maybe give them some coast tiles so they can get to other islands early in the game?

That's pretty much it, awesome work, I've been waiting for something like this for a while now and had no idea it was right here! :goodjob:

AbsintheRed
Feb 14, 2010, 03:33 AM
I agree Capo, it's a cool feature, but what will you do when there are both Aztecs and Mayas, Babylon and Sumeria in the game (just to stick with vanilla civs). They start too close to each other...
And just to mention some of the bigger problems with the new civs, what about both Italy and Rome, or Aztecs/Mayas and Mexico?
My point is you will have way too many civs for a script like this...

The Capo
Feb 14, 2010, 12:39 PM
I agree Capo, it's a cool feature, but what will you do when there are both Aztecs and Mayas, Babylon and Sumeria in the game (just to stick with vanilla civs). They start too close to each other...
And just to mention some of the bigger problems with the new civs, what about both Italy and Rome, or Aztecs/Mayas and Mexico?
My point is you will have way too many civs for a script like this...

Well this won't work with modular civs anyway because, from what I can tell, the civ starting locations are in the code, so I'd have to add code for every modular civ I made and I am not going to do that. Obviously there will be conflicts though with starting locations:

France, England, Netherlands, Germany would be very cramped.
Greece, Byzantium, Turks would be very cramped
Israel, Egypt, Sumeria, Babylon, Persia, Arabia
Etc.


I mean, that is just something that is bound to happen, you play on an Earth map you know there will be real starting locations and that has two issues with it (1) bad starting spots and (2) possibility to be cramped. So in my mind, if you're going to play on a world map, and then say "well this sucks, I'm Carthage and have Egypt and Mali to contend with, I don't have any good land to expand to" then you're playing an Earth map for the wrong reasons and should probably play another map.

So I guess to put it in a nutshell: I don't care, buyer beware.

Vadus
Feb 18, 2010, 12:56 PM
This is pretty sweet. I have a few questions though...

I would like this to work with my mod, I have added a few civs to this mod and would like to know how easy it is to modify to accomodate the new civs.

One of these civs is Polynesia, is there a way I can alter this map a little to make Hawaii bigger and maybe give them some coast tiles so they can get to other islands early in the game?

That's pretty much it, awesome work, I've been waiting for something like this for a while now and had no idea it was right here! :goodjob:

Hi Capo,

yes, this is right, what you've mentioned. So AbsintheRed, when you are playing the small world map (vadus_world.wbs) with 18 civs (by selecting a huge world size at start) you have to expect, that there might the another settler unit right next to your starting spot. You might have been lucky and be the first one, who settles in the first turn :)

About adapting this script to a mod with different civs: no problem with that ! You just have to change the scenarioworld.properties file. There enter the map-file, you want to play on and set the correct starting positions for your new civs. Thats all. The properties file binds the map and starting positions to the map script.

Vadus
Feb 21, 2010, 07:51 AM
hi Folks !

a new version is out ! Check the first post. Now, you can choose at the beginning, which prepared map you want to play :)

Aegnor
Feb 26, 2010, 08:53 AM
Hi Vadus !

I've tried your map script, but I can't find the ScenarioWorld MapScript at the beginning.
I think it is because there is no ScenarioWorld.py in your archive.

Vadus
Mar 20, 2010, 09:30 AM
uups ! you are right !! I've corrected the archive now. Please try it out :)

ATC1983
Nov 11, 2011, 03:56 AM
Is this the in-game Earth18 or your own version of Earth18? And if it's your own version is it roughly the same map size?