Sign in to follow this  

[web] CGI Games (Like Swirve)

This topic is 4532 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Anyone know of some decent tutorials on this? I'm rather new to web games, but I love some of these games. Such as Utopia or Earth: 2025 (http://games.swirve.com) I want to develop my own of this kind, purely text based, but I'm unsure how to start. It would seem CGI tutorials are lacking around here, or would it be better to do this in PHP? Thanks for any help.

Share this post


Link to post
Share on other sites
I think you are right, CGI material is very limited towards games. I think that this is becuase of the fact that there is some lettency and time restriction. say for instance, you press a web form button ie subit some info you have to wait for it to reach the server, process it and send back some form of output. This client - server architecture makes it rather hard to make games. Although I have to stress it is not imposible, I suppose it depends on what type of game you are building. tic tac toe YES. Asteroids NO.

Share this post


Link to post
Share on other sites
The core part of the system would be the database, usually, in a text-based game to keep track of what goes on in your world. PHP can interface easily with a MySQL database (and good news: PHP and MySQL are both free, and can be easily set up - to serve the pages you can use Apache which, too, is free).
As far as tutorials go, the extended CHM PHP manual is a Godsend as a language reference, and there are a wide variety of books on the subject of using PHP and MySQL.
In response to what nas1982 said, Tic Tac Toe would be quite "tricky" to do via PHP - how can your page tell when the other player has made a move? Trading games, where you don't have to wait for an immediate response from the other player (you place an order, say, and a message is sent to the other player's account, who can then OK transaction) shouldn't be too tricky, though.

Share this post


Link to post
Share on other sites
by no means are these games "instant". A basic overview of the game is like this:

The player, gains "stamina" as REAL time progresses (lets say, 1 Stamina every hour, capping out at 50) When the player logs in, he can do various things with his Stamina points, like buy items, train, etc. Fighting would be 100% server processed based on the character's points, the player is in charge of training the character not using him.

So, PHP seems like it would be the way to go I suppose. I prefer CGI over PHP but if it's that much of an advantage then I guess I must get some PHP books :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Darc
The player, gains "stamina" as REAL time progresses...
Sadly, none of the servers I've ever used for hosting have allowed me to set up cron jobs [sad].
For that sort of thing, you could tell the server to execute a script at a given time interval, which would then go through the database and update player's records.

Share this post


Link to post
Share on other sites
No, there aren't any tutorials, you have to find your own way. But it's a really good idea if you plan it properly and think you can pull it off.

I can't see any massive advantages of using PHP over CGI (in whatever language you use, C++?) - just go with what you're comfortable with

Mark

Share this post


Link to post
Share on other sites

This topic is 4532 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this