Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / MultiPlayer - 8 or more

Author
Message
ruckertheron
7
Years of Service
User Offline
Joined: 12th Nov 2016
Location:
Posted: 19th Dec 2017 00:27
I have recently started a multiplayer game using the tutorials available. I want to create a 2d shooter where up to 8 players can run around grabbing power ups, weapons, and items as a treat for the stay overs I have with some of my friends' children. I have tried to modify the multiplayer example for more than 2 and it back fired!!! I have very novice level understanding in how hosting a network and dealing with clients actually works even though I've read a lot of documentation of such subject. I even tested it on 3 devices and only 2 of the user sprites move correctly. The first, I believe, and third has a flicker of position. Basically it is not starting well!!! Does anybody out there know a simple model of a multiplayer that I can use that can deal with up to 8 players?
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 19th Dec 2017 22:02
Hi,

You have a flicker of position on a local area network ?? (LAN)
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 19th Dec 2017 22:44
There's a lot to consider when making a multiplayer game which requires frequent updates.
There's only so much data that can be sent in each message, so it sounds at a basic level like you've overloaded the update packet with too much info.

You'll run out of space anyway, so will need to think about interpolation to handle the "gaps" in the information.
You will want to plan out what exactly and how you will fill the info packets with. Probably want to pack integers with say 4 bytes of information, rather than one for instance.

Also, what / where is the server?
Is it peer-to-peer or dedicated?

Setting up a testing environment which allows you to test and verify throughput would be a good start. Joining, leaving, lobby, diagnostics etc. Probably don't even think about the actual game until the network code is developed.
ruckertheron
7
Years of Service
User Offline
Joined: 12th Nov 2016
Location:
Posted: 22nd Dec 2017 21:05
Thanks.. I fixed the problem.. I reconstructed the whole system I had.. I definitely know there is a more efficient way to fix it but it works!! I ran one as solely the host and the other one as a client. I passed strings using CreateNetworkMessage() function such as this:

"P1/100.0/100.0/50.0/0/0/0/0/0/11/0/0/..."

(1) (2) (3) (4) (5) (6) (7) (8) (9)
playername$/xpos#/ypos#/health#/weapon1/weapon1ammo/weapon2/weapon2ammo/sprnum/...

used the GetStringToken() function to extract and use to update other clients sprites and actions...







EdzUp
21
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 25th Dec 2017 20:20
one thing to always remember is never send packets for the sake of it you should send a maximum of 10-20 per second maximum and interpolate between frames.
-EdzUp
ruckertheron
7
Years of Service
User Offline
Joined: 12th Nov 2016
Location:
Posted: 5th Feb 2018 22:56
I just sent when a playermoves.. it writes and every loop it reads... but the 20 packet limit only makes it possible for 20 people max.

Login to post a reply

Server time is: 2024-03-29 06:05:58
Your offset time is: 2024-03-29 06:05:58