Network Pong Demo

Post your Construct-made creations!

Post » Wed Mar 31, 2010 7:28 am

Yeah it was over internet... My connection is 10/2 so it should be fast enough for this (it's cable)
B
11
S
3
G
4
Posts: 622
Reputation: 3,186

Post » Wed Mar 31, 2010 10:22 pm

Thanks Sagal for the info. I did some network testing and I'm getting the following info for latency:
- Lan: .4 ms
- google: 25ms
- scirra: 46ms

I'm on a cable connection as well. Since the ball location only updates once a game loop my guess is everything is fine in the LAN case since it is well under the 10 ms event loop time. However, the internet latency is at best 2-4x over over so it might cause some lag for the ball. Also, I have the ball going pretty fast and I might want to slow it down some as well.

I have a couple of ideas on how to minimize internet lag it so hopefully I'll get a new version out that fixes this. :-)
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Thu Apr 01, 2010 5:22 am

Ah great^^ this all will mark new era for Construct maybe even the Golden Era! (probably not). But good luck trying to get it done so it can be used to make over internet multiplayer games.
B
11
S
3
G
4
Posts: 622
Reputation: 3,186

Post » Thu Apr 01, 2010 2:06 pm

I would suggest predicting where the ball and the opponents paddle will go using interpolation, and fixing any discrepancies whenever the next bit of information comes in. The ball should follow some pretty straightforward rules of motion and bouncing, so the predictive algorithm wouldn't be too complex. I think most action internet games have some form of prediction.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Thu Apr 01, 2010 7:34 pm

[quote="lucid":2ebda7sa]I would suggest predicting where the ball and the opponents paddle will go using interpolation, and fixing any discrepancies whenever the next bit of information comes in. The ball should follow some pretty straightforward rules of motion and bouncing, so the predictive algorithm wouldn't be too complex. I think most action internet games have some form of prediction.[/quote:2ebda7sa]
FPS games, for example, try to have very good netcode to limit the effects of lag.
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Sat Apr 03, 2010 3:31 am

I really liked Guyon's idea about the paddles so I implemented the game using mouse control, only for 2 players at the moment.



You can get the server and client here:
http://www.box.net/shared/5703uihspa

Some quirks:
1. You can swing the paddle really fast and go through the ball. For simplicity sake I have not addressed this. For now, you have to resist the temptation to swing at the ball. :) If you know of an easy way to do this that won't add too much complexity to the soon to be tutorial ;-) then please let me know and I'll incorporate it.
2. Over internet. My guess is there will be lots of lag with players moving their mouse so quick. I plan on releasing the tutorial then looking at another library (plus interpolation/prediction) to handle online lag.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sat Apr 03, 2010 7:43 am

[quote="scidave":3is4nw3h]I plan on releasing the tutorial then looking at another library (plus interpolation/prediction) to handle online lag.[/quote:3is4nw3h]
<3

I already have a decent understanding on how one would write predictive net code so bring on the tutorial.

Looking forward to playtesting some online gamage with my friends/brothers.

Thanks again Scidave, you are a gentleman and a scholar. :wink:
B
2
S
2
G
5
Posts: 108
Reputation: 1,866

Post » Sat Apr 03, 2010 11:52 am

I uploaded a new version which improves collisions and increases ball max speed (felt a little slow last time I tested). Working on 4 player version now. :-)
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Mon Apr 05, 2010 3:29 am

Guyon.. prepare your quarters!

Finally got the four player version working thanks to Rojohound and newt. With this version you can select between 2 or 4 players on the server.

Please test it out, since I can't test the 4 player version that well. It is a demo, so there are a few quirks.. but as long as the main functions work right is what I'm interested in.

http://www.box.net/shared/spoafestsh

Thanks!

Update: Tested the 4 player version seemed pretty decent on the Lan. I'm going to build one more example game as part of the tutorial then will start on the writing. I want to build a game that is slower but with more players to show off the strong points of the library and give better usage ideas.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Wed Nov 05, 2014 11:51 am

Where can i get Construct 99.84?

Thanks.
B
2
S
1
Posts: 1
Reputation: 302

PreviousNext

Return to Your Creations

Who is online

Users browsing this forum: No registered users and 0 guests