[Map Script] SmartMap

PBaron said:
First off, I wanted to say what a great job you did on this map generator. I have tried out a few of the settings, and even on tropical, it doesn't seem to be generating very many rivers. I was wondering if you could put a River percentage meter or something in future versions.

Also, I noticed that the maps I generate are extremely wide and not tall at all. Seems like a 4:1 ratio of width to height, what can I do to make it more rectangular or square?

Keep up the good work!

You can override the width & height to whatever you want. The next version will come with hints on what sizes are appropriate, so that will be easier to do. Otherwise .. it's pretty random.

I went in and looked at the algorithm for generating a width and height. I've tweaked it a bit so that the default maps should get roughly no more than 3x ratio of width to height.
 
surt said:
If you actually want to try wrap y you may find that it works with my script since my script always keeps all features other than ice more than 2 tiles away from the edge. (not that I play it much myself, but i've tried it a couple times and not noticed a problem).

Also, I agree with the other poster on fog of war ... if you line-of-sight a goody hut that has been picked up by another player, but was under fog-of-war then it has to kaboom.

I haven't tried wrap y alone... but with "wrap both" land can definitely overlap the edges.

(The goody hut problem I see must not be in the scripts, there is something buggy in the game... I have seen goody huts go perma-poof when entering worldbuilder right after regenerating a map. It is the same effect as the illegal land resource on water going poof.)
 
My problem doesn't seem to have anything to do with this mapscript in particular, so I propose we move the discussion to the general thread I opened: http://forums.civfanatics.com/showthread.php?t=159845

Hi,

I tried using this mapscript with Kael's Fall From Heaven mod. Here's what I do so you can see when the error appears:

I start CIV 4
I go for Advanced / Load a Mod / Fall From Heaven 095
I press OK on "The game needs to restart"
The game restarts; soon as the progress bar is full and the screen goes black, I get a dialog saying "Failed to load Python module SmartMap".

Should I talk to Kael about this or do you know what could be causing this?

[edit] Hm, something seems to be wrong with my CIV. When I start a normal unmodded game and go for Single Player, I get the error "Failed to load python module SmartMap"; when I try to turn on python error msgs for debugging (in the .ini file), the game hangs during the startup phase when it hits "Initializing Python". Any clue what could be wrong?

[edit number 2] This also happens with STO's mapscripts I downloaded from this forum; I assume it's something on my side.
 
Koyaanisqatsi: sorry, I misspoke: land is definitely allowed on the wrap-edges, just not on the non-wrap edges. So on wrap both i would expect land to occur on both edges. Wrap-neither would be the case where I would expect no land at any border. However, since I now place as little land as possible on the wrap-border, this problem should be relatively rare, and hopefully firaxis will fix whatever the wrap issue is in their code in the next patch. As to the poofing items ... I think I've seen what you're talking about. I suspect that these may be cases of items not getting cleaned up when regenerating maps (a leftover item is in an illegal place on the new map). Would definitely be a firaxis side bug if so.

Bringa: does sound like you have something wrong in your configuration, but it's not obvious what. See my response to your question in your other thread though, and see if anything I said there helps your situation.
 
This small update adds a river/lake frequency control, and a new '0 continents' continent option which makes for a very arhcipelago style of game. Also an assortment of other tweaks.

# 7.2
# Separate GoodyHut option from Bonuses, and add support for
# no/low/normal/high rates of goody huts.
# Add support for low/normal/high levels of resources (with low = 2/3rds
# and high = 4/3rds normal, same for goody huts).
# Rearrange all of the options to put the less commonly used ones at the end.
# Tweak up the default hills % slightly.
# Tweak up the river rate slightly.
# Make broad empty plains a little less likely by distributing hills better.
# Add some extra continent options, 1 per 2 players, 1 per 3, 1 per 4
# these may be easier for some to think about than picking an exact number.
# Added continent options 2 per player, 3 per, 4 per. These are good to use
# if you're using low sea levels to allow land blobs to merge.
# Improve the likelyhood that small numbers of continents are well separated.
# Improve the chance that player start plots will neighbor at least one hill.
# Added option to adjust the river and lake frequencies.
# Tweaked the width/height calculation so that super wide maps aren't as likely.
# Tweaked hills placement to make big empty plains less likely.
# Improved the resource distribution to get better strategic resource separation.
# Added no-continents option, which will result in all land being placed in
# fragments instead (looks suspiciously like 'archipelago').
# Fixed a bug in the counting of land resulting in fewer peaks than expected.
#
# 7.1
# After reading that Atlas can generate 1600x1600 maps (not that civiv can
# load them) decided to bump up the maximum width/height overrides so
# that if, in the future, civiv can handle such maps, SmartMap will be
# ready. Can now, hypothetically, generate 5000x5000 maps.
# Also, converted the units to map tiles, since that is probably less confusing
# for non map-scripters.
# Bump up the size of duel, tiny, small due to our allowance for more ocean
# and also because the actual chosen dimensions tend to result in a map with
# slightly smaller than the expected area.
# Areas Duel Tiny Small Standard Large Huge
# SmartMap: 80 140 220 360 560 860
# Standard: 60 104 160 273 416 640
# Make SmartMap strict default for feature generation.
# Tweak up the default ocean size due to the larger map size.
 
Random map size option (with override) is f*cked up. It allmost always chooses so big maps which are impossible to load :cry:
 
Crash757 said:
Random map size option (with override) is f*cked up. It allmost always chooses so big maps which are impossible to load :cry:

Unfortunately, that's beyond my control, the script isn't informed when the 'Random' choice is selected. So in order to make big sized maps available for those who want them, it pretty much requires that 'random' overrides width and height are not valid options.

You can either choose random for map size (in which case you'll get a random pick of duel, tiny, small, standard, large, huge), or you can specify the exact map size that you want with the overrides. Note that even if you just pick (for example) large, and leave the overrides set to their default (no override) you're still getting a randomly sized map (just one that approximately fits the size of 'large'). The width and height are still random, so I think there's still plenty of size randomness available here.

The overrides were specifically provided for those who wanted to exactly control the size of the map they played on.

That said, you can fix this for yourself. Edit SmartMap.py in notepad. Find the following:

Code:
	                  [
	                   ["16",4],
	                   ["24",6],
	                   ["32 (duel)",8],
	                   ["40 (tiny)",10],
	                   ["48 (small)",12],
	                   ["56",14],
	                   ["64 (standard)",16],
	                   ["72",18],
	                   ["80 (large)",20],
	                   ["100",25],
	                   ["120 (huge)",30],
	                   ["140",35],
	                   ["160",40],
	                   ["180",45],
	                   ["200",50],
	                   ["240",60],
	                   ["280",70],
	                   ["320",80],
	                   ["360",90],
	                   ["400",100],
	                   ["480",120],
	                   ["560",140],
	                   ["640",160],
	                   ["720",180],
	                   ["800",200],
	                   ["880",220],
	                   ["1000",250],
	                   ["1200",300],
	                   ["1400",350],
	                   ["1600",400],
	                   ["1800",450],
	                   ["2000",500],
	                   ["2400",600],
	                   ["2800",700],
	                   ["3200",800],
	                   ["3600",900],
	                   ["4000",1000],
	                   ["5000",1250],
	                   ["don't override",-1],
	                   ],

and change to something like this:

Code:
	                  [
	                   ["16",4],
	                   ["24",6],
	                   ["32 (duel)",8],
	                   ["40 (tiny)",10],
	                   ["48 (small)",12],
	                   ["56",14],
	                   ["64 (standard)",16],
	                   ["72",18],
	                   ["80 (large)",20],
	                   ["100",25],
	                   ["120 (huge)",30],
	                   ["140",35],
	                   ["160",40],
	                   ["180",45],
	                   ["200",50],
	                   ["240",60],
#	                   ["280",70],
#	                   ["320",80],
#	                   ["360",90],
#	                   ["400",100],
#	                   ["480",120],
#	                   ["560",140],
#	                   ["640",160],
#	                   ["720",180],
#	                   ["800",200],
#	                   ["880",220],
#	                   ["1000",250],
#	                   ["1200",300],
#	                   ["1400",350],
#	                   ["1600",400],
#	                   ["1800",450],
#	                   ["2000",500],
#	                   ["2400",600],
#	                   ["2800",700],
#	                   ["3200",800],
#	                   ["3600",900],
#	                   ["4000",1000],
#	                   ["5000",1250],
	                   ["don't override",-1],
	                   ],

Putting the # in front will remove that option from the list, which will make random no longer able to pick it, which should solve your problem. Note: you'll have to make this change twice, once for width, once for height.
 
I dont know, how it works, but i have some proposition, which can make this great script some more better:

Do You can introduce a "areas" or "regions" with typically landscape, for example "plains", "desert", "hills", "mountains"?.. It must be not ONLY this regions on the map, but such things would be nice ("Ok, now i've arrived the greate planes" "Looks like the Himalayas" and so on)

And another proposition: tiles near mountains should have bigger chance to be hills. Like foothills.


Best regards,
Erendir

P.S. Sorry for my english :rolleyes:
 
Erendir said:
I dont know, how it works, but i have some proposition, which can make this great script some more better:

Do You can introduce a "areas" or "regions" with typically landscape, for example "plains", "desert", "hills", "mountains"?.. It must be not ONLY this regions on the map, but such things would be nice ("Ok, now i've arrived the greate planes" "Looks like the Himalayas" and so on)

And another proposition: tiles near mountains should have bigger chance to be hills. Like foothills.


Best regards,
Erendir

P.S. Sorry for my english :rolleyes:

Interestingly enough, the mountains actually work the reverse way in my script: a tile near a hill has a greater chance to become a mountain.

For the other idea ... that would be somewhat difficult, as my script doesn't really have a notion of areas built into it, only continents at the moment. But i'll think about it and see if anything comes to me.
 
Another interesting concept would be large mountain ranges, with some passes in them. It would add a new strategic layer to the game. Right now peaks are only unusable terrains for city purposes, as they can be easily bypassed by units...
 
elhoim said:
Another interesting concept would be large mountain ranges, with some passes in them. It would add a new strategic layer to the game. Right now peaks are only unusable terrains for city purposes, as they can be easily bypassed by units...

I've thought about this as well, and I think it is a good idea. Unfortunatley, I haven't yet thought of a good way to figure out where strategic bottlenecks will be by algorithm, so it's hard to place peaks in a deliberate way that will add meaningfully to the strategy. But i'll keep thinking about it, maybe something will come to me.
 
That wouldn't work, because you'd end up with big, blobby, checkerboard patterns, instead of chains of mountains.

I'd suggest an algorithm that comes up with a line that tends to follow along the edges of a couple landmasses or large patches of desert/plains/grassland/whatever, have a certain percentage of the land tiles along that route become mountains, and then place hills along a certain percentage of the tiles adjacent to those mountains. That way you get some interesting mountain ranges, with nice piedmont regions around them; in addition, you also mimic plate tectonics, because the mountain chains span multiple landmasses, implying that the landmasses were once part of a single continent/pangaea that broke apart as the tectonic plates shifted.

The trickiest part, of course, would be finding a way to generate and work with that curvy guideline... Maybe by creating several smaller, straight lines?
 
I've noticed, that also by many/many rivers/lakes, there will be really MANY lakes, but only few rivers.

=>
the rivers can lead to/from lakes (like from mountains)
one lake can have many rivers inflowing in it and 0-1-few outflowing.
the rivers can have inflows...

and so on. :)
 
1) I know it's been said before, but YOUR SCRIPT ROCKS. :goodjob:
2) Whenever people come out and say "XYZ needs improvement", you have a new version in a few days, usually with extra features we didn't even think to ask for. I think we all really appreciate it. :hatsoff:

-RdF

P.S. I discovered something recently: on the first turn of the game, there is a "Regenerate Map" button in the game menu. It lets you start a new game with all of the same parameters without having to go to the main menu and go through the whole setup process again. (There's no message that it's working: it just looks like your computer freezes while it's making the new map.)
 
roidesfoux said:
1) I know it's been said before, but YOUR SCRIPT ROCKS. :goodjob:
2) Whenever people come out and say "XYZ needs improvement", you have a new version in a few days, usually with extra features we didn't even think to ask for. I think we all really appreciate it. :hatsoff:

-RdF

P.S. I discovered something recently: on the first turn of the game, there is a "Regenerate Map" button in the game menu. It lets you start a new game with all of the same parameters without having to go to the main menu and go through the whole setup process again. (There's no message that it's working: it just looks like your computer freezes while it's making the new map.)

I use the "regenerate map" function all the time, and it does take some time for it to do so, but it has never locked on me.

YMMV

-=R=-
 
Regenerate map is a generic civ4 feature, it should work with all scripts, not just mine. Unfortunately, it doesn't put the progress bar up, so it will appear that the game is frozen until the regeneration process is complete.

Also, I'm trying to find out if there is a good way for me to 'remember' your settings between trials so that you won't have to keep setting all your preferred options every time. Unfortunately, I'm taking a week long trip, so the next version will be longer than usual in coming.
 
Back
Top Bottom