Forum Settings
       
Reply To Thread

Question for those who develop web pagesFollow

#1 Jan 07 2007 at 1:14 AM Rating: Decent
I have a little single player game I've written in C which I've hacked into a hotseat multiplayer game (meaning each person uses the computer, in turn). I'd love to take this to the web. I guess my question is: by what method can I most easily get this up and running? I'm not worried about massive numbers of users or security - I'd just like my friends to play.

I've heard the gold standard is php/mysql. Is this overkill? Can I do something simple with just html?

I'll expand a bit more:

Most of my data resides in memory (the characters), and there is effectively a schedule file. On each player's turn, their commands edit the schedule file and then after all players "go", the computer reads the file and decides the outcome of events.

I'm envisioning something like this: each player signs on, and their character is read from disk, and each player issues commands and ends their turn. These are written to individual schedule files. (Or to a master file, I don't care). A script in the background is checking all the schedule files, checking to see when they are done (or, perhaps, going on a timer, such as once per day) and at that time each schedule file is read and the outcomes decided. The results are written to the character files (e.g. you're now level 2 and such).

Is this even possible without a database? Won't there be conflicts on accessing the files? A player may issue a new command while the computer is reading the schedule file.

#2 Jan 07 2007 at 6:23 AM Rating: Decent
***
1,719 posts
Anything is possible however I think if you were to try and use pure HTML/CSS you would have many things not work correctly. It would be a little easier using a server which is setup for php/mysql as you can then pull information from your database and not the players computer. Lets be honest if I had my character sheet information on my computer I would edit that thing and look I am an instant LV99 with the BFG.

If you still want to keep it in HTML you might be able to do it with an upload type feature which could determine turns however again the local fine is subject to editing. you will have to create a cgi-bin to store temp information such as the turn, damage, etc, etc.

So in short your best bet is to use php/mysql or convert your game into something universal such as Java and then use Cookies for storing your information.
#3 Jan 08 2007 at 3:20 PM Rating: Decent
Dear xXBiji - Thanks for your reply!

xXBijiontXx wrote:
Anything is possible however I think if you were to try and use pure HTML/CSS you would have many things not work correctly. It would be a little easier using a server which is setup for php/mysql as you can then pull information from your database and not the players computer. Lets be honest if I had my character sheet information on my computer I would edit that thing and look I am an instant LV99 with the BFG.


The data would be stored on the server, along with my C program, which would accumulate each player's info and determine what happens and re-write new files. The players would come back later and their browsers would read the new files which reflect the results.

Quote:
If you still want to keep it in HTML you might be able to do it with an upload type feature


Actually, yes, in reality, this is all that is needed. It could be a Play-By-Email game. However, I know I can create a simple form-based interface and give immediate feedback (e.g. the emails could be poorly formated).

Quote:
So in short your best bet is to use php/mysql or convert your game into something universal such as Java and then use Cookies for storing your information.


I have no real fear of converting it to Java. However, I think there would still need to be a server - one central location which collects everything.

I have another really simple question: with html, how would players "log on"? How can the server know who is who? Store a cookie on the local machine of the player? I'd rather store it on the server. Is it possible? How is that cookie tied to a specific person? IP address? Is this a html server question (apache question?)

Lastly, assume I can acquire and set up any server and software necessary.

Thanks.
#4 Jan 08 2007 at 10:06 PM Rating: Decent
***
1,719 posts
Hmm for the login, you could make it a simple user login like you see for memberships which is actually a simple HTML/Javascript you can write. If you want to have more user tracking as far as IP address and also being able to select a "player" out of the list you could look at striping out code from a phpBB system.

there is a good example of what you want I think, I remember my friend playing Pokemon a lot online at www.pokemoncrater.com it has a very interesting online play. I would go there sing up for a membership which is free and take a look at the battle system which allows you to select your opponent from a list. Maybe it will give you some more idea's.

The site looks to be done mainly in php from what I can tell.

Hope that helps you
#5 Feb 06 2007 at 4:38 PM Rating: Decent
Thanks. My inspiration is Kingdom Of Loathing, which is also done in php, but it will take some time until I can learn php. My spare time is in demand.
Reply To Thread

Colors Smileys Quote OriginalQuote Checked Help

 

Recent Visitors: 38 All times are in CST
Anonymous Guests (38)