Opened 3 months ago

Closed 7 weeks ago

#5788 closed defect (fixed)

Gathering/hunting infinite loop r23796

Reported by: Angen Owned by: wraitii
Priority: Release Blocker Milestone: Alpha 24
Component: Simulation Keywords:
Cc: wraitii Patch: Phab:D2920

Description

Attachments (1)

commands.txt (316.4 KB ) - added by Angen 8 weeks ago.
replay

Download all attachments as: .zip

Change History (9)

by Angen, 8 weeks ago

Attachment: commands.txt added

replay

comment:1 by Angen, 8 weeks ago

Summary: Crash without logs and dumpsCrash without logs and dumps r23796

comment:2 by Angen, 8 weeks ago

Owner: set to Angen

comment:3 by Angen, 8 weeks ago

Cc: wraitii added
Owner: Angen removed

We have here infinite loop indeed.

wraitii not sure which commit did it, but I think you touched code around hunt and gathering mostly, could you investigate, I am a bit lost in its maze, I believe you have better understanding of that part.

		if (this.log)
				warn(this.entity + " -> new state");
		if (this.CheckTargetRange(this.order.data.target, IID_ResourceGatherer))
			this.SetNextState("INDIVIDUAL.GATHER.GATHERING");
		else
			this.SetNextState("INDIVIDUAL.GATHER.APPROACHING");
WARNING: 7941 FINDINGNEWTARGET.enter

WARNING: 7941 Order.Gather

WARNING: 7941 -> new state

WARNING: 7941 FINDINGNEWTARGET.leave

WARNING: 7941 FINDINGNEWTARGET.enter

WARNING: 7941 Order.Gather

WARNING: 7941 -> new state

WARNING: 7941 FINDINGNEWTARGET.leave

WARNING: 7941 FINDINGNEWTARGET.enter

WARNING: 7941 Order.Gather

WARNING: 7941 -> new state

WARNING: 7941 FINDINGNEWTARGET.leave

WARNING: 7941 FINDINGNEWTARGET.enter

WARNING: 7941 Order.Gather

WARNING: 7941 -> new state

WARNING: 7941 FINDINGNEWTARGET.leave

WARNING: 7941 FINDINGNEWTARGET.enter

WARNING: 7941 Order.Gather

WARNING: 7941 -> new state

WARNING: 7941 FINDINGNEWTARGET.leave

WARNING: 7941 FINDINGNEWTARGET.enter

WARNING: 7941 Order.Gather

WARNING: 7941 -> new state

WARNING: 7941 FINDINGNEWTARGET.leave

WARNING: 7941 FINDINGNEWTARGET.enter

WARNING: 7941 Order.Gather

WARNING: 7941 -> new state

WARNING: 7941 FINDINGNEWTARGET.leave

WARNING: 7941 FINDINGNEWTARGET.enter

WARNING: 7941 Order.Gather

WARNING: 7941 -> new state

WARNING: 7941 FINDINGNEWTARGET.leave

WARNING: 7941 FINDINGNEWTARGET.enter

WARNING: 7941 Order.Gather

WARNING: 7941 -> new state

WARNING: 7941 FINDINGNEWTARGET.leave

WARNING: 7941 FINDINGNEWTARGET.enter

WARNING: 7941 Order.Gather

WARNING: 7941 -> new state

WARNING: 7941 FINDINGNEWTARGET.leave

WARNING: 7941 FINDINGNEWTARGET.enter

comment:4 by Angen, 8 weeks ago

Summary: Crash without logs and dumps r23796Gathering/hunting infinite loop r23796

comment:5 by stanislas69, 8 weeks ago

Maybe Phab:D2791 would help?

comment:6 by wraitii, 8 weeks ago

Thanks for the investigation, I'm taking over, should be relatively straightforward to fix with a replay.

The obvious suspect is Phab:rP23742, but that diff is conceptually correct so this likely means that we're using different checks in different places.

comment:7 by wraitii, 8 weeks ago

Owner: set to wraitii
Patch: Phab:D2920

comment:8 by wraitii, 7 weeks ago

Resolution: fixed
Status: newclosed

In 23920:

Fix gathering infinite loop when the gatherer is out of the world.

Promoted units move out of the world but keep their current orders, which can trigger invalid states.
As cleanup, handle this case in GATHER.FINDINGNEWTARGET

A more general fix seems possible by putting the UnitAI in a default state.

Reported by: psypherium

Reviewed By: Angen

Fixes #5788

Differential Revision: https://code.wildfiregames.com/D2920

Note: See TracTickets for help on using tickets.