Simple Network Chat

Post your Construct-made creations!

Post » Sat Mar 20, 2010 1:45 am

Here is a simple network chat program that I worked up today to learn more about network programming with Python. It may be one of the first Construct network programs!!



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

The Python dependencies should be redistributed with the client and the server. For, the server you just put in the port that it will listen on (you should select a high number like 6000). For the client, you pick the player nickname, the IP address of the server, and the port of the server. I only tested with two clients but it should support many more. Time permitting I'll add new features to this or move on to a real network game.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sat Mar 20, 2010 1:55 am

Nice one scidave!
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Sat Mar 20, 2010 5:03 am

Looks awesome. Good job.
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Sat Mar 20, 2010 6:38 am

Very impressive, Great job scidave.
B
9
S
2
G
3
Posts: 176
Reputation: 1,954

Post » Sat Mar 20, 2010 12:33 pm

Great news! Finally, Construct will communicate. I'd still prefer a plugin, but with all your work so far you've pointed to an alternative that's worth to try.

I thought I should point to this link about port numbers as early as possible that helps avoiding conflicts with multiple port use.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sat Mar 20, 2010 1:47 pm

[quote="tulamide":2to5lkuf]Great news! Finally, Construct will communicate. I'd still prefer a plugin, but with all your work so far you've pointed to an alternative that's worth to try.

I thought I should point to this link about port numbers as early as possible that helps avoiding conflicts with multiple port use.[/quote:2to5lkuf]
Officially, there's supposed to be a Multiplayer Plugin by 1.0's release.
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Sat Mar 20, 2010 3:09 pm

I don't think anyone's working on a multiplayer plugin any more, so I don't think there'll be one at the 1.0 release.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,564

Post » Sat Mar 20, 2010 5:54 pm

That's disappointing. Someone should change the wiki's FAQ then.
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Sun Mar 21, 2010 2:55 pm

Thanks everybody. Python really opens up lots of interesting possibilities.

[quote="tulamide":3epxlyrc]I'd still prefer a plugin, but with all your work so far you've pointed to an alternative that's worth to try.[/quote:3epxlyrc]

I would prefer a plugin too. The pros with a plugin are you would have better speed and that it would be better integrated with Construct. The positives for Python is that it is really easy to add network support, the code amount is minimal (e.g. the Chat Server is only 40 lines of Python and about half of that was cut and paste boilerplate code) and it is easy to extend the support without making a whole new plugin. Once I move on to an actual game I'll let you know if I hit any walls with integration with Construct behaviors and other stuff.

Also, good link about the port numbers.

In general, you want to set the server to listen on a port higher than 1024 since it takes an admin to listen on low/privileged ports. For those curious about what is listening on their system you can type: "netstat -an | more" at a command prompt and you will see ip addresses and ports. The server uses TCP so nothing can be listening on the TCP port you choose.

I updated the chat server to show what IP it is listening on. I didn't put any error checking on the port so pick a high port or do a netstat to see what is available.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sun Mar 21, 2010 7:16 pm

Im more or less wondering how to develop this.. Like will you release source or make a tutorial on how adding networking can be done? Ive got a game in development and have been looking into this networking for a while.
B
2
S
1
G
3
Posts: 49
Reputation: 1,098

Next

Return to Your Creations

Who is online

Users browsing this forum: No registered users and 2 guests