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.
Search for “text adventure” without the quotes. Open the JavaScript developer console by pushing Command+Option+J on a Mac, or Ctrl+Shift+J on Windows. You should see a prompt asking if you “Would like to play a game?” Type yes and push enter, and the game will start!
Text adventures (sometimes synonymously referred to as interactive fiction) are text-based games wherein worlds are described in the narrative and the player submits typically simple commands to interact with the worlds.
Text-based adventure games (also known as Interactive Fiction, or IF) are a classic game genre where all the interaction takes place through on-screen words. Despite their primitive origins born from hardware limitations, this type of adventure is still alive today and enjoyable on modern devices.
Colossal Cave Adventure was the first text-based adventure game—It was developed in 1976 using one of the earliest computer programming languages, at the same time as the earliest version of the internet itself, ARPANET.
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!
Sounds like you could map it out using a state machine (in any of your chosen languages)...could be a fun little project (:
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.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With