A Flash Developer Resource Site

Page 14 of 15 FirstFirst ... 4101112131415 LastLast
Results 261 to 280 of 284

Thread: The Grand Multiplayer Thread

  1. #261
    Senior Member webgeek's Avatar
    Join Date
    Sep 2000
    Posts
    1,352
    We do and I'm sure our competitors do but this is probably inappropriate for this forum. Please contact [email protected] if you are interested in the details. Thanks!

  2. #262
    Cool, thanks for the help! I love coding and like tinkering, so I'll let you know if I decide to not create my own system. I'll likely want to create a modular system tailored to my own needs, but I'll definitely let you know if I need something pre-built!

  3. #263
    Senior Member lapo73's Avatar
    Join Date
    Jun 2003
    Location
    italy
    Posts
    395

    Re: socket server without *any* polling?

    Originally posted by infinite_fish

    Ok, I'm probably not being clear about this, but most Java examples tend to have a while(true) or equivalent section which just repeatedly checks the state of the socket buffer, waiting for data. This method works, but will eat up 25% of my CPU usage even though my server activity is completely idle.
    Mmm... this sounds a little weird to me, since most of the basic socket servers examples out there are based on the old blocking java.net libraries.

    A typical while section could look like this:

    PHP Code:
    while (!quit)
                {
                    
    String msg data_in.readLine();
                    
                    if (
    msg == nullquit true;
                    
                    if (!
    msg.trim().equals("EXIT"))
                    {
                        
    data_out.println("Data read: <b>"+msg.trim()+"</b>"+EOF);
                        
    data_out.flush();
                    }
                    else
                    {
                        
    quit true;
                    }
                } 
    Since the readline() method is blocking (stops the execution of the thread until data is received) the application will stay idle until some data is read from the socket, then it will process it and go back to idle.

    If the examples you've found are sucking 25% of the cpu when doing nothing then there must be something wrong in that code!

    Here's a link to an article I wrote some time ago that might interest you:

    http://www.gotoandplay.it/_articles/.../xmlSocket.php

    And here's a whole section in my website dedicated to multiplayer games in flash >> http://www.gotoandplay.it/_articles/multiplayerCentral

    Also here's a must read for all those interested in developing with the latest java.nio package >> http://gee.cs.oswego.edu/dl/cpjslides/nio.pdf

    Hope it helps

    Lapo
    www.gotoandplay.it
    Flash game developers community
    www.smartfoxserver.com
    Multiplayer Flash Server

  4. #264
    Junior Member
    Join Date
    May 2006
    Posts
    3
    This hurts the brain....

    I'm trying to understand this but...Looks like I need my friend to take a look at this.

  5. #265
    Death to anime
    Join Date
    Mar 2006
    Location
    Holland, MI
    Posts
    32

    Flash MMO

    Forgive my ignorance, but do you put other kinds of code directley into flash or in the webpage you post it on?
    Code:
    onClipEvent(load){
    trace("I am a geek")
    }

  6. #266
    Junior Member
    Join Date
    Nov 2006
    Posts
    1
    hi

    here is a free solution:
    http://swocket.sourceforge.net/

    Swocket is a cross-platform modular XML Socket server framework implemented in Python with the intention of being used to communicate with Macromedia® Flash® 5 content but is easily usable with other platforms that support the same flavor of XML Sockets.

    ---

    does anyone know what's going on with xandra?
    their site www.xandra.com seems to be down.

  7. #267
    Senior Member webgeek's Avatar
    Join Date
    Sep 2000
    Posts
    1,352
    IIRC Xandra is no longer made. Unity is in the same boat. Colin Moock, at least temporarily, has moved onto other things. Several other servers (both commercial and otherwise) have come and gone since this thread started. Many open source servers have been created as well, most have fallen by the wayside. It seems that everyone thinks they can create their own server but none of them ever seem to last. Makes me feel old

  8. #268
    Senior Member Alluvian's Avatar
    Join Date
    Jun 2006
    Posts
    967
    --Multiplayer thread!!! Rise from your GRAVE!!!--

    I have not read this entire thread, but most of it seems to be about realtime and the socket method.

    My server provider does not let us do very much, so I could probably not get a socket solution running through them, but my game is turn based, and since I already know php/mysql and xml, polling seems like a good solution for me.

    I would like some advice, but first, my gametype: It is going to be concurrent turn based (planning stage, then all pieces move at once, then another planning stage) with NPCs initially being handled in php serverside with phase 2 maybe seeing if I can do AI clientside if I can come up with a totally non-random solution or some way to seed all client RNGs the same.

    What is faster to store/access gamedata? Flatfile or mysql database?
    This probably ties with the next question, but if there is a game with 5 players, and each of them is querything the server every 5 seconds, is that too much? Our site gets a decent amount of traffic already, and almost EVERY page on the site is dynamic, so a few of these games is going to be nothing, but if it gets popular maybe it could be an issue?
    From a dev standpoint, I would greatly prefer mysql as I already have a pretty good understanding of optimization and proper indexing.

    How often should the clients poll for new data?
    The responses would be pretty simple during planning. Basically a binary done/notdone for each human player. Once all human players are done a larger response would arrive containing all the other player's moves (human and computer), as well as anything that might require a random roll (so all players stay in synch). I was thinking every 5 seconds? Is that too fast?

    Is chat feasible in a polling environment?
    I suppose this all depends on the answer to how often do I poll, but do you think simple text chat would work okay for players to chat while a slowpoke is making their move? I think I could keep data transmission minimal by having the server provide an incremental ID number to each chatline and then just send new lines to a requesting client when needed.


    Would anyone with any applicable knowledge/experience care to offer any suggestions or common pitfalls I might miss? This is my first game in flash (made some AWFUL VB games years ago) and certainly my first network game.

    I am so glad I read this original post. I was beating my head around issues of getting a server to handle sockets and had never even considered the concept of polling a database. It's brilliant. Like a faster version of play by email!
    Last edited by Alluvian; 08-01-2007 at 04:32 PM.

  9. #269
    Senior Member webgeek's Avatar
    Join Date
    Sep 2000
    Posts
    1,352
    I've written a large blog post that covers a lot of the problems with polling and such here:
    http://mikegrundvig.blogspot.com/200...-to-avoid.html

    In general, HTTP polling is not nearly as good a solution as it sounds.

  10. #270
    Senior Member Alluvian's Avatar
    Join Date
    Jun 2006
    Posts
    967
    Ah..hah....

    You just want to sell me your fancy schmancy server code!!! I see through you like a movieClip with _alpha = 0!!!

    Just kidding, thanks for the response, I'll check out the blog post! And here I thought I was on to something too

    Unfortunately it is really my only option as I can't run a socket server and can't really afford decent server software if I could. Plus I would have to learn it, and server speach and packets and all still really alien to me.

  11. #271
    Senior Member Alluvian's Avatar
    Join Date
    Jun 2006
    Posts
    967
    Read the blogpost, and agree with the pitfalls you pointed out.

    I don't know how to do the store data in memory trick in php, or even if it CAN be done in that language.

    Since the chat would be just between the players (probably 6 max in my game), and nothing else needs to happen with any urgency, I think I could get away with a 5 second poll delay.



    Let me bite though, I have been to the electroserver site way back when I first was working on this game an briefly again a few days ago. In between these visits I have become a webmaster for my wifes site hosted by the ultracheap plan available at lunarpages.

    What server requirements would I need to run something like electroserver? Please remember you are speaking to a real newb when it comes to servers and the lingo. Could it run on a shared server for example? What server features/options would need to exist?

  12. #272
    Senior Member webgeek's Avatar
    Join Date
    Sep 2000
    Posts
    1,352
    Any box that can run the Java VM can run ElectroServer (or any of our Java-based competitors). Most virtual environments can run it as long as you can install software and run a process in the background.

  13. #273
    Junior Member
    Join Date
    Aug 2007
    Posts
    3
    Can anyone explain the basic concept for flash games? I have alot of flash knowledge...I am the guy who created Maple Story: Papulatus on newgrounds... but anyways, I have flash media server 2. I have it kinda figured out, like how to call functions from the server and how to call functions from the client to the server... I just don't understnad how I could have one client->server updates then if I want another client trying to find out where another location is, how would it find it? o_O
    I want to know how I could save data on the server, and if that is possible, then how do I access and distribute the data?

  14. #274
    Junior Member
    Join Date
    Feb 2009
    Posts
    2
    I think I'll post in this thread rather than making a new one, seeing as though it's relevant to my problem.

    I want to be able to make just some small, simple multiplayer games, and get them working. However, I don't want to be paying a monthly fee of $20 to keep up a virtual private server. If possible, I would like to be able to just the leave the game online, without worrying about the server cost building up or having to eventually abandon the game. Is there ANY way I could get multiplayer working for free, and without using my own computer as the server?

  15. #275
    Custom User Title Incrue's Avatar
    Join Date
    Feb 2004
    Posts
    973
    Yeah, nonoba provides the server and host the game for you
    I was even learning C# just to use their stuff until i saw that and that.
    Its the kind of risk you take if you dont do it all by yourself.

  16. #276
    Junior Member
    Join Date
    Feb 2009
    Posts
    2
    Quote Originally Posted by Incrue View Post
    Yeah, nonoba provides the server and host the game for you
    I was even learning C# just to use their stuff until i saw that and that.
    Its the kind of risk you take if you dont do it all by yourself.
    Thank you very much for the reply. This is just the thing I'm looking for! =D I'm only looking to upload small, useless games, so it doesn't matter that much if anything happens to them, or if the site eventually gets closed down for copyright infringement.

  17. #277
    Custom User Title Incrue's Avatar
    Join Date
    Feb 2004
    Posts
    973

  18. #278
    Junior Member
    Join Date
    May 2009
    Posts
    2
    just for the fun of posting to a thread that's been alive for 6 years, here's a little news: the "unity" project never actually died. in fact, it has evolved significantly, and been reborn as "Union". see www.unionplatform.com. happy (multiuser) coding!

  19. #279
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697

  20. #280
    Now tell me whos watchin...... samvillian's Avatar
    Join Date
    Feb 2007
    Location
    Where do you live?
    Posts
    539
    oh em gee its colin moock.........
    If the only tool you have is a hammer, you tend to see every problem as a nail.

    Xbox 360 Modding Controller PS3 Mod Paint Spray LED Case

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center