How to disable building certain ships types?

Hello, I'm looking for a way to disable building of certain ship types. Anyone has an idea? Is there any workaround e.g. by setting the cost for the specific ship type very high?

As few might know I'm working on an "AI mod" (it is not really much of a mod). One feature is to give the AI special ships, like capitals with 0 fleet support requirement (while reducing the AI overall fleet support capacity) to counter the AI tendency to focus on cruisers and frigates. This would also an opportunity to give the AI ships little different abilities the AI can handle better, as I recognized a few mods have difficulties getting certain abilities to work with the AI.

Any idea appreciated

20,497 views 18 replies
Reply #1 Top

Honestly, I would just have two versions of each faction: a "human" version and an "AI" version...with separate player files, these factions could have completely different tech trees and building options for structures and ships...

At each game start, you'd want to make sure all the slots for AIs were filled with AI versions, of course...so one limitation is that you couldn't really use random...

Another possibility is to add technologies that appear "offscreen" by having the tech icon in the tech tree appear in a location you cannot see via the UI...if you can't see the icon, you can't click on it, and if you can't click on it, then you can't research it...doesn't affect the AI because the AI doesn't "use" the UI....

This allows you to add researchable abilities or prototype technologies...if you make the tech have no lab requirement or cost, you start with it for free, so you can even grant the AI bonuses (or penalties) from the very beginning...this method is good for adding additional things to the AI's arsenal...

It seems though that you are looking to give the AI capital ships that don't require fleet supply...I think you would need to have a duplicate player file that gives the player a different roster of capital ships (the duplicate caps that are the same in every way but don't require fleet supply)...

Also, don't forget that each capital ship has an unused ability slot....this "slot" is graphically covered up by the ability management button, but you can still put abilities there and have no stability issues...one problem is that if this 5th ability is an active ability, a human player cannot click on the ability button (because the ability management button is covering it), so usually this 5th ability needs to be passive...however, if you only added 5th abilities to the AI versions of capital ships, then it wouldn't matter, as the AI would still be able to use the ability...

If you don't want the 5th ability to use ability points, you'd need to change the levelSourceType to either an ability that inherently comes with the ship no matter what, or one that is available after a certain research requirement...

 

 

Reply #2 Top

Simply giving the AI a ton of capital ship slots won't necessarily make it produce capital ships. The only way I have seen the AI use large amounts of ships is to give it a custom tech, one that gives capital ships a large amount of experience until level three, which in essence makes them come fresh out of the factory at level 3, which for some reason convinces the AI to produce large amounts of capital ships. Here is the code for such research:

researchModifier
    modifierType "ExperienceConstantGainRate"
    baseValue 0.000000
    perLevelValue 200.000000
researchModifier
    modifierType "ExperienceConstantGainLevelCap"
    baseValue 0.000000
    perLevelValue 3.000000

If you want to disable certain ship types, without removing them from the game, the best way is to give them a single research item that is exorbitantly expensive (i.e. in the millions or billions of resource), so the AI cannot research it.

Reply #3 Top

Quoting Lavo_2, reply 2
If you want to disable certain ship types, without removing them from the game, the best way is to give them a single research item that is exorbitantly expensive (i.e. in the millions or billions of resource), so the AI cannot research it.
End of Lavo_2's quote

The only problem with this is that it prevents humans from obtaining it too....if you are looking for some sort of discrimination (ie, AI can have it but humans can't), price inflation I don't think is going to help...

Reply #4 Top

Its fairly easy to make ships only the AI can build. Its probably impossible to make ships the players can build that the AI can't build. I think the separate factions idea is probably as good as its going to get Quiet Man.

 

Reply #5 Top

Also you have to realize if you disable certain ships the AI may spazz out all together. My rule of thumb, and safest bet is that a faction must have at least ONE of every StatCountType in its lineup. If you remove the scout, colony frigate, colony capital, and the siege frigate the AI will have a seizure, and not build anything at all.

the StatCountType is the line in the ships entity near the "RoleType". StatCountType is what the AI uses to determine how many of what roletypes it needs to build. The ship does not need to be the same RoleType as the StatCountType, and the ships can have 2 roletypes. For example in the SoA 2 mod we have ships in the carrier slots that are not carriers primary StatCountType is carrier so the AI sees it as a carrier, but the 2 roletypes are Support Cruiser, and Heavy Cruiser. The RoleType tells the AI how the ship should behave in game.

Another example is the AntiStructure slot. We have the Akira in the AntiStructure slot. Its statcounttype is antistructure, but its primary roletype is also antistructure (so it will attack structures with its antistructure ability). In vanilla sins the antistructure ships cant attack other ships. However, The Akira's secondary roletype is Heavy Cruiser so the AI will tell it to attack ships as well like a normal cruiser.

You can experiment with every other ship in the lineup, but a faction MUST have the scout, colony frig, siege frig, and colony capital in its lineup, or the AI will not build, or expand at all.

Reply #6 Top

Quoting Major, reply 5
. However, The Akira's secondary roletype is Heavy Cruiser so the AI will tell it to attack ships as well like a normal cruiser.
End of Major's quote

My understanding was that the damage tables actually guided which targets a ship selects by default...know for a fact this works for any frigate or SC target, and affects frigates and SC exactly the same...perhaps structures are different in this aspect?

Reply #7 Top

hmm, seams "no", except defining a complete new race.

I try to keep the changes from my "mod" at minimal. The only "irregular" setting I have is to keep the research for AI in an undefined block, so players can't see or use it. I don't want to mess around to deeply in the game functions, just adjust settings.

Reply #8 Top

Quoting Seleuceia, reply 6
My understanding was that the damage tables actually guided which targets a ship selects by default...know for a fact this works for any frigate or SC target, and affects frigates and SC exactly the same...perhaps structures are different in this aspect?
End of Seleuceia's quote

Well with siege frigates the problem becomes the AI doesn't want to use them for actual combat. Once the planet is destroyed they tend to leave and send them to the next planet, so they need a combat roletype to get them to do both.

Once they do commit them to fighting, yeah they use some formula of the damage tables, distances and perhaps damage to select a target.

Reply #9 Top

Quoting GoaFan77, reply 8
Well with siege frigates the problem becomes the AI doesn't want to use them for actual combat. Once the planet is destroyed they tend to leave and send them to the next planet, so they need a combat roletype to get them to do both.
End of GoaFan77's quote

See, that makes sense...but I would think it would be the roletype that would cause that, not the statcounttype...I would think the AI would use the roletype to prioritize the actions of colony ships, scouts, and SB constructors....

It just doesn't make sense to me that statcounttype would do that...especially considering the Vasari, who's scout and colony ship function very differently from the other factions...if statcounttype was responsible for this programming, how does the same statcounttype for scouts and colony ships get the TEC/Advent and Vasari to use their ships differently?

Reply #10 Top

Quoting Seleuceia, reply 9
See, that makes sense...but I would think it would be the roletype that would cause that, not the statcounttype...I would think the AI would use the roletype to prioritize the actions of colony ships, scouts, and SB constructors....
End of Seleuceia's quote

That is how it works, and that seems to be what Major Stress is saying as well. Stattypes is what the AI uses for determining build orders, Role types for how to use it.

Reply #11 Top

Shows what I know....should probably read a bit more carefully next time...

Reply #12 Top

Yea that was exactly what i was trying to say. Stat Type = what the AI should build. determined by how many of them are on the map, and AI difficulty. Role type = How the AI makes ships fight, or behave in game.

A unit that is Antistructure by itself will not attack other ships. Even if you give it the weapons to do so. We don't know why since the AI is hard coded. However giving it the second roletype like Heavy Cruiser, Light Frig, or LRM will make it attack other ships, but if you reverse the roletypes (put heavy cruiser, or LRM before Antistructure) then the ship will not function at all. It will sit, and do nothing. It obviously has to do with the ship slot itself which is also hard coded into the AI.

Similar situation with the Siege frig. though after bombing, or if there is nothing to bomb it will attack other ships, but if there is a planet to bomb it will b-line it to the planet ignoring everything else in its path (cept turrets which it will try to go around them). If you give the siege frig side, and rear firing weapons it will shoot them while bombing planets. Unfortunately you cant have a working faction without a siege frig roletype (see above post's).

Vasari faction is a little different from TEC. So is Advent, but they all have the core units the AI needs to function. Scout, Siege, and Colony roletypes.

Reply #13 Top

Good to know, most certainly....

I would assume the answer to this question is no, but does the placement in the player file matter?  As in, the order the ships are put, or which group they are put in ("frigates" and "cruisers")...

I'd think it wouldn't but I could be wrong...

Reply #14 Top

Oh wow... And here I thought StatCountType was absolutely useless, was just used for what showed up in the stats page at the end of a game. Well, I have a lot of tweaking to do now.

Reply #15 Top

Quoting Seleuceia, reply 13
Good to know, most certainly....

I would assume the answer to this question is no, but does the placement in the player file matter?  As in, the order the ships are put, or which group they are put in ("frigates" and "cruisers")...

I'd think it wouldn't but I could be wrong...
End of Seleuceia's quote

It shouldn't matter what order they placed as long as frigate entity's are in the frigate/cruiser build menus, and cap ship entity's are in the cap ship build menus. I usually place the order starting from the weakest ship to the strongest ship, but it really dont matter as long as frigates are in frigate menus, and cap ships are in cap ship menus. The AI doesnt see an "order" in the build menus. It just determines how many of what statcounttype is missing, and researches/builds it.

Reply #16 Top

hmm, it seams to be driven also by resources. The AI seams to have some sort of an action cycle. When is comes to building ships and it can afford only cheap frigates, it will build only them instead of saving resources for larger ships. Depending on the situation good or bad thing. Occasional I saw AI with large fleets of light frigates.

Reply #17 Top

Yea the AI likes to bankrupt itself by not developing infrastructure on worlds it just captured, Spending ridiculous amounts of its economy on research while at the same time trying to build up a fleet of planet bombers when it really needs combat ships. Only when using cruel, and vicious cheating AI do i ever see fleets worthy enough to try to kill.

Reply #18 Top

Hello, I'm looking for a way to disable building of certain ship types.
End of quote

After re-reading your original post, you stated, "To disable building certain types of ships". You didn't specify that this was for the AI only, or for both the AI and the player. If it's for both the AI and the player, couldn't he just delete the ship's entry in the Player TECH, PSI, and PHASE entity files? If that doesn't work, then also deleting the same ship's entry in both the statcount type and role type might be worth a shot. If that works, both the AI and the player will not be able to build whatever ship you want to delete. But unless I misinterpreted your post, you didn't say that you wanted the player to still be able to build the ship in question.