mws262 / qwop-controls

0 stars 0 forks source link

Unifying multi and single-threaded games with Box2D optimizations #12

Closed mws262 closed 5 years ago

mws262 commented 5 years ago

With the JBox2D library, it was not normally possible to run two independent copies of the game without clashing over static fields. Previously, this had been solved by having many classloaders and tons of reflection to get methods and fields. JBox2D has been moved into the rest of the source and cleaned up considerably. Many non-applicable features have been removed. Object pooling (which had been implemented inside JBox2D) has been removed and replaced with once-allocated fields when possible. Done some profiling to optimize. Many of the classes have been made Externalizable to make serializing more efficient. Now, there is a single copy of the game which can work in single or multithread applications without reflection and multiple classloaders. Copies of the game can be serialized with the FST library which seems pretty fast so far.