Modding Questions

Figured we'd have one eventually. I'll start:

1. Is there a way to make it so that certain types of starbases or starbase effects will not stack? I.e. if I wanted to make Economic Starbases individually more powerful but incapable of stacking with one another, how would I do that?

2. Is there a way to scale the tech costs without messing around with colony production or output?

3. Is there a way to use formulas to compute values in the XML rather than going with fixed values? Say, if I wanted to subtract 0.001 influence from a colony per turn per tile affected by its influence, or if I wanted to scale a colony's population growth by some function of the number of colonies in the empire, where the function was not just (some constant) * (number of colonies).

19,397 views 10 replies
Reply #1 Top

I honestly have no idea how any of that would work. Changing a xml value is easy enough. Scripting in new functions or knowing what functions and commands to use is past my little bit of skill. I can find pieces from xml's and combine them and then edit them into something that works for whatever simple thing it is I'm trying to do most of the time, but I think we'd need a local xml Wizard for this one.

Finding people good with code who want to help for fun can be as hard as finding "Where's Waldo" when he's hiding in a barber pole factory next to a candy cane warehouse.

Reply #2 Top

Not sure about 2 and 3 but in my attempts to remove the large empire penalty I saw <RequiredStarbaseSpacing>5</RequiredStarbaseSpacing>, so by default its just based on starbases themselves but you may be able to mod in a more specific starbase spacing but I haven't seen any references to specific starbases yet so you may have your work cut out for you to do so.

Reply #3 Top

Yeah, I know about the starbase spacing thing, I'd just rather leave that alone and make it so that even if a world happens to be within the AoE of two or more economic starbases it'll only get the bonus from one of them. The only thing stacking economic stations adds to the game is even more constructor spam in my opinion, and given that the bonuses from economic stations tend to be more worthwhile than whatever you can do with the one or two resources you might be preventing yourself from acquiring by building the 'ideal' circle of starbases around each of your planets, I tend to think the game would be improved without the stacking.

Reply #4 Top

Unfortunatelly, that is not how the modding system works.  You would have to change game files (decompile then recompile)... that is not really "modding" as much as it is hacking game code.  

I would like to be able to do some of what you mentioned, though.  :/

Reply #5 Top

How do the materials and surfaces work?

Guessing - the "FactionNameTexture_A_Data.dds" is like a material properties ID or some such, but not sure, but I think is like a specular amount control not unlike a specular map in SoaSE.

            - the "FactionNameTexture_A_Diffuse.dds" is what is says, diffuse.

 

            - the "FactionNameTexture_A_Lean1.dds" is like and inverted normal map with the red channel copied and inverted to the alpha. Guessing it works something like normal map.

 

            - the "FactionNameTexture_A_Lean2.dds" seams like again normal map data but with the flat surfaces removed. Perhaps is like a coloured curvature map but really don't know.

 

            - the "FactionNameTexture_A_Light.dds" seams to be an emissivity map for the ship windows and lights.

 

            - the "FactionNameTexture_A_Normal.dds" is what it says, a normal map.

 

There's probably no reason to make variations of these for custom faction ship styles other than the diffuse and light map though I guess.

 

Then there is Surfaces, which maybe there could be variations made for custom faction ship styles.

Again Guessing - the "OverlayTexture_##.dds" seams to be a diffuse with red and blue channels filled white. Not sure how the alpha is derived. I'm guessing this provides some shading overlay, similar to what the lean1 map does for the materials does.

 

                    - the "OverlayTexture_##_Lean.dds" seams to be similar but different to the Lean2 map of materials. Looks like a normal map with the blue channel removed or made black. No alpha. Again, I guess this provides some shading overlay.

 

                    - the "OverlayTexture_##_Normal.dds" is what it says, a normal map.

 

I have tried making a custom surface, but it made the ships appear completely black. Maybe it is how I've tried to replicate the texture maps, but also and I think more likely, its how I referenced the maps with the xml. and they are showing black because the texture maps are not being read at all.

How I have this set up is a Copy of the "GC3SurfaceDefs.xml" renamed it and put it into my mods Core folder. Deleted all entries except 1 and renamed it and put reference to my textures for it that I had put in the Gfx/Models/Ships/Textures folder of my mod. Then made the relevant edit to the FactionDefs.xml surfaces line. The surface shows up in game and you can select it in the in - game custom faction editor but it is showing completely black. So I'm guessing that I'm missing something in the xml. but I guess it could be the textures.

Anyway maybe someone could explain a bit more of what's required.

Thanks.

Edit: so I have got rid of the black, oops my bad :blush:  but the surface still doesn't show on the ships and just stays as the last selected surface eg. surface 19 or surface 1. 

Reply #6 Top

Quoting In_stasis, reply 5

How do the materials and surfaces work?


I haven't done any surfaces yet my-self, but in Derek's post here: https://forums.galciv3.com/461766/page/6/#3549837 he mods a material. Near the bottom of his post before the picture of the ship he talks about messing with reflectivity. Not sure if any of that will give you a hand by looking at it but it might be worth a shot. I've no clue on the xml part.

Once though learning to do skins on Elemental I had a similar problem where it wasn't seeing a layer because I hadn't saved it correctly or the spacing was off. I'd like to add in some more color combinations for the drop downs in the creator.

Reply #7 Top

Oh yes I have read Derek's post several times and I'm comfortable with what he's explained with the GC3_MaterialDefs.xml. To be honest I'm quite lost as to what's going on with material defs. Just was thinking if there was something to base it all off you could know which direction your going with things more.

Reply #8 Top

I tried creating a new overlay, using a basic StarFleet ship texture Aztec, couldn't get it to show up...
But then some of the DDS files won't open for me, and the ones I can see, appear to be Pink... which i've never seen before.

Also noticed that models are an SDF file, rather than .X 
Seem I have to learn all over again how to change and add things.

Reply #9 Top

2. Tech costs are defined in tech tree XMLs as an integer, without any possible modifiers. You could have every tech decrease the amount of research points that the faction can do. But you already said you don't want to tamper with colony output.

3. There are two modifiers, Flat and Multiplier, both can be signed decimal numbers(+0.1,-0.1):
Still not sure how exactly Multiplier works, as I have tried to have it at zero, which seems to make no changes, when I want to have the final parameter to be always zero.

Reply #10 Top

Quoting pendrokar, reply 9

3. There are two modifiers, Flat and Multiplier, both can be signed decimal numbers(+0.1,-0.1):
Still not sure how exactly Multiplier works, as I have tried to have it at zero, which seems to make no changes, when I want to have the final parameter to be always zero.

In all the places I recall trying it, multiplier works as [base value] * (1 + [multiplier setting] * [whatever it scales with]). If it doesn't scale with anything, then the value of [whatever it scales with] is 1; in such a case, I would suggest using -1 as the multiplier to make the thing you're trying to affect always equal zero. If the multiplier scales with something, you might still try using -1 and see if they've made it so the actual value you're modifying cannot go negative; if I recall correctly, morale cannot go negative, but I'm not sure about other values.

Quoting pendrokar, reply 9

2. Tech costs are defined in tech tree XMLs as an integer, without any possible modifiers. You could have every tech decrease the amount of research points that the faction can do. But you already said you don't want to tamper with colony output.

The reason why I don't want to mess around with colony outputs is because at the moment I don't see a good way of doing it without screwing over large empires. I'd like to make it so that tech costs scale as though

[tech cost] = [base cost] * (1 + [scaling factor] * [number of colonies])

or something like that, but I can't do this because I don't know of any modifiers I can apply to the base tech costs and I don't know of any way I can divide colony outputs by (1 + [scaling factor] * [number of colonies]). The only way I know of to affect colony outputs is to multiply them by (1 + [scaling factory] * [number of colonies]) or add [flat bonus] * [number of colonies], both of which become screwy if you use negative scaling factors or flat bonuses.

I also only really want to target research output, but the way the multipliers stack is additive, so if I try to make tech progress 50% slower or something like that, it only works if I build no labs or if I target base production rather than research output. I'm against the latter because I don't really want to affect the other two output types and I cannot really cancel it out with multipliers to the other output types because of the additive multiplier stacking, and also because the existence of percentage bonuses to base production (e.g. economic starbases, level bonuses from Thalan hives) means that this fails to achieve the intended result. The former way just doesn't work properly due to additive multiplier stacking from standard production buildings and bonuses.