4 Replies - 1680 Views - Last Post: 30 July 2007 - 11:57 AM Rate Topic: -----

#1 anow2  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 28-July 07

Getting Started with a Text Based Game.

Posted 28 July 2007 - 03:42 PM

I am looking at creating a Text based game, in PHP.
I just started learning PHP about 2 days ago, and I have so far, only created a Login/Register System, using MySQL.

I am not sure whether or not I am going to be tackling on this project by myself or with a friend of mine.

The game is going to be a Tycoon sortof game, where you build buildings, and can upgrade, etc. Closer to the road gives a bigger boost for more traffic. You could also vandalize other peoples property. (Bomb, Graffiti, etc.)

How would I go about starting my project?

Thanks,
-anow2

Is This A Good Question/Topic? 0
  • +

Replies To: Getting Started with a Text Based Game.

#2 girasquid  Icon User is offline

  • Barbarbar
  • member icon

Reputation: 108
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Re: Getting Started with a Text Based Game.

Posted 28 July 2007 - 11:10 PM

Writing your authentication system first seems like a good idea to me - it's generally the course I follow when I'm building something too.

Once you've gotten that part down, start with the simplest and least inter-linked part of the system. That might seem weird, but it works.

Let's say you have 2 options: letting players choose where to place a building, and letting players customize a building based on where it was placed. You'd probably want to work on the first segment first, and then work on the systems that required it afterwards.

That's the process I follow, though. Your mileage may vary.
Was This Post Helpful? 0
  • +
  • -

#3 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4421
  • View blog
  • Posts: 12,286
  • Joined: 18-April 07

Re: Getting Started with a Text Based Game.

Posted 29 July 2007 - 04:50 PM

If you are really serious about this I would start by grabbing a pad and pencil and write down everything you want in the game and how things might interact with other objects. For instance you might want to define the building types, what kinds of buildings will you have? How much will they cost? Can they be upgraded? What type of people or what types of streets, how will the player make money etc.

It seems a bit boring, but thinking it all out and writing it down will make your programming easier. You will then clearly see what needs to be done before other steps by putting your ideas in a general outline of events (even a Gantt chart if you know what those are).

Once you have that done the coding part will be much easier and faster. You will stand a better chance of actually finishing it and getting it out there on the market for others to enjoy.

Oh and don't forget to put in a programming lab building to your game so that your players can have cool elite hacker like geeks into their city to solve the world's problems. ;)

This post has been edited by Martyr2: 29 July 2007 - 04:51 PM

Was This Post Helpful? 0
  • +
  • -

#4 NickyBoy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 30-July 07

Re: Getting Started with a Text Based Game.

Posted 30 July 2007 - 03:54 AM

Hello!
First of all I like announce you that i might do some mistakes in spelling. :D
I'm learning PHP,MySql,Javascript,CSS and html.... And I wanna' make a browser game like anow2.
...but I have some questions.
1)Let's say my city have some resources and for example 1200 WOOD. And the villagers consume 60 wood/hour. How can I modify my database every second for all the players. It will take too long? Is there another way?
I have tried with php timer and... it dose'nt work.
2)I have read on other forums that the security is a big problem.
3)MySql is good enouth for suporting plenty of users?

10x,
NickyBoy
Was This Post Helpful? 0
  • +
  • -

#5 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4421
  • View blog
  • Posts: 12,286
  • Joined: 18-April 07

Re: Getting Started with a Text Based Game.

Posted 30 July 2007 - 11:57 AM

View PostNickyBoy, on 30 Jul, 2007 - 03:54 AM, said:

Hello!
First of all I like announce you that i might do some mistakes in spelling. :D
I'm learning PHP,MySql,Javascript,CSS and html.... And I wanna' make a browser game like anow2.
...but I have some questions.
1)Let's say my city have some resources and for example 1200 WOOD. And the villagers consume 60 wood/hour. How can I modify my database every second for all the players. It will take too long? Is there another way?
I have tried with php timer and... it dose'nt work.
2)I have read on other forums that the security is a big problem.
3)MySql is good enouth for suporting plenty of users?

10x,
NickyBoy


Yeah that is a bit of the tricky part but what is usually done is the setup of a what is known as a "cron job" (chronological job) on the server. It is a scheduled process which executes a script every so many seconds, minutes, hours, days etc.

For your example you would setup a script that calculates the rate of wood consumption (based on population, mills you have built etc) and then deduct that from their total. Now unlike desktop games where you could update every second or so, due to the work that may be involved to update hundreds and thousands of users this would be impractical. So what you would do is instead maybe set the schedule every 5 minutes or maybe every 30 minutes. If they are using 60 wood/hour, you may need to design the game so that your job runs every 30 minutes and subtracts 30 wood from the account.

This limitation is why you find many online games work on the idea of a "game day" where a game day may be an hour in real life. Their job will then run every hour and update gold, wood, stone, etc. I strongly recommend never setting up the scheduled job less than maybe 5 minutes because you will run into scalability issues later if your game becomes quite popular.

Below is a few links to an explanation of what cron jobs are (I am probably going to get yelled out by the *nix crowd for such simple sites but oh well). I hope they help push you into the right direction.

Cron job basics
Cron help site
Setting up crons (link to windows version as well)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1