Announcement

Collapse
No announcement yet.

Interesting terrain idea

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Interesting terrain idea

    I'm so happy with myself over this one!

    I've been working on the Alexander scenario, and a problem I've faced is that I want Galleys (transport ships) to be able to sail up and down big rivers and well as go in the open sea. Locutus was helping me write some SLIC code for this, but a few minutes ago I had a better idea.

    Its true that right now one can't have any new terrain or tile improvement graphics. But there's nothing to stop someone from using the same graphic in a new spot. So I took all the info from Grasslands, and replaced most of the info in the Water Volcano spot. The exception being that this type of Grassland allows units that can move on Shallow Water moe on it as well, in addition to land units being able to move on it.

    I just tried it out, and it works. Of course I'm only using this tile for tiles covered with river on big rivers like the Danube and Ganges. I'm going to reassign several other deep sea unused spots so navigable rivers can be Plains, Swamp, etc...

    There are a lot of other things one can do with this. One other thing I've already done is create two kinds of Desert. The regular Desert, plus an impassable desert that prevents units from wandering off into useless areas. There's even a special extra tileset that is exactly the same as Desert but doesn't have the occasional cactus and skull graphics, so it works perfectly for this.

    Another idea people might want to explore is having channels in the ocean, like the Gulf Stream. One could have a fast moving and slow moving deep sea. Or you could have two types of Forest, but when you transform one it turns into Plains, and when you transform the other it turns into Grassland. If you called them both the same thing, there'd be no way to know what it transforms into until you do it.

    Right now I've only tried replacing current unused terrain types, but I think its probable one could just add on to the end of the Terrain.txt file all the extras you want. So modpacks could use all of these ideas and more. And thus if one plays on a premade map using these extra types, they'd work for the modpack, but if one plays on a random starting map, that works fine as well.

  • #2
    Its funny, but I was just thinking how maybe they should have terrain areas that armies cannot get into. I know that horses cant go into mountains - maybe nobody should be able to. Same with very deep deserts. That would focus you along limited avenues of attacks.

    Just thinking outloud.



    ------------------
    Bluevoss-
    Bluevoss-

    Comment


    • #3
      Yeah, I've taken care of mountains too in the scenario, now. The map has Polar Mountain to represent the incredibly high mountains of places like Tibet. That terrain normally allows this:

      MovementType: Air
      MovementType: Mountain

      I simply removed the second line, and now no ground unit can walk there.

      I've been experimenting around with this discovery, and found some interesting things. One is that no matter what you do with a terrain slot, it retains its original color in the world map (the tiny map) and the original background in battles over it. So right now battles on the big rivers look like they're taking place with guys standing on water, when you go to the battleground screen. I wonder if there's a way to change those.

      I'm intrigued with the idea of making these big rivers in the scenario impassable to ground troops, except if there is a road over the river. Incredibly, it seems to work. If I make these impassable to all but Shallow Ocean units, land units can't use them, but they CAN go over roads on them, and fight battles over such "bridges". One can even build new bridges, just like putting PW anywhere else. I'll have to playtest to see if the AI crosses at such places (I assume they will- it should be just like crossing a mountain with a road on it for non-mountainous units). Its an extremely tricky thing to get working though: once you remove the MovementType: Land from the terrain file for that terrain type, the computer has an urge to revert the graphics all along the river to Beach. This is also a problem along the coasts where a big river meets the ocean. The graphics come out screwy.

      I think I came up with a solution, though. The terrain type needs either the MovementType: Land or MovementType: Mountain for these problems not to show up, so I have the units that can go into mountains an ability to cross these rivers as well. Everything seems to be okay now.

      I'm really psyched. I always wanted my civ game to play like this, with big rivers being hard to cross, possible only if there was a ford or bridge there. And I've always wanted to have certain ships able to sail up big rivers. Now it looks like I'll be able to get both, at least on premade maps using the properly edited mod files.

      It could also allow the much desired canal feature. For instance, simply allow Grassland to be transformed to Grassland River. The only problem here is that you could't actually see the river graphic on the square, it would look like any other Grassland square. But you could move certain ships through it, and land units through it, and give the square a bonus better than regular Grassland to represent the canal improvement. Not perfect, but what can you do.

      Its interesting to note that ships get the road or river movement bonus when moving over land. Interestingly, land units can attack enemy land units on these squares, but apparently CAN'T attack ship units on the same squares.

      Comment


      • #4
        Great, I like this idea.

        To change the battlescreen background, create a new .TGA file and put it in the [CtP2]\ctp2_data\default\graphics\pictures directory.

        It needs to be a 718(w)x380(h), 16-bit, uncompressed TGA file. To get the 'Special2' or Terrain Type 26 battles to show up on this terrain, call it upbg006.tga.

        For a test, I did a screen capture of the grass terrain and put a blue river down it. I imagine you could screen capture from any game or pic and use it without any problems.

        I haven't decoded the other terrain tiles yet for the upbg???.tga number but I will if your testing proves you are interested in this.

        EDIT: Used a pic with a bridge on it. I am no graphic artist but you get the idea. Also, Timothy is correct(below), we need to find out if the AI understands it.


        [This message has been edited by skorpion59 (edited January 04, 2001).]
        Don,
        CtPMaps (Hosted by Apolyton)

        Comment


        • #5
          Well, now my boats-on-river code turned out to be totally useless, I could instead direct my attention to a trigger that makes ships ignore roads and rivers and stuff and always make movement cost 100 movement points, if you'd like that.
          Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

          Comment


          • #6
            Hi Locutus,

            If you have a Slic Trigger that does boats on rivers, it may by a more efficient way to do it than the one Harlan has come up with. Slic may be getter suited to getting the AI to use boats on rivers than the Terrain Manipulation that Harlan is using, or the reverse may be true. It is something worth looking into.

            Timothy Pintello

            Comment


            • #7
              Real Easy Way

              Edit BattleView.ldl in the [CtP2]\ctp_data\english\uidata\layout directory.
              Change the terrain associated with the terrain tile. For instance, below is what I did to change the type 25 and 26 (index 24 & 25) battleview terrains. This way you can make the TGA whatever name you want.

              Code:
              BattleViewTerrainTable {
              	int numstrings		26
              	bool	nodatabase	true
              	# Forest
              	string	string0		"upbg001.tga"
              	# Plains
              	string	string1		"upbg002.tga"
              	# Tundra
              	string	string2		"upbg005.tga"
              	# Glacier
              	string	string3		"upbg005.tga"
              	# Grassland
              	string	string4		"upbg001.tga"
              	# Desert
              	string	string5		"upbg003.tga"
              	# Swamp
              	string	string6		"upbg001.tga"
              	# Jungle
              	string	string7		"upbg001.tga"
              	# Mountain
              	string	string8		"upbg001.tga"
              	# Hill
              	string	string9		"upbg001.tga"
              	# Shallow Water
              	string	string10	"upbg004.tga"
              	# Deep Water
              	string	string11	"upbg004.tga"
              	# Volcano Water
              	string	string12	"upbg004.tga"
              	# Beach Water
              	string	string13	"upbg004.tga"
              	# Shelf Water
              	string	string14	"upbg004.tga"
              	# Trench Water
              	string	string15	"upbg004.tga"
              	# Rift Water
              	string	string16	"upbg004.tga"
              	# Dead
              	string	string17	"upbg007.tga"
              	# Brown Hill
              	string	string18	"upbg002.tga"
              	# Brown Mountain
              	string	string19	"upbg003.tga"
              	# White Hill
              	string	string20	"upbg005.tga"
              	# White Mountain
              	string	string21	"upbg005.tga"
              	# Kelp or Reef
              	string  string22    "upbg004.tga"
              	# Reef or Kelp
              	string  string23    "upbg004.tga"
              	# Special 1 ***** This one modified *****
              	string  string24    "upbg006a.tga"
              	# Special 2 ***** This one modified *****
              	string  string25    "upbg006.tga"
              }
              [This message has been edited by skorpion59 (edited January 04, 2001).]
              Don,
              CtPMaps (Hosted by Apolyton)

              Comment


              • #8
                Pintello,
                I haven't really tested it yet, but I imagine that the way I'm doing it, the AI will use boats on rivers just as much or as less as they use boats with the Shallow Ocean flag on any other tile with the Shallow Ocean flag. For them there's no difference- for that particular unit they don't know or care what other types of units can go on that terrain. Its just like adding or removing the Mountain flag from any terrain. I don't see what the problem would be.

                Things might have been squirrely at first if I didn't at least have a Mountain flag on these big rivers, but now that I have that, everything seems pretty cut and dry. No bugs or wierd things going on anymore. I'll check to make sure though.

                Don, given what you say, I'm torn between having a picture like the one you've shown or reusing pictures without rivers on them. Reason I might do the second is cos the size of the file is pretty big, and it might make a download of the scenario much bigger, since I'd need a number of those. Anyone have any thought on this- graphical prettiness vs. download of file size? And can you send me the full version of the bridge pic you've made? Looks pretty cool.

                I've also found out that the Colorset00.txt file does interesting things. It changes the colors in the world map (or mini map or whatever you call it) to whatever exact shade you want as well as changing the civ colors. I wonder, Scorpion, if these exact shades are the shades used in the BMP2CTP2 conversion program? And I wonder if that file shows there are 4 extra terrain slots, including the two special ones already existing?

                A question I'd have for people: should I have the color in the world map be the same for say, Grassland with and without a big river on it, or should they be different so one can see where the big rivers are at least on the world map?

                Comment


                • #9
                  By the way, am I crazy or do those ldl files look like you can edit just about anything visually in the game? I wonder if one could make one big city screen instead of breaking the data up into five separate ones, for instance. That would be incredible. Great find, Scorpion.

                  Comment


                  • #10
                    Well, the problem with my code is that it hasn't been tested thoroughly. I had some problems with it myself, but I suspect those might be specific to my system. If other people could try it out and tell me if it works that would be great, so I posted the code below. Most important thing to find out is if the code always works (in my case it was sometimes possible to move onto land tiles without a river) and if that is the case, to see if the AI knows how to use it. This code requires you to edit units.txt as well: to all ships that can move on rivers (for now just LONGSHIP and CATAMARAN but others can easily be added) the line "MovementType: Land" must be added.

                    Code:
                    int_f	HasCity(location_t theLoc) {
                    location_t	tmpLoc;
                    city_t	tmpCity;
                    	tmpLoc = theLoc;
                    
                    	GetCityByLocation(tmpLoc, tmpCity);
                    	if (CityIsValid(tmpCity)) {
                    		return 1;
                    	} else {
                    		return 0;
                    	}
                    }
                    
                    int_f	IsWater(location_t theLoc) {
                    location_t	tmpLoc;
                    	tmpLoc = theLoc;
                    
                    	if (TerrainType(tmpLoc) == TerrainDB(TERRAIN_WATER_SHALLOW)) {
                    		return 1;
                    	} elseif (TerrainType(tmpLoc) == TerrainDB(TERRAIN_WATER_DEEP)) {
                    		return 1;
                    	} elseif (TerrainType(tmpLoc) == TerrainDB(TERRAIN_WATER_RIFT)) {
                    		return 1;
                    	} elseif (TerrainType(tmpLoc) == TerrainDB(TERRAIN_WATER_TRENCH)) {
                    		return 1;
                    	} elseif (TerrainType(tmpLoc) == TerrainDB(TERRAIN_WATER_VOLCANO)) {
                    		return 1;
                    	} elseif (TerrainType(tmpLoc) == TerrainDB(TERRAIN_WATER_REEF)) {
                    		return 1;
                    	} elseif (TerrainType(tmpLoc) == TerrainDB(TERRAIN_WATER_KELP)) {
                    		return 1;
                    	} elseif (TerrainType(tmpLoc) == TerrainDB(TERRAIN_WATER_BEACH)) {
                    		return 1;
                    	} elseif (TerrainType(tmpLoc) == TerrainDB(TERRAIN_WATER_SHELF)) {
                    		return 1;
                    	} else {
                    		return 0;
                    	}
                    }
                    
                    HandleEvent(MoveUnits) 'AG2_BoatMovement' pre {
                    location_t	tmpLoc;
                    unit_t	tmpUnit;
                    army_t	tmpArmy;
                    int_t	i;
                    int_t	anyBoats;
                    	anyBoats = 0;
                    	tmpArmy = army[0];
                    	tmpLoc = location[1];
                    
                    	for (i = 0; i < tmpArmy.size; i = i + 1) {
                    		GetUnitFromArmy(tmpArmy, i, tmpUnit);
                    		if (anyBoats == 0 && (tmpUnit.type == UnitDB(UNIT_LONGSHIP) | | tmpUnit.type == UnitDB(UNIT_CATAMARAN))) { 
                    		// | | tmpUnit.type == UnitDB(UNIT_CORACLE) | | etc. -> all ships that sail on rivers
                    			anyBoats = 1;
                    		}
                    	}
                    	if (anyBoats == 1) {
                    		if (!IsWater(tmpLoc)) {
                    			if (!HasRiver(tmpLoc) && !HasCity(tmpLoc)) {
                    //				Message(1, 'GotHere');
                    				return STOP;
                    			}
                    		}
                    	}
                    }
                    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                    Comment


                    • #11
                      quote:

                      Originally posted by Harlan on 01-04-2001 03:41 PM
                      By the way, am I crazy or do those ldl files look like you can edit just about anything visually in the game? I wonder if one could make one big city screen instead of breaking the data up into five separate ones, for instance. That would be incredible. Great find, Scorpion.


                      Well, you can't just change anything, there are some restrictions: some things have to be in certain places. One of the Activioners mentioned something about this a while back, there was at least one thing in the city screen that had to be on a specific tab, I don't remember what though. But it's definetely true that the ldl files have a lot of potential (they already had for CtPI), it's just that so far almost noone bothered to look at them. (Only Martin the Dane had some successes with them for CtPI and released a small mod for it that made the trade and city screens bigger.)

                      Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                      Comment


                      • #12
                        Hi Harlan,

                        Looks like you have thought out your Terrain Modifications very throroughly. I look forward to trying your completed Mod.

                        Timothy Pintello

                        Comment


                        • #13
                          Using new TGA's will greatly increase the size of the D/L. Since you cant change the actual terrain tile, YET, I don't know that it would buy you much to just change the Battleview terrain. I am on cable so I don't worry about file sizes but this would be important to modem users.

                          Using the ldl files you can change any graphics associated with the UI, as well as a lot of screen placements. I already thought about making different city screens but, as Locutus pointed out, there is something that keeps that from working. Although I will still look into this so more.

                          I haven't looked at the colorset00.txt file but I will. That very well might be where the color palette comes from. I haven't seen anything yet which points to more than the 2 extra terrain slots but it could be possible. For instance, the ldl file above, could it be changed to 28 instead of 26 and still work.

                          I will send you the bridge file but my outgoing email backs up for 4-6 hours at a time so I don't know how long it will take to get there.

                          All these options need much more exploring.

                          Locutus, I will put your code in while I am testing and see what I can find out. Also, I have to say, "Damn good to see ya back".

                          [This message has been edited by skorpion59 (edited January 04, 2001).]
                          Don,
                          CtPMaps (Hosted by Apolyton)

                          Comment


                          • #14
                            Thanks, Don, that would be great. It's good to be back too (I actually missed Apolyton while I was on vacation, I guess my real life is officially over now )
                            Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                            Comment

                            Working...
                            X