Implementing Web-based RPG fighting?

Discussion in 'HTML' started by Leif K-Brooks, May 21, 2005.

  1. I'm in the process of coding what amounts to a Web-based multi-player
    RPG. An important feature will be player-versus-player fighting. Since
    the players in a fight will never move instantly (or even close to it),
    there will need to be a way to inform players when their opponents have
    made a move.

    The most common implementation I've seen is using the Refresh header
    (possibly simulated via http-equiv -- ew!) with a period of around one
    refresh per second. When the opponent has moved, the page stops
    refreshing and displays the results of the turn along with a form for
    the player to make their move.

    This approach has a few problems: it's non-standard (although
    widely-supported, the Refresh header isn't in any HTTP spec), the
    constant reloading can cause high server load, and it takes at least one
    second for a player to be notified of their opponent's move (since
    that's how long it takes for the page to refresh).

    One alternative I've thought of is having keeping the HTTP connection
    open until the opponent moves, so that the page would look like this:

    ------------------------------------------------------------------------
    <p>Your opponent is moving, please wait...</p>

    (The page will stop loading at this point, but the connection will stay
    open. When the opponent moves, the loading will continue:)

    <p>Your opponent, <strong>Big Meanie</strong>, has kicked you in the
    crotch doing 30HP of damage.</p>
    ------------------------------------------------------------------------

    Unfortunately, this approach has a few problems of its own: the user
    might be confused by the page continuing to load even when nothing
    appears to be happening; some proxies would probably only send the user
    the page once it has been completely sent by the server (which could
    take over a minute in some cases); some browsers might timeout the
    request after a while; also, this approach would work with an
    asynchronous server, but wouldn't work so well with a multi-threaded or
    multi-process server (since the whole thread or process would be tied up
    until the opponent moved).

    Does anyone have suggestions for approaches I haven't thought of?
    Accessibility is a concern, but I recognize that this might be something
    that simply can't be done in every environment, so my biggest concern at
    the moment is usability in common visual browsers.
    Leif K-Brooks, May 21, 2005
    #1
    1. Advertising

  2. Leif K-Brooks wrote:
    > I'm in the process of coding what amounts to a Web-based multi-player
    > RPG.....


    Why would you want to do this when there are so many obviously better
    options out there. I seriously doubt someone who wants to play a RPG on
    line is worried about using Flash or Java or (maybe less so) activeX.

    I am not trying to be a smart ass, I seriously want to know why you dont
    want to use those technologies. What you are proposing is akin to using
    a chisel and rock to send mail.

    --
    -=tn=-
    Travis Newbury, May 21, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Jennings

    I want to make a scrolling RPG game...

    Kevin Jennings, Apr 16, 2004, in forum: Java
    Replies:
    4
    Views:
    1,397
    Andrew Thompson
    Jun 7, 2004
  2. My small RPG in UML

    , Sep 25, 2005, in forum: Java
    Replies:
    4
    Views:
    1,231
  3. MiniDisc_2k2
    Replies:
    1
    Views:
    358
    Default User
    Jul 3, 2003
  4. Ruairidh Mchardy

    Text Based RPG in Ruby

    Ruairidh Mchardy, Nov 1, 2008, in forum: Ruby
    Replies:
    11
    Views:
    283
    Ruairidh Mchardy
    Nov 3, 2008
  5. riklaunim
    Replies:
    0
    Views:
    153
    riklaunim
    May 5, 2009
Loading...

Share This Page