Easy way to add more natural wonders?

NaturalWonder

Chieftain
Joined
Jul 14, 2012
Messages
10
Hey guys, I'm a huge Civ fan and have been really enjoying Civ5 lately. Anyway, I really like natural wonders and was wondering if there is a simple way to mod a map (say the archipelago map or continents map) to spawn more natural wonders. It seems like a "normal" sized map always produces 5, but I think it would be cool to have 10 or something.

I'm new to the forum, so if there is a thread where this has already been done feel free to redirect me there.

If it's important I'm using a Mac, play Civ5 through Steam and have all the DLC including the God/Kings expansion.

Thanks!
 
I would presume it would be possible to add more natural wonders on a proper map (Like the Earth map, it's not actually a script) through Worldbuilder, but I'm not sure about the map scripts

Let me see if I get what you are saying. So through Worldbuilder I could manually add more wonders onto a map? But this wouldn't allow me to randomly generate a map with more natural wonders? Thanks for your help in any case.

Also it seems as though I can't download Worldbuilder at the moment. Perhaps because Steam is too busy.
 
You can randomly generate maps in worldbuilder, but you would have to manually add the extra wonders in and you would know where everything is

Ah OK, that's what I thought you meant. Obviously I'd rather have the wonders scattered randomly, but that is pretty good too. Thanks!

If anyone can give me some advice on a script I can use let me know.
 
In case anyone is wondering, I'm making progress. I'm sure most modders know this stuff already, but here is where I am:

1) User > Library > Application Support > Steam > SteamApps > common > Civ 5

2) Right Click the Civ5 Gods/Kind Application and choose "show package contents"

3) Contents > Home > assets > DLC > Expansion > Gameplay

Under XML you can open Terrain then CIV5Features to view a list of tiles, including the 15 Natural Wonders.

Lua seems to have the scripts I want to change though. From looking at the map files they are calling the script AssignStatingPlots.lua, so open that up. Right now I'm browsing that and trying to find where it assigns the number of natural wonders for a map. Hopefully I can change a single number and be done :)

Edit: Found this part in AssignStatingPlots.lua

-- Determine how many NWs to attempt to place. Target is regulated per map size.
-- The final number cannot exceed the number the map has locations to support.
local worldsizes = {
[GameInfo.Worlds.WORLDSIZE_DUEL.ID] = 2,
[GameInfo.Worlds.WORLDSIZE_TINY.ID] = 3,
[GameInfo.Worlds.WORLDSIZE_SMALL.ID] = 4,
[GameInfo.Worlds.WORLDSIZE_STANDARD.ID] = 5,
[GameInfo.Worlds.WORLDSIZE_LARGE.ID] = 6,
[GameInfo.Worlds.WORLDSIZE_HUGE.ID] = 7
}
local target_number = worldsizes[Map.GetWorldSize()];
local iNumNWtoPlace = math.min(target_number, iNumNWCandidates);
local selected_NWs, fallback_NWs = {}, {};
for loop, NW in ipairs(NW_eligibility_order) do
if loop <= iNumNWtoPlace then
table.insert(selected_NWs, NW);
else
table.insert(fallback_NWs, NW);
end
end

So it seems like all I need to do is change this part. The first thing I will try is to replace the worldsizes with bigger numbers.
 
Awesome that you found that. I'm not sure how the lua tables are updated, as I've got very little knowledge in that. But I would presume updating that section there through a mod (Not in base game, very dangerous) would change the ammount of natural wonders to be placed.
 
Hahaha, I just went ahead and edited it for the base game (I had created a backup file, so I assumed worst comes to worst it would be OK) and it worked!

I started a game on a Standard size Pangaea map and my starting warrior found the Grand Mesa in like 5 turns and the game said there were 11 more Natural Wonders still to find!
 
Yes, the LUA function is what you want to change. There's also an XML value in Civ5Worlds.xml, but that doesn't seem to be used or have any effect.

Either edit AssignStartingPlots.lua itself and make the changes to: function AssignStartingPlots:placeNaturalWonders()

(This will affect all your maps when using this mod.)

or

Copy function AssignStartingPlots:placeNaturalWonders() into a LUA map script (such as a custom one you've created or one you use most often) and make the changes there.

(This will affect only that map script and others will be unaffected)

I'm not very experienced with LUA, so I don't know if there's a slicker way to do it. Some functions you don't even need to copy over to the map script and you can just change a list of variables and send them over as "args" when you call the function. But, as far as I know, this one doesn't look like you can do that.
 
But, as far as I know, this one doesn't look like you can do that.

It's hard coded; there's even a comment that says it should be moved out into XML! Looks like a job half-complete ;)
 
-- Determine how many NWs to attempt to place. Target is regulated per map size.
-- The final number cannot exceed the number the map has locations to support.
local worldsizes = {
[GameInfo.Worlds.WORLDSIZE_DUEL.ID] = 2,
[GameInfo.Worlds.WORLDSIZE_TINY.ID] = 3,
[GameInfo.Worlds.WORLDSIZE_SMALL.ID] = 4,
[GameInfo.Worlds.WORLDSIZE_STANDARD.ID] = 5,
[GameInfo.Worlds.WORLDSIZE_LARGE.ID] = 6,
[GameInfo.Worlds.WORLDSIZE_HUGE.ID] = 7
}


So it seems like all I need to do is change this part. The first thing I will try is to replace the worldsizes with bigger numbers.

Thread necro!

I tried doing this, and I never get more than 8 even when I have the max set to 14. Is there something else I have to modify?
 
Thread necro!

I tried doing this, and I never get more than 8 even when I have the max set to 14. Is there something else I have to modify?
No, modifying AssignStartingPlots.lua should be the only change necessary - I say that with some confidence because I've done this change myself, and it works as intended. I suppose some hiccups may arise if you try to place a very large number of natural wonders on a very small map, simply because there will not be enough elegible spots. Are you sure that the game is actually using your modified ASP.lua - i.e. have you imported the file correctly?
 
No, modifying AssignStartingPlots.lua should be the only change necessary - I say that with some confidence because I've done this change myself, and it works as intended. I suppose some hiccups may arise if you try to place a very large number of natural wonders on a very small map, simply because there will not be enough elegible spots. Are you sure that the game is actually using your modified ASP.lua - i.e. have you imported the file correctly?
Does this also apply for custom natural wonders?
 
Thread necro!

I tried doing this, and I never get more than 8 even when I have the max set to 14. Is there something else I have to modify?

To increase the total, you just need to increase the values per world size in PlaceNaturalWonders(). Though, as kaspergm said, to increase the chances of getting that total onto the map (especially if it's large -- like 14!!), you'll need to tinker with the ripple radius of placements. Otherwise, they'll easily block each other out.

NW's block other NW's in a radius equal to: (height of map) / 5

Also, remember, civ starts block out NW's too in a radius equal to: 4
(Though, you shouldn't really need to decrease that, even with many civs -- it would unbalance things further. It's just something to keep in mind when determining the other ripple radius.)

Just do a search for "self:placeResourceImpact(x, y, 6" and you'll find both of them (6 is the natural wonder layer) and modify the last value.
 
No, modifying AssignStartingPlots.lua should be the only change necessary - I say that with some confidence because I've done this change myself, and it works as intended. I suppose some hiccups may arise if you try to place a very large number of natural wonders on a very small map, simply because there will not be enough elegible spots. Are you sure that the game is actually using your modified ASP.lua - i.e. have you imported the file correctly?

I figured out the problem I was having. If you have BNW, you have to modify the AssignStartingPlots.lua in the Expansion2 folder. Since I was following these instructions from after GnK, I only modified the GnK file. For those that have BNW, just make sure you change the correct file.

I set the standard amount of NWs on standard maps to be 12. I've seen 12-13 spawn each time now, because the Great Barrier Reef will almost always spawn and thus increase the number of NWs you can find by 1.

On a related note, does anybody know how to make NWs avoid city-states? Having CSes grab half the NWs on the map is kind of annoying.
 
http://forums.civfanatics.com/showthread.php?t=508236

Google helped me out here, so I figured I'd reply to myself to help out anybody else who wants to grab those tasty NWs for themselves. I haven't tried this yet myself but I don't see any reason it wouldn't work.
Oh thanx very much for the link to the information about Natural Wonder / City State ripple number. I had myself considered changing the placement order of the two, but was woried that it might cause issues, so haven't come to it now. This seems a lot easier - if you do try it out, please let us know how it plays out!
 
To increase the total, you just need to increase the values per world size in PlaceNaturalWonders(). Though, as kaspergm said, to increase the chances of getting that total onto the map (especially if it's large -- like 14!!), you'll need to tinker with the ripple radius of placements. Otherwise, they'll easily block each other out.

NW's block other NW's in a radius equal to: (height of map) / 5

Also, remember, civ starts block out NW's too in a radius equal to: 4
(Though, you shouldn't really need to decrease that, even with many civs -- it would unbalance things further. It's just something to keep in mind when determining the other ripple radius.)

Just do a search for "self:placeResourceImpact(x, y, 6" and you'll find both of them (6 is the natural wonder layer) and modify the last value.
First of all thank you for a GREAT help! I have been wanting to do this for ages - but never even known it was possible!!

However, I haven't been successful. So I hope you can offer additional help to a poor NW desperate soul! :)
I have found a APS.lua file. I have modified the numbers of allowed NW in the different size maps AND I have altered the (x, y, 6 (height of map) / 5) to (height of map) / 4 for all the wonders individually. But I still don't see any change?!

I'm playing on Mac and steam. And I have installed both GaK and BNW. But still when I look through my Civ5 files, I can only find one folder with .lua files - the one I have modified.
I have located this under the path: steam/steam apps/common/sid meier's civilization v/assets/gameplay/lua/assignstartingplots

Should I be looking for another file to modify?? Or when I modify the file (in textedit) do I then need to do something else than just save it?
 
Top Bottom