Multiplayer Demo in C2

Show us your completed creations made in Construct 2

Post » Tue Jan 03, 2012 4:02 am

Hey there,

here's a little demo of my multiplayer implementation done in construct 2.

Update [05/01/12 - NowJS]:
http://vimeo.com/34595294

After a sleepless night, I've finally finished recoding my main nowjs functions. All client/server communication is now running on Nowjs and I must say I'm very happy with it. Accessing client/server function directly from client/serve is very, very useful and allows for rather fast development.

I've added a chat/notifications system as well as bullets! Have a look at the video above to find out more.

As far as the plugin/behaviour is concerned there's still a lot of work left. I'd like to make it as accessible as possible to newbies and pros alike, so I'm working on writing out some generic functions which then could be used in many games/on many server setups!

Anyhow, next I'll be working on an interactive world, highscores/scoring system as well as some basic gameplay. Stay tuned!

http://vimeo.com/34491260

Sorry there's no playable version yet, but hopefully I'll have it up soon enough (I'd like to introduce some type of registration system first, a chat and some actual gameplay).

This little game will be based on "I Have No Mouth And I Must Scream" by Harlan Ellison (a brilliant little story, definitely worth a read if you haven't read it already!), but more on the story/gameplay some other time...

Networking wise, I'm using a socket.io v.0.8 implementation to send/receive/broadcast events to the server (the server is running on node.js btw). The game essentially runs on the server, thus preserving game state without the need to worry about clients/loss of state. I'm also experimenting with some data-compression techniques right now to eventually save bandwidth and so on.

Here's a short-term TO-DO list for now:
-Registration system
-Chat
-Destructible game world
-Basic gameplay

I will also try and release all of the plugins as well as the server code as soon as I'm somewhat comfortable with the project/have cleaned up my spaghetti code.

So stay tuned guys, any questions/feedback are very much welcome!

CheersKyatric2012-01-05 05:52:36
B
6
S
1
G
1
Posts: 23
Reputation: 833

Post » Tue Jan 03, 2012 4:09 am

"The game essentially runs on the server" is a good idea to prevent cheat and sync problems, however it will increase the gap of game development, since the logic is not in C2(clients).

That's why kbdmaster will ask a server which can be created in C2.
rexrainbow2012-01-03 04:15:17
B
97
S
22
G
178
Posts: 4,120
Reputation: 104,047

Post » Tue Jan 03, 2012 4:13 am

Nice video.

It seems to work very good on local. Have you some lag compensation measures planned nevertheless ?

And what plugins did you make ? (You made your own implementation of socket.io but what else did you make ?)

Anyway, good job, keep it up.
This will be nice having this around.Kyatric2012-01-03 04:17:07
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Tue Jan 03, 2012 4:26 am

Nice quick progress Talkinghead!

All aboard the multiplay train "Wohooooooo"
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605

Post » Tue Jan 03, 2012 5:06 am

@rexrainbow
Servers created in construct would rock man :)

@Kyatric
Thanks mate. We'll I've tested it out on my remote linux box and it seemed to run fairly well... That being said I haven't really done much latency-prevention wise, apart from the pretty basic that is. Keeping an array buffer with previous character states on the client helps with synchronizing with the server (say client's state differes from server's state->server remains end authority->current client state gets reversed to previous client state). A circular buffer would serve this better than an array though, I'm working on a plugin for this now (which will also be released).

Apart from that. Here's something rather interesting: http://nowjs.com/
I might try working on this tomorrow, wrapping it up in a plugin, and see if this could potentially replace the sockets model. Sounds very promising that's for sure.

@GenkiGenga
Haha, thanks GenkiGenga

Anyways, I'm going back to coding this, will take a look at nowjs and see if this could be implemented easily.

Cheerstalkinghead2012-01-03 05:08:44
B
6
S
1
G
1
Posts: 23
Reputation: 833

Post » Tue Jan 03, 2012 5:40 am

@talkinghead

http://nowjs.com/ seems amazing, nice job.
B
97
S
22
G
178
Posts: 4,120
Reputation: 104,047

Post » Tue Jan 03, 2012 5:55 am

How cool would that be if C2 had a nodejs exporter, allowing to code the logic in C2, but still export as/to a web server in the end ?

It's probably not for any time soon.


As for nowJS it looks interesting, but will it be possible to implement it as a plugin with a shared workspace in the sealed C2's SDK ?
And also, how will it behave for action games ?
I'm curious what the result of your experimentations will be.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Tue Jan 03, 2012 6:00 am

Warcraft3 is a multi-players game, I had used it's game editor before (just 3 months). In the editor, designer does not need to know which part is server/client, moreover, designer does not need any network knowledge. (The same as in editor of starcraft2)

Could we make a network plugin that any fool can use like the editor of warcraft3?

Well, I know browser can not be a server, so there is a big different between html5 with general socket application. So it's not easy...rexrainbow2012-01-03 06:57:32
B
97
S
22
G
178
Posts: 4,120
Reputation: 104,047

Post » Tue Jan 03, 2012 6:27 am

Hello. Amazing work, can't wait to make my own game multiplayer :)
NowJS seems nice BTW.

My first multiplayer test was made in AJAX, and worked quite well in local but only saved player position. Also, it was ways too heavy.Morhaus2012-01-03 06:31:02
B
7
S
3
G
3
Posts: 26
Reputation: 1,652

Post » Tue Jan 03, 2012 10:22 am

@Kyatric
Just tested out nowjs by writing a really, really (really) simple plugin that allows you to define a nowjs function (or several nowjs functions for that matter) which can then be called from the server or vice versa. I'm pleased to say that everything is working as it should be!

So now the next step is simply expanding on this. I'll be working on fleshing out this plugin little by little. Next, synchronizing variables with nowjs and stuff like that. Very excited about this, opens up many new doors (sockets are a bit cumbersome after-all). Hopefully I'll be able to pub a new video by tonight (and of course the plugin itself some time this month haha).

@rexrainbow
I see what you are saying, then again, it's better to just learn some things. I mean sure, warcraft 3 editing might be a complex procedure however you can more or less have a "walled-garden" approach development wise. As you only need the editor to perform one (or several limited) goals. With servers and networking thats... well that's a whole other level, but I'm sure you are aware of that.

@Morhaus
Thanks mate! I'm hoping that we'll be able to expand C2's functionality tenfold. It's certainly an amazing product. So, the base is there, up to us to make the best out of it!

Cheers
B
6
S
1
G
1
Posts: 23
Reputation: 833

Next

Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 1 guest