Giant Map Scripts

Sir Shfvingle

Chieftain
Joined
Feb 12, 2010
Messages
46
Location
The Planet Vulcan
First off, I'm sorry if this has been addressed somewhere else, but I've looked for the past hour and it's either not there, or isn't updated.

I've seen examples of Giant Earth Maps, or maps that are larger than the "huge" size, but I'd like to know, is there a script to create random giant maps? Some sort of mod I can put in place that will allow me to choose a different map size in the game setup screen? I want to play with all the Civ's, but in huge it's ridiculous, and I've gotten tired of playing on Earth.

Thanks for any help.
 
It was explained to me by Sirian that huge maps are not practical for Civ5 because it takes a ton of memory and since its a 32 bit application it will always cause instability on any computer. Civ5 just wasn't built to accomodate larger maps.
 
It was explained to me by Sirian that huge maps are not practical for Civ5 because it takes a ton of memory and since its a 32 bit application it will always cause instability on any computer. Civ5 just wasn't built to accomodate larger maps.

Even if it is 32bit application 4GB or RAM sould be more than enough for a giant map.
 
Its doable(or was pre G&K), but, its not simple, you need XML's/SQL's for the sizes you want, then you have to have a custom AssignStartingPlots.lua to gel it all together.
 
Its doable(or was pre G&K), but, its not simple, you need XML's/SQL's for the sizes you want, then you have to have a custom AssignStartingPlots.lua to gel it all together.

In my Mod I have XMLed the Gridsizes from 128*80 to 160*100 or 256*160 and both caused CCTD, and because i'm not deep into Civ5 Modding or Lua, Í can't make my own continental Mapscipt.

Edit:
The one who is able to make a small Mod only for bigger worlds would be the hero.
 
If you have not changes AssignStartingPlots.lua to coniside with you new map sizes, it will CTD as the map generator wont reconise your changes and go ARGHHHHH BOOM!
 
Ok so there is something hardcode writen in the assignStartingPlots.lua?? or what is the problem of this script?
I'm dont understand Lua so the question may sound totally stupid.
Shouldn't the AssignStartingPlots.lua be so dynamic that change of worldsize would not matter?
 
Even if it is 32bit application 4GB or RAM sould be more than enough for a giant map.

Don't assume things like this. The game stores far more information about each hex than you might think, and all of that adds up quickly.

For instance, every hex blends together with the six surrounding it, graphically. That is, a desert that borders a grassland will have a bit of "bleed" in each direction, with the boundary between the two affecting the graphics of both hexes. Actually, you get a 3-way bleed at each intersection, as well, so it's not even THAT simple. That's twelve transition regions per hex, each with very complex combinations of graphics (averaging 5 transitions per hex on a large map, since six of the twelve are shared with one other hex and another six with two others). So whatever number you were thinking a map needed, memory-wise? Multiply it by six.

The thing is, the game isn't doing this dynamically. When your game session loads, the game generates (or re-generates, as the case may be) the map, including all of these transition regions. When you pan back and forth across the map, you're seeing this generated world; it's stored in your cache, and the game pulls it from there as needed. This is why using Lua to "terraform" terrain doesn't work; even though you can change the terrain type for a hex, and the game will mechanically recognize it as its new type, this won't trigger a recalculation of those twelve transition areas near the hex (plus the center of the hex itself, of course) and so the visible map won't change. You'll only see those change if you save and load the game, which DOES force the game to remake the map, which is why it takes so long to load a game. So if that whole map needs to be stored in memory, it's going to take up quite a bit of room.

Then, each hex has to keep track of a large number of characteristics. Plot type, terrain type, resource type, improvement type, feature type, if there's a city (and which buildings in that city are visible on the map), if there are units, and so on. Those last couple are less about the initial generation and more about on-the-fly access, but it's still an issue; larger maps also mean more units and cities to keep track of, which each have their own data structures to deal with. At some point, the sizes of the arrays needed to store all of this info will consistently exceed what a 32-bit executable can handle, no matter how much RAM you throw at it.

Bottom line, the maximum size they set is fairly close to the maximum size you'll get without crashing. You can go way above that and hope for the best, if you want to, but don't be surprised when everything dies. As much fun as it might seem to play a game with every civ represented, this game just isn't built for it, either mechanically or balance-wise.
 
Ok so there is something hardcode writen in the assignStartingPlots.lua??

Correct.

Shouldn't the AssignStartingPlots.lua be so dynamic that change of worldsize would not matter?

Affraid not. Heres a snippet of code form AssignStartingPlots.lua, it lists the map sizes available and what needs to be done for each for a certain function(and there are many functions relating to map size):-

Code:
function AssignStartingPlots:GetCityStateLuxuriesTargetNumber()
	-- This data was separated out to allow easy replacement in map scripts.
	local worldsizes = {
		[GameInfo.Worlds.WORLDSIZE_DUEL.ID] = 3,
		[GameInfo.Worlds.WORLDSIZE_TINY.ID] = 3,
		[GameInfo.Worlds.WORLDSIZE_SMALL.ID] = 3,
		[GameInfo.Worlds.WORLDSIZE_STANDARD.ID] = 3,
		[GameInfo.Worlds.WORLDSIZE_LARGE.ID] = 4,
		[GameInfo.Worlds.WORLDSIZE_HUGE.ID] = 4
		}
	local CSluxCount = worldsizes[Map.GetWorldSize()];
	return CSluxCount
end

If your map size isnt listed in these, then these function will fail and you will either get a CTD or an instant defeat when u start a game.

Edit:-

Looking at it, theres 7 Functions regarding map sizes, now I can not say for sure, just adding in your new sizes to all 7 functions will make it load up, as this file can be dam fickley.

Edit 2:-

You will also have to edit the FeatureGenerator.lua for your new map sizes. And possibly others, as I siad its doable but it will take alot of work + you are more than likely going to run into the issue Spatzimaus has pointed out.
 
The handmade maps before G&K show that the Ram space is not the problem, the maps are working.

And also the required space of RAM would not be so big, 1 hex * 6 edges * 3 to 5 layers + 1(for itself) * 3 to 5 layers as information for what textures and stuff there is * (128*80) = 358400 types of information about all hexes, that can not spam the RAM the Textures are also just instances to save space. The information of the Hexes and the layers would be mostly just int counters about the status of some information. That is the way I would make it.

So it is just the problem while generating the map. that there is something we don't know or can't see.

When you have 16GB RAM, and a 32Bit application can handle a maximum of 4GB that would not really be the problem, the OS just tells the application where the space to use begins and the application than adresses it, for use.

Otherwise the giant manuall made maps wouldn't work as well, but as you heared, they are there and can be played.
 
If you want to test the limits its easy to change the sizes of 'large' and 'huge' etc. I originally made the PerfectWorld3 'huge' size as big as the Terra huge size and everyone was having a lot of problems with it so I had to scale it back.

It's not really that the size of the map that causes a problem, its that the game does not handle it in an optimized way because for some reason they thought that nobody would want or need super huge maps. You'll note that Civ4 can handle really large maps but Civ5 can't.

Personally I think they could have implemented it a lot better. Many mods could benefit from a different size paradigm that is required for Civ.
 
@Cephalo
Code:
[GameInfo.Worlds.WORLDSIZE_HUGE.ID] = {120, 84}

You mean this is the WorldGridSize of PerfectWorld mod? X=120, Y=84?
It is hardcoded? not loaded from the XML?

Edit:
I made a Continental Huge map with 160*100 Tiles.
Can't believe It was so easy to Unlock,
How I did it:
I looked at the Large_Islands.lua int the Expansion/Maps and took
Code:
function GetMapInitData(worldSize)
	local worldsizes = {
		[GameInfo.Worlds.WORLDSIZE_DUEL.ID] = {30, 24},
		[GameInfo.Worlds.WORLDSIZE_TINY.ID] = {50, 40},
		[GameInfo.Worlds.WORLDSIZE_SMALL.ID] = {60, 48},
		[GameInfo.Worlds.WORLDSIZE_STANDARD.ID] = {80, 56},
		[GameInfo.Worlds.WORLDSIZE_LARGE.ID] = {100, 64},
		[GameInfo.Worlds.WORLDSIZE_HUGE.ID] = {120, 80}
		}
	local grid_size = worldsizes[worldSize];
	--
	local world = GameInfo.Worlds[worldSize];
	if (world ~= nil) then
		return {
			Width = grid_size[1],
			Height = grid_size[2],
			WrapX = true,
		}; 
	end     
end
and placed it at the same position in the Vanilla Game Assets/Maps/Continents.lua

Generator made a normal map with new size, all working :D
Loaded it into Worldbuilder to see if really had new gridsize, and everything is perfect.

Edit 2: Anything bigger than 179*112 is causing CTD.
 
Today I will try this Manuall override with severall mapstypes, and report about the results.

Update:
So far so well,
-Fractal
-Large Islands
-Continents
-Pangaea

tested and Working as normal with HUGE size.
 
Today I will try this Manuall override with severall mapstypes, and report about the results.

Update:
So far so well,
-Fractal
-Large Islands
-Continents
-Pangaea

tested and Working as normal with HUGE size.

One thing you will want to watch out for is CTD and massive slowdown mid-game. It might be able to handle a very large map initially, when you are just looking at the map, but then when it starts filling up with units you get problems.
 
That is not new, that already happens to normal maps to me.....
16GB RAM, 2600K 3.2GHz, GTX580 SLI.... the internal Gamemechanics are the problem.
Don't have the tiles a Database on their own?
 
Great this game-engine sucks, giant map with 156*95 or anything till 179*112:confused: tiles crashes at about 400 rounds.
Normal map with 128*80 tiles crashes just 200 rounds later.

Argh since 1.0 never got besser.... :(
 
Back
Top Bottom