Tectonics

Yes, rainshadow is something I'd like to add when I'll put terrain (grass/plains/desert...) generation in.
However, I wonder whether I'll do the same pattern as I used in Civ IV, which resulted in maybe too many deserts. I still want Saharas... I should probably do a Terra script first and then try to code the rainpattern/climate stuff until it's realistic enough on the Terra map.

As for coding, yes, the start location code is ugly. The if 1 else if 3 or 4 else with no function but lots of stuff inside is bad coding. Putting ";" at the end of lines in lua is weird and useless. But I wouldn't blame Sirian too much however. He did a lot of work to get the scripts to be good, powerful and moddable. It's just it was way easier and better in Civ IV. Except for the rivers, which are really good imo in V.
 
Is it possible for a map script to cause incorrect terrain graphics to be drawn? I started a custom game using Tectonics and saw places where tiles looked like mountains, but they were not. Also there are some places that look like hills, but they are actually mountains.

Here's a shot of one of the problems. Right below the Indian Warrior, you can see a tile that looks like a mountain with jungle on it. I could enter it and the tooltip said it was actually a jungle tile. There's also another tile near the upper left corner of the tooltip in the screenshot that looks like mountain with jungle on it. I could move onto that tile as well.

If this is just a CiV bug, then I apologize for resurrecting this thread and I'll go post in the bug forum.


 
There is only one way I can think of for this to happen. The script creator used "TERRAIN_MOUNTAIN" when they meant to use "PLOT_MOUNTAIN".
 
Could be a factor, that it appears like the tile is on the border of the map. The strange straight line on the cloud as well as on the mountains lower down suggests this.
 
I don't think it's related to TERRAIN_MOUNTAIN as the only place in the script where I say mountain is this line:
self.plotTypes[plotIndex] = PlotTypes.PLOT_MOUNTAIN
I am absolutely unable to understand why this bug happens, but it's annoyingly common that a few tiles are bad. The border of the map thing would be interesting to investigate.
 
I think PieceOfMind found something.
I checked my current game, and I see 2 badly placed mountains: One ix 0x27y but shows in 0x25y, and there's another one showing in 0x15y that shouldn't be there (0x17y is in FoW but likely a real mountain). There's also a plains shown as mountain in 0x26y.
Thus I think it's likely that mountains (plots?) on the 0x line are somehow messed.

I checked in the worldbuilder and sure the bug is there:
I made a strip of land with a few mountains on or near the 0x line.
I had mountains in 0x3y, 0x5y and 31x4y (smallest map, 32width).
The 0x4y plot on the map showed as a mountain despite being actually a grassland.

Therefore congratulations PieceOfMind, you've found a but in Civ 5 :D

Now there's little I can do about the bug. I could work around it by preventing mountains from spawning in the 0x/max x line but it really really is annoying. I posted again on the official forums to advertise the bug and hopefully get it solved.
 

Attachments

  • MountainTest.zip
    2.2 KB · Views: 246
I've seen at least once another very amusing bug with the map border, but it's not always reproducible so I haven't made a bug report yet. If you set up a ranged fire where the arrow crosses the border of the map, rather than the arrow pointing across 2 tiles or whatever, it (sometimes) wraps across the entire map the other way round - one gigantic red arrow. :lol: When I saw this I was battling a barbarian galley near the coast of New Zealand on the standard-size Earth map.
 
Yes, movement across the 0x line is sometimes fun. The red arrows going all around the world, but sometimes units too when they move.
 
Yes, movement across the 0x line is sometimes fun. The red arrows going all around the world, but sometimes units too when they move.

I've seen this happen too!

And in my current game, one of my cities is now showing a mountain instead of the city graphic, but I think I settled it in grassland.. And I built Walls to see what happened, and now I have a mountain surrounded with walls lol
Strange thing is this only happened after loading a save game.
 
I've been seeing tiles placed wrong as well. Fields that have hills when there is no hill, or mnts. when it's really a plain. Stuff like that. It causes the curser to slow down when you try to move units in the area of a bugged tile. I'm wondering if it could also be causing slow down with turns. I've checked theses areas in the strategic veiw and it shows what should really be there. Reloading the game will sometimes correct the problem, it can also revert it back to the wrong tile when you restart the game later.

I see a lot of these bad tills when playing on larger maps, huge and bigger.
I don't see this happening with the default generators.


If your machine is pushing its own hardware limits, a script with more demanding output could push you over the edge in to anomalies that appear when you just don't have the RAM to run the script in question at upper map sizes.

If the Tectonics script is running on a larger grid and/or placing more land plots than the core scripts, this means it will consume more memory than a core script of the same map size. (Land graphics take much more memory than water).

There is also the possibility of a script exceeding what is currently feasible. As Steam is a 32-bit platform and Civ5 is currently forced to run 32bit because it's a Steam game, there IS a ceiling on total RAM available, so a large enough script with a lot going on could cause the "not enough memory" issues to appear for ANY computer. This could change if Steam went 64bit, but until then we have the current ceilings to contend with.

If you are getting anomalies from running out of memory, the only solutions are to play on smaller map sizes, play less demanding scripts, or upgrade your hardware.


- Sirian
 
Hi Sirian.
The issue of 'bad plots' is not with the scripts. It's with the resulting map. Generating a map in worldBuilder is enough to reproduce the problem. There's a bug around the 0x axis which only shows in the 3d view, not in the strategic view. I don't think a 20x32 map with mostly water in WB is pushing the limits.
 
Hey I just came by to say that this mod rocks! I have yet to come across a boring map, which is saying a lot because the vanilla mapscripts are usually really bland.

Todo include :
-Bug fixing. There are some very very rare cases where terrain lacks mountain or is all flat. I couldn't reproduce that, but if I understand how to capture the random seed that should become easy.

I don't think this needs "fixing" (unless you mean the whole map is such) - there are plenty of places in the world that are flat. I think the goal of this mod is to provide more realistic maps, yes?

-adding more options like Terra, Pangaea and tuning of plate numbers

More options are always welcome, can't wait for you to implement them.

Thanks for your great work:thumbsup:
 
Hi Sirian.
The issue of 'bad plots' is not with the scripts. It's with the resulting map. Generating a map in worldBuilder is enough to reproduce the problem. There's a bug around the 0x axis which only shows in the 3d view, not in the strategic view. I don't think a 20x32 map with mostly water in WB is pushing the limits.

I haven't actually looked at Tectonics.lua, but I've been poking around in the MapGenerator.lua code, and I noticed that the function SetPlotTypes adds one to the index array to accomodate the 1 based indexing in lua, but its sister function SetTerrainTypes does not add one to the index, and is thus inconsistent with SetPlotTypes in what kind of array you should put in. In any case, if you assume zero based or one based for all of your data, one of the two functions will trip you up if you use them.

I'm thinking that there may be some garbage values at the end of the array, which would manifest at the x axis.
 
I use this script a lot because I like the mountain ranges and choke points.
I also had a strange hex. A ruin placed on top of a mountain. I could not enter the hex. It looked kind of cool, like Machu Pichu or something, but it was obviously an error.
 
lol, $10 says it was on the edge of the map. :p

No, I don't think it was. When I finally got a full view of the minimap, it was near the middle.
 
Since I didn't change the code to place ruins, I'd say this can happen on just about any map. However, the default maps usually don't have as many mountains or mountain clusters (ranges) as this one, so the bug may not happen on these peculiar configurations. Worldbuilder can probably get that reproduced, but it's not going to be easy to find.
 
I really like this map script, long rivers and the mountain ranges add a certain realism feeling plus make it possible to have large cities which even have good production after hydro-plants. :D

Thanks!
 
Since I didn't change the code to place ruins, I'd say this can happen on just about any map. However, the default maps usually don't have as many mountains or mountain clusters (ranges) as this one, so the bug may not happen on these peculiar configurations. Worldbuilder can probably get that reproduced, but it's not going to be easy to find.

I have seen this anomaly in a few of my games(where it looks like ruins are placed atop an unreachable mountain top) I have no mods running or downloaded for CivV.
 
Top Bottom