Sins of a Solar Empire : Real-Time Strategy. Unrivalled Scale.
© 2003-2013 Ironclad Games Corporation Vancouver, BC. All rights reserved.
© 2006-2013 Stardock Entertainment

How to disable building certain ships types?

By on March 30, 2012 2:21:03 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Quiet_Man

Join Date 07/2010
+10

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

18 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
March 30, 2012 4:14:51 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

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...

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
March 30, 2012 8:44:26 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
March 30, 2012 3:05:49 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Quoting Lavo_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.

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...

Reason for Karma (Optional)
Successfully updated karma reason!
March 30, 2012 3:13:29 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

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.

 

Reason for Karma (Optional)
Successfully updated karma reason!
March 31, 2012 12:01:21 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
March 31, 2012 3:25:34 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

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

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?

Reason for Karma (Optional)
Successfully updated karma reason!
March 31, 2012 4:47:44 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
March 31, 2012 12:35:00 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Quoting Seleuceia,
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?

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.

Reason for Karma (Optional)
Successfully updated karma reason!
March 31, 2012 1:36:28 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Quoting GoaFan77,
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.

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?

Reason for Karma (Optional)
Successfully updated karma reason!
April 1, 2012 3:37:55 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Quoting Seleuceia,
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....

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.

Reason for Karma (Optional)
Successfully updated karma reason!
April 1, 2012 1:34:47 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

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

Reason for Karma (Optional)
Successfully updated karma reason!
April 1, 2012 6:15:39 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
April 1, 2012 6:39:35 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

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...

Reason for Karma (Optional)
Successfully updated karma reason!
April 1, 2012 11:26:34 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
April 2, 2012 11:30:10 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Quoting Seleuceia,
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...

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.

Reason for Karma (Optional)
Successfully updated karma reason!
April 3, 2012 6:45:34 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
April 3, 2012 9:49:57 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
April 16, 2012 9:31:03 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

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

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.

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108435  walnut2   Server Load Time: 00:00:00.0000078   Page Render Time: