PDA

View Full Version : Fast paced Multiplayer in Flash



Dan0
March 28th, 2007, 12:03 PM
Hey!
Before you start reading don't blam, this is not a noob post.
I got SmartFox and learnt how to do it quite well. So far infact I linked a prototype tile game up with SmartFox with unlimited numbers of players. However there is one problem. I found using the inbuilt function SmartFox offers the connections can be slow to send and recieve (not high ping just not enough messages sent). So i set about writing the server side script in SmartFox. I did a really simple one, the simplest possible and while it did improve the situation it was still really crap. The players didn't lag they just jittered as the messages inbetween were lost but were sent. I know this is got round by adding forces with each message so the player still moves. However I tried this and there was still much lag. I think the reason maybe because every time the message is sent flash needs to check it first. I'm not sure though because I don't know much about servers.:stunned:

There are no fast paced multiplayer flash games. Maybe because the server is too expensive. The only one is XGenStudios - Stick Arena but they like scripted their own socket server!:toad:

Is there any solution?
Thanks for your help,
Dan :rabbit:

duncanhall
March 28th, 2007, 12:52 PM
Have you had a look at this: http://www.kirupa.com/developer/flash8/php5sockets_flash8.htm ?

Dan0
March 28th, 2007, 02:09 PM
Wow no sorry. I must take a look! Thanks for the link :blush:

duncanhall
March 28th, 2007, 02:11 PM
No worries. Just know that you must have PHP5 and a dedicated server (or unprecedented access to a shared server).

Dan0
March 28th, 2007, 05:23 PM
Errr it doesnt work. Please I'm not a noob I know about localhosts and stuff. I got SmartFox working and a Radio station lol. When I do the tutorial I says I am connected (**WOOT!!**) but I can't send/recieve the messages. I think my .bat file may be wrong. Is it ment to continously run? I set up the file links O.K. but when i run it, it closes like most cmd applications.

Oh yes also Kirupa's tutorial does not cover the new security restrictions that come in flash 8+. SmartFox got around it by having an xmlsocket for loading the policy file. I added my c:\ to the acceptions list. Should I export with network files or local files?

Thanks for your help,
Dan

duncanhall
March 28th, 2007, 05:30 PM
I'm afraid I'm no help on this. I made an attempt on that tutorial before realising I have neither of the afore-mentioned requirements. Try posting in the 'Server-Side' forum.

Dan0
March 29th, 2007, 02:43 PM
I can't be bothered. What is the difference between this kinda of server communication and SmartFox? SmartFox is easier etc and I'm sure this type of thing cant detect if a user quits the flash app (instead of pressing disconnect).
I should try the SmartFox forum.

duncanhall
March 29th, 2007, 03:46 PM
That tutorial is only the basics to get you started. Seeing as you said that the only game you've seen that provides adequate performance was run on a custom built socket-server, I thought you might appreciate a tutorial on how to build a custom socket-server. Obviously not.

If you can't be bothered, fair enough, but then obviously don't expect any help. If you're looking for a way to improve SmartFox, then yes, SmartFox forums are probably the way to go. If you want help with Kirupas server tutorial, you're going to have to be bothered to go and seek it in the Server-Side forum.

Dan0
April 1st, 2007, 01:10 PM
Meh im not too stressed about multiuser functionallity at the moment. The custom socket-server thing is kind of over-my-head. I don't know PHP let alone Apache. I have to learn it first. I wasn't really asking about how to go about building my own but seeing as there is a tutorial its an added bonus.

BTW can this kind of set up detect if a user closes the flash app without clicking an obvious "disconnect" button? I always wondered how SmartFox did that.

Thanks for the help,
Dan