question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE] Debugging invalid references.

See original GitHub issue

as 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:closed
  • Created 4 years ago
  • Comments:57 (26 by maintainers)

github_iconTop GitHub Comments

1reaction
DaanVanYperencommented, May 16, 2019

PoC done! 😃 Just need to pivot subclasses to @Grafts.

image

0reactions
DaanVanYperencommented, Oct 13, 2019

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found