Jump to content

Project MWX - multiplayer RPG


taoprox
 Share

Recommended Posts

Hey Guys,

I'm currently working on a browser multiplayer RPG (no name yet)

Using Node.js as the server and HTML5 canvas, CSS, Javascript for the client.

The style of the game is based on another game called Tibia, a 2.5d~ tile based open world, where you can battle creatures, solo or team hunt, find and complete quests. Grind and level up to buy new weapons and equipment.

Its in very early development, to help build I am actually using Tibia's graphics as a base, of course I will hopefully have my own spritesheets but....its a big task on my own.

Ive coded this from scratch, with no external help or libraries(except for Node.js ofc).

Check out my channel here for videos and more info:

https://www.youtube.com/channel/UCfTiD1IpXjuQxtZFN_N1tsA

Let me know if you have any interest in this or any questions.

Thanks guys,

Tao

 

Screen Shot 2019-01-20 at 18.11.24.png

 

Edit 13/03

Just redesigning my map editor. Adding sprite data support so I can manage all the game data in one app. Redesigning the UI for better management and efficiency. Big task is saving to all data files in one operation, some files are shared between client and server, some client only and some server only. Node requires module exports so the start of the files need to be different. Backups already done so now the tricky part!

1444884956_ScreenShot2019-03-13at00_03_39.thumb.png.c5298c16f2a99068c7952714a0702c2a.png

 

Edited by taoprox
Added content
Link to comment
Share on other sites

Before I even read your post, I looked at the screen and I was like "Tibia!!! :D :D". Nice to see you used it as an inspiration. Played it for a very very long time as a teenager and played it recently too to see what changed. I do have one question though concerning NodeJS. I'm currently developing a multiplayer top down shooter from which I also use Tibia as my inspiration (understand the excitement now? :D). But I replaced NodeJS after several failed stress tests with a multi threaded websocket server I have written in C#. The reason? NodeJS is single-threaded, meaning only one request can be processed at a time. For a small amount of players this don't matter that much, but if you got like 1000 clients sending requests all at the same time, the entire game could lag as hell. But if the server is multi-threaded, each request that comes in will be handled on a different thread so the main thread wont be blocking. In case of a multiplayer-game, this could speed up the process big time.

So here is my question: How will you deal with that issue? Because I'm always in for a new multiplayer game and since I'm creating one myself, I know how hard it is. So I always have respect for those who dare to pull the mmo-scalibur out of the big rock. And since I know the pitfalls all too well, I'm curious how others deal with them.

Link to comment
Share on other sites

5 hours ago, Semir said:

I would like to help on this project, but i don't know how, because i still learning in JavaScript.

Hi Semir,

Thanks for your interest. There is a lot of data that needs to be stated, how much javaScript knowledge do you have? Also, you can more than help me when it comes to testing the game, I will soon be entering that phase! In the meantime, if you like, I do stream my coding on twitch so you can watch me develop the game. https://www.twitch.tv/taoprox ( I will be on in 3-4 hours time)

Thanks,

 

3 hours ago, TheBoneJarmer said:

Before I even read your post, I looked at the screen and I was like "Tibia!!! :D :D". Nice to see you used it as an inspiration. Played it for a very very long time as a teenager and played it recently too to see what changed. I do have one question though concerning NodeJS. I'm currently developing a multiplayer top down shooter from which I also use Tibia as my inspiration (understand the excitement now? :D). But I replaced NodeJS after several failed stress tests with a multi threaded websocket server I have written in C#. The reason? NodeJS is single-threaded, meaning only one request can be processed at a time. For a small amount of players this don't matter that much, but if you got like 1000 clients sending requests all at the same time, the entire game could lag as hell. But if the server is multi-threaded, each request that comes in will be handled on a different thread so the main thread wont be blocking. In case of a multiplayer-game, this could speed up the process big time.

So here is my question: How will you deal with that issue? Because I'm always in for a new multiplayer game and since I'm creating one myself, I know how hard it is. So I always have respect for those who dare to pull the mmo-scalibur out of the big rock. And since I know the pitfalls all too well, I'm curious how others deal with them.

Hi TheBoneJarmer,

Thanks for the reply! I played Tibia from 2004~ to around 2012. Fun times! I have always wanted to create a game like Tibia and I feel like I have the logic needed to complete it. Structuring and keeping it in modules is by far the hardest part, but I'm getting there.

Regarding your concerns, you are correct, everything you said is true. I would absolutely love to code the engine in C++ or another low level language, however, I do not have the time or even possibly the intellect to learn everything to a point where I can replicate this in an application manner.

I have conducted some test runs involving 100 connections. The server and client already convert any data into binary which helps speed things along.

The login server handles ALL I/O logic, such as any database querys etc. The game server is just normal logic involving mathematical equations, and asynchronous functions that will not block or hold the event loop. Keeping everything async is key here, I believe the game server can probably handle 1000 requests a second.

The problem comes in how or where to store the users data in the game server, currently I am sending the users data from the login server to the client. This is currently very bad obviously because of manipulation reasons. I am relying on passing data from the user to the game server. The game server has no option but to accept the data as there is no store in the game server. Maybe there is an option to pass data from the login server to the game server, but this will probably be as harmful as performing I/O operations directly in the game server.

I am still learning as I go further down the path, and there is a good chance I might run into a brick wall and experience what you explained in your reply.

I will value any opinions and help on this matter, and if you are interested in this project, give me a shout!

Thanks,

--

Tao

 

 

Link to comment
Share on other sites

Well, perhaps I can help with something I did not knew about NodeJS for a long while: nothing is async because async means using a different thread to execute a function. I assume you mean you are using those setTimout or setInterval functions right? Sadly, they are not async, they just delay the function only to be executed at a later moment in the same thread. If you did not mean that, tell me what you did use because that would be very interesting. ?

Concerning your data storage issue, you should not have another process handle the authentication. Use the game server only to handle the authentication because otherwise you need to have a way to share the user's data between two applications, like you said. If you keep it in one process, you could keep up a multidimensional array of tokens and player id's and store the player data in the server's memory and send only the token to the client once the player signed in. Because that way you wont give away important data. Each time the player is performing an action, send the token along with the websocket message. On server side, strip the token from the message, lookup the player id in the array I mentioned before with the token you just stripped and use that id to retrieve the player's data.

Also, concerning database queries; only get, update and insert records when you need them. Not constantly. Of course it is important to update your database frequently so what I'm doing is using a thread to update my database each 5 minutes. In your case a setInterval will do. But it will take a certain restrain away and keep your ram usage low. :) 

Link to comment
Share on other sites

2 hours ago, taoprox said:

Yes, this is a much older attempt ?

There is actually no HTML5 canvas in this version of my game. Amazingly, I was using just the DOM to move divs around. Definitely not the best idea in the world!

Trust me, you are not the only one who came up with that idea haha.

Link to comment
Share on other sites

Just redesigning my map editor. Adding sprite data support so I can manage all the game data in one app. Redesigning the UI for better management and efficiency. Big task is saving to all data files in one operation, some files are shared between client and server, some client only and some server only. Node requires module exports so the start of the files need to be different. Backups already done so now the tricky part!

Features will include auto-borders and brushes, tile stack reordering/deletion, stack evaluating (getting rid of unwanted tiles, such as a stack that doesn't need to be drawn), creature and NPC spawns, tile UID's for game interactions (scripts executed for a given tile.object with matching UID), sprite data editing (blockable, climbable and other data), and much more to come!

1444884956_ScreenShot2019-03-13at00_03_39.thumb.png.c5298c16f2a99068c7952714a0702c2a.png

Link to comment
Share on other sites

  • 2 weeks later...

Hey Semir,

I am focusing a lot on my game editor at the moment, I've hit a point in development where I need a lot more attribute data for sprites and objects, and therefore need a easy way to edit this.

I will always write here for you whenever I make any progress and be sure to keep checking my youtube channel for more videos in the future!

I appreciate your interest in this, and in the future when I need help testing it, you will be one of the first I will ask!

Thanks, Tao

Link to comment
Share on other sites

  • 1 year later...
  • 11 months later...
  • 1 month later...
On 10/8/2020 at 1:50 PM, Glauro Juliani said:

Hey @taoprox it's really amazing project and a would like to help you, I'm a front-developer and a tibia big fan, please let me know if I could help you with some architecture or code stuffs.

Bests.

Sorry for the late reply, I have only just received the notification.

Thank you. Awesome, I am currently working at the moment and don't have as much spare time but are you still interested in this and do you have any examples of work I can view?

 

On 9/14/2021 at 5:56 PM, thedragonlord said:

How are you dealing with different floors on the map? How to render it?

Sorry for the late reply, I have only just received the notification.

Each map has its own file of binary data. After the client has loaded all the files and when rendering the map, each floor is offset.

So for example, obviously the floor the player is on is both 0 offset x and y. The floor above will be drawn offset of -32px on both x and y. The floor above that (+2 from player) will be -64px offset.

To calculate whether to show the floors above. We just loop through each floor above the player to see if that tile contains data. If there is data, we hide the floors and if its empty we draw.

Hope this is an easy enough explanation :)

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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