Opened 4 years ago

Closed 4 years ago

#5788 closed defect (fixed)

Gathering/hunting infinite loop r23796

Reported by: Silier 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 Silier 4 years ago.
replay

Download all attachments as: .zip

Change History (9)

by Silier, 4 years ago

Attachment: commands.txt added

replay

comment:1 by Silier, 4 years ago

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

comment:2 by Silier, 4 years ago

Owner: set to Silier

comment:3 by Silier, 4 years ago

Cc: wraitii added
Owner: Silier 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 Silier, 4 years ago

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

comment:5 by Stan, 4 years ago

Maybe Phab:D2791 would help?

comment:6 by wraitii, 4 years 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, 4 years ago

Owner: set to wraitii
Patch: Phab:D2920

comment:8 by wraitii, 4 years 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.