Jump to content

R&D AI Improvements


Amineri

Recommended Posts

As I said earlier, AI performs poorly when not seeing player, which often results in alien hiding in corners or flanking themselves.

If you have read last post in topic (to which I posted link), you would have seen I am quite aware of the problem.

 

<..>

I was able to make aliens go on overwatch on activation, it works, but visualization if awful: two subsequent calls of MoveToCover and DoOverwatch result in alien go on overwatch and then take cover.

If you was trying to hijack original code, that causes overwatch on non-cover unit, then it may be not your fault, as that code is buggy, and launches itself out of sequence (seen today on stream on Mectoid pack activation Mectoid doing overwatch, then getting his free move toward player; that looked so hax :rolleyes:).

Edited by Tycus
Link to comment
Share on other sites

  • Replies 144
  • Created
  • Last Reply

Top Posters In This Topic

If you have read last post in topic (to which I posted link), you would have seen I am quite aware of the problem.

Sorry, I haven't read that post. When I'm working, I sometimes get obsessed with what I do, so I stop paying attention. :sad: Sorry again.

If you was trying to hijack original code, that causes overwatch on non-cover unit, then it may be not your fault, as that code is buggy, and launches itself out of sequence (seen today on stream on Mectoid pack activation Mectoid doing overwatch, then getting his free move toward player; that looked so hax :rolleyes:).

No, that wasn't the issue, although it may be related. I was able to add a check for IsMoving and pause script. Now it looks good. And even "Itchy Trigger Tentacle" fire works, but I made it hard-coded. I haven't checked patrol activation yet. When I do, I will release the code for anyone to play around.

 

Optional fire is supposed to trigger for pod leader only (actually, for the first alien who will be able to see XCOM unit, but in vanilla case it will be pod leader). Overwatch is punishing enough, so I may leave this part of code as it is.

 

PS Sorry for hijacking the topic, but originally I was positive I won't be able to do this myself, so I decided to post the idea here for others to try and implement it.

Edited by wghost81
Link to comment
Share on other sites

OK, I finally have some code to release. Ninja-style, as Amineri may say. :smile: Was able to move a portion of a code without actually moving it. :smile: Crazy jumps inside! :smile:

 

 

MOD_NAME=Overwatch on Reveal
AUTHOR=wghost81 aka Wasteland Ghost
DESCRIPTION=Overwatch on Reveal

Version: 1.0

Compatible with XCOM Enemy Within versions:
 - Initial release (Changelist: 394142)


UPK_FILE=XComGame.upk
OFFSET=6842938
[MODDED_HEX]
                              06 AC 15 07 6B 14
82 82 19 19 19 2E BD 32 00 00 19 12 20 36 FE FF
FF 0A 00 9E F9 FF FF 00 1C DE FB FF FF 16 09 00
5C F9 FF FF 00 01 5C F9 FF FF 09 00 C9 32 00 00
00 01 C9 32 00 00 09 00 7D AE 00 00 00 01 7D AE
00 00 0A 00 4F 42 00 00 00 2D 01 4F 42 00 00 18
0D 00 81 2D 01 B1 3F 00 00 16 16 18 22 00 81 19
01 90 3F 00 00 0A 00 83 3A 00 00 00 1B 18 45 00
00 00 00 00 00 16 16 16 07 65 11 82 19 01 90 3F
00 00 0A 00 2B C6 00 00 00 1B 25 45 00 00 00 00
00 00 16 18 38 00 81 19 19 01 90 3F 00 00 09 00
F8 39 00 00 00 01 F8 39 00 00 0B 00 CB FF FF FF
00 C5 21 D1 80 00 00 00 00 00 00 16 16 16 61 00
1E CD CC CC 3D 16 06 FC 10 07 E3 13 97 36 19 01
90 3F 00 00 09 00 95 39 00 00 00 01 95 39 00 00
25 16 07 79 12 19 19 2E 2D 32 00 00 19 12 20 36
FE FF FF 0A 00 9E F9 FF FF 00 1C DE FB FF FF 16
09 00 5C F9 FF FF 00 01 5C F9 FF FF 09 00 1F 32
00 00 00 01 1F 32 00 00 0C 00 1F 10 00 00 00 1B
3B 45 00 00 00 00 00 00 24 0E 16 0F 19 19 19 2E
BD 32 00 00 19 12 20 36 FE FF FF 0A 00 9E F9 FF
FF 00 1C DE FB FF FF 16 09 00 5C F9 FF FF 00 01
5C F9 FF FF 09 00 C9 32 00 00 00 01 C9 32 00 00
09 00 7D AE 00 00 00 01 7D AE 00 00 09 00 3A 42
00 00 00 01 3A 42 00 00 2C 32 06 F7 12 0F 19 19
19 2E BD 32 00 00 19 12 20 36 FE FF FF 0A 00 9E
F9 FF FF 00 1C DE FB FF FF 16 09 00 5C F9 FF FF
00 01 5C F9 FF FF 09 00 C9 32 00 00 00 01 C9 32
00 00 09 00 7D AE 00 00 00 01 7D AE 00 00 09 00
3A 42 00 00 00 01 3A 42 00 00 25 07 E3 13 96 12
20 CC 55 00 00 2C 00 79 55 00 00 00 1C 7C 55 00
00 2C 64 A8 A8 38 57 01 D3 F9 FF FF 38 57 61 1C
16 16 38 57 1C A2 FC FF FF 16 16 16 19 19 19 2E
BD 32 00 00 19 12 20 36 FE FF FF 0A 00 9E F9 FF
FF 00 1C DE FB FF FF 16 09 00 5C F9 FF FF 00 01
5C F9 FF FF 09 00 C9 32 00 00 00 01 C9 32 00 00
09 00 7D AE 00 00 00 01 7D AE 00 00 09 00 3A 42
00 00 00 01 3A 42 00 00 16 14 2D 01 B1 3F 00 00
19 01 90 3F 00 00 0A 00 5F C9 00 00 00 1B 38 33
00 00 00 00 00 00 16 07 5F 14 81 2D 01 B1 3F 00
00 16 07 2B 14 9A 19 01 90 3F 00 00 0A 00 16 3B
00 00 00 1B 9E 37 00 00 00 00 00 00 16 2C 08 16
1B C2 61 00 00 00 00 00 00 01 90 3F 00 00 16 19
19 01 90 3F 00 00 09 00 EB 39 00 00 00 01 EB 39
00 00 0A 00 00 00 00 00 00 1B CE 1D 00 00 00 00
00 00 16 14 2D 01 B1 3F 00 00 28 06 2B 19 01 A9
3F 00 00 01 A9 3F 00 00 01 A9 3F 00 00 01 A9 3F
00 00 01 A9 3F 00 00 01 A9 3F 00 00 01 A9 3F 00
00 01 A9 3F 00 00 01 A9 3F 00 00 01 A9 3F 00 00
01 A9 3F 00 00 01 A9 3F 00 00 01 A9 3F 00 00 01
A9 3F 00 00 01 A9 3F 00 00 01 A9 3F 00 00 01 A9
3F 00 00 01 A9 3F 00 00 01 A9 3F 00 00 0B 0B 0B
0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B
0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B
0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B
0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B
0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B
0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B
0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B
0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B
0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B

UPK_FILE=XComGame.upk
OFFSET=6844220
[MODDED_HEX]
                                    07 86 19 97
36 01 92 3F 00 00 25 16 0F 01 A6 3F 00 00 01 92
3F 00 00 0F 01 90 3F 00 00 10 25 01 A6 3F 00 00
0F 01 A9 3F 00 00 24 08 07 86 19 77 01 90 3F 00
00 2A 16 0F 01 A9 3F 00 00 24 09 07 28 19 9A 19
01 90 3F 00 00 0A 00 16 3B 00 00 00 1B 9E 37 00
00 00 00 00 00 16 2C 17 16 07 D4 18 19 2E F3 A3
00 00 19 01 90 3F 00 00 09 00 EB 39 00 00 00 01
EB 39 00 00 0A 00 DC A3 00 00 00 1B 99 11 00 00
00 00 00 00 16 07 D1 18 82 19 01 90 3F 00 00 0A
00 A1 36 00 00 00 1B 14 46 00 00 00 00 00 00 16
18 21 00 19 01 90 3F 00 00 0B 00 CC 37 00 00 00
1B EF 43 00 00 00 00 00 00 4A 16 16 07 C6 18 19
19 01 90 3F 00 00 0A 00 07 C9 00 00 00 1B F0 36
00 00 00 00 00 00 16 0B 00 CB FF FF FF 00 C5 21
FE 80 00 00 00 00 00 00 16 19 19 01 90 3F 00 00
0A 00 07 C9 00 00 00 1B F0 36 00 00 00 00 00 00
16 0A 00 00 00 00 00 00 1B E3 00 00 00 00 00 00
00 16 61 00 1E CD CC CC 3D 16 06 11 18 06 DC 18
61 00 1E 00 00 80 3F 16 07 25 19 19 01 90 3F 00
00 0B 00 CC 37 00 00 00 1B EF 43 00 00 00 00 00
00 4A 16 1B EA 5D 00 00 00 00 00 00 01 8D 3F 00
00 16 1B 33 0C 00 00 00 00 00 00 01 90 3F 00 00
16 06 2B 19 06 45 10 56 01 A6 3F 00 00 0A 00 01
90 3F 00 00 16 07 69 19 97 36 01 A6 3F 00 00 25
16 0F 01 90 3F 00 00 10 25 01 A6 3F 00 00 06 74
19 0F 01 90 3F 00 00 2A 06 90 17 01 A9 3F 00 00
0B 0B 0B 0B 0B 0B

 

Copy-paste to txt file and use with ToolBoks Custom Mod feature.

 

It works for the most part, even compatible with SW option "Itchy Trigger Tentacle": if selected, aliens will shoot with 50% chance instead of going to overwatch.

 

But I have some problems with patrols: overwatch not activates for one alien (pod leader?). Can't see what's preventing it. :sad: But I'll continue to dig into the code and hopefully will find an answer sooner or later. :smile:

Link to comment
Share on other sites

UPD: started a new game, waited for the patrol and had all three aliens go on overwatch. I hate random bugs.

 

If anyone wants to try this, I need a reports on aliens behavior:

- stationary pods;

- patrolling pods;

- commanders;

- non-cover aliens;

- melee aliens;

- mix of melee and ranged units (berserker with mutons);

- special case: Etherial with Elite Mutons, 'cause they have a special code for reveal process;

- called-to-help pods: when you attack command aliens, they "call for help". Called pods have a special code too.

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

While digging around XComAlienPod scripts, I found a piece of code (inside PlayRevealPodMatinee function), which allowed me to consistently replicate "double-move" bug.

 

I noticed long ago, that sometimes when alien pod activates during alien turn, pod aliens get double-move: they perform reveal maneuver (go to cover) and then have their usual turn, which effectively allows chryssalids, for example, to cross the entire map in one turn.

 

I'm now able to replicate this consistently. It happens with ghosted/mimetic soldiers. If such soldier performs a non-move action, which doesn't involve aliens (like ghosted heavy firing rocket in opposite direction from inside an alien LOS), he gets revealed, but the revealing itself doesn't cause pod activation. But, at the end of the turn, aliens activate immediately and get double-move.

 

I have to examine the code carefully, as now I don't know how to fix it properly.

Link to comment
Share on other sites

I've found that the game doesn't handle revealing enemies all that well and I've been poking around the same code doing some work to try to fix it. I think the problem with this is similar to something I've been working on; there's no logic in XGAction_Fire to handle revealing pods. If you had fired a rocket at or shot those aliens, that would have been handled by the unit's OnTakeDamage function and the pod would have been revealed. However, firing a rocket away from or even just shooting an alien that isn't part of that pod would leave the other pod unrevealed. What I've been working on could be made to fix this, I think. I've co-opted a debug function in XComAlienPodManager and called it from the end of XGAction_Fire.Firing state that will reveal any pods that can see another pod that is taking/returning fire. I initially started working on this to handle the issue where there are two pods close to each other, but only one of them gets revealed due to LOS, and the other one just sits there while you wipe out their buddies right in front of them. I could see maybe using this function to handle the issue you've uncovered as well.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...