Containers L cannot be hit by AI crafts

Any issues with the XWAU or X-Wing Alliance? Please let us know here!
Post Reply

Containers L cannot be hit by AI crafts

User avatar
Phoenix Leader
Rebel Alliance
Posts: 437
Joined: Wed Aug 08, 2018 2:20 pm

Post by Phoenix Leader » Fri Jan 11, 2019 8:01 am

While I was playing Prologue, Mission #2 I experienced this problem: FRS Andrasta is not able to hit the type L containers.
I've uploaded a video: https://www.youtube.com/watch?v=TyGw8qo1IWI
This is not an issue related to the mission because I have the same problem in the Flight Simulator, skirmish mode.
I also tried to change craft and the X-Wing got the same result.
This has definitely something to do with the type L containers, not the fighters.

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Jan 11, 2019 1:13 pm

Hello,
You can try this patch:

Code: Select all

; fix ContainerSphere not being hittable by AI
At offset 0119A6, replace 0F842F010000 with 909090909090.
Tell me if this works or not.

User avatar
Phoenix Leader
Rebel Alliance
Posts: 437
Joined: Wed Aug 08, 2018 2:20 pm

Post by Phoenix Leader » Fri Jan 11, 2019 5:22 pm

I tried to open XwingAlliance.exe with Resource Hacker, but I didn't find 0F842F010000.
Did I use the wrong software to open .exe?

I forgot to write I have DSUCP v2.5 installed.
I don't know in detail how it modifies XwingAlliance.exe.

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Jan 11, 2019 6:01 pm

As an alternative, you can use XwaExePatcher and add this to patcher.xml:

Code: Select all

  <Patch Name ="fix ContainerSphere not being hittable by AI">
    <Item Offset="0119A6" From="0F842F010000" To="909090909090" />
  </Patch>

User avatar
Phoenix Leader
Rebel Alliance
Posts: 437
Joined: Wed Aug 08, 2018 2:20 pm

Post by Phoenix Leader » Fri Jan 11, 2019 6:39 pm

I downloaded the XwaExePatcher-1.0.11.zip (14.8 KB), extracted the files, opened patcher.xml with notepad and added the patch (of course before </ArrayOfPatch>); than I copied patcher.xml and pasted it to the X-Wing Alliance directory.

The problem is partially solved: some fighters, the Firespray for example, are now able to hit the containers type L, while others, the X-Wing for example, still miss the targets.

Is there anything I did wrong in the patch installation process?

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Fri Jan 11, 2019 7:09 pm

No, extract the XwaExePatcher-1.0.11.zip then add

Code: Select all

  <Patch Name ="fix ContainerSphere not being hittable by AI">
    <Item Offset="0119A6" From="0F842F010000" To="909090909090" />
  </Patch>
to the patcher.xml (you can open this with Notepad)

and yes before the </ArrayOfPatch>

Next goto you xwa Dir copy and paste the XwingAlliance.exe in to the XwaExePatcher-1.0.11 directory

next click on XwaExePatcherWindow.exe a window will open, scroll down to the bottom you will see the "fix ContainerSphere not being hittable by AI"

click "Apply" you have now applied the fix

Next Copy and paste the XwingAlliance.exe back to your XWA Dir, test the fix by playing the game

If you find the fix doesn't work repeat the above but click on "Restore to remove the "fix ContainerSphere not being hittable by AI".

Hope thats a little clearer :D
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Jan 11, 2019 7:13 pm

Like I said, it's a try. The patch may not work.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Fri Jan 11, 2019 7:41 pm

Ok I've done a test, without the patch, 6 container L (sphere) vs 6 x-wing, the xwings destroyed the spheres
Without Patch 6 Tie fighters again destroyed the sheres
Awings same result

Bwings, find it harder to hit the spheres and Firesprays couldn't hit a death star if it was right infront of them

Tried exactly the same with the patch and got the same result

Because the Ties, Awing and X-wings lasers are closer to centre the AI find it easy destroying the targets

Bwings and the Firspray there lasers are a fare bit off centre so the AI find it harder to hit anything

I don't think the patch works, I think its just the positioning of the lasers on the craft, the further away the lasers are from centre the hard AI craft find it to hit anything

So if your going to have a squardon of anything select a craft the has laser near the centre
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Justagai
Cadet 1st Class
Posts: 218
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Fri Jan 11, 2019 9:30 pm

Yes the issue does seem to be related to how the AI aim for the center of the target. With an unmodded XWA installation, some ships may have trouble hitting the container on the first pass but they will most likely destroy it on the second pass. Weird that this is happening with the upgraded container. Is it possible that the upgraded container is off center?

EDIT: There may be something hardcoded to compensate aim for the L container. I know in XvT there was specific hardcoding for certain containers and their hitbox since they weren't large enough to be considered for precision collision checking. Just a theory though.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Fri Jan 11, 2019 9:53 pm

Justagai wrote:
Fri Jan 11, 2019 9:30 pm
Is it possible that the upgraded container is off center?
No I've checked them

I still believe its the positioning of the laser hardpoints, the further away the laser hardpoints are away from the centre of the craft, I think it makes it harder for an AI craft to aim, just look at the positioning of the laser hardpoint on the slave1 and Bwing, Then look at the positioning of of the laser hardpoints on say the Tie Fighter or Awing

It like having a gun in both hands, then stretching your arms out to the side and still trying to fire forward, your aim is going to be way off.
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
Phoenix Leader
Rebel Alliance
Posts: 437
Joined: Wed Aug 08, 2018 2:20 pm

Post by Phoenix Leader » Sat Jan 12, 2019 5:14 am

Thanks for the replies.
So this seems to be an AI related issue and solving it could require editing AI behavior, which means essentially cheating.
Firesprays couldn't hit a death star if it was right in front of them
LOL
I knew Emon is getting old.

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sat Jan 12, 2019 9:29 pm

I noticed a similar issue a few years ago when I had a corvette try to clear a mine field, but it shot right through the mines without damaging them.
Last edited by Bman on Tue Jan 15, 2019 5:57 am, edited 1 time in total.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 599
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Sun Jan 13, 2019 6:30 am

I did some filming, and as far as I can tell, the AIs don't use laser convergence. I think, if they did, it would resolve the issue.

User avatar
Phoenix Leader
Rebel Alliance
Posts: 437
Joined: Wed Aug 08, 2018 2:20 pm

Post by Phoenix Leader » Sun Jan 13, 2019 11:14 am

Strange, the laser convergence system is turned on by default.
Shouldn't the AI be using the auto-setting?

Justagai
Cadet 1st Class
Posts: 218
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Sun Jan 13, 2019 11:47 pm

I was going to post "Not all ships have convergence systems" but I wanted to see how the AI is acting with a ship that does have convergence. I have uploaded a video with me spectating the AI.

https://1drv.ms/v/s!AoEpIrw6LOkUjcYCwwp1D4tUm7qd4Q

keiranhalcyon7 is correct, the AI don't use convergence. As a matter of fact, they will turn it off if its on which I find interesting.

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Jan 14, 2019 5:23 pm

Hello,
The code that defines gun convergence for AI crafts looks like this:

Code: Select all

    s_pXwaCurrentCraft->LasersConvergence = LasersConvergence_Off;

    if( s_XwaObjects[s_V0x07CA1A0.ObjectIndex].ShipCategory == ShipCategory_Starfighter || s_XwaObjects[s_V0x07CA1A0.ObjectIndex].ModelIndex == ModelIndex_051_0_38_EscortShuttle )
    {
        switch( s_XwaObjects[esp18].ShipCategory )
        {
        case ShipCategory_Starfighter:
        case ShipCategory_Transport:
        case ShipCategory_UtilityVehicle:
        case ShipCategory_Mine:
        case ShipCategory_Satellite:
        case ShipCategory_Droid:
        case ShipCategory_Armament:
            if( s_ExeCraftTable[s_pXwaCurrentCraft->CraftIndex].GunConvergence == GunConvergence_Manual )
            {
                s_pXwaCurrentCraft->LasersConvergence = LasersConvergence_Medium;
            }
            else if( s_ExeCraftTable[s_pXwaCurrentCraft->CraftIndex].GunConvergence == GunConvergence_Auto )
            {
                s_pXwaCurrentCraft->LasersConvergence = LasersConvergence_On;
            }

            break;
        }
    }
As you can see, the AI doesn't use gun convergence when shooting to containers.

You can enable gun convergence for AI craft with this patch:

Code: Select all

  <Patch Name ="fix gun convergence for AI">
    <Item Offset="0A6C09" From="7407" To="EB07" />
    <Item Offset="0A77E4" From="0303" To="0202" />
  </Patch>
The first item removes the ship category/model index filter for the current craft.
The second item enables gun convergence when shooting at people and container

With the patch, the code will look like that:

Code: Select all

    s_pXwaCurrentCraft->LasersConvergence = LasersConvergence_Off;

        switch( s_XwaObjects[esp18].ShipCategory )
        {
        case ShipCategory_Starfighter:
        case ShipCategory_Transport:
        case ShipCategory_UtilityVehicle:
        case ShipCategory_Mine:
        case ShipCategory_Satellite:
        case ShipCategory_People:
        case ShipCategory_Container:
        case ShipCategory_Droid:
        case ShipCategory_Armament:
            if( s_ExeCraftTable[s_pXwaCurrentCraft->CraftIndex].GunConvergence == GunConvergence_Manual )
            {
                s_pXwaCurrentCraft->LasersConvergence = LasersConvergence_Medium;
            }
            else if( s_ExeCraftTable[s_pXwaCurrentCraft->CraftIndex].GunConvergence == GunConvergence_Auto )
            {
                s_pXwaCurrentCraft->LasersConvergence = LasersConvergence_On;
            }

            break;
        }

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 599
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Mon Jan 14, 2019 5:59 pm

Confirmed, both the Firespray and the B-Wing have no trouble hitting the containers with this patch applied. I also threw in some zero-g Stormtroopers, which they also had no trouble with.

EDIT: Although now I realize that zero-g Stormtroopers are in the droid category, not the people category, and as such, the AIs always used convergence against them, and never had any trouble hitting them. I guess clones are closer to droids than to people? Anyway, I couldn't actually find anything with ship type: people in MXvTED with which to test that part of the change.

So s_V0x07CA1A0 appears to be a data structure for the current craft, and esp18 is the ObjectIndex for the target craft. I'm curious, is s_pXwaCurrentCraft just a pointer to s_V0x07CA1A0?

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Jan 14, 2019 6:54 pm

It seems that the people category is never used.

s_V0x07CA1A0 is a data structure used by the AI code. esp18 is the object index of the target craft. s_pXwaCurrentCraft is not a pointer to s_V0x07CA1A0. It is a pointer to a structure that contains data related to a craft.

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 599
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Mon Jan 14, 2019 7:20 pm

Hmm, thanks, Jeremy. And congrats on post 1000!

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Mon Jan 14, 2019 7:21 pm

If I apply this to the DSUCP and XWACP, is this going to bugger up any missions???
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Justagai
Cadet 1st Class
Posts: 218
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Mon Jan 14, 2019 8:00 pm

JeremyaFr wrote:
Mon Jan 14, 2019 5:23 pm
Hello,
The code that defines gun convergence for AI crafts looks like this:

Code: Select all

    s_pXwaCurrentCraft->LasersConvergence = LasersConvergence_Off;

    if( s_XwaObjects[s_V0x07CA1A0.ObjectIndex].ShipCategory == ShipCategory_Starfighter || s_XwaObjects[s_V0x07CA1A0.ObjectIndex].ModelIndex == ModelIndex_051_0_38_EscortShuttle )
    {
        switch( s_XwaObjects[esp18].ShipCategory )
        {
        case ShipCategory_Starfighter:
        case ShipCategory_Transport:
        case ShipCategory_UtilityVehicle:
        case ShipCategory_Mine:
        case ShipCategory_Satellite:
        case ShipCategory_Droid:
        case ShipCategory_Armament:
            if( s_ExeCraftTable[s_pXwaCurrentCraft->CraftIndex].GunConvergence == GunConvergence_Manual )
            {
                s_pXwaCurrentCraft->LasersConvergence = LasersConvergence_Medium;
            }
            else if( s_ExeCraftTable[s_pXwaCurrentCraft->CraftIndex].GunConvergence == GunConvergence_Auto )
            {
                s_pXwaCurrentCraft->LasersConvergence = LasersConvergence_On;
            }

            break;
        }
    }
As you can see, the AI doesn't use gun convergence when shooting to containers.

You can enable gun convergence for AI craft with this patch:

Code: Select all

  <Patch Name ="fix gun convergence for AI">
    <Item Offset="0A6C09" From="7407" To="EB07" />
    <Item Offset="0A77E4" From="0303" To="0202" />
  </Patch>
The first item removes the ship category/model index filter for the current craft.
The second item enables gun convergence when shooting at people and container

With the patch, the code will look like that:

Code: Select all

    s_pXwaCurrentCraft->LasersConvergence = LasersConvergence_Off;

        switch( s_XwaObjects[esp18].ShipCategory )
        {
        case ShipCategory_Starfighter:
        case ShipCategory_Transport:
        case ShipCategory_UtilityVehicle:
        case ShipCategory_Mine:
        case ShipCategory_Satellite:
        case ShipCategory_People:
        case ShipCategory_Container:
        case ShipCategory_Droid:
        case ShipCategory_Armament:
            if( s_ExeCraftTable[s_pXwaCurrentCraft->CraftIndex].GunConvergence == GunConvergence_Manual )
            {
                s_pXwaCurrentCraft->LasersConvergence = LasersConvergence_Medium;
            }
            else if( s_ExeCraftTable[s_pXwaCurrentCraft->CraftIndex].GunConvergence == GunConvergence_Auto )
            {
                s_pXwaCurrentCraft->LasersConvergence = LasersConvergence_On;
            }

            break;
        }
This is very good stuff! I'll add this to the database.
Darksaber wrote:
Mon Jan 14, 2019 7:21 pm
If I apply this to the DSUCP and XWACP, is this going to bugger up any missions???
Maybe? For example, enemy craft that are attacking friendly small containers would be more difficult. But it also works in reverse.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Mon Jan 14, 2019 8:07 pm

Justagai wrote:
Mon Jan 14, 2019 8:00 pm
Maybe? For example, enemy craft that are attacking friendly small containers would be more difficult. But it also works in reverse.
Ok thanks, I'll probably leave it out then :)
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
Phoenix Leader
Rebel Alliance
Posts: 437
Joined: Wed Aug 08, 2018 2:20 pm

Post by Phoenix Leader » Tue Jan 15, 2019 9:37 am

Maybe? For example, enemy craft that are attacking friendly small containers would be more difficult. But it also works in reverse.
There is only 1 mission where enemy fighters attack friendly containers: B2M1 where TIE Experimental M1 attack type B containers, but they aren't small.

As for the opposite situation, there are no mission where friendly fighters attack enemy containers, unless you order them to do so.

User avatar
Mark_Farlander
Rebel Alliance
Posts: 580
Joined: Tue Jan 16, 2018 10:47 pm

Post by Mark_Farlander » Tue Mar 31, 2020 1:47 pm

Hello pilots,
I've applied the "fix gun convergence for AI" patch with XwaExePatcherWindow (XwaExePatcher-1.0.25) and now Firesprays can hit small objects such as Containers G that they couldn't hit before, but with the patch another issue has come: the gun turret on YT-1300 in B0M2 moves without input from player.
This happens regardless of the fact the Sabra is performing the "Follow Targets" order or not, therefore it cannot be a mission problem, but this only happens in areas where such order is present at any time, therefore it "seems" a mission problem.
I'm puzzled.
I don't judge tactics. The Battle is the best and only Judge.

Post Reply