Help with Network Coding

For questions about using Classic.

Post » Wed Jan 04, 2012 11:05 am

Hi there guys,

I am currently learning to make a side scrolling multiplayer shooter with Construct, and I found the great plugin by scidave

I was making progress with it, and managed to replicate it and make a chat program on local and also a test with two players controlling a cube each (nothing fun yet).

The first version I made was to avoid the way scidave coded as I want to leave the code as future friendly as possible (the game will have 2 players, but looking to support up to 6 players).

The first versions basically have two Avatars both with 8 direction behavior and depending on the pNumber assigned by the server, pNumber1 will control the redbox and ignore bluebox's control, and vice versa with pNumber2. It works fine and all, but I noticed that even on local testing, there's a slight lag on both players.

The next version was done by a friend where he follow's scidave example, and surprisingly his version played much smoother. The only problem with this version is the that players, regardless of pNumber1 or pNumber2, will always be the redCube while the 'enemy' will always be blueCube. I hope this is not too confusing.

My question is that which method is better? I really liked scidave's method, for it seems to make the lag disappear almost entirely. Is there any other alternative that will be better to code for a multiplayer action game?

Here's the two cap files for both versions, in case you guys would like to see the mess I made :D. I appreciate any help or insight on this.

Version1

Scidave style


Cheers!

Edit

Sorry, I noticed I made an error on the link for the first one. It's fixed now.Yung2012-01-04 13:56:08
B
27
S
9
G
5
Posts: 108
Reputation: 5,744

Post » Sat Jan 07, 2012 4:25 am

Hi guys, just a bump for help on this matter.

I also noticed that someone is developing a network plugin for C2. Seems like a good choice to migrate, as it seems Scidave is busy lately.
C2 MultiplayerYung2012-01-07 04:26:13
B
27
S
9
G
5
Posts: 108
Reputation: 5,744

Post » Sun Jan 08, 2012 4:17 pm

Yes, unfortunately I'm not going to be able to do any work/help on this for about 6 months. Have intermittent computer/internet access.

You might be able to look at the Pixel People online source that was posted for help. Besides that, C2 might be a better approach because more people are active on that project in relation to Networking. Although the benefit of CC is that the Server and Client can be written entirely in Construct.

You might also explore Podsixnet, but I found the performance to be lacking for action games compared to my beta plugin (because it used TCP vs UDP). Cheers!!
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sun Jan 08, 2012 4:49 pm

Thanks for the suggestion, scidave! I hope you can work on this again sometime in the near future, it's truly a brilliant plugin. I tried Podsixnet could not get it to work at all no matter how I want to.

I will looking into the Pixel People source as you've suggested :D
B
27
S
9
G
5
Posts: 108
Reputation: 5,744

Post » Tue Feb 14, 2012 6:45 am

[QUOTE=Yung]I will looking into the Pixel People source as you've suggested :D[/QUOTE]

I haven't touched it in a few months, but feel free to ask me if you have any questions about how I made it =] It's my first real attempt at network multiplayer, so I'm sure lots of things I did can be improved or done more efficiently Jayjay2012-02-14 06:45:57
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Fri Feb 17, 2012 10:22 am

Thanks for the offer, Jayjay. One question I have in mind is so far, from my testing in local network, it seems to be quick and stable enough. But in your opinion, would it be suitable for making suitable fast paced shootemup multiplayers? Thanks!
B
27
S
9
G
5
Posts: 108
Reputation: 5,744

Post » Fri Feb 17, 2012 5:45 pm

It depends, the plugin has a strange bug over the internet where (it looks like) once a packet is dropped the whole system starts re-sending packets to everyone, and really breaks the game.

However, if you mean over a LAN, or where ping between players is around 100ms or less, then it should work fine I think.

I'll be trying to edit the plugin code that SciDave nicely open sourced, but until then a workaround might be to create a system to ignore repeat packets (store a list of the most recent 100 messages received?)Jayjay2012-02-17 17:47:55
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Tue Feb 21, 2012 2:59 pm


Would that mean like maybe position of each player, we store that at 100 and constantly update it, eliminating the oldest data, and compare and update it to the player's on position?


Hmm...seems like multiplayer for your first game is kinda out of the pictures :P.
B
27
S
9
G
5
Posts: 108
Reputation: 5,744


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests