Just to bring some updates on the platform I've been working on.
V4 is coming! I've stopped adding any new features in favor of clean up the code structure which will make everything easier for everyone.
Below you will find some of the big differences between v3 and v4:
- A full folders restructure, everything is been moved into a "src" folder and split in modules which are called from server or client.
- A "Managers" structure was implemented in the code which are used to handle different stuff. Everything will be documented in time, but for example we have the Config Manager or the features Manager to load and handle all the saved values in the storage.
- A lot of name conventions are been followed to make everything easier to find (but this may still change).
- Almost all the Promises were replaced by async/await and a small fix for Parcel (to include Babel plugin-transform-runtime), was introduced to handle the async/await on the client side.
- All the hardcoded queries were removed and Objection JS was implemented to handle all models. If you are not related to Objection JS I've strongly recommend you to check on it, it is not an ORM but like they claim an "enhanced query builder" and is based on Knex JS so if you know Knex you will love Objection: https://vincit.github.io/objection.js/
- The migrations system was re-implemented as well using Knex migrations, so now everything is under the same module.
- All the hardcoded HTML code is been removed and replaced by templates. Mustache was implemented for this matter in combination of Phaser DOM and the scenes preload, this way we were able to preload the templates and then parse it with Mustache before render.
- Almost all the TODO's related to configurable values from the database were completed, and the plan is to clean up all the ones related to issues that were avoided with some "code hack".
- The database structure was fully modified, all the JSON type fields were removed, and all the data was split in several related tables.
- The introduction of users / players difference was implemented to prepare the platform to allow users have multiple players created in the future.
- Players "status" now has it's own schema and players "stats" are handled in a private way using room messages.
- Physics module is now are prepared to handle multiple collisions and not only players-walls.
- Chat module was implemented as feature and it can be enabled/disabled from the config now.
- All the code is been commented and documented.
- Colyseus and Phaser are been upgraded to each available last version (as for this post Colyseus 0.11.15 and Phaser 3.19.0).
Thought this is still a work in progress you can find the code in the v4 branch: https://github.com/damian-pastorini/reldens/tree/v4.0.0
And the example database: https://www.dwdeveloper.com/media/reldens/reldens-install-v4.0.0-2019-09-30.sql
- After finish with the full refactor (a lot of client side is still old), the idea is to implement a lot of custom callbacks (beside the ones you can already use from Colyseus or Phaser), in order to make the platform work as package.
- Implement the most basic important pending features: password recovery, NPC and enemies, collisions between players-enemies-NPC's, and add some basic examples for animations in the maps.
- And after these items then continue with the road map: https://github.com/damian-pastorini/reldens/wiki/Road-Map
As you can see V4 will be basically fully incompatible with the priors, it will be a fresh start but if you have any custom maps already created those will still work as the same in v3, you will only need to push the proper values in the database since the structure changes.
I hope you like it! Any feedback will be welcome!