Questions with RC's multiplayer series
2 posters
Page 1 of 1
Questions with RC's multiplayer series
Hi there! I'm still fairly new to programming and I was hoping I could have some guidance from you knowledgeable programmers. I had a few questions about RC's multiplayer series.
1. From my understanding, I believe the server is constantly sending out init, update, and remove updates? Wouldn't this be inefficient if I wanted up to 50+ players online? If so, what would be a better way to go upon sending update packets to clients? I'm confused as to why they aren't only sent out when something needs to be updated or happens can someone please explain?
2. What would be a good format for saving player information into the MongoDB? In example would I save the character's x,y,hp,hpmax into the account table along with username and password or create a new table? Possibly even saving multiple character spells, spell level as well in the future?
3. How would I introduce interpolation for smooth movement over latency? What would I need to change?
1. From my understanding, I believe the server is constantly sending out init, update, and remove updates? Wouldn't this be inefficient if I wanted up to 50+ players online? If so, what would be a better way to go upon sending update packets to clients? I'm confused as to why they aren't only sent out when something needs to be updated or happens can someone please explain?
2. What would be a good format for saving player information into the MongoDB? In example would I save the character's x,y,hp,hpmax into the account table along with username and password or create a new table? Possibly even saving multiple character spells, spell level as well in the future?
3. How would I introduce interpolation for smooth movement over latency? What would I need to change?
Melons- Posts : 5
Reputation : 0
Join date : 2016-05-17
Re: Questions with RC's multiplayer series
Hey.
1- In the tutorial series, I'm doing the easiest method. Normally, you'd only want to send data that's relevant and only the data that changed. In Raining Chain, only the actors near the player are sent and only the changes are sent. CHecking if something changed is a lot harder than it seems.
Check http://rainingchain.com/tutorial/howItsMade under Difference Detection.
2- In Raining Chain, I save the player and the account details in two separated tables. Yes, you can save multiple spells in the same table with the player. That's what I do with abilities. I use js-schema for schema validation.
3- Quick easy interpolation is just to set newX = (currentX + realX)/2.
1- In the tutorial series, I'm doing the easiest method. Normally, you'd only want to send data that's relevant and only the data that changed. In Raining Chain, only the actors near the player are sent and only the changes are sent. CHecking if something changed is a lot harder than it seems.
Check http://rainingchain.com/tutorial/howItsMade under Difference Detection.
2- In Raining Chain, I save the player and the account details in two separated tables. Yes, you can save multiple spells in the same table with the player. That's what I do with abilities. I use js-schema for schema validation.
3- Quick easy interpolation is just to set newX = (currentX + realX)/2.
Re: Questions with RC's multiplayer series
Thank you for your response, RC! I've been working hard to learn more everyday and though it's slow progress, I'm getting the hang of things!
Check out an early stage of my game! This was all thanks to you
I recently just added a body system that divides the torso and legs into two sections so that I can produce different animation frames and more versatile actions. It still needs to be fixed up a bit but soon enough! Hope you like it.
W A S D - to move
Space - to jump
http://storyninja.herokuapp.com/
--
I hope you continue your multiplayer series soon! I've learned so much from them.
Check out an early stage of my game! This was all thanks to you
I recently just added a body system that divides the torso and legs into two sections so that I can produce different animation frames and more versatile actions. It still needs to be fixed up a bit but soon enough! Hope you like it.
W A S D - to move
Space - to jump
http://storyninja.herokuapp.com/
--
I hope you continue your multiplayer series soon! I've learned so much from them.
Melons- Posts : 5
Reputation : 0
Join date : 2016-05-17
Re: Questions with RC's multiplayer series
Also another question;
Would it be wise to make
belong to each socket that is connected so that I could send them data that's only relevant to them? Instead of sending every player the same data?
Would it be wise to make
- Code:
var updatePack = {player:[],bullet:[]};
var initPack = {player:[],bullet:[]};
var removePack = {player:[],bullet:[]};
belong to each socket that is connected so that I could send them data that's only relevant to them? Instead of sending every player the same data?
Melons- Posts : 5
Reputation : 0
Join date : 2016-05-17
Re: Questions with RC's multiplayer series
Yes, that's normally what's done.
In Raining Chain, every player has an active list containing the actors surrounding him. Only data from monsters in this list is sent to the player.
Basically, each actor has a changeset that is updated every frame. Then I loop thru every player and for each actor in their active list, I push the changeset to the player updatePack. (This is done to avoid computing the changeset multiple times if multiple players have the same actor in their active list.)
Certain data is also private to the player like his inventory. So in that case, it must be sent separately.
In Raining Chain, every player has an active list containing the actors surrounding him. Only data from monsters in this list is sent to the player.
Basically, each actor has a changeset that is updated every frame. Then I loop thru every player and for each actor in their active list, I push the changeset to the player updatePack. (This is done to avoid computing the changeset multiple times if multiple players have the same actor in their active list.)
Certain data is also private to the player like his inventory. So in that case, it must be sent separately.
Similar topics
» Create a game first / Follow the NODE.JS multiplayer videos first?
» Websocket error when following multiplayer node tutorial "Client State"
» Suggestion - Questions Subforum
» (Questions on tiled map editor) Does tiled require you to set a collision layer?
» Websocket error when following multiplayer node tutorial "Client State"
» Suggestion - Questions Subforum
» (Questions on tiled map editor) Does tiled require you to set a collision layer?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|