Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Anton Gustafsson
@antag99
Yeah, and not understanding what the hell the code does - one of the major selling points of open source.
Shaun Reich
@sreich
Fair point :)
Although I think the set of people who would work on an ECS wouldn't be phased by that
ECS is rather complex to begin with
What are you gonna be doing with lock step?
Anton Gustafsson
@antag99
Writing a simple game that uses it and trying to make it work well.
Shaun Reich
@sreich
Sounds like a fun challenge
Anton Gustafsson
@antag99
Do you want a PR for switching to LWJGL 3? (Not compatible with gdx-tools ATM)
Shaun Reich
@sreich
@antag99 yep that'd be nice
I didn't realize that backend was stableish yet
Anton Gustafsson
@antag99
Should I switch to packing textures on the fly with PixmapPacker instead of relying on gdx-tools? The problem is that gdx-tools depends on the LWJGL 2 backend, which clashes with the LWJGL 3 one.
Shaun Reich
@sreich
@antag99 yeah that sounds fine
Hmm, does it have the same settings?
Shaun Reich
@sreich
Awesome
@antag99 I did actually notice there's a performance regression when it comes to cloning an entity. Tracked it down to a line in the world, cloneEntity
Shaun Reich
@sreich
Looked like it was taking 400ms when cloning an item component for some reason
Anton Gustafsson
@antag99
Hmm
Sounds like it's my fault :D
Shaun Reich
@sreich
Maybe it's got a ton of properties to walk
Haha
Yeah you'll notice it if you hit 2 and then 4 and go back again. Or just scroll the wheel
I can't remember if it happens every time or just the first time
Anton Gustafsson
@antag99
Well, I think it caches the thing the first time
Shaun Reich
@sreich
Yeah that's what I thought
Anton Gustafsson
@antag99
Seems strange that it would be slow
Shaun Reich
@sreich
Yeah
Anton Gustafsson
@antag99
I'll look into it once I'm done with this LWJGL 3 thing
Shaun Reich
@sreich
OK thanks
Anton Gustafsson
@antag99
Does Throwable.printStackTrace() actually compile on your machine? Seems like it was removed in Kotlin 1.1.
Shaun Reich
@sreich
Yeah
Isn't that from Java?
Anton Gustafsson
@antag99
Kotlin defines another Throwable in their stdlib, which I think is magically removed by the compiler.
Anton Gustafsson
@antag99
Turns out my setup was broken... nevermind.
Anton Gustafsson
@antag99
#5
Anton Gustafsson
@antag99
I've found the culprit: Kotlin's reflection library is slow. The first cache time can be reduced by invoking reflection methods on another unrelated class, but ideally the caches should be created at startup.
Shaun Reich
@sreich
Ouch, I was afraid of that
Wonder how it's that slow, heh
Anton Gustafsson
@antag99
I think it would be helpful to register all component types
Shaun Reich
@sreich
That sounds like a good idea
Anton Gustafsson
@antag99
Well, it emulates the kotlin lang on top of regular java reflection
Shaun Reich
@sreich
Ah
Anton Gustafsson
@antag99
Seems like it was written for elegance rather than performance
IDK
Registering component types would also allow for a cleaner cloneEntity implementation.
Shaun Reich
@sreich
That'd be nice :)
How would registering all component types help? Just to warm the cache?
Btw what specific method in kotlin reflect is slow? Wondering if it's a known issue or if I should report it
Anton Gustafsson
@antag99
Should really write benchmarks for it
The bottleneck occurs when invoking KClass.members.