AI Behavior Problems while modding, any insight or suggestions appreciated

Hey Guys,

I've been making my own personal MOD, and have come across the following issues quite a bit while play testing it.  Does anyone have any suggestions on how any of them may be resolved?  Has anyone else experienced these issues? I would appreciate any insight that may be offered, as when they happen in many cases it stops the AI enemy's expansion and makes the game no challenge.

1.  After initially engaging the militia at an unoccupied planet, the AI player at some time stops attacking them altogether.  At this point, they just sit there, and while they're being attacked by the militia, they do absolutely nothing in retaliation.  It's almost like the game has hung up for that particular AI player at that planet.  I've noticed, when this AI player is my ally, and I destroy the militia for them, it takes them out of this 'hung' state, and they go about expanding and acting as expected.  But until the militia is out of the way, they just sit there.

2.  The fighters sometimes spawn way out of the gravity well area, and the ships end up chasing them outside. This causes the AI to not really expand, or slows down their expansion and make the game much less challenging, as there is a whole fleet of ships way, way out of the gravity well forever chasing down something.

3.  Some capital ships that are using the fighter style movement sometimes start going out of the gravity well area instead of turning around to attack the target ship. This is different from chasing fighters, as I've notice they're still focused on attacking the enemy ship, not a fighter, but it won't turn around, it just goes in a straight line away from the target ship.

5,658 views 7 replies
Reply #1 Top

It sound to me you are modding to many files without enough testing as you go. If I change 1 line in a file I test it with the Dev.exe which will stop the game at the problem point and give a sometimes cryptic report but if I only changed a little thing its easy to find.

Do you  use the Devs?

Edit: I think the outside grav well has to do with firing ranges. In SOA2 they wrote a post on it. The ships will want to fire from there farthest point or something like that.

Reply #2 Top

1. I have had some similar problems with a high delay before my ships start attacking, not sure what causes this.

2. This happens when the ship with the fighter doesn't have a hangar point in its mesh file.

3. How fast is the ship? The experience I have had with fighter movement the ships seem to move away from the target for a certain time and then reengage it, if they are too fast then they will move out of the gravity well.

Reply #3 Top

1.  I'm not sure on this one, but might it have something to do with the role types or statcount types that you've placed on your ships?  I know certain types prefer certain targets and such, but I don't recall the AI ever choosing not to attack.  I say take a look at the entity file for ship and compare it directly with a entity file of the same roletype (long-range frigate to long-range frigate, for instance) from whichever version of stock Sins you're modding for. 

I've known shield mitigation to rise so high that the AI will stop firing a ship.  You might also check the weapon type versus armor type (Anti-Light, Anti-Heavy, Light, Heavy, etc).  I don't think that's it, but there might be something in the game constant file you messed up by accident.

2.  I think gruntmaster pinpointed the problem here.  To be honest, I didn't know they could spawn outside of the gravity well, though.  I thought they just came from the center of the ship when no hangar point existed. 

3. Continuous movement away from the gravity well does indeed have to do with the weapon ranges.  The first line below your weapon entries is "m_weaponIndexForRange X" with "X" being 0, 1, or 2 (a reference to the weapon index or hardpoint.  The ship will move to the maximum range of whichever weapon type you enter here before it decides it wants to turn and face it's pursuer.  So, if I choose to have my ship use all weapon 1 hardpoints (or the second weapon entry), which has a range of 4000, then my ship will attempt to move 4000 units away from its target before turning around.

Unfortunately, the fastest way to do this is a straight line that inevitably leads out of the gravity well.  If the pursuing ship is the same speed or very close to the same speed, that capital ship of yours will just continue running unless you give it specific orders to attack.

I'm still experimenting with it in my own mod, but I've found that it usually occurs when the pursuing ship does NOT have fighter-style movement enabled and is faster or similar in speed to my ship.  Or, if both ships have fighter style movement and the same speed.  If my ship is faster everything works out.  I'm still working on getting models with textures into the game for the first faction, but I believe that once all ships have fighter-style movement I'll be able to jimmy the speed values to reduce this problem to a rare occurance. 

 

 

Reply #4 Top

Thanks so much for the responses.  It's given me something to look into as I've been bewildered with what to do.

On 1, I haven't changed the roleTypes or the StatCount types much at all.  Perhaps only two ships, but they weren't in the most recent game that I play tested which gave the problem.  On the other hand, I have been changing weapon types and its associated weapon effects, so I'll look into this some more.

On 2, I never thought about the mesh file needing a hanger point.  I'm actually merging two different MODs and may have to use a different model for the carrier ships since some of them may not have a hanger point in the mesh.

On 3, I'll try to find the SOA2 post on firing ranges, and see if messing around with this and the ship speed will fix the issue of the ship moving in a straight line from the target.

Reply #5 Top

Quoting VoyagerIII, reply 4

On 1, I haven't changed the roleTypes or the StatCount types much at all.  Perhaps only two ships, but they weren't in the most recent game that I play tested which gave the problem.  On the other hand, I have been changing weapon types and its associated weapon effects, so I'll look into this some more.

On 2, I never thought about the mesh file needing a hanger point.  I'm actually merging two different MODs and may have to use a different model for the carrier ships since some of them may not have a hanger point in the mesh.

On 3, I'll try to find the SOA2 post on firing ranges, and see if messing around with this and the ship speed will fix the issue of the ship moving in a straight line from the target.
End of VoyagerIII's quote

1. If a new race doesn't have certain StatCount types available to it, you get this problem. In general try to have one ship comparable to what the regular Sins ships can do.

2. You can open the mesh file in notepad and add a hangar point manually (careful with the spelling). I usually just find the "Center" point, copy it, paste it, change it to hangar, and update the count at the top.

Reply #6 Top

If a ship uses strike craft then that ship MUST have a Hangar Null. Otherwise strike craft spawn randomly anywhere on the map. Usually way outside of the gravwells. You can easily create a "dummy" hangar null in the mesh file with wordpad. The Hangar null can not be inside, or touching any poly on the ship mesh. That causes problems. Just copy the "Above" null with all of its info under it. Paste it, and rename it to 'hangar". Add one to the number of mesh nulls line on top.

Each playable faction in Sins MUST have at least one of each "StatCountType" in its build menus. This is so the hard coded AI doesnt have a seizure when it tries to build, and expand. If not all StatCountTypes are present you will notice that the AI is very slow to build, and/or doesnt build, or expand at all. If you are missing the Scout StatCounttype. The AI will refuse to build Period. Same with the Siege frigate, or Colony Frig/Colony Capital. The AI will just sit there, and not build at all if those ships are missing. The best way to make sure your mod has all of the statcountypes is to "mimic" how a sins faction is set up, and use the reference file of the original sins ship for the ship you are replacing. For example if you want to make a new siege frig. Use the reference file from a vanilla siege frig entity. It is already set up as a siege frig in its "StatCounType". You can change the "RoleTypes" to whatever you want to as long as you have all of the StatCountTypes. It is the StatCounType that the AI uses to set up its fleet build orders. The Roletype determines how the ship behaves in game. Be it a siege frig, or if you changed the roletype to LRM, Carrier, Light, Scout, etc. In Entrenchment, and Diplomacy you can have 2 RoleTypes per ship.

Ships will always move to their maximum firing ranges to fire their weapons if Dynamic (fighter) Movement is enabled. If a ship has a shorter maximum range it will chase the ship that has a long range, and the long range ship will keep moving away from the short range ships to reach its max range. This is why ships leave the gravity wells during a fight. This is the problem SoA 2 has, and with other mods that use dynamic movement. Weapon Ranges will have to be adjusted to fix this as best as possible, because it is an AI issue. The AI is hard coded (as in we cant touch it).

Reply #7 Top

I have gone through and made all the ships using strike craft have a Hanger point reference in the mesh file.  Thanks so much for this tip, as well as how to accomplish it, as a lot of those ships did not have this, and I had very frequent spawns way outside the gavrity well.

I have a bunch of differing factions, but two of them were not using all the statcount types.  I had initally ensured that all the role types were there, with one ship having two types to make up for a mising ship, but not so the statcount types.  This has been corrected based on the feedback you guys have given.

My MOD is more focused on getting certain model meshes with the appropriate weapon effects for those models.  As such, I am relying on the original game's balacing and research.  So, I didn't change the original weapon types and stats much, but I did change the weapon effects so that it will look how it should for the ship model used.  As such, I may have a weapon Type defined as Projectile, but it's effects would use a beam weapon stats.  There are not any apparent problems doing it this way, but I could be wrong, and it may also be the culprit that is causing the ships to just stop firing after a while in some instances.  

On the firing range bit, and how it affects the fighter style movement, I will have to do trial and error with it I guess...  Messing around with the ship speeds and attack range until ships running away from the other is minimized or resolved.

Again, thanks for all your help and feedback, guys.  It was very userful.