Questions with RC's multiplayer series

2 posters

Go down

Questions with RC's multiplayer series Empty Questions with RC's multiplayer series

Post by Melons Tue Oct 18, 2016 5:05 am

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?

Melons

Posts : 5
Reputation : 0
Join date : 2016-05-17

Back to top Go down

Questions with RC's multiplayer series Empty Re: Questions with RC's multiplayer series

Post by rc Wed Oct 26, 2016 11:31 pm

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.
rc
rc
Admin

Posts : 164
Reputation : 9
Join date : 2016-04-04
Age : 30
Location : Montreal

http://rainingchain.com

Back to top Go down

Questions with RC's multiplayer series Empty Re: Questions with RC's multiplayer series

Post by Melons Tue Nov 15, 2016 7:29 pm

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 Smile

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

Back to top Go down

Questions with RC's multiplayer series Empty Re: Questions with RC's multiplayer series

Post by Melons Thu Nov 17, 2016 6:04 pm

Also another question;

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

Back to top Go down

Questions with RC's multiplayer series Empty Re: Questions with RC's multiplayer series

Post by rc Fri Nov 18, 2016 11:32 pm

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.
rc
rc
Admin

Posts : 164
Reputation : 9
Join date : 2016-04-04
Age : 30
Location : Montreal

http://rainingchain.com

Back to top Go down

Questions with RC's multiplayer series Empty Re: Questions with RC's multiplayer series

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum