How Do I Make New Terrains Or Features?

Civitar

Adventurer
Joined
Mar 23, 2014
Messages
1,507
Location
Switzerland
What I want to do is make two new feature/terrain types: Magical Energy and Chaos Wasteland.
Magical Energy, ideally, would be blue-purplish fallout that gives +2 culture but damage units standing in it (and not units that are adjacent). Either making a new feature or modifying fallout is OK with me.
Chaos Wasteland is probably trickier. I'd like it to look like blackened tundra with the volcanic eruption effect, so it looks burnt and has lava spouting from the middle of the tile periodically. It should only appear in the north and south of the map. It should also damage units standing in it but not units standing adjacent to it.
I neither know how to recolor terrain/features or mess with their attributes, so please tell me anything you may know about that, even if it seems obvious.
Thank you!
 
Hahahaha! Thank you bouncymischa, I've downloaded it. From the screenshots it looks perfect, and adding volcano effects should be fairly easy. I'll talk to him to see about getting it ingame:crazyeye:. Any ideas for the Magical Energy?
 
Unfortunately, no... I imagine Fallout would be trickier to modify because it's animated, isn't it? I'm not sure if you could just recolor the .dds files for it... I'm just venturing into the field of modifying graphics myself, so I'm not familiar enough with Blender or Nexus to know what you'd need for that, and I haven't seen any threads working on those kinds of graphic mods. :(
 
Ah! Saw your PM before I saw this. I'm pasting my response here in case it is useful to anyone else...

Pazyryk said:
Civitar said:
I saw you were working on a Blight effect for Éa, and I'd appreciate some help doing something similar. (Yes, I downloaded Éa, but I can't play it - no BNW).
I'm looking to make two new features, like forest or marsh:
  • Chaos Waste: Should only appear at the poles (north and south). Will very slowly spread. I want it to look like your blight with Krakatoa's effect, so it has gouts of flame shooting up. It should damage units on it, but not units adjacent to it.
  • Magical Energy: I want it to look like blue-purplish fallout. It should damage units on it, but not units adjacent to it. It should be fairly rare.
I don't really know how to do any of these, so can you help? I'd prefer if it could be done as entirely new feature types, so that I can delete all vanilla features with SQL (which, btw, is working out grand for me - thanks for the tip-off!).
Thanks as always.
OK, this is doable but it is very complicated due to hard-coded limitations. If you read this reference, you will know that you can't delete features as you've indicated. Here are the rules you have to follow:
  1. Don't change names or IDs for any of the first 7 features (ids 0 - 6). They are hard-coded in both dll and graphics engine (even dll modders can't do anything about the latter).
  2. Only the first 7 features will update graphically if changed in-game. Atoll and the NWs and any you add won't (note: graphics will work for a permanent feature there at game start).
  3. Improvements and resources will update graphically in-game.
My mod has two "bad" plots that spread: Blight and Breach. Blight is the one you probably saw in a screenshot. Breach is that plus the base Civ5 fallout. Based on rules above, you should realize that these aren't just features! If you dig through my mod code, you will find:

FEATURE_BLIGHT
IMPROVEMENT_BLIGHT
RESOURCE_BLIGHT

The first one has ArtDefine = "dummy". It isn't linked to any art asset (and I was very careful in my SQL to preserve IDs 0-6 as they are). Both the blight improvement and resource are linked to the new blight art. Blight in my mod is always:

FEATURE_BLIGHT plus (IMPROVEMENT_BLIGHT or RESOURCE_BLIGHT)

The feature provides the yield effect (-4f iirc) and the graphic is provided by the improvement or resource. So the feature is always paired with the improvement or resource. The mod decides whether to apply the improvement or resource based on some complicated Lua. The problem here is that if I use improvement, it will overwrite any existing improvement. Or if I use resource, then it will overwrite any existing resource. I wanted my blight to destroy most improvements anyway, but some I waned to save so in those plots I use the blight resource.

Breach is just the base FEATURE_FALLOUT paired with the blight improvement or resource. FEATURE_FALLOUT is one of the "privileged" 7 features, so it will update just fine.

You can find all of this in my mod. The blight feature, improvement and resource are all added in CoreTables/Terrain.sql (you can also see here the complicated way that I preserve IDs 0-6 while adding stuff after). The Lua logic for applying blight or breach is in EaMain/EaPlot.lua, functions BlightPlot() and BreachPlot().

I think that you can modify the existing fallout feature graphic to recolor it. But no promises there. A surprising amount of the feature stuff is hard-coded in graphics engine.
Note: the player doesn't see any of the complexity above. I also modded UI (PlotMouseOver.lua or something like that) so that these plots just show as "Blight" or "Breach".
 
After a bit of digging, I found that (a) the actual fallout feature's texture is totally transparent, so you can see the ground beneath - exactly what I want for Magical Energy - and (b) that the sparkling orange effect is pointed at some PSB files, which I don't know how to open. Any ideas?
OK, so I won't be deleting any terrain types. Could I make a brand new terrain for Wasteland and just change the TXT_KEYs and ArtInfos of the Fallout though? You know how you can have desert hills, grassland hills, plains forests, etc, so couldn't I make a new terrain that uses the Chaos Wasteland graphics, then restrict certain features from appearing on Wasteland? Forest, jungle, and marshes to be precise. Hills and mountains could still appear on the Wastes. Then Fallout (I'd have to figure out how to make it appear on the map though) would work mostly the way it already does, it'd just give a LOT of culture and be impossible to remove.
Nutty had already mentioned editing effects when we were discussing the Dragon (his flame breath is too big for my liking), and he said hugojackson18 (I think) had done custom effects for a unit. So I think it should be doable for a feature, which is much simpler graphics-wise than a unit, especially if I'm just recoloring the existing fallout effect.
 
After a bit of digging, I found that (a) the actual fallout feature's texture is totally transparent, so you can see the ground beneath - exactly what I want for Magical Energy - and (b) that the sparkling orange effect is pointed at some PSB files, which I don't know how to open. Any ideas?
OK, so I won't be deleting any terrain types. Could I make a brand new terrain for Wasteland and just change the TXT_KEYs and ArtInfos of the Fallout though? You know how you can have desert hills, grassland hills, plains forests, etc, so couldn't I make a new terrain that uses the Chaos Wasteland graphics, then restrict certain features from appearing on Wasteland? Forest, jungle, and marshes to be precise. Hills and mountains could still appear on the Wastes. Then Fallout (I'd have to figure out how to make it appear on the map though) would work mostly the way it already does, it'd just give a LOT of culture and be impossible to remove.
Nutty had already mentioned editing effects when we were discussing the Dragon (his flame breath is too big for my liking), and he said hugojackson18 (I think) had done custom effects for a unit. So I think it should be doable for a feature, which is much simpler graphics-wise than a unit, especially if I'm just recoloring the existing fallout effect.

Unfortunately, features are one of the most difficult graphics set ups to mod in an effective way, because of the way (it looks like) Firaxis has done the graphics side of it. Changing the art defines, orderings, database entries for existing features (the privileged 0-7 Pazyryk discussed above) will not affect graphics in any way. Underneath FEATURE_FOREST is a number, which, just for example's sake, we'll say is 2. Ask the game to render feature 2 and it will render a forest. You can change the database and art defines all you like, the graphics engine appears to completely ignore them.

Here's a thread where I cracked my head against this problem for a good while before finally giving up. Pazyryk has gotten farther than I ever did, and I'd say his system is the only way to go. My experiments (in the linked thread) seem to indicate that the feature graphics system is fixed at game load and only the initial 0-7 features can ever be added/removed from tiles on the map while the game is running. (This is purely from a graphics perspective - gameplay all updates fine, but graphics don't.) Any changes to features that aren't 0-7 will only be visible after the player reloads that game from a save. (This also affects natural wonders, it looks like Firaxis ran into this problem themselves but since they never needed to dynamically add natural wonders, they just left it alone.)

Features make me sad. :(
 
Yes, I know - but since the fallout's whole thing is just an effect like the arrows from archers or explosions from nukes, I'm thinking I could copy all the effect files, recolor whatever I need to, then put it as a new effect for a new feature and do the same for the chaos wasteland, but the wasteland is easier as it would use an existing effect (Krakatoa).
 
Back
Top Bottom