Player move Player is about to be pushed on v4 branch!
Best posts made by dpastorini
Considering how much behind the v3 was getting I've decided to do a beta release for v4!
This version is available on NPM:
And the installation is easier than before:
For that matter I've created an Skeleton repository:
The dev server was updated as well http://dev.reldens.com
And between all the huge refactor now you will find:
- Almost everything now works based in events, so this will allow you implement a lot of customizations without need to rewrite almost anything.
- In any case there are still some configuration files and the idea of having a "game-theme" was implemented, so you could easily use the skeleton theme for start.
- At the same time a lot more stuff is now configurable just by changing some values in the database.
- Maps animations were implemented (in the skeleton example you can see the river moving).
- Objects with animations are also available in both public (broadcast), and private (for single client). For example: the doors will open > the player will change the room > but for the other users that are seeing the door open, a few seconds later the door will be closed.
- A basic NPC was implemented. NPC's are used like another object type that will just respond on specific actions. In the skeleton example you can click on the NPC (the guy with the hat) and it will show a message.
- Targets System was implemented, you can click on any player or NPC, and the target will be selected.
- With targets, short distance attacks are now available, if you are close enough to a player and click on it, then you can click on the action button or press the space bar to attack (for now we only have that action).
- Related to attacks, the stats are now affected, atk and def are (for now) simple compared to validate the attack, and when the attack success (for now always since the atk and the def are the same for all the players), the HP will be reduced.
- And for last! Now we have the Game-Over event when a player that die will be kicked out! Sorry, that was the quickest thing I was able to come up with.
In terms of roadmap, issues and progress tracking I've started to complete the project board with all the tasks: https://github.com/damian-pastorini/reldens/projects/2
Hope you like all the new improvements, I'll keep adding new stuff and fixing the parts that can be improved.
I'm back on the project and v4.0.0-beta.7 is about to be released!
What's included in this beta?
- Issues fixed! 5 issues were reported and the 5 were fixed https://github.com/damian-pastorini/reldens/issues
- Battle mode is been implemented, you will be able to start a battle and set a battle time-off which will be considered after the last player attack (still incomplete since there are none rules for what happens on this mode, but it's already available to setup any).
- PvP with (for now), short distance attack was implemented using the battle mode.
- A new "Forest" map was included with some enemies. PvE is still in progress but will be available with the beta.7 release.
- A path finder was implemented (though it still can be improved, it's working for a start point), now you can click on the scene and the player will move to that point. With this implementation enemies will also go after you.
- Health bar is now visible for the current player.
- Some new animations are been implemented and others were fixed: hit player and die.
- All dependencies were updated: Colyseus 0.12.x, Phaser, etc.
Here's a small video to show you the progress!
The promised is a debt!
Before anything please consider that this is my first implementation ever!
I've never used neither Node.js, even less Parcel, Colyseus or Phaser, my world before this first incursion in game development was all about PHP and Magento, so that should give you an idea from where I'm coming.
This quite awful but working example took me 75hs, including the time I've used for research and for decide which platform use for the server and the client.
After all the research, Node + Colyseus and Phaser 3 looked as the better start point since I was familiar with JS and HTML of course but had zero knowledge about Unity (the other option I would like to use), but I've prefered make the learn curve not so slow.
This is a really simple base MMORPG game created based on the Colyseus samples:
And on the Phaser 3 implementation from Jacky Rusly:
As you will see I've considerable modified how the jrgame was interacting with Socket.io in order to make it work as how the Colyseus example was working, I've thought that was the better way to do it (follow up on server ready samples and break apart the client :P sorry Jacky!)
The game basics are login through DB, loader, scene change, players sync, but nothing like chat, items, or attacks was implemented here (so far).
Here's the link to the repo:
Please feel free to create any tickets or pull requests for questions, fixes or improvements, I would love to get good feedback!
I don't have a public link to show it yet but I'm planning to create a dev server soon (for now you will need to install it and run it to see it), at the end it will look like:
But you will see the login screen first which in the server side will connect to the DB and all the players sync was done with Colyseus.
I saw comments from people looking for Colyseus integrated with a DB engine (in this case I've chosen MySQL), so at least that part should be useful.
I really hope this help more than one person, maybe someone like me who would loved to get this as starting point.
A few months ago I've started my project using Colyseus and Phaser 3:
After hit a few walls and considering it was my first project it took me some time until I was able to get the physics working on the server to avoid cheating.
The way I get it done was using Phaser physics engine P2JS: https://github.com/schteppe/p2.js
Doing this I was able to avoid an overhead of modules and stuff required to run a headless Phaser.
Here I bring for you a small example of how to recreate a Tiledmap using P2JS:
I'm still finishing the dwdgame version 1.2.6 in which this demo will be fully integrated.
Hope you like it, and please I would love to get any feedback!
hi @stromkuo , that's not the way it works, clients can join or create rooms but not "host" a room.
The way you could achieve something like that would be with a custom implementation where you allow only an specific client to create rooms and the other ones only join those rooms if were already created.
Also, you could save in the room metadata which user create it and give it more "features" than to the other joined clients, but again Colyseus by default will handle the server-client communication and sync, everything else will be on your own.
hi @shashank , yes, those doesn't exist anymore in 0.11.
V3 of my project Reldens was released! Hope you like it!
Features list: https://github.com/damian-pastorini/reldens/wiki/Features
The demo: http://dev.reldens.com/
I would love to get any feedback! Thanks!
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!
Hi @endel , @codestitch , side-note, beside the allowReconnection I though some additional will be required to make it work, like express-session or so? https://www.npmjs.com/package/express-session
Here is the related topic: https://discuss.colyseus.io/topic/139/persistent-sessions/4
hi @ttcong194 , that's a really generic question, it will all depend on your game logic and the type of tournament you like to create.
In any case there's none recipe for that, I would recommend to check on split matches by rooms (in which you can set a max users limit), and then use a general one to keep track of the general tournament progress (users can be connected to multiple rooms at the same time).
Hope this give you some ideas.