eliasku / ecx

ECX is Entity Component System framework for Haxe
52 stars 10 forks source link

update while updating #7

Closed Misiur closed 8 years ago

Misiur commented 8 years ago

I encountered a rather cryptic error:

D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(phys.component.MovementCollisionData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-0 spec-0 phys.component.MovementCollision
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #0 phys.component.MovementCollision
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-1 spec-1 phys.system.ShadowPositionSystem
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-2 spec-2 phys.system.MovementSystem
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-3 spec-3 phys.system.CollisionPositionSystem
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-4 spec-4 phys.system.BulletCollisionSystem
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-5 spec-5 EntityCreator
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(phys.component.BulletCollisionData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-6 spec-6 phys.component.BulletCollision
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #1 phys.component.BulletCollision
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(gameplay.component.LifeData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-7 spec-7 gameplay.component.Life
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #2 gameplay.component.Life
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-8 spec-8 gameplay.system.DelayedBulletSystem
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-9 spec-9 gameplay.system.BulletAgeSystem
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(gameplay.component.BulletData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-10 spec-10 gameplay.component.Bullet
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #3 gameplay.component.Bullet
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-11 spec-11 input.system.WeaponControlSystem
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-12 spec-12 input.Input
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(input.component.WeaponControlsData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-13 spec-13 input.component.WeaponControls
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #4 input.component.WeaponControls
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(gameplay.component.DelayedBulletData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-14 spec-14 gameplay.component.DelayedBullet
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #5 gameplay.component.DelayedBullet
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-15 spec-15 input.system.MotionControlSystem
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(input.component.MotionControlsData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-16 spec-16 input.component.MotionControls
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #6 input.component.MotionControls
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-17 spec-17 input.system.InventoryControlSystem
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(gameplay.component.WeaponData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-18 spec-18 gameplay.component.Weapon
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #7 gameplay.component.Weapon
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(gameplay.component.ShipData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-19 spec-19 gameplay.component.Ship
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #8 gameplay.component.Ship
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(input.component.InventoryControlsData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-20 spec-20 input.component.InventoryControls
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #9 input.component.InventoryControls
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-21 spec-21 display.system.SailPositionSystem
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(gameplay.component.SailData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-22 spec-22 gameplay.component.Sail
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #10 gameplay.component.Sail
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-23 spec-23 effect.system.ShadowSystem
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(effect.component.ShadowData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-24 spec-24 effect.component.Shadow
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #11 effect.component.Shadow
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(effect.component.DropsShadowData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-25 spec-25 effect.component.DropsShadow
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #12 effect.component.DropsShadow
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-26 spec-26 core.system.EnterFrameSystem
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-27 spec-27 ai.system.PatrolSystem
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-28 spec-28 ai.system.FollowSystem
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(phys.component.MotionData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-29 spec-29 phys.component.Motion
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #13 phys.component.Motion
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(ai.component.FollowerData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-30 spec-30 ai.component.Follower
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #14 ai.component.Follower
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-31 spec-31 util.ShapeDebug
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-32 spec-32 util.FPS
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-12 spec-33 input.Keyboard : input.Input
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-33 spec-34 core.GameConfig
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-34 spec-35 display.system.Renderer
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-35 spec-36 gameplay.system.GameManagerSystem
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(gameplay.component.GameStateData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-36 spec-37 gameplay.component.GameState
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #15 gameplay.component.GameState
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(ai.component.PatrollingData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-37 spec-38 ai.component.Patrolling
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #16 ai.component.Patrolling
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(display.component.RenderData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-38 spec-39 display.component.Render
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #17 display.component.Render
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-39 spec-40 ecx.common.systems.TimeSystem
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-40 spec-41 ecx.common.systems.SystemRunner
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-41 spec-42 ecx.common.systems.FsmSystem
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-42 spec-43 ecx.common.systems.FpsMeter
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-43 spec-44 ecx.common.components.Name
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #18 ecx.common.components.Name
D:/Dev/ecx-dev/src/ecx/macro/AutoCompBuilder.hx:190: No copy for: TInst(ecx.common.components.FsmData,[])
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:23: > (S) type-44 spec-45 ecx.common.components.Fsm
D:/Dev/ecx-dev/src/ecx/macro/MacroBuildDebug.hx:31: > [C] #19 ecx.common.components.Fsm
update while updating
    at ecx::World/changeEntities()[D:/Dev/ecx-dev/src/ecx/World.hx:371]
    at ecx::World/invalidate()[D:/Dev/ecx-dev/src/ecx/World.hx:165]
    at ecx.common.systems::SystemRunner/updateFrame()[D:/Dev/ecx-common/src/ecx/common/systems/SystemRunner.hx:38]
    at core.system::EnterFrameSystem/onEnterFrame()[Source/core/system/EnterFrameSystem.hx:22]
imm1
    at ecx.types::FamilyData/debugLock()[D:/Dev/ecx-dev/src/ecx/types/FamilyData.hx:100]
    at ecx.managers::WorldDebug$/lockFamilies()[D:/Dev/ecx-dev/src/ecx/managers/WorldDebug.hx:28]
    at ecx::World/invalidate()[D:/Dev/ecx-dev/src/ecx/World.hx:160]
    at ecx.common.systems::SystemRunner/updateFrame()[D:/Dev/ecx-common/src/ecx/common/systems/SystemRunner.hx:35]
    at core.system::EnterFrameSystem/onEnterFrame()[Source/core/system/EnterFrameSystem.hx:22]

It appears when I create a new entity in OnEntityAdded of some another system. I can't reproduce it in clean repository. world.create() is all it takes, even with comented out world.commit and component adding code it happens. Any ideas how can I debug it further?

eliasku commented 8 years ago

What it was: during changing entities (changing bits on families), you trap into the onEntityAdded, then you create entity, and world mark it as dirty, the changed vector is growing during the changes updating phase, then ecx_debug assert fired because start and finish set of entities count doesn't match. So it was just paranoia assert left by me long time ago.

So now I finally allow create/commit/destroy entities during the invalidation "change" phase.

Fix is on develop. Please, try reproduce.

Misiur commented 8 years ago

Works perfectly, thank you!

eliasku commented 8 years ago

@Misiur you are welcome :)