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

Tectonics

Discussion in 'Civ5 - Map Scripts' started by LDiCesare, Oct 2, 2010.

  1. LDiCesare

    LDiCesare Deity

    Joined:
    Dec 22, 2005
    Messages:
    2,612
    Location:
    France
    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.
     
  2. gruven

    gruven Chieftain

    Joined:
    May 12, 2010
    Messages:
    75
    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.


     
  3. JeBuS27

    JeBuS27 Heretic

    Joined:
    Sep 21, 2005
    Messages:
    321
    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".
     
  4. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    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.
     
  5. LDiCesare

    LDiCesare Deity

    Joined:
    Dec 22, 2005
    Messages:
    2,612
    Location:
    France
    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.
     
  6. LDiCesare

    LDiCesare Deity

    Joined:
    Dec 22, 2005
    Messages:
    2,612
    Location:
    France
    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.
     

    Attached Files:

  7. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    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.
     
  8. LDiCesare

    LDiCesare Deity

    Joined:
    Dec 22, 2005
    Messages:
    2,612
    Location:
    France
    Yes, movement across the 0x line is sometimes fun. The red arrows going all around the world, but sometimes units too when they move.
     
  9. Madeira

    Madeira Emperor

    Joined:
    Dec 27, 2001
    Messages:
    1,437
    Location:
    Portugal
    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.
     
  10. Sirian

    Sirian Civ Map Programmer

    Joined:
    Dec 20, 2001
    Messages:
    3,651
    Location:
    Pennsylvania, USA

    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
     
  11. LDiCesare

    LDiCesare Deity

    Joined:
    Dec 22, 2005
    Messages:
    2,612
    Location:
    France
    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.
     
  12. Seek

    Seek Deity Supporter

    Joined:
    Aug 7, 2010
    Messages:
    3,410
    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.

    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?

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

    Thanks for your great work:thumbsup:
     
  13. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    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.
     
  14. Armandeus

    Armandeus Warlord

    Joined:
    Jan 17, 2006
    Messages:
    161
    Location:
    Japan
    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.
     
  15. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    lol, $10 says it was on the edge of the map. :p
     
  16. Armandeus

    Armandeus Warlord

    Joined:
    Jan 17, 2006
    Messages:
    161
    Location:
    Japan
    No, I don't think it was. When I finally got a full view of the minimap, it was near the middle.
     
  17. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
  18. LDiCesare

    LDiCesare Deity

    Joined:
    Dec 22, 2005
    Messages:
    2,612
    Location:
    France
    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.
     
  19. 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!
     
  20. plesniak

    plesniak Warlord

    Joined:
    Oct 23, 2006
    Messages:
    238
    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.
     

Share This Page