[FEATURE] Debugging invalid references.
See original GitHub issueas a framework user I want to log when and where entities are created or destroyed. So that I can debug reference issues.
Criteria (edit after discussion)
- Debug plugin
- Ability to detect illegal access to components and entities.
- Ability to report the cause (for example, delete issued in class@linenumber).
- Ability to log all lifecycle events (optional).
- Expose all debug information to ECS (via components).
- Lifecycle naming of entities for easy tracking.
- Extend/replace logging and naming.
- Plug and play.
- Lifecycle listener plugin.
- Intended to augment editors and debuggers.
- Can be disabled. No performance impact when disabled.
- Hook into lifecycle events for Entities and Components.
- Hook into lifecycle events for World (?)
- Plug and play.
Code example
To log all calls coming from net.mostlyoriginal
package.
WorldConfigurationBuilder.with(DebugPlugin.thatLogsErrorsIn("net.mostlyoriginal"))
log output (Proof of concept)
NotableNautilus(1) CREATE @ net.mostlyoriginal.game.system.map.TiledMapManager.createLayerEntity(TiledMapManager.java:85)
.. net.mostlyoriginal.game.system.map.TiledMapManager.load(TiledMapManager.java:73)
.. net.mostlyoriginal.game.system.map.TiledMapManager.initialize(TiledMapManager.java:62)
NotableNautilus(1) DELETE @ net.mostlyoriginal.game.system.map.TiledMapManager.createLayerEntity(TiledMapManager.java:90)
.. net.mostlyoriginal.game.system.map.TiledMapManager.load(TiledMapManager.java:73)
.. net.mostlyoriginal.game.system.map.TiledMapManager.initialize(TiledMapManager.java:62)
*********************
NotableNautilus(1) ERROR_ATTEMPT_TO_DELETE_DELETED_ENTITY @ net.mostlyoriginal.game.system.map.TiledMapManager.createLayerEntity(TiledMapManager.java:91)
.. net.mostlyoriginal.game.system.map.TiledMapManager.load(TiledMapManager.java:73)
.. net.mostlyoriginal.game.system.map.TiledMapManager.initialize(TiledMapManager.java:62)
Cause (Already deleted at):
NotableNautilus(1) DELETE @ net.mostlyoriginal.game.system.map.TiledMapManager.createLayerEntity(TiledMapManager.java:90)
.. net.mostlyoriginal.game.system.map.TiledMapManager.load(TiledMapManager.java:73)
.. net.mostlyoriginal.game.system.map.TiledMapManager.initialize(TiledMapManager.java:62)
*********************
Background
While attempting to refactor a Jam game into a more best practices example for ECS I’m running into a lot of bugs related to expired id references, even with the help of @EntityId
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:57 (26 by maintainers)
Top Results From Across the Web
Feature request [warning for invalid references before ...
It's only possible to find out about Invalid references when trying to publish from the collaboration branch.
Read more >More verbosity for "invalid reference format" message #36545
it can happen that a glitch in the YAML causes the message "invalid reference format", and this is very hard to debug.
Read more >Invalid Reference Error - OutSystems 10 Documentation
You have a Reference to an Action that has a Parameter in which the definition includes a Multi-tenant entity and the Show Tenant...
Read more >How do I debug an "Invalid face reference: quote" message?
After using Emacs for some time, the message Invalid face reference: quote starts popping up in my message buffer. I'm not sure what...
Read more >NuGet References invalid when changed to Release build ...
For unknown reason, debug build went just fine with invalid paths (probably the assemblies are gathered some other way, as I manually ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
PoC done! 😃 Just need to pivot subclasses to
@Graft
s.I’m happy how graftt turned out on contrib. Thanks for that @junkdog! Travis build is passing. This ticket is pretty much done, just waiting for some snapshots to release and then we have a go!