View Full Version : Proposal: culturally and physically appropriate starting positions.
lumpthing Oct 25, 2007, 04:23 AM Anyone know of a a map script that causes civs to start in appropriate locations? e.g. East Asian civs start close to one another, European civs start in a cold/temperate region etc.
If not, could anyone give me any pointers to getting started on creating one myself?
alireza1354 Oct 27, 2007, 02:56 PM Would be very cool if u could choose it to be like this...
lumpthing Oct 27, 2007, 03:56 PM well watch this space... I have hatched upon a cunning plan for a map script which might just work!
will post here after I have created and tested it
Amuroray Oct 28, 2007, 08:20 AM really? can t wait for it :)
lumpthing Nov 04, 2007, 04:04 AM Update time:
My not particularly cunning plan was to modify dreiche2's Fall From Heaven 'flavor map' script for the standard Earth civs instead of Fall From Heaven's fantasy civs.
Unfortunately I can't seem to get it to work for me, as you can read here: http://forums.civfanatics.com/showpost.php?p=6115852&postcount=176
So I'm waiting for someone to enlighten me as to what the problem is. Otherwise I'm going to have to give up :(
SlightlyMad Nov 05, 2007, 12:54 PM lumpthing, that's a really cool idea, could you post your script so I can debug it and see if I can find the problem?
lumpthing Nov 05, 2007, 02:09 PM Here you go. Good luck!
I haven't edited any of dreiche2's text, so some of it is misleading since it refers to his original Fall from Heaven file. But it should be perfectly obvious where this is the case. The only thing I have modified is the information referring to specific civs, and the file name itself.
To get the mod to work, you need to place it within the publicMaps folder and then paste in the following line of code into the top of any map script you want to be affected by it:
from flavourStartsMapMod import normalizeStartingPlotLocations
NB: I've included a bunch of text files which contain my notes on things like which resources appear at what latitudes etc. They shouldn't have any effect on the problem at hand but might be helpful if you decide to take the mod further. One useful bit of info I didn't include in my notes is the fact that luxury appear less frequently and in much more concentrated patterns than food resources.
SlightlyMad Nov 05, 2007, 02:27 PM Very cool, I'd love to experiment with this in my PerfectWorld variant I've been using. I'll add it in, and add some debugging output to see if I can figure out the issue.
What script were you using it with?
lumpthing Nov 05, 2007, 02:44 PM I've been testing it with tectonics (my favourite user-made script) and the default continents script (huge size in both cases). Didn't seem to work with either script.
By the way I updated my download file to include my notes, see my previous post in this forum.
SlightlyMad Nov 05, 2007, 03:26 PM Okay, I'm still at work so I haven't had a chance to actually test this yet, but it looks like a lot of the civs you've set up have some of their conditions commented out, and there's not a whole lot of consistency in your groupings. When I get home, I'm going to simplify the script as a test. It's possible that it is working, but the way you have it set up, it's just not that meaningful.
edit: I think it might be wise as well, to tighten up the groupings into fewer more cohesive arrangements. Is it really that important that South Asia and East Asia, or North America and South America be separate? I'd rather have them together in an ahistorical arrangement than on separate continents altogether. It's also worth considering adjusting for resources that are specific to a civ. Like giving ivory a bonus for the Khmer start, and ocean and coast a bonus for Vikings and Dutch. Of course, there are some serious pros and cons to that one ;)
SlightlyMad Nov 05, 2007, 08:29 PM Okay, I found two problems that were preventing the code from running at all. First, you have to change "FfH_flavor_mapmod" to the name of your new script, "flavourStartsMapMod" in the import statement. I'm guessing that was just a typo in your post though. Second, there was a typo on line 479 that I discovered when I checked the PythonErr.log file. It says just "info" where it should say "infoMongol".
If you then set the FFH_DEBUG variable to "True" in the script, you can check the PythonDbg.log file and see all the debug output. In looking at this, I could see that your script appears to be working fine at that point. I'm still a little dubious about how meaningful the results will be with the rules as you have them set, though.
Thanks for putting this together, I'm going to keep working with it a bit for a much more simplified version and see if that's more to my liking, as we seem to have different goals in a script like this.
Calavente Nov 06, 2007, 01:32 AM dreiche 2 reported some reasons yesterday...
the script will look at all 'starting points' then count a grid of N in all direction. then add : +x for this, -y for that... and no notion of distance. so, if sheep is important, give them a factor 10. thus, 3 jungle w10 tiles south will not negate a sheep in the fat cross and declare the site invalide.
so his advices are :
-reduce the grid size.
-change impact of ressources compared to terrain
I would add :
-use less -x bonus...
lumpthing Nov 06, 2007, 01:41 AM thanks
The way I sorted out the different civ groupings is a work in progress. I've shuffled them around a few times trying to get things to work, so how it happens to be now only partially reflects how I envision it work out in the end. Right now, my primary concern is getting it to work at all!
Needless to say you should work things out exactly how you like, I just want to see if any kind of cultural grouping is possible.
But as an interesting point of dicussion I do see South Asia and East Asia as significantly different. I mean, Indian and East Asian civilization have very separate origins, as separate as any you can expect while still being on the same landmass. Indian cultural origins are in my opinion closer to that of European and Middle Eastern civilizations. The people who laid the foundations Indian culture in the form of Hinduism are very related to Europeans and this is especially evident in their language. But India was still historically very different to the Middle East and Europe so I tend to see it as more of a 'free-floating' civilization, not tied to any other.
I can't remember who the Khmer are grouped with in the file I sent you but I would certainly now consider them part of the East Asian grouping rather than the South Asian group.
And yes the import line of code was just (shockingly glaring!) typo. I'll correct it in my post in case anyone else has a go. I know that the code is being imported because I get the all-grassland map of error if I make a mistake in the syntax.
Cheers for the Mongol typo.
dreiche2 Nov 06, 2007, 07:34 AM Hi all, probably it makes more sense to discuss this stuff in this thread, so for completeness' sake I quote my answer from the other thread (although Calavente reported it already):
First of all, you could try to reduce regionSize further, if just for testing purposes. That makes it easier to see what's really close to the starting position. I recommend 6 or something.
Secondly, you could play around with the values a little bit. In particularly, you should set the value for boni higher than that for terrains, because they appear less often. What the algorithm does is to count all the things withing range, multiply each count with it's corresponding value, and add everything up. With your setting, a single jungle tile withing range will basically negate one sheep resource within range...
So if you really want to know if the sheep thing works, make it the only flavor setting for that civ, and then look at what you get...
And btw, just because Calavente mentioned the "notion of distance": there is actually another setting that let's you give closer tiles a higher weight (though not specifically for certain terrains or features). You can define the size of a "close" region and assign an additional weight factor to it.
But as mentioned before, to have an observable effect you should probably make the overall regionSize small to begin with.
lumpthing Nov 06, 2007, 02:19 PM Oops, I just noticed that in dreiche2's explanatory notes, it says SetPriority. I had been spelling it setPriority ('s' instead of 'S'). I'm pretty certain this was the problem. Bloody syntax. Don't have time to make 100% sure tonight but I'm optimistic.
In the meantime, dreiche2: do you know if its possible to have decimal values for SetPriority, e.g. 1.5, 2.5.?
dreiche2 Nov 06, 2007, 02:45 PM Looked into the file, setPriority is correct. The notes are wrong in that regard. I suspect it should give an error if you try otherwise.
Priority can only have 1, 2, or 3 as value the way it is currently implemented.
lumpthing Nov 06, 2007, 03:16 PM oh :( In that case I'll report on my latest attempts...
i tried reducing the regionSize to 6 and increased the value for sheep to 10, but to no avail.
I then tried commenting out all the code for non-European civs - so the Europeans all desperately wanted sheep and had priority 1, and all the other civs didn't care. Three out of my three trials worked perfectly - for the first time all the European civs had sheep in their region! I'll have to do more tests to make sure of course, but it seems like a step closer towards identifying the problem.
dreiche2 Nov 06, 2007, 03:56 PM hm... oops. Just had another look at the script; possibly the whole priority thing is bugged. Well, very possibly, that is.
Could you test that: In the following code segment,
def setPriority(self,priority): # the lower the earlier
if priority < 1:
priority = 1
if priority > 3:
priority = 3
self.priority_ = priority
replace "self.priority_" with "self._priority". The underscore is on the wrong spot, a typo it seems. :mischief:
Apart from that, the above argument with the regionSize and Bonus value still applies, though.
lumpthing Nov 12, 2007, 01:57 AM just to give an update: I have been doing more testing, with that bit of code correct. The results are encouraging but I need to do more. I'm just very busy at the moment and its difficult to find even a spare half hour :/
Amuroray Nov 12, 2007, 07:30 AM just to give an update: I have been doing more testing, with that bit of code correct. The results are encouraging but I need to do more. I'm just very busy at the moment and its difficult to find even a spare half hour :/
keep the good work, we will wait ^^
lumpthing Nov 12, 2007, 03:42 PM thanks, but its definitely not going to be as good as i originally envisaged, but better than nothing
CyberChrist Nov 13, 2007, 01:56 AM @dreiche2:
Am I reading your code right when I come to the conclusion that what you have done doesn't actually generate starting plots from scratch, but rather reshuffles and reassigns the startingplots that the mapscript have already generated and assigned?
If so then it would require an expansion/rework of the 'flavor' script to ensure anything to do with cultural linked start positions.
lumpthing Nov 15, 2007, 04:06 AM More frustrating test results:
I've edited it as follows:
Priority 1 civs are the East Asians the New World civs. East Asians like silk and New Worlders like dye.
Priority 2 civs are the 'tropical' civs (Sub-saharan Africans and India), who like jungle and don't tundra. regionSize = 6
Priority 3 civs are everyone else, haviig various terrain preferences which I won't bother going into. regionSize = 6
I've been testing on continents and in every test I've done the priority 1 civs always starting near their desired luxuries, resulting in successful groupings of New World and East Asian civs.
Unfortunately the priority 2 civs, the tropicals, often don't start anywhere near jungle, even though priority 3 civs do!
So it seems that priority 1 civs do get priority, but priority 2 civs are not getting priority over priority 3 civs :/
I've attached my latest file
lumpthing Nov 17, 2007, 04:51 AM I test again, this time with the tropical civs priority 1, same as the east asians and new worlders. same problem: perfect results for east asians/new worlders, bad results for the tropicals
This suggests that the problem is not to do with priority after all. Perhaps its something to do with the fact that the east asians and new worlders are attracted to particular luxuries, whereas the other civs are all looking for particular terrains.
lumpthing Nov 20, 2007, 01:52 AM oops, i made a typo (had written 'boni' when I meant 'terrains' in some of the tropical civs' entries)... things seem okay now
lumpthing Nov 20, 2007, 02:54 AM or not... im just going round in circles here
lumpthing Nov 20, 2007, 04:11 AM and i take it back once again, i think im getting close...
lumpthing Nov 20, 2007, 06:48 AM Alright, is done at last.
Like I said, it's not as good as I had originally hoped for, for example the Europeans are very unlikely to start in a single clump. On the other hand, the climate-linked starting positions works reasonably well and there is a bit of cultural-linking going on, especially for the East Asians and New Worlders.
Download the file and post any further comments here please: http://forums.civfanatics.com/showthread.php?t=251580
|
|