Multiple ocean terrain types

Andu

Chieftain
Joined
Nov 12, 2021
Messages
5
Redirected from here

Hi everyone,

I'm new to scenario designing. How can I make the game treat multiple terrain types as ocean, like the sci-fi scenario does on Nona with ammonia, methane, and hydrogen? I couldn't find anything in the sci-fi rules.txt; I tried copying the map generation settings in @SECONDARY_MAPS but that didn't do it.
 
There's only one terrain type (per map) that will work as ocean (meaning that domain 2 ships can sail on it). The sci fi scenario uses several different land tiles for ammonia and hydrogen. Methane is the only one that is "ocean."

@TERRAIN3
Metallic Hydrogen, 1,2, 1,2,2, yes, 1,10, 5, yes, 2,10, 1, no, no, ; Drt
Gasbag, 2,2, 2,1,1, yes, 3, 5, 1, no, 0, 0, 0, no, no, ; Pln
Solid Hydrogen, 1,2, 1,2,2, yes, 2,10, 5, yes, 1,10, 1, no, no, ; Grs
Ancient Hall, 3,4, 0,2,4, no, 0, 0, 0, no, 0, 0, 0, no, no, ; For
Ancient Room, 6,6, 0,1,5, no, 0, 0, 0, no, 0, 0, 0, no, yes, ; Hil
Storm, 6,2, 0,2,2, no, 0, 0, 0, no, 0, 0, 0, no, yes, ; Mou
Ammonia, 1,2, 2,2,1, no, 0, 0, 0, no, 0, 0, 0, no, no, ; Tun
Hydrogen, 1,2, 2,2,1, no, 0, 0, 0, no, 0, 0, 0, no, no, ; Gla
Eidolon, 1,6, 9,9,9, yes, 3, 5, 0, yes, 3, 5, 0, no, no, ; Swa
Leviathana, 2,2, 2,1,1, yes, 3, 5, 1, no, 0, 0, 0, no, no, ; Jun
Methane, 1,2, 2,2,1, no, 0, 0, 0, no, 0, 0, 0, no, no, ; Oce
 
I saw that, but yet in the sci-fi game, domain 2 units can sail on all three of methane, ammonia, and hydrogen, and harbor/offshore platform increase the yields.
 
You know what? I have never played the Sci Fi scenario and I just took a look at it, and you're right... That is really weird. Really cool find though. No idea how to replicate it unfortunately!
 
Try starting a sci-fi game and moving that file to a different folder, with different rules. See if the equivalent terrain types still function as 'oceans'. Not too long ago, I had some trouble triggering the Alpha Centauri event (not reaching AC, but making code run when that happens), and the reason was that I hadn't started an 'extended original' game.
 
Try starting a sci-fi game and moving that file to a different folder, with different rules. See if the equivalent terrain types still function as 'oceans'. Not too long ago, I had some trouble triggering the Alpha Centauri event (not reaching AC, but making code run when that happens), and the reason was that I hadn't started an 'extended original' game.

To expand on this I think (and you'd need to test this early) but you can probably get the effect to "happen" even without truly understanding "why" if you just build your scenario off of the SciFi one. Meaning, when you "break ground" on your scenario you would start a new SciFi game, load whatever map you wanted, etc. and move forward with development. Just save a copy of the SciFi folder as you'll need to overwrite rules etc.

I mean if your goal is to have this effect in your game, this should do it. A scenario is basically a "reskin" of Civ2, and you'd just start with the SciFi scenario as your template.
 
Ah, I've done some testing...unfortunately it seems to be merely a skin on top, hard-coded in the sci-fi game mode...the underlying terrain is actually methane (ocean), but the game displays the ocean on map 4 as one of the other terrain types in a pre-determined pattern. If you change the terrain to ammonium or hydrogen, it becomes a land tile which boats cannot go on, as expected. If you change a tile to methane, it displays as one of the three gases depending on which "band" the tile is in, but the tile is actually methane with methane yields. Unfortunately I can't use this, as I can't change the pre-determined pattern built to look like a gas giant. :( Thanks for the tips anyway!
 
If you're OK with sacrificing the two ocean special resources, you could use those as alternate "terrain types," since TOTPP allows custom resource placement. (If you want to use 'placeholder' terrain, it should not be difficult to write a script to replace that terrain with oceans and the appropriate special resource.) I also believe that TOTPP allows you to make rivers navigable to ships, so invisible rivers could provide you the desired functionality also.
 
If you're OK with sacrificing the two ocean special resources, you could use those as alternate "terrain types," since TOTPP allows custom resource placement. (If you want to use 'placeholder' terrain, it should not be difficult to write a script to replace that terrain with oceans and the appropriate special resource.) I also believe that TOTPP allows you to make rivers navigable to ships, so invisible rivers could provide you the desired functionality also.

With onActivate now applying to each tile a human player moves, couldn't you also temporarily change the domain of a unit depending on what tile it found itself on as well? If coupled with using a "coastline" terrain that has the impassable flag, I think the desired effect could be achieved.
 
Ah, I've done some testing...unfortunately it seems to be merely a skin on top, hard-coded in the sci-fi game mode...the underlying terrain is actually methane (ocean), but the game displays the ocean on map 4 as one of the other terrain types in a pre-determined pattern. If you change the terrain to ammonium or hydrogen, it becomes a land tile which boats cannot go on, as expected. If you change a tile to methane, it displays as one of the three gases depending on which "band" the tile is in, but the tile is actually methane with methane yields. Unfortunately I can't use this, as I can't change the pre-determined pattern built to look like a gas giant. :( Thanks for the tips anyway!

This is interesting. I've wondered about the gas giant planet in the sci-fi game for years. As I understand you, the skin a graphic effect only, with food, shields, trade all the same as Methane. Is there any prospect of varying any of those?
 
TIL that Civ II still has some surprises to offer, even after all these years! Like JPetroski, I've never really played the Scifi game, and this is certainly some map wizardry I wasn't aware of.

One of the implementation keys is that in Terrain8.bmp, the ocean terrain at the bottom is mostly transparent (only the "land" portion of the coastline is filled in). I think this is what allows other terrains and colors to show through, so the "ocean" doesn't look uniformly the same.

Also, note that in Terrain7.bmp, the white text labeling each terrain type is wrong in some cases -- you have to look at Rules.txt to see the true names of each terrain type. More fun: the 9th terrain from the top (ID 8 in TOTPP) is named Eidolon and the three colors for it match Ammonia (in column 1), Hydrogen (in column 2), and Methane (in column 3). Merriam-Webster dictionary defines "eidolon" as "an unsubstantial image : phantom". :lol:

Catfish's saved game format has two "unknown map block" sections -- which makes me wonder if this unique behavior is handled through, or driven by, data stored in those sections. It would take a lot of painstaking analysis, but considering how much of the saved game format has been cracked already... who knows, maybe there could be some way of customizing and controlling this.

@Andu thanks for pointing this out!
 
Last edited:
Nona map rendering uses the Eidolon terrain basically as a fourth variation tile for Hydrogen, Methane and Ammonia. Ocean tiles on Nona are rendered as one of these four terrain types. Given x and y, this Lua snippet gives the terrain type it's rendered as:

Code:
offset = {0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0}
terrain = {7, 7, 7, 10, 10, 8, 7, 7, 8, 8, 7, 7, 6, 6, 8, 8, 7, 7, 6, 6, 8, 10, 10, 7, 7, 7, 7, 6, 8, 7, 7, 8}
terrain[((y >> 1) + offset[((x ~ y) & 15) + 1] & 31) + 1]

The civilopedia description for Eidolon seems to indicate that it was perhaps supposed to be a unique terrain type (perhaps bound to an event), but real Eidolon tiles are never generated naturally.

The second of the "unknown map block" sections in Catfish's docs is landmass data (256 * 40 bytes) for AI goals. Each record contains counts for land tiles, ocean tiles, potential city sites, and the landmasses it's adjacent to (1 bit per landmass, 32 bytes).

The first unknown map block may have something to do with reachability, it's used in the goto command, and the code distinguishes between land and sea domain, while air domain doesn't use it at all. But I'm not really sure about this one.
 
With onActivate now applying to each tile a human player moves, couldn't you also temporarily change the domain of a unit depending on what tile it found itself on as well? If coupled with using a "coastline" terrain that has the impassable flag, I think the desired effect could be achieved.

I think you will run into trouble if the unit in question is supposed to be able to carry units, since changing the domain away from 2 will leave the unit behind. I suppose you could use onkeypress to teleport the unit (and any units carried) from tile to tile. Sacrificing rivers or ocean specials still seems more practical to me.
 
Nona map rendering uses the Eidolon terrain basically as a fourth variation tile for Hydrogen, Methane and Ammonia. Ocean tiles on Nona are rendered as one of these four terrain types.
Can you tell, is this behavior dependent on the game type of Sci-Fi? hardcoded to only apply to map 3 (using 0-based counting)? enabled for any map type 5 ("gas giant") as defined in @SECONDARY_MAPS? some combination of those, or something else entirely?

It's especially interesting to me because it's not just a graphical rendering in the map pane... the status pane also shows the name of the terrain type as if it truly is the type that's displayed. Except when it's actually Eidolon! Even when it's using one of the Eidolon terrain graphics, it labels the terrain consistent with its appearance as one of the other three types.

The second of the "unknown map block" sections in Catfish's docs is landmass data (256 * 40 bytes) for AI goals. Each record contains counts for land tiles, ocean tiles, potential city sites, and the landmasses it's adjacent to (1 bit per landmass, 32 bytes).

The first unknown map block may have something to do with reachability, it's used in the goto command, and the code distinguishes between land and sea domain, while air domain doesn't use it at all. But I'm not really sure about this one.
Thanks for the additional info!
 
Last edited:
Top Bottom