#6580 closed defect (fixed)

Trouble with merging formations

Reported by: Langbart Owned by: Freagarach
Priority: Release Blocker Milestone: Alpha 26
Component: Simulation Keywords: regression
Cc: Patch: Phab:D4727

Description

Issue No.1 - conversion check

This issue was first reported by andy5995 in the forum

errors

ERROR: JavaScript error: simulation/components/Formation.js line 931
Script value conversion check failed: v.isString() || v.isNumber() || v.isBoolean() (got type undefined)
  Formation.prototype.ComputeMotionParameters@simulation/components/Formation.js:931:16
  Formation.prototype.AddMembers@simulation/components/Formation.js:449:7
  Formation.prototype.ShapeUpdate@simulation/components/Formation.js:973:8
  Timer.prototype.OnUpdate@simulation/components/Timer.js:139:44
ERROR: Script message handler OnUpdate failed

to reproduce

Note: The steps for reproduction could not be clearly determined, the following points only increase the probability of the error occurring.

  • Start a map with three unit groups, each with at least 4 entities.
  • Position them far apart and select them all.
  • First choose the None formation and after that the Box formation
  • Units should not come together, but only form a formation at the position they are currently at.
  • Now order all three groups to come together by clicking at the center point.
  • Check the images below and the first minute of the attached replay for more clarity: conversion_check.txt

possible solution for issue no.1

  • binaries/data/mods/public/simulation/components/Formation.js

    a b Formation.prototype.ShapeUpdate = function()  
    969969        // Merge the members from the twin formation into this one
    970970        // twin formations should always have exactly the same orders.
    971971        let otherMembers = cmpOtherFormation.members;
     972        if (otherMembers.length == 0)
     973            continue;
    972974        cmpOtherFormation.RemoveMembers(otherMembers);
    973975        this.AddMembers(otherMembers);
    974976        Engine.DestroyEntity(this.twinFormations[i]);

Issue No.2

It is related to problem no. 1. If the group is not successfully merged, there is a big problem that prevents any interaction with the game when trying to select certain units that have not been successfully merged into the new large formation.

errors

ERROR: JavaScript error: gui/session/selection.js line 500
GetEntityState(...) is null
  EntitySelection.prototype.addFormationMembers@gui/session/selection.js:500:39
  EntitySelection.prototype.setHighlightList@gui/session/selection.js:433:20
  handleInputBeforeGui@gui/session/input.js:529:16

to reproduce

Note: The steps for reproduction could not be clearly determined, the following points only increase the probability of the error occurring.

  • Try the steps from issue no.1 with a mixture of different unit types.
  • This might take multiple runs to occur.
  • Watch the replay GetEntityState_null.txt till 50 seconds have gone by and then try to select all the units that have tried to merge.

bisect

(not yet)

reproducible

Could not trigger any of the errors described above in A25b, I guess the problem must have been introduced after [25860].

additional notes

Tested on [26983] with default settings.

Attachments (6)

merge_gone_wrong.jpg (177.3 KB ) - added by Langbart 22 months ago.
GetEntityState_null.txt (12.6 KB ) - added by Langbart 22 months ago.
conversion_check.txt (21.6 KB ) - added by Langbart 22 months ago.
conversion_check.jpg (187.8 KB ) - added by Langbart 22 months ago.
conversion_check_fail.jpg (197.4 KB ) - added by Langbart 22 months ago.
2022-06-27_0002.zip (661.3 KB ) - added by Andy Alt 22 months ago.
saharan oases replay + interestinglog.html 2v3AI

Download all attachments as: .zip

Change History (11)

by Langbart, 22 months ago

Attachment: merge_gone_wrong.jpg added

by Langbart, 22 months ago

Attachment: GetEntityState_null.txt added

by Langbart, 22 months ago

Attachment: conversion_check.txt added

by Langbart, 22 months ago

Attachment: conversion_check.jpg added

by Langbart, 22 months ago

Attachment: conversion_check_fail.jpg added

comment:1 by Stan, 22 months ago

Hey,

Thanks again for the very detailed report. It's nice to see all one can see with markdown, you seem to have mastered it :)

Could be Phab:rP26956, or Phab:rP26893.

Sounds like it might happen often so it is indeed a release blocker. I hope Freagarach will have some time after the weekend :/

This is blocking for RC2 as well.

comment:3 by Freagarach, 22 months ago

Component: Core engineSimulation
Keywords: regression added
Owner: set to Freagarach
Patch: Phab:D4727

Thanks for the thorough report. :)

comment:4 by Andy Alt, 22 months ago

Since I reported that a few days ago, I haven't played any games until today. Me and Jammy again vs AI. we played 2 games. The first one was short, maybe 20 minutes. Second game (same setup) was over an hour. Scripting error happened on the second game. We both used the latest git version at commit 74a0875.

I'll attach the replay and interestinglog

by Andy Alt, 22 months ago

Attachment: 2022-06-27_0002.zip added

saharan oases replay + interestinglog.html 2v3AI

comment:5 by Freagarach, 22 months ago

Resolution: fixed
Status: newclosed

In 26993:

Fix formation merging issues.

The motion parameters were calculated even without members, which caused us to try set a undefined passclass.
Also were members added to previously merged twin-formations. Once merged (i.e. disbanded), they are moved out of world now.

Some cleanups/deduplication whilst at it.

Reported by: @andy5995 at the forums (https://wildfiregames.com/forum/topic/71578-feedbacks-from-a26-svn-tests/page/8/#comment-505078)
Differential revision: https://code.wildfiregames.com/D4727
Comments by: @Langbart, @marder
Tested by: @Langbart
Fixes #6580

Note: See TracTickets for help on using tickets.