views:

388

answers:

5

I wanted to create a text based browser game, so how should I go about? I can do programming in asp or jsp or php that is not a barrier, but I am unaware of what steps that one needs to follow while attempting to make such games. So please guide me.

please also recommend me a programming language for making the same.

A: 

Design. Implement. Test. Play.

If it is a text based browser game, you can go with HTML :)

Zed
But it will be complicated... just like those football manager games..
5lackp1x3l0x17
Then definitely PHP, ASP, JSP, or one of the others.
Zed
+2  A: 

One of the simplest browser games is just a series of static pages with links on each page leading to other pages. Often there will be some "story" on the page followed by a few choices you can make. Different choices lead to different pages.

The next step up is to use dynamic pages instead. When loading a new page, the browser can send some variables to the server and the server can generate a page on the fly. This saves you the effort of creating lots of similar pages by hand, and also allows you to do things like random outcomes.

However, if you want to keep a lot of user state (such as inventory, skills, or whatever), it becomes cumbersome (and insecure) to continually pass this from server to browser to server. This is what session handling is for: it remembers a user for a while, and lets you remember some variables at the server side.

If you want a more interactive game, you would need to look into Javascript and perhaps AJAX, which allow things to change in the browser without needing to load a new page.

In terms of language, I would suggest Python CGI, 'cause I like Python. Start with something simple so you can get a better idea of what you're working with, before you design something large.

Have fun!

Artelius
If you're writing Python, best author to WSGI (either directly or through a framework if you prefer). You can deploy it through CGI for quick testing, but then you're not limited to slow CGI when the game needs better performance.
bobince
Thank you for your answer
5lackp1x3l0x17
A: 

Personally I would make a text based game in python and then get that to talk to a webserver. that way you can test the game without so much hassle.

What kind of game are you looking to write?

you have to think about what the user might do as well. They can duplicate their window and send the same information twice. They can click back which might mess up the game. You could get the user to submit the time and a session ID each time they click submit.

p.s. continuation passing style is one way to emulate the ability to call an return. It's not an easy way to write things though.

James Brooks
A: 

Sounds like you could map it out using a state machine (in any of your chosen languages)...could be a fun little project (:

Kieron
A: 

create a map - basically a two-dimensional array of "rooms" - alternatively you can make it three dimensional if you need to have your character go up and down as well...

then in the game when the player moves character to the south, just find that room in the array.

array could contain all required things related to the room (description, objects, NPCs etc.)

dusoft