Containers L cannot be hit by AI crafts

Need help with hardware? Game doesn't run? System wont boot? We might be able to help!

Moderators: Darksaber, Forceflow, decoy

Post Reply

Containers L cannot be hit by AI crafts

User avatar
Phoenix Leader
Cadet 1st Class
Posts: 122
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.

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1008
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
Cadet 1st Class
Posts: 122
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.

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1008
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
Cadet 1st Class
Posts: 122
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

Fleet Admiral (Administrator)
Posts: 9619
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
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1008
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

Fleet Admiral (Administrator)
Posts: 9619
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
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Justagai
Cadet 1st Class
Posts: 104
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

Fleet Admiral (Administrator)
Posts: 9619
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.
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
Phoenix Leader
Cadet 1st Class
Posts: 122
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 JG
Posts: 540
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: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

User avatar
keiranhalcyon7
Cadet 1st Class
Posts: 121
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
Cadet 1st Class
Posts: 122
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: 104
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.

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1008
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
Cadet 1st Class
Posts: 121
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?

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1008
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
Cadet 1st Class
Posts: 121
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

Fleet Admiral (Administrator)
Posts: 9619
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???
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Justagai
Cadet 1st Class
Posts: 104
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

Fleet Admiral (Administrator)
Posts: 9619
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 :)
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
Phoenix Leader
Cadet 1st Class
Posts: 122
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.

Post Reply