Green Inland Sea and TBG

Speaker

Deity
Joined
Nov 4, 2002
Messages
2,097
Location
Section 1
Hello All,

I'm messing around with map scripting and trying to teach myself a bit of python in the process, and was looking for a little bit of advice or tips on where to start.

What I'd like to do, specifically, is take both the Inland Sea and Team Battleground scripts and make them "green." Remove the tundra and ice, reduce (significantly) the percentage of plains tiles, and maybe put about 10% more food resources? Also I'd like to include Ivory as one of the "balanced" resources and remove the line which excludes Marble from the map when the resources are "balanced."

Would any of you more experienced modders be willing to teach me a bit about how the map scripts are arranged, and how to go about doing this simple project, so I can maybe move on to more complicated scripts, either via this forum, PM, or IM? For your information, I am pretty good at Php, MySql, CSS, and HTML (not that they are relevant here), but don't have much experience with Python. So I'm not a total coding noob. Thanks!
 
I can help with some of that. I think the 'balanced' changes you want to make are easy. One trick is that there are rules to naming map scripts - break the rules and your map script will not show up on your list of maps under Civ4. Now, if only I could remember what those rules were ...
 
What I'd like to do, specifically, is take both the Inland Sea and Team Battleground scripts and make them "green." Remove the tundra and ice, reduce (significantly) the percentage of plains tiles, and maybe put about 10% more food resources?

If not the way is the goal itself, i would suggest doing that by XML.
First can be done by GameInfo\ClimateInfos.xml, the resources in Terrain\BonusInfos.xml.


Also I'd like to include Ivory as one of the "balanced" resources and remove the line which excludes Marble from the map when the resources are "balanced."

For both should be lists in the mapscript. Just searching for BONUS_ should bring you to there.

I can help with some of that. I think the 'balanced' changes you want to make are easy. One trick is that there are rules to naming map scripts - break the rules and your map script will not show up on your list of maps under Civ4. Now, if only I could remember what those rules were ...

Has nothing to do with the name, it's coded in the mapscript itself:
PHP:
def isAdvancedMap():
	"This map should show up in simple mode"
	return 0
 
Here is what I've accomplished so far with the Team Battleground script.

I've run into an interesting/crappy bug er feature. Because the land on the edges is now good, the map generator loves placing many of the civs along the extreme edges, resulting in long distances between teammates, which is not what I want. I liked the spatial placement on Team Battleground (using "Start Separated"), but not the land along the edges.

Anyone have any ideas on how to get back the "old" spacing of starting plots?
 

Attachments

  • Green_Team_Battleground2.rar
    6.1 KB · Views: 75
off the top of my head, there is some code that tests if a plot is a valid starting position. You can put some code in there to make sure that each valid starting position is within 'n' plots of its team mates. Typically it is something like ...

if plot is > 'n' from team mate:
[tab]return False

Effectively, you say the plot you are testing is bad and it will pick another plot.
 
Thanks, Ainwood :).

@Speaker: Because all the subforums (excluding the SDK/Python subforum) are only for files, and questions have to go to the main forum.

ruff_hi's method should work, i guess.
Manually setting the starting points would not (but i'm not sure).
 
These are all examples of threads with questions, which are in the mapscript forum. And mine has a file in it, so....

It just seems odd to move a thread that's clearly about map scripts out of the map script forum.

"Smartmap with fixed starting positions?"

"Truly Balanced mapscripts for MP?"

"is a map script like this possible? and where to start."

"Gigantic map size?"

"REQUAST - hills on ocean terrain "

Anyways, thanks for the advice J and Ruff. I'm going to try Ruff's method, or make a check that rejects a starting location if it is too close to the edge of the map (closer than 6 tiles = skip). Maybe even check all the starting locations and if there is already one or two chosen that is closer than 6 tiles, skip, so we don't end up with all the Civs near the edge. Having one or two near the edge is okay, but more than that makes the map too spread out.

The ideal, however, would be to have the map generate with the same code as TBG. Then assign starting plots. Then have the tundra and ice replaced with grassland and plains (and new resources seeded), maybe using "afterGeneration." Is this possible?
 
I'm messing around with map scripting and trying to teach myself a bit of python in the process, and was looking for a little bit of advice or tips on where to start.

For what it's worth, I found the problem of trying to create a football field map (green grassland, no fresh water or resources) to be educational. It's a simple idea, which makes it easy to see when you haven't gotten it right, and I learned a bit about where things happen by switching them off one at a time.

(Note: Uniformia is going to be really slow to load if you let the game engine try to choose which of a 1000 identical tiles are the best start positions. Implementing fixed locations is probably wiser for this exercise.)
 
These are all examples of threads with questions, which are in the mapscript forum. And mine has a file in it, so....

Yes, should also have reported them, but the mods are at the momemt a bit busy with the bots.
 
For what it's worth, I found the problem of trying to create a football field map (green grassland, no fresh water or resources) to be educational. It's a simple idea, which makes it easy to see when you haven't gotten it right, and I learned a bit about where things happen by switching them off one at a time.

(Note: Uniformia is going to be really slow to load if you let the game engine try to choose which of a 1000 identical tiles are the best start positions. Implementing fixed locations is probably wiser for this exercise.)
Good idea. I'll give that a try. I'll put the human starting plot on the 50-yard line, the best seat in the house. :)
 
Good idea. I'll give that a try. I'll put the human starting plot on the 50-yard line, the best seat in the house. :)

If you want something to compare against, Four Green Fields includes a link to the map script I used to generate it.
 
Top Bottom