473,387 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Implementing a simple persistent web game server

Hi everyone,

I have a concept for a pretty simple web game, and am currently
considering my options regarding the storage of the game state.
Ideally, I would like to have a custom server running that keeps the
most accessed data in memory, and which all clients connect to.
Nothing new there, but I am wondering as to what protocol to use for
the client server communication. Go for one of the available XML-
based standards, or use something custom that will generate less
overhead but be more cryptic (and possibly difficult to maintain in
the long run)?

My current plan is to use PEAR's Net_Server (1) and extend that with
the functionality I need.

Thanks in advance for any input you may have.
--
1. http://pear.php.net/package/Net_Server
Aug 8 '08 #1
8 2609
On Aug 8, 3:19*pm, AeonOfTime <s.mordz...@gmail.comwrote:
I am wondering as to what protocol to use for
the client server communication.
What kind of data are you sending? How much?
Aug 8 '08 #2
On Aug 8, 3:52*pm, Sjoerd <sjoer...@gmail.comwrote:
On Aug 8, 3:19*pm, AeonOfTime <s.mordz...@gmail.comwrote:
I am wondering as to what protocol to use for
the client server communication.

What kind of data are you sending? How much?
It's an RPG-style game, so it's character stats and actions to
undertake - mostly numbers there, so not much data at all. Where there
will be more data is in querying item descriptions, but I think that
will be a separate daemon as the main server only keeps track of stats
and what items you have.
Aug 8 '08 #3
On 8 Aug, 15:06, AeonOfTime <s.mordz...@gmail.comwrote:
On Aug 8, 3:52*pm, Sjoerd <sjoer...@gmail.comwrote:
On Aug 8, 3:19*pm, AeonOfTime <s.mordz...@gmail.comwrote:
I am wondering as to what protocol to use for
the client server communication.
What kind of data are you sending? How much?

It's an RPG-style game, so it's character stats
That should be "its character sets".

Aug 8 '08 #4
On Aug 8, 4:53*pm, Captain Paralytic <paul_laut...@yahoo.comwrote:
>
It's an RPG-style game, so it's character stats

That should be "its character sets".
Sorry for being cryptic, I suppose that should have read "It is an RPG-
style game, so the data consists of character statistics and commands
for actions to undertake".

For my defense I have to add that I am french, and that accounts for
some occasional glitches :)
Aug 8 '08 #5
AeonOfTime wrote:
Hi everyone,

I have a concept for a pretty simple web game, and am currently
considering my options regarding the storage of the game state.
Ideally, I would like to have a custom server running that keeps the
most accessed data in memory, and which all clients connect to.
Nothing new there, but I am wondering as to what protocol to use for
the client server communication. Go for one of the available XML-
based standards, or use something custom that will generate less
overhead but be more cryptic (and possibly difficult to maintain in
the long run)?

My current plan is to use PEAR's Net_Server (1) and extend that with
the functionality I need.

Thanks in advance for any input you may have.
--
1. http://pear.php.net/package/Net_Server
Most OS's and databases already cache the most recently used data in memory.

If you're going to use PHP on the server, you're probably going to be
using html, xml, etc. over HTTP It really doesn't make that much
difference which it is, because you'll be using a browser on the other
end. There are other ways to do it - but they will be much harder to
implement from the client end (where most people will NOT have PHP).
Also, please remember that HTTP is a stateless protocol - strictly
request from the client/response from the server and that's all.

Alternatively, you could use something like Java where you have more
flexibility and can run applets or java applications on the client end
(many people do have java, but not all).

The actual format of the data is meaningless at this point. You need to
first determine what you need for the game as far as communications, and
concentrate on that. That will help you determine what protocol you
need to use. And once you have the protocol, you can do about whatever
you want with the data.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 9 '08 #6
On Aug 9, 2:30*am, Jerry Stuckle <jstuck...@attglobal.netwrote:
The actual format of the data is meaningless at this point.
I agree. You should first use any protocol which is easy to work with
and is simple to use. That will no doubt give problems with
performance and/or flexibility. When you see these problems, you know
better what your program demands of the protocol and you can pick a
better one.

This means that you will be changing the protocol somewhere in the
development of your game. This means that you need to have an
abstraction layer, which handles the communication and has an
interface which is unaware of the underlying protocol.
Aug 9 '08 #7
On Aug 9, 2:30*am, Jerry Stuckle <jstuck...@attglobal.netwrote:
>
Most OS's and databases already cache the most recently used data in memory.

If you're going to use PHP on the server, you're probably going to be
using html, xml, etc. over HTTP *It really doesn't make that much
difference which it is, because you'll be using a browser on the other
end. *There are other ways to do it - but they will be much harder to
implement from the client end (where most people will NOT have PHP).
Also, please remember that HTTP is a stateless protocol - strictly
request from the client/response from the server and that's all.

Alternatively, you could use something like Java where you have more
flexibility and can run applets or java applications on the client end
(many people do have java, but not all).

The actual format of the data is meaningless at this point. *You need to
first determine what you need for the game as far as communications, and
concentrate on that. *That will help you determine what protocol you
need to use. *And once you have the protocol, you can do about whatever
you want with the data.
Agreed on all of the above. I still had a misconception about the
client/server architecture I would have to use. I was thinking in
terms of games that have a real client that runs on the player's
computer and communicates with the server. In my case, the client will
be a PHP script on my end with a local server script I will use to
access the data via HTTP to (hopefully) allow for semi-real time event
game events.

The initial question about the protocol was also motivated by the fact
that I plan on making the game code public at some point, and using an
established standard for the game/server communication would enable
developers faster access to it. There will be constaints in
performance though, so in the end I may have to go for something
proprietary anyway.

Thanks for the input!
Aug 12 '08 #8
On Aug 9, 8:33*pm, Sjoerd <sjoer...@gmail.comwrote:
On Aug 9, 2:30*am, Jerry Stuckle <jstuck...@attglobal.netwrote:
The actual format of the data is meaningless at this point.

I agree. You should first use any protocol which is easy to work with
and is simple to use. That will no doubt give problems with
performance and/or flexibility. When you see these problems, you know
better what your program demands of the protocol and you can pick a
better one.

This means that you will be changing the protocol somewhere in the
development of your game. This means that you need to have an
abstraction layer, which handles the communication and has an
interface which is unaware of the underlying protocol.
You are right. I was planning on building the server, and on the
client side have a class that handles all the communication with an
easy to understand API to access or send the required data. Then I can
change the underlying protocol if I need to without modifying anything
in the code on the client.
Aug 12 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Paul Rubin | last post by:
I've had this recurring half-baked desire for long enough that I thought I'd post about it, even though I don't have any concrete proposals and the whole idea is fraught with hazards. Basically...
0
by: obhayes | last post by:
Hi All, Im using classic ASP (3.0) and I have a web farm with 2 webservers (webserver A and webserver B, both windows server 2003). I do not want to store any client specific information on the...
1
by: brad | last post by:
Hi, Im using classic ASP (3.0) and I have a web farm with 2 webservers (webserver A and webserver B, both windows server 2003). I do not want to store any client specific information on the...
7
by: Steven | last post by:
Hello, First, let me state that I am trying to learn asp.net, so I am a beginner. Now on to the issue. I have a webform with a single Textbox and a FileSystemWatcher monitoring a directory for...
2
by: Vitali Gontsharuk | last post by:
Hi! I have a problem programming a simple client-server game, which is called pingpong ;-) The final program will first be started as a server (nr. 2) and then as a client. The client then...
6
by: Joseph Geretz | last post by:
I have the following class which I am serializing and passing back and forth between my Web Service application and the client. public class Token : SoapHeader { public string SID; public...
3
by: sanchita | last post by:
Hello everyone, I didn't get any response in "Security" forum hence posting here again. I am having problem with persistent cookies. Even after setting "CreatePersistentCookie" to true in...
5
by: koonda | last post by:
Hi all, I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the...
9
by: mel | last post by:
Hi all, I need a persistent TCP connection with my web server over page reloads. This means that, even if the user goes to a different page (in my domain), I want to keep a TCP connection...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.