1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[Map Script] Planet Generator

Discussion in 'Civ4 - Map Scripts' started by Nercury, Aug 5, 2006.

  1. brandonjm8

    brandonjm8 Chieftain

    Joined:
    Dec 30, 2009
    Messages:
    18
    Location:
    Land of 10,000 Lakes
    Nercury, you still here?

    quick question for anyone that can answer, while having a wet climate theres way too much tundra and ice, they almost extend 60% towards the equator, i do have very huge maps one setting lower than the max but still about 40% of the land is either tundra or ice, it took me almost 2 hours to change all of them using WB, is there a way i can rewrite something in the code for how far down from either poles ice/tundra go? if so how do i do it, im not much of a programmer so if you can give detailed instructions, thx. also i tried max map and had this problem then tried one lower of max and same problem happened then i turned my graphics down to medium but it didnt help, i get a column from pole to pole on the eastern side of the map maybe 20% of map but its blurred out kinda thing, it doesnt look right, my current game i started in this place and i can work it and see but its alittle blurred and im just wondering WTF happened, i dont know if my "huge" maps are too big or if i found a bug. i have civ4 bts 3.19, vista 64x, high-end machine 4 gigs 2.4 dual core and nvidia g-force G100 (good card) graphics card. this is the only mapscript that has this blurred part of the eastern map from north to south.
     
  2. AccipiterQ

    AccipiterQ Chieftain

    Joined:
    Aug 17, 2007
    Messages:
    59
    Does this thing just NOT work with the latest BAT mod?? It shows up on the list for custom game, but you can't change anything, all the options are gone. The only thing you can change is stuff like humidity and sea level.
     
  3. skodkim

    skodkim Chieftain

    Joined:
    Jan 16, 2004
    Messages:
    2,220
    Location:
    Denmark
    This looks really promising. Have been using smartmap a lot but it hasn'r been supported for quite a while now.

    Would it be possible to incorporate some of the ideas from smartmap, like:
    -A no snow/tundra option
    -An option to control amount of rivers/lakes/goodies/bonusses

    \Skodkim
     
  4. Kavryelh

    Kavryelh Chieftain

    Joined:
    Jan 11, 2010
    Messages:
    2
    Your map script is nearly perfect.
    It lacks an option to allow a continent free of Civilizations, a bit like Terra map with the old world option.
    Is there a way to add a bit of a player placement script in your map script to make an Old World option ?
    I am sadly not able to do it myself, as I don't have the necessary skills.

    I love your map script, it makes maps just like I want them, as I said it lacks just this option to be perfect in my eyes ^^

    Thank you for your map script.

    (I am not a native english speaker, so I apologize for my probable mistakes).
     
  5. Kavryelh

    Kavryelh Chieftain

    Joined:
    Jan 11, 2010
    Messages:
    2
    Finaly, I've managed to do it myself.
    Basically I've paste the "player starting locations" block from terra.py over the corresponding one in your map script.
    It was way simpler than I thought.

    Again, thank you for your beautiful map script ^^
     
  6. stljeffbb

    stljeffbb XML Journeyman!

    Joined:
    Oct 22, 2006
    Messages:
    67
    Location:
    Wisconsin
    I enjoy this map script quite a bit! I ve been using it for a while....the one thing I noticed is that when using anything other than the "standard generator" for resources (by modding the file a little bit), things are crazy....marble in the ocean, and lots of resources....any way to include random choices for resources?

    Regards, and thanks for making this!

    Jeff
     
  7. berlinmassive

    berlinmassive Chieftain

    Joined:
    Jan 27, 2010
    Messages:
    3
    hey,
    this, i am sure, is a very unqualified and noob question, but i searched and couldnt figure it out, so please help me with this.
    I am trying to get the map generator running for me but it crashes after the load bar is about 1/6 complete and it says Initializing. It just freezes there and windows task manager says "no response".
    I am running vista as admin, have all other relevant latest patches and so forth. i have the unofficial patch as a mod, so i start bts, load the mod and want to start a random planet. then, above problem shows up.
    everything else works fine.

    i copied the .py into the bts public maps folder, which is where it needs to be as far as i know, because it only showed up as an option in the game after i did this.

    thanks in advance
     
  8. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    2,055
    Location:
    Missouri, USA
    There's no real way(actually there might be, but most map scripters don't know it) for a map-script to give feedback on that progress bar, so make sure that you are waiting long enough. Some maps take longer than others to generate.
     
  9. brandonjm8

    brandonjm8 Chieftain

    Joined:
    Dec 30, 2009
    Messages:
    18
    Location:
    Land of 10,000 Lakes
    does anyone else get a blurred part of the eastern side of the map from north to south poles? they shrink the smaller map i use but i use bigger than huge maps and they are always there, just more pronounced the bigger the map is.

    any comments would be appreciated and welcomed, id like to know if anyone else has this bug and if its normal or if it has something to do with mine, its only using this mapscript does that happen but this is the only script i use to have bigger than huge maps.
     
  10. LunarMongoose

    LunarMongoose Chieftain

    Joined:
    Jan 29, 2006
    Messages:
    730
    Gender:
    Male
    Location:
    Boston, MA, USA
    Since I was curious, I investigated this a little. There is an entry in CIV4GameText_Misc1.xml called TXT_KEY_INIT_INITIALIZING that controls what the progress bar says. If you change it to "Aardvarking" like I did, that's what it will say while the map script is generating a map. If you then search for this text key in the SDK and Python folders you come up empty. I can therefore say with reasonable confidence that that loading dialog and, by extension, its progress bar, are controlled by the .exe and thus not enhanceable. Sowwy, heh, wish I could help cuz that'd be a neat thing to do.
     
  11. stljeffbb

    stljeffbb XML Journeyman!

    Joined:
    Oct 22, 2006
    Messages:
    67
    Location:
    Wisconsin
    Hello Kavryelh....how exactly did you do this? I'm having a bit of trouble making it work....I've tried pasting the findStartingPlot text but have not had any luck....

    Thanks,

    Jeff

    PS....I guess I'm just looking for a way to incorporate a New World option into this generator....if there is another way, I would be glad to know of it! :)

    PPS OK I figured it out...to a point.

    Here is the original:

    Code:
    def findStartingPlot(argsList):
    	"Can override to return	the	plot index at which	the	given player should	start"
    	#print "-------- Find starting plot ----------"
    	playerID = argsList[0]
    	CyPythonMgr().allowDefaultImpl()
    Replace that with:

    Code:
    def findStartingPlot(argsList):
    	"Can override to return	the	plot index at which	the	given player should	start"
    	#print "-------- Find starting plot ----------"
    	playerID = argsList[0]
    
    	def isValid(playerID, x, y):
    		map = CyMap()
    		pPlot = map.plot(x, y)
    		
    		if (pPlot.getArea() != map.findBiggestArea(False).getID()):
    			return False
    
    		return True
    	
    	return CvMapGeneratorUtil.findStartingPlot(playerID, isValid)
    
    	CyPythonMgr().allowDefaultImpl()
    ...problem is, so far only one continent has filled up with players, and ALL others have been vacant. Now, a workaround would be something like using RevolutionDCM and enable "BarbarianWorld" and "BarbarianCiv" options, which would enable Barbarian cities to sprout up elsewhere, then become civs....I will work a little bit with the code and see what I come up with....

    PPPS.....well, empty continents are TRULY empty...even of barbarians at the beginning of a RevolutionDCM game....I'm running an auto-play game to see if Barbarians "sprout up".... ;)

    PPPPS...yes indeed, barbarians do sprout up...this might be a very good way to simulate a "new" world!
     
  12. exodustpa

    exodustpa Chieftain

    Joined:
    Feb 18, 2010
    Messages:
    42
    Is there any way to generate a map with more resources with this map script. Im having trouble generating maps in Total war mod with much resources. My entire continent that is at least a few hundred squares has like less than 10 resources on it.
     
  13. stljeffbb

    stljeffbb XML Journeyman!

    Joined:
    Oct 22, 2006
    Messages:
    67
    Location:
    Wisconsin
    Hello exodustpa...yes, there definitely is. I'm at work right now, but when I get a chance this weekend, I'll edit this message with some of my findings...I play on a 256x160 map, and I was actually looking to have less and more random numbers of resource...I finally reached what I was looking for, and I'll explain how it can be done

    Regards,

    Jeff
     
  14. kivanc

    kivanc Chieftain

    Joined:
    Aug 23, 2007
    Messages:
    895
    Location:
    1) Istanbul 2) Izmir (Turkey)
    this generator used to have a problem about forests. does it still exist?

    bec of forest on %90 of tiles, there were very very very few resources.
    once i counted, there were 5-6 types of resources on a landmass. and 2-3 for each type. the landmass was a very big one, nearly half of the world.
    the world was a bit larger than civ4 huge world. i think that was damaging sth and not working prperly.
    i don't have the save now. i had quitted the game in late age bec it took very much for each end of turn in my old computer.
     
  15. stljeffbb

    stljeffbb XML Journeyman!

    Joined:
    Oct 22, 2006
    Messages:
    67
    Location:
    Wisconsin
    @camarilla......yes I've read about this before...there ARE a lot of forests, but I have not counted how many there are....90% seems a bit high....I play on the largest size map possible (256x160), but at about 80% ocean....there ARE open spots on occasion, but I ultimately feel that a lot of trees is "more" realistic.

    I personally like less resources....it makes it fun trying to fight the AI for the scarce vegetables and minerals I need to win....but enough about that....here is how to get somewhat more random numbers using this generator, and also (presumably) getting more resources on your map.

    Here is a bit of code:

    Code:
    ...<iConstAppearance>100</iConstAppearance>
    			<iMinAreaSize>3</iMinAreaSize>
    			<iMinLatitude>0</iMinLatitude>
    			<iMaxLatitude>90</iMaxLatitude>
    			<Rands>
    				<iRandApp1>400</iRandApp1>
    				<iRandApp2>400</iRandApp2>
    				<iRandApp3>400</iRandApp3>
    				<iRandApp4>400</iRandApp4>
    			</Rands>
    			<iPlayer>10</iPlayer>
    			<iTilesPer>2000</iTilesPer>
    			<iMinLandPercent>0</iMinLandPercent>
    			<iUnique>0</iUnique>...
    This is located in your CIV4BonusInfos XML file (from the Assets\XML\Terrain folder)...the tags we will be most concerned with are:

    iConstAppearance
    iRandApp1 through 4
    iPlayer
    iTilesPer

    The following is borrowed from http://civ4.wikidot.com/xml:civ4bonusinfos

    iConstAppearance = Percentage, once the number of bonus resources to place is calculated, it is multiplied by this percentage. Note, once there are no more valid plots on the map, no more resources will be placed. If this value is set high, typically the iUnique value will limit the number of resources.

    iRandApp1 through 4 = Random number, from 0 to iRandApp1 (through 4) of additional resources to place, also see multiple line tag Rands below.

    Rands = Contains integer tags iRandApp1, iRandApp2, iRandApp3, iRandApp4. Random number of additional resources to place, in addition to the constant number specified by iPlayer and iTilesPer.

    iPlayer = Approximate occurrences per player, in percent (%), so 150 is about 1.5 per player.

    iTilesPer = The fixed number of additional occurrences per x tiles, so 120 would mean an additional occurrence every 120 tiles existing on the map. Note, an additional random number of this resource is added by iRandApp1 through iRandApp4.

    So, I started playing around with these four tags to see what I could get. I decided to modify only Resources and Luxuries, because I was happy with the food placement....there are some subtle differences between the different bonuses in the original Civ4BonusInfos to represent the relative availability / scarcity, however I felt there were actually too many resources, so I changed it around to the above numbers listed in the code....

    Basically, if you want to increase the amount of a given bonus, increase either the iConstAppearance, the iPlayer, or both!

    Now, I have read on this thread that there was a problem with using anything other than the "Standard Generator" in the .py mapscript. Indeed, I found this to be true after trying to modify the mapscript code (and the remnants are even there, but REMed out)....after playing with the numbers, it is my hunch (and just that) that the iRandApp numbers may be percentages and not hard numbers...this is based on the differing results I have received from testing my version of the file:

    HTML:
    						 
                                                                     Average
    Aluminum	         7	23	0	13	19	12.4
    Coal	                17	11	0	 8	17	10.6
    Copper	        14	26	17	14	25	19.2
    Horse	        22	16	23	22	13	19.2
    Iron	                20	24	18	14	22	19.6
    Marble	        21	9	10	21	21	16.4
    Oil	                14	16	30	22	36	23.6
    Stone	        14	13	14	18	21	16
    Uranium	        22	41	24	50	29	33.2
    Dye	                13	19	22	14	0	13.6
    Fur	                30	17	0	20	26	18.6
    Gems	        13	15	17	17	0	12.4
    Gold	                10	15	0	13	23	12.2
    Incense	        0	15	17	17	0	9.8
    Ivory	        16	16	41	21	18	22.4
    Silk	                25	33	20	17	17	22.4
    Silver	        12	8	0	0	15	7
    Spices	        8	21	30	35	16	22
    Sugar	        3	14	25	24	0	13.2
    Wine	        14	13	20	11	6	12.8
    Whale	        16	0	13	0	0	5.8
    
    
    (sorry.....can't quite get this to line up :( )

    ....now, you might notice that sometimes there are 0 instances of a resource/luxury! I have a feeling that the generation script will somewhat help take care of this (you know, when you have a mine and then, perhaps 5 to 200 turns later, you get the message "you have found a source of iron!")....if not, then I guess all of the civs will be stuck in the Industrial age ;)

    Also, I play with the RevolutionDCM mod, and I play with the BarbarianCiv mod that spawns civs from Barb cities....also, as shown above in a previous post, I modified this script to allow for a "new world" situation....that has been VERY fun! I also start with 20 civs, but some civs are instantly killed off to allow the script to regenerate them later...so basically, there is about one instance of each vital resource per civ.

    There you have it! :goodjob:

    Regards,

    Jeff
     

    Attached Files:

  16. exodustpa

    exodustpa Chieftain

    Joined:
    Feb 18, 2010
    Messages:
    42
    so is there a way to increase the resource generated by this map script?
     
  17. stljeffbb

    stljeffbb XML Journeyman!

    Joined:
    Oct 22, 2006
    Messages:
    67
    Location:
    Wisconsin
    "Basically, if you want to increase the amount of a given bonus, increase either the iConstAppearance, the iPlayer, or both!"

    :)
     
  18. stljeffbb

    stljeffbb XML Journeyman!

    Joined:
    Oct 22, 2006
    Messages:
    67
    Location:
    Wisconsin
    Hmm...I'm noticing that my ships can sail through an isthmus, and I've been in touch with the folks running the RevDCM mod (the only other mod I run), and they say it is not their doing...so, anyone know where I can find the pathfinding AI portion of the files?

    :)

    Jeff
     
  19. Fuyu

    Fuyu Chieftain

    Joined:
    Nov 5, 2009
    Messages:
    1,220
    Location:
    Austria
  20. stljeffbb

    stljeffbb XML Journeyman!

    Joined:
    Oct 22, 2006
    Messages:
    67
    Location:
    Wisconsin
    Hello Fuyu...yes, I found your post during a search of this issue....so it's a vanilla thing then? Interesting...I do not recall this in the past, but maybe it has been too long since I played vanilla Civ 4...oh well....certainly not a game breaker at all...I just wanted to try to be sure the AI does it too...I thought perhaps only hu-man players could do this....

    Thanks!

    Jeff
     

Share This Page