Forum Topic: Server Side programming?

(142 views • 6 replies)

This topic is 1 page long.

<< < > >>
None

4urentertainment

Reply To Post Reply & Quote

Posted at: 5/16/09 10:03 AM

4urentertainment NEUTRAL LEVEL 13

Sign-Up: 08/01/08

Posts: 1,573

Now suppose I'm trying to get into that, and if I have the all the AS needed for my game, how hard/long would it be to put multiplayer in it? To allow two people to connect and face each other in the same game.

I'd need a server, and I heard there are some free ones for testing. But the question is to do this whole multiplayer, would it need 100+ lines of code or something a little bit simpler?

And are there any tutorials to get started on that?

"When you look at yourself from a universal standpoint, something inside always reminds or informs you that there are bigger and better things to worry about. "- Einstein


None

BeefyBoy12

Reply To Post Reply & Quote

Posted at: 5/16/09 10:07 AM

BeefyBoy12 EVIL LEVEL 10

Sign-Up: 08/14/08

Posts: 215


None

WolfAkela

Reply To Post Reply & Quote

Posted at: 5/16/09 10:56 AM

WolfAkela LIGHT LEVEL 08

Sign-Up: 12/19/05

Posts: 2,327

Networked games is quite painful to implement. :/ Took me several days just to finish my networked Game of the Generals in Java and that's with Java's simplified networking and the assumption that the network is perfect (no lag/failure to deliver packets). The biggest problem you'll have is how to handle lost packets (strings of data).


None

apeskape

Reply To Post Reply & Quote

Posted at: 5/16/09 11:34 AM

apeskape LIGHT LEVEL 02

Sign-Up: 02/12/09

Posts: 86

If you are going to be buying electroserver or smartfox server just be aware that you will have to program the scripts in java telling the server what you want to do. If you are quite handy with java, you can make the server yourself, keeping it lightweight and restriction free. You could probably even make a flash mmo server by looking at the structure of some open source games' server code and then changing it to your needs, with permission of course. I have been working on a flash socket server in java myself from scratch, and I can assure you, it is much higher performance than electro or smartfox server and as of now it can handle a bare minimum of 2,000 players.


None

4urentertainment

Reply To Post Reply & Quote

Posted at: 5/16/09 01:29 PM

4urentertainment NEUTRAL LEVEL 13

Sign-Up: 08/01/08

Posts: 1,573

So...in other words it's going to be very hard to almost impossible to implement since I have no knowledge of programming outside of AS?

"When you look at yourself from a universal standpoint, something inside always reminds or informs you that there are bigger and better things to worry about. "- Einstein


None

GustTheASGuy

Reply To Post Reply & Quote

Posted at: 5/16/09 03:49 PM

GustTheASGuy LIGHT LEVEL 08

Sign-Up: 11/02/05

Posts: 11,383

The server is not the problem. You can have a sufficient Java server in 500 lines of code that manages connections and passes along data sent from one client to others and leave the actual logic in Flash. But it's not as easy as adding some extra code to your game and it'll become synchronized across computers.

'if (Key.isDown (Key.RIGHT)) player._x += speed' ?
'if (bullet [i].hitTest (enemy [j])) enemy [j].removeMovieClip ()' ?

Nope. You can't just add a line here sending a message to your peers to do the same action as you go. The message is going to arrive with latency, or it might not arrive at all. It just won't work.

If you have a nice game object framework it might be easier to add a gateway to which the game objects send what they want to happen rather than executing the effect, and then leave it to the gateway to handle the synchronization. The gateway can send out the socket messages and verify that absolute states are in sync, and decide when to hang a game in case of network issues.

It's much easier if it's a turn-based game, of course. One client waits for the other to decide and send a message of his move, then the other way.

#ngprogramming at irc.freenode.net
haXe | Keel imperative | Spyro! | Thru you


Happy

zenyara

Reply To Post Reply & Quote

Posted at: 5/16/09 04:38 PM

zenyara NEUTRAL LEVEL 13

Sign-Up: 06/17/05

Posts: 1,189

I have a php socket code that is free and well-tested.

It's very basic code once you know how to connect:

http://togagames.com/boards/index.php?to pic=175.0

Check out the latest updates:

Toga Games (crew)

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 03:03 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!