Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allyground_attackrange_gl4 reporting zombies #4031

Open
saurtron opened this issue Dec 17, 2024 · 4 comments
Open

allyground_attackrange_gl4 reporting zombies #4031

saurtron opened this issue Dec 17, 2024 · 4 comments
Labels
Bug Something isn't working

Comments

@saurtron
Copy link
Collaborator

saurtron commented Dec 17, 2024

Description

This is because engine isn't actually removing from selection handler when units get killed. Can be solved by beyond-all-reason/spring#1824 if that gets accepted, otherwise we can work around, but there might be an unknown number of widgets/gadgets with the same problem.

Expected Behaviour

Shouldn't be reporting zombies, specially in xmas XD

Actual Behaviour

Reports zombies

Reproduction steps

Can be reproduced using the test and dbg_test_runner "fix" at this branch: https://github.com/saurtron/Beyond-All-Reason/tree/test-selection-destroy check instructions at the above engine issue.

Backtrace

[t=00:47:39.115268][f=0021436] TraceFullEcho:[allyground_attackrange_gl4	]
1: popElementInstance  @LuaUI/Widgets/Include/instancevbotable.lua:491 Locals:(iT={myName:allyground_attackrange_gl4, primitiveType:4, VAO:<userdata>, zombies:<table>, makeVAOandAttach:<function>, }[#28]; instanceID=11100811; noUpload=nil; oldElementIndex=1; lastElementIndex=7; lastElementInstanceID=1125756; iTStep=24; endOffset=144; oldOffset=0; instanceData={1:3944.63745, 2:316.712006, 3:1124.28015, 4:140, 5:1, }[#1200])
2: RemoveSelectedUnit  @LuaUI/Widgets/gui_attackrange_gl4.lua:585 Locals:(unitID=811; mouseover=true; collections={811:<table>, }[#1]; removedRings=0; collection={posx:3275.30249, posy:315.015625, allied:true, unitDefID:99, vaokeys:<table>, }[#6]; (for generator)=<function>; (for state)={11100811:allyground, }[#1]; (for control)=11100811; instanceKey=11100811; vaoKey=allyground)
3: ??
4: pcall  @=[C]:-1 Locals:()
5: Update  @LuaUI/barwidgets.lua:711 Locals:(w={DrawWorldPreUnit:<function>, uploadAllElements:<function>, LUAUI_DIRNAME:LuaUI/, VFS:<table>, tostring:<function>, }[#103])
6: func  @LuaUI/barwidgets.lua:1276 Locals:(self=??; deltaTime=0.0053014; (for generator)=<function>; (for state)={1:<table>, 2:<table>, 3:<table>, 4:<table>, 5:<table>, }[#76]; (for control)=16; _=16; w={DrawWorldPreUnit:<function>, uploadAllElements:<function>, LUAUI_DIRNAME:LuaUI/, VFS:<table>, tostring:<function>, }[#103])
7: Update  @LuaUI/barwidgets.lua:852 Locals:()
8: ??
@saurtron saurtron added the Bug Something isn't working label Dec 17, 2024
@sprunk
Copy link
Collaborator

sprunk commented Dec 17, 2024

Isn't it expected for there to be zombies until the next frame? GL4 batches updates to GameFramePost.

@saurtron
Copy link
Collaborator Author

Isn't it expected for there to be zombies until the next frame? GL4 batches updates to GameFramePost.

I don't think so, otherwise why the warnings? The proposed fix solves this too, note in this case it's just a warning, but in other similar situations it can be worse. Actually in this case it's not so good because I think that requires the vbo code to be doing a lot of extra checks to ensure consistency.

@sprunk
Copy link
Collaborator

sprunk commented Dec 17, 2024

I think that requires the vbo code to be doing a lot of extra checks to ensure consistency.

Make the VBO use RenderUnitDestroyed, which is the one after which the unit is definitely gone. There isn't supposed to be any inconsistency at any point before this (incl. after UnitDestroyed).

@saurtron
Copy link
Collaborator Author

saurtron commented Dec 17, 2024

Make the VBO use RenderUnitDestroyed, which is the one after which the unit is definitely gone. There isn't supposed to be any inconsistency at any point before this (incl. after UnitDestroyed).

but that's too late, all those widgets don't really want the killed unit to be relevant

and btw, checking at #error-reports, I think there's a few more widgets affected, this is just the first one I have investigated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants