Jump to content

Base MMORPG - Node, MySQL, Colyseus, Parcel and Phaser 3


Damian Pastorini
 Share

Recommended Posts

Hi everyone!

Before anything I wasn't sure if this was the correct place to post this, please moderators move it as you consider if this should go to some other place like Projects and Demos.

https://github.com/damian-pastorini/dwdgame

Also, 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.

So....

This is a really simple base MMORPG game created based on the Colyseus samples:
https://github.com/gamestdio/colyseus-examples

And on the Phaser 3 implementation from Jacky Rusly:
https://github.com/jackyrusly/jrgame

As you will see I've considerable modified how the jrgame was interacting with Socket.io in order to make it works 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:
https://github.com/damian-pastorini/dwdgame

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:
https://jrgame.herokuapp.com
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 love to get this as starting point.

Best,
Damian

Link to comment
Share on other sites

Hi @Wavertron, almost all the other implementations I saw were made with plain Socket.io / WebSockets, and all the sessions handlers and states sync were done "manually", which I was preferring to avoid.

Another options I saw were:

- Pomelo, but last update was 2 years ago... https://github.com/NetEase/pomelo

- ActionHero: https://github.com/actionhero/actionhero 

But Colyseus looked easier and cleanest.

Do you recommend any other?

Best,

Link to comment
Share on other sites

  • 11 months later...

Hi everyone!

Just re-found this post and decided to keep it updated.

My old MMORPG platform is taking great shape! I've put it a new name I like "Reldens", and started to publish in a new repo:

https://github.com/damian-pastorini/reldens

The current release is v3.1.2, it has a lot of improvements and more features than the initial version published in this post, between the improvements:

- Full server physics as authority for every action.
- New graphics set.
- Better TiledMaps handlers which are used in the server side to create all the required objects using a few name conventions.
- Full chat implementation, with global, private and room chat.
- Basic players stats.

You can find the current docs here: https://github.com/damian-pastorini/reldens/wiki

And the demo: https://dev.reldens.com/

At this point version 3.x will be the last one since the new coming v4.0.0 has huge changes!
The entire architecture was modified, the code was optimized a lot and tons of new features will be included: 

https://github.com/damian-pastorini/reldens/tree/v4.0.0

 I hope you like it!

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Hi everyone!

Just to keep this post updated, v4 is going to be available on NPM, the way the platform could be implemented and installed will change lot.

We will have a default theme for your to easily start a new project where you will find examples on how to do a lot of stuff.

The V4 will also include a lot of new features not available in V3, so here's a small video to show you what you will get from the current branch:

As always any feedback will be welcome!

Link to comment
Share on other sites

  • 2 weeks later...

Hey Damian !

 

You put a great amount of work on this, I dig it !

I have a question though, I understand the server authority in terms of movements and action, but shouldn't it follow the "typical" MMORPG model ? Wouldn't it be more fluid to "lag compensate" after server verification, instead of taking in all the inputs, processing them, then returning the result on the client-side ?

On a typical online game, if you experience packets losses, you would have some rollbacks from time to time in order to resynchronize your position, etc... On your model you feel the lag between the moment you press a key and the moment you move on the screen, and this does not feel good at all.

If the movement was click based I wouldn't mind, but the way this is intended to be played (movement buttons and key presses) this is really frustrating; And I can't imagine your model doing well with 50+ CCU (and I mean no offence at all).

I didn't really take the time to explore the entirety of your code, but wouldn't it be possible to enable/disable total server authority via some config file ?

I might star this project on GitHub tonight, I'd be happy to give a hand in this beautiful project if you need it !

 

Have a great day !

Link to comment
Share on other sites

Hi @Kroonax it seems you message went through!

I'll just leave here the link to the thread in GitHub for anyone to check: https://github.com/damian-pastorini/reldens/issues/38

Again I really appreciate your input and interest on the project!

Best,

Damian

 

PS

For anyone interested in test the last updates on the project please check: https://github.com/damian-pastorini/reldens/tree/v4.0.0-npm-setup-v1

And then follow: https://github.com/damian-pastorini/reldens/wiki/V4-NPM-Ready 

:) 

 

Edited by Damian Pastorini
Link to comment
Share on other sites

  • 2 weeks later...

Alright!

Considering how much behind the v3 was getting I've decided to do a beta release for v4!

This version is available on NPM: 
https://www.npmjs.com/package/reldens
And the installation is easier than before: 
https://github.com/damian-pastorini/reldens/wiki/New-v4.0.0-beta.6-Installation
For that matter I've created an Skeleton repository:
https://github.com/damian-pastorini/reldens-skeleton

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.

Best,
Damian
 

Link to comment
Share on other sites

  • 1 month later...

Hello everyone!
I'm back on the project and v4.0.0-beta.7 is about to be released!
https://github.com/damian-pastorini/reldens/pull/51

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!
https://www.youtube.com/watch?v=3MRsYyXk1Bo

Link to comment
Share on other sites

  • 1 month later...

Some time without publish a new release, so here's beta.11!

- GitHub: https://github.com/damian-pastorini/reldens
- NPM: https://www.npmjs.com/package/reldens
- Demo: http://dev.reldens.com/
- Installation guide: https://github.com/damian-pastorini/reldens/wiki/New-v4.0.0-beta.x-Installation
- Discord: https://discord.gg/HuJMxUY

What's new on this beta?

- Made bundler optional and created an await class for the original process.
- Packages updates.
- Fixed issues from GitHub #54, #60, #62, #63.
- Fixed monitor and included authentication.
- Exported modules @reldens/utils and @reldens/storage.
- Included SQL script for upgrade from beta.8 to beta.9.
- PvE, PvP, different attacks short and long distance are fully working, though there still some improvements to be made these are fully operational.
- Pathfinder was improved and pathfinder layers were included.

Here's the last video:

https://www.youtube.com/watch?v=msyK2Lc9HpE 

 

Edited by Damian Pastorini
Link to comment
Share on other sites

  • 3 months later...

Hello everyone!

Long time without post any updates and that's because this is a big one.
I've created two new websites, one for me dwdeveloper.com, and one for the project reldens.com
Along with this I've also deployed a new beta of the project: v4.0.0-beta.14 which includes a lot of new features!

The main ones:
- Inventory system.
- Equipment.
- Improvements on responsive screen and mobile experience.
- A bit better performance related to some recursive unneeded queries to the database.
- And a lot of other changes that you can check on the change log.

For last I've also created accounts on Patreon and Ko-fi so any support will be really appreciated, this project can be a reality sooner if I can get any support.
Obviously by support I never mean only money, I'm also looking for anyone that would like to collaborate on the graphics side and improve the demo.

Any feedback will be appreciated! I've put a lot of effort on this and I will keep doing it! So I hope you like it!

Regards,
Damian

Edited by Damian Pastorini
Corrected links.
Link to comment
Share on other sites

  • 4 weeks later...
  • 7 months later...

Hello everyone! Just to bring some updates here!

A lot happened since beta.15, we are in beta.17 now and a lot new features had been included:

- Multiple players per user is now available (it can be enable/disable in the database).
- New contents can be dynamically created on the database: 
    Class paths (5 included in the demo)
    Levels based on experience system (10 levels for each class were generated for the demo)
    Skills (by levels), with different types (attacks, effects, physical attacks, physical effects)
    Player stats (the basic were included in the demo as example, like HP, MP, ATK, DEF, etc)
- Included W-A-S-D controllers.
- Improved initial screen, logos and background as part of the sample theme.
- Improved death event and game restart automatically with a timer configurable in the database.
- New optional features: 
    Display enemies life-bar
    Display other players life-bar
    Damage configurable to be displayed on the sprites that were hit
    Players names configurable to be visible on every player
- Included instructions UI (button and boxed modal with inside-scroll).
- Included new animations for: directional skills, skills cast, skills hit, physical Skills moving object, deaths and level up.
- Optional set player in direction to the target when casting a skill.
- Optional enable/disable TAB target.
- Implement class selector on registration.
- Implemented events using remove and master keys to handle events easily per user, object or room.
- New chat balloon alert and new example notifications.

And at the same time a lot of fixes were applied, you can always find the details on the releases page: https://github.com/damian-pastorini/reldens/releases

DEMO: https://demo.reldens.com/

 

 

Link to comment
Share on other sites

  • 5 months later...

New beta.18.1 was released!

Between the new features we have:

  • Sounds system: now you can create different sound categories to group different sounds or music (for example environment sounds, scene music, etc.), assign sounds to any game event or any animations (in the demo you will find the scene music for the town and the footsteps as animation related sound), turn on/off general sound categories or per-player config.
  • Mini-Map: small mini-map of the current scene, configurable in size and shape.
  • Aggressive enemies: when reach the an enemy area it will hunt you!
  • Initial scene/world selection: available by configuration when you create a new player or even after every login, this will set the base for a server selection feature and improve scalation (you will be able to easily split the game in multiple servers for different rooms).
  • Other improvements in the events manager, in the life-bar configuration and some bugs fixed.
  • Web and docs: Installation | Reldens

Open Source Project in GitHub: GitHub - damian-pastorini/reldens: Reldens - You can make it - Open Source MMORPG Platform
Skeleton App for starters: GitHub - damian-pastorini/reldens-skeleton: Reldens - Skeleton
Demo: https://dev.reldens.com/

 

0_1628954261333_669fc212-07db-4cc7-a81b-36caf3fa1b3b-image.png

image.png.b8f3c4ffa0af138b1b984c565917259e.png

Link to comment
Share on other sites

  • 4 weeks later...
  • 5 months later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...