Jump to content

R&D AI Improvements


Amineri

Recommended Posts

Some updates on the alien teleporting behavior. I added in just the change that should prevent teleporting when a pod is patrolling (and not the individual unit teleport removal).

 

I'm running with the developer console so I can see how the unit's are generally moving using the \AIDebugAI command. I also took and tossed out some battlescanners for good measure.

 

The results are interesting ... patrolling units are "double teleporting", it appears. With the pod patrol WarpTo removed, I observed that each pod would teleport once, often quite far, and then would patrol move normally.

 

This would explain the "soft teleport" bug, as the aliens are teleporting once into visual range with the first teleport move, and then teleporting to another area of the map with their second teleport move. I have no idea where or why the first teleport is occuring, but I'm going to explore it.

Link to comment
Share on other sites

  • Replies 144
  • Created
  • Last Reply

Top Posters In This Topic

I think I'm making some progress toward further reducing the effect of teleporting aliens.

 

After making a lot of debug hex edits disabling various error-condition WarpTo calls, it appears that the path-finding code in XComAlienPod.InitMoveManeuver is sometimes returning invalid paths, which is what is causing the initial spurious teleport.

 

When disabled, the pod often ends up on opposite ends of the map or otherwise rather wildly separated. (i.e. 1 unit will be on the right edge of the map and the others will be on the left edge). My suspicion is that the placement of aliens around the center point results in some aliens "wrapping around" the map, or otherwise ending up with paths that are illegally long, causing the pathing algorithm to return an exception, which then triggers the pod to teleport. However, after teleporting the pod still makes its regular patrol move.

 

With this disabled and the regular teleporting of pods disabled (for when they are not visible / activated), pods appear to move around the map a bit more orderly. I've watched quite a few successive turns on a map (the diner) that was regularly generating teleport jumps for the two active patrolling pods (1 pod of Drones and 1 pod of Sectoids). Occasionally a lone unit makes an illegally long move or ends up separated from his pod for a turn or two, but I think this behavior is generally an improvement over the random-seeming teleports.

 

My current headache is trying to figure out how to disable the Unit Flags for inactive-but-seen units that have moved into the Fog of War. Currently the flags are never disabled once seen (until the unit becomes active), which is brokenly useful.

 

Here are the two hex changes that seem to be doing the trick:

XComAlienPod.InitMoveManeuver) -- removing this makes all patrolling units move even when hidden from player's LOS

	change:
	WalkPodToLocation(Location, !bReveal);
	
	to
	WalkPodToLocation(Location, false);
	bReveal;
	
	original:
	1B 54 71 00 00 00 00 00 00 01 DE F8 FF FF 81 2D 00 59 39 00 00 16 16
	
	new:
	1B 54 71 00 00 00 00 00 00 01 DE F8 FF FF 28 16 2D 00 59 39 00 00 0B 

----------------------------

4.2) Disable error checking for invalid paths in XComAlienPod.InitMoveManeuver -- removing this appears to have eliminated the aberrent teleporting behavior!

change:
if(bValid)
07 12 09 2D 00 5A 39 00 00 

to:
(bValid)
0B 0B 0B 2D 00 5A 39 00 00 

Link to comment
Share on other sites

  • 5 weeks later...

Hi Amineri,

 

Just a small report here, in case you're interested. I have installed and I'm currently testing the teleport behaviour changes from these posts:

 

http://forums.nexusmods.com/index.php?/topic/989749-r-d-ai-improvements/?p=8593613

http://forums.nexusmods.com/index.php?/topic/989749-r-d-ai-improvements/page-6&do=findComment&comment=8622316

 

I have noticed that visible aliens, after the reveal animation has occurred, if they need to move (e.g. after blown up cover) they teleport instead of just running for it. Same thing happens when they go into and then come back from a fog-of-war area after being revealed. I'm talking about a 3-5 square distance teleport through a clear, visible path. Edit: And it seems this teleport-in-sight behaviour interferes with the ability to produce overwatch reaction shots. Also, because the aliens now walk around, they tend to converge at the location where the action is happening. This means more aliens are usually on screen at once.

 

Note that I'm using some of your other changes:

 

- Multiple alien bases / retake lost countries modlet (full version not released)

- Overwatch Dangerzone calculations' changes from this thread

- All Countries Contribute

- Damage rework modlet

- XMarksTheSpot's small items UI changes (not the scrollbar version)

 

I was wondering if you'd like me to pay attention to some stuff in particular while using your changes, teleport stuff or otherwise.

 

Cheers.

 

Edit: I like the changes, but I will have to wait until you release a version where the teleport-in-sight bug is fixed.

Edited by FogGene
Link to comment
Share on other sites

What we've got working in Long War 2.0 (which seems to be working pretty well) is using only the two pod-related WarpTo changes, and not the change to individual alien movement. (i.e. NOT the XGAIBehavior.MoveToPoint change)

 

Based on your feedback it appears that the attempt to remove the individual unit WarpTo function in MoveToPoint is actually causing some teleporting behavior. I'd suggest undoing only that change and leaving in the two InitMoveManeuver changes.

 

Note that this doesn't fix the underlying problem. The root-cause of the error is in how the pod manuever function computes the paths for the pod. Sometimes one pod member may end up off the edge of the map or on the far side of a wall, in which case the pathing throws up an error (I think the error is generally that the unit is moving too far, or is too far away from the rest of the pod).

 

Disabling the WarpTo error-handling prevents the pod from teleporting, but allows some units to make unreasonably large moves.

Link to comment
Share on other sites

I've also had such surprising pod spawn lately with increased pod numbers in abduction missions, before I removed these changes again. I'm sure it also happened after killing another alien pod because I had a clear vision on this spot and visited the location shortly before. It was on the tiny shop map with the warehouse and truck in the backyard where you sometimes disarm bombs. There, you can't hardly a miss a pod moving past you.

 

I've reduced the patrol distance from 45 to 10, instead of 20. Maybe this can also help preventing aliens from moving/warping too close to player characters. I think it’s more plausible if they normally do a slow stroll/sneak/patrol move and then get the extra dash move when encountered. No reason to make them dash around like crazy on many of these small maps, so you stumble upon all of them right on the first turns.

old: 0F 01 7a 2F 00 00 1E 00 00 34 42
new: 0F 01 7a 2F 00 00 1E 00 00 20 41
Link to comment
Share on other sites

I'm testing lowering the patrol distance to 12. Not sure yet how much impact it's had on pace of encounters occurring (need more testing), but it *appears* it makes a difference on reaction fire, in that my guys on overwatch are hitting their targets on alien pod reveal/arrival with significantly greater frequency. It may be that 12 is below the threshold for dash.

Link to comment
Share on other sites

The reduced patrol pathlength will in general reduce the patrol distances, which will definitlely help on the smaller maps when there's 4 pods and a bunch are patrolling.

 

It just won't help at all when there are the crazy paths that happen due to pathing errors from how the pods are placed.

 

In particular the increased pod sizes (drawn from the general increased pod size mod, which supports up to 8 or 9 aliens per pod) probably increases the chance of pod pathing errors just because of the larger number of aliens per pod. Pods are always set down in a 3x3 grid surrounding the target center point, so with 8 aliens every single square is occupied. This leads to greater chances of an alien ending up off the edge of the map or on the far side of a wall. There's also likely more problems when aliens are moving within buildings/UFOs, particular multi-story buildings.

 

I'm not 100% sure how the dashing works. There is a SetDashing() function that accepts a boolean as a parameter. For aliens it is set true when an alien is flanking and when an alien is patrolling. There's also some hex earlier in this thread that sets it true for fleeing aliens (which is in Long War). However, I'm not sure whether having it set true always makes the alien's move count as dashing or whether it simply allows the dashing double move pathlength.

Link to comment
Share on other sites

Hey Amineri,

 

Just wanted to chime in one last time and say that following your instructions worked wonderfully.

 

Alien turns are a bit longer now, but not unreasonably so (I actually like it in fact, builds up more tension). In return, Aliens do walk around the map instead of teleporting around, patrols I spot with battle scanners no longer warp away and aliens converge into the action areas in a realistic way. Also, these changes seem to have the effect of making alien patrols stumble into the XCOM team more often on their own. Not sure if you intended this last thing, but it is awesome.

 

All in all, very pleased with these changes. Thanks a lot for sharing.

Link to comment
Share on other sites

  • 2 months later...

Amineri, I took a liberty of making a ToolBoks Mod out of your AI changes hex code, posted in this topic. Can I upload it to Nexus or send it to you, so you could check and upload it yourself?

 

PS I also made a ToolBoks Mod for your Revive Fix to use it with your XCOM Bug Fixes. Can you include it in your Bug Fixes too?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...