[MapScript] ScenarioMap

Vadus

pretend the impossible
Joined
Nov 23, 2003
Messages
374
Location
Northern Germany
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:
 

Attachments

  • VadusWorld01.png
    VadusWorld01.png
    300 KB · Views: 2,282
  • VadusWorld02.png
    VadusWorld02.png
    302.2 KB · Views: 1,860
  • earth_start.png
    earth_start.png
    268.3 KB · Views: 1,509
  • start_choise.jpg
    start_choise.jpg
    60.5 KB · Views: 892
  • ScenarioWorld_v2.zip
    109.1 KB · Views: 855
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 ;)
 
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.

Civ4ScreenShot0037.jpg

The Scenario works on it's own without the script though.
 
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.)
 
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.

View attachment 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.civ4worldbuildersave ( 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
 
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.
 
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
 
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?
 
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
 
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.
 
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?
 
There seems to be a slight error in the English starting position in Scenarioworld.properties

Code:
CIVILIZATION_ENGLAND=39,40

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

Code:
CIVILIZATION_ENGLAND=39,41
 
[EC]immortal7;8380968 said:
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:
 
Top Bottom