IskatuMesk IskatuMesk

AI properties research

AI properties research

In all of my mods, making the AI the most functional it can possibly be is amongst my highest priorities. Without going too deep into my game design concepts, AI is a part of a four-section ring, including Gameplay, Graphics, and Sounds, that a mod should strive to deliver.

But the AI in sins is vastly hardcoded. All we have to work with are some values in Gameplay Constants and the roletypes of ships.

After hounding the forums with the search function, I have been unable to find any consolidated source (surprise surprise, looks like this is the way for nearly everything sins-related) of information related to discovering how exactly the AI functions.

From what I've been able to gather, I've made the following concept of how the Ai works in my head,

- The AI functions similarily to the Ai in Age of Wonders 2 in which it calculates some kind of attribute in individual ships to weigh their "power" when engaging enemy forces. This is definitely not damage, because in my current test build of my mod, the AI was suiciding small fleets into a duo of Fear megaships and Blood Moons over and over again who, while they did not have modded health, 1-shotted the smaller capital ships instantly. I suspect it may have to do with health or cost values. When Blood Moons and Fears were not put into the equation, the AI's hid in their systems sins-style in a cold war military-style buildup but did not build that many ships very quickly.

However, the cost thing doesn't make a lot of sense either. With 3 Gorekhans, that cost 2.5k credits a piece, and a slew of Vallus' and a World Eater, all with extremely high damage and the former two with extremely high health, the AI tried to stand and fight with nothing but modded light corvettes that have 6k health but do only 16 damage, and some LRM frigates and his one level 1 capital that died five seconds into the fight. However, when a small Pirate fleet showed up, he ran away.

This will require further experimentation or the input of another individual to formulate a concept of. Since my mod will have three tiers of capital ships, ranging from basic capitals to "Megaships" that are at the end of the tech tree and are exceptionally powerful, I want to see if I can avoid having the AI suicide its units unnecessarily into high-tech fleets. They seem to be reasonably good at avoiding that in vanilla sins, except for starbases, which they don't seem to account for starbase upgrades.

- The values in gameplay.constants potentially function similar to the priority in Starcraft AI handling. So, with the initial values of 5's and 2's and 1's, the 5's have an exponentially greater value than the 2's, which are double the value of the 1's. No wonder why in an 8 hour long game an "Unfair" AI doesn't even get halfway through the upgrades! I set all of theses to 50's and 30's and 45's, but have not yet tested it thoroughly enough to judge if it's making a difference. So far the difference is minimal.

This will require further experimentation and perhaps reducing certain values to try to encourage other values. In particular I want the AI to build a lot of frigate factories (which I set to cost 1 logistics slot) and build many more ships faster. My mod will play more like an RTS and involve much more intense fighting than vanilla sins. The AI will have to keep up in order for the mod to go anywhere.

- The biggest problem of all I ran into was the AI using "fleet" groups. With any capitals even slighter larger than a regular capital, the units would bunch up right around them and try to move "inside them", even to the point of refusing to engage enemy forces that are attacking them. I liked how the AI stuck close to the artillery ships while they bombed the enemy from afar, but if I can figure out how to disable the fleet formations or at least extend the radius of their clustering, I will do that. I found a file called Fleet.entity that I think sets the default formation value for ships. I searched the forum for information on this file and found absolutely nothing of value except for one person referring to a formation setting as "loose". So I changed it from Near to Loose. I haven't tested the changes yet, it's on my slate for today. I am hoping this also changes the AI formation settings. I have no idea if this is the highest maximum setting or not. Why the devs didn't post this kind of information confounds me. Well, really, why anyone would hardcode AI at all confounds me, especially in a game as complex as this.

- What I really want to do right now is figure out how to feed the AI more cash (infinite cash if possible). More cash must mean more ships and better upgrades and researching, right? But I think that's hardcoded. Maybe Diplomacy and it's two additional difficulty levels are what I'm searching for.

 

Ultimately I don't care if the AI can't micro. If I can get them to build a ton of ships and upgrade fully, I'll be happy. I always play with Locked Teams because I prefer the RTS portion of the game. I'll be removing stuff like allegiance and influence and focusing exclusively on economic, strategic, and tactical elements. If I can turn the AI into an unstoppable killing machine, I'll have achieved my goal. Since this mod will massively increase the depth of researching and upgrading (system stuff like population, mines, ect. will be very numerous and grow exponentially more expensive as you invest into them, allowing end-game to keep growing into the very high-end stuff, while preventing tech rushing at the same time). The first step is to get the AI to invest in the current gameplay elements before increasing their complexity to a point where I'll have no idea how the AI will react.

Now, here's some questions I have;

- I know the AI reads "roletypes" for ship usage. Is it possible to give a ship multiple roletypes?

- When two roletypes exist, how does the AI decide between them? Randomly, cost, cost-effectiveness, strictly from stats, or is this largely unknown? At the very least, has it been observed that they construct both ships with the same roletype?

- If the AI starts off with three capitals - Carrier, Colony, and either Battleship or Support or something, will they build between these three ships or try to tech to build one of the other ones? I noticed in some mods, especially the Star Trek one, that the AI will often disregard getting early capitals and sit there on its ass until it techs to a point where it can build what it wants. This could be bad news.

 

If there is interest in this subject I will update this thread with my findings as I progress through development, at least until sc2 beta comes out. I consider AI to be one of the most important things of a game, and it is my greatest disappointment in Ironclad that they've hardcoded it to this ridiculous extent. Still, I've worked with Hardcoded games before and pushed above and beyond to deliver the ultimate AI experience (Age of Wonders 2, Starcraft, Diablo 2...), I will try to do so here if it's possible.

25,906 views 38 replies
Reply #26 Top

It was using 1.5gigs of ram, I checked during the height of the game. I don't think sins' ram usage changes throughout the game since it just loads everything all at once, even stuff that never gets used. I actually expect the ram usage to go down as I replace more ships because most of my ships just tile the same texture specific to their race.

And yeah, we concluded it had no multi-core support. Which is kind of silly in this day and age seeing as how dual cores are dominating most of the market, but eh. Plenty of games use dual cores but function fine on single-core systems, it just takes good programmers and a bit of time. Judging by how many things Ironclad decided to leave out, including animated turrets, a reasonable data structure, AI in a format that can be tweaked, ect. I get the impression they were massively crunched for time and just had to rush their way through and hope for the best.

But there really aren't any other options out there for creating a space RTS. Homeworld 2 is an absolute trainwreck if you consider the fact that it performs ten times as bad as Sins does on ATI cards just because of lazy openGL rendering, there is no way to add hardpoints/turrets to ships except through an extremely time-consuming and exhausting WASD process with a user-made tool, the colision pathing is an absolute DISASTER (I was utterly shocked that I could import a ship twice the size of a Kol into sins and they'd actually move around just fine, it's just the fleet formation AI that I don't even use that causes issues), and then there's the files. Dear God, the files. The weapon file is just a bunch of numbers. You have to count around using an external reference to figure out what anything does. Then there's FX editing. I absolutely love the Sins particle editor although sometimes particles don't appear ingame and I still haven't figured out why.

The list goes on. Sins has its limits, I'll just have to do the same thing I do with every other game - use brute force. Force is, after all, the answer to everything!

The 2gb limit and single-core thing doesn't really bother me that much. Sins performs very well on its own now, it's something I did, probably the gravity wells or perhaps Ironclad Online, that caused such a tremendous performance hit. I'll route out the cause eventually.

All I'm really trying to do here is get some ships from my novel into the game in a manner I can just watch some carnage with. The AI is the best route to that, and so this thread is a reseviore of my continued research as I experiment. I can't expect to get my full GEC into swing since I can't set firing arcs, but whatever. It's the shiny I'm after.

But do note that when the Starcraft 2 beta starts my presence here will vastly diminish since I'll be covering that extensively for the Starcraft community, especially in terms of modding.

Reply #27 Top

And yeah, we concluded it had no multi-core support. Which is kind of silly in this day and age seeing as how dual cores are dominating most of the market, but eh. Plenty of games use dual cores but function fine on single-core systems, it just takes good programmers and a bit of time. Judging by how many things Ironclad decided to leave out, including animated turrets, a reasonable data structure, AI in a format that can be tweaked, ect. I get the impression they were massively crunched for time and just had to rush their way through and hope for the best.

Keep in mind IC was 9 people when they made it (I think they have 11 now). And when Sins came out 2 years ago, there were still a lot of people using single-cores.

They've addressed the moving turrets thing before. They felt that when you can potentially have thousands of ships in one game, each one of those ships with moving turrets would have been too resource intensive.

Reply #28 Top

Oh wow, 9 people? I didn't think they were that small. That puts things into perspective.

About turrets - that's true if they are subsystems like in Homeworld 2. Homeworld 2's second big performance killer is subsystems because they are separate entities. But games like Eve online, Homeworld 1, Supreme Commander ect ect some even with far more demanding engines still use moving turrets. Supcom, even with its ridiculous bottleneck from bones, has a lot of turrets going on for practically every single unit there is. And it can get a unit count far higher than sins going. Unfortunately that engine has major performance issues in other areas and pretty much needs a quad core to run well because of that.

Semantics by this point, though. I understand their reasoning perfectly well.

Reply #29 Top

Minor update

 

I am now almost 100% certain that the AI is reading the DPS shown on the mouseover display rather than raw damage values. At least for broadsiding.

I have a ship that does 15k damage in one shot, but the main cannon has a 25 sec cooldown. The frontal arc also has three additional sniper cannons that do a fair bit of damage.

But this ship broadsides because it thinks the 500 damage Point Defense guns on the side, thanks to their higher firing rate, do more damage.

Problem - I had forgot to set the targets per bank, so those guns didn't fire, anyway!

 

In other news, the game is still lagging like crazy after a while. I'm starting to suspect that mines are a part of the problem. I recall something about mines and lag a while ago, and with these settings the AI is filling every single system with 150 mines that don't even explode when a fleet rolls over them. I'm going to try outright removing them and seeing if the AI will asplode or not.

 

Question - If you have a weapon that fires bursts, is the damage split amongst all of the bursts or by-burst?

Reply #30 Top

Bursts are meaningless, they're purely graphical.  All the damage is applied when firing.  It makes no difference whether the burst has one shot or twenty, it still does the damage listed in the entity file.

Reply #31 Top

I see.

So, one burst of 20 doing 1k damage will do 1k damage on the first shot? Same with two bursts of 20?

Reply #32 Top

What do you mean by two bursts of twenty?  All Sins allows is a single burst per firing cycle.

Reply #33 Top

On the topic of AI and Capital ships, do you know of the AI will upgrade it's capital ships?

Reply #34 Top

I have never witnessed it personally, so I do not believe so.

 

/e

 

Per burst, I mean -

        burstCount 1
        burstDelay 1.50000

and...

    PointStaggerDelay 0.050000

If I set this to 3 burst, it will fire from all hardpoints 3 times. Is the damage for the attack done in the first burst and the other two ignored damage-wise?

 

Also I'm pretty sure mines were partly responsible for our extremely poor performance.

Reply #35 Top

Yeah, all damage is dealt in the first burst and the other two are just pretty lights.

Reply #36 Top

I see. This explains some of my peculiar observations... and will help me figure out some balancing.

Reply #37 Top

Correction - I'm pretty sure I just saw the AI purchase a level upgrade for his Crusader. I haven't ever seen them do that before, I think that if this was the case that it's new with Diplomacy.

As a sidenote, I've made my first ability - the Zeral`Motakk's Ruby Suncrasher cannon. This charges up for 10 seconds then fires a short-lived beam obliteraring frigates/destroyers in a small radius. At level 10, the third level of this beam deals enough damage to 1-shot most heavy destroyers and the radius increases. The Undead are all about weapons of mass destruction, and this tier 1 flagship will be a great way to introduce viewers to my mod once I have enough hammered out to make a short trailer.

Reply #38 Top

Correction - I'm pretty sure I just saw the AI purchase a level upgrade for his Crusader. I haven't ever seen them do that before, I think that if this was the case that it's new with Diplomacy.

Check the after-game stats. Under the capital ships tab, one of the options is "capital ship levels purchased" If the AI has bought any levels, that should tell you.