Advice on planning a text based browser game in PHP

  • (2 Pages)
  • +
  • 1
  • 2

22 Replies - 2481 Views - Last Post: 13 December 2012 - 12:52 PM Rate Topic: -----

#1 theonlyone2012  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 12-December 12

Advice on planning a text based browser game in PHP

Posted 12 December 2012 - 08:31 AM

Hi,

I am interested in creating a text based browser game. I am currently familiar with HTML, CSS, PHP, MySQL & a small bit of javascript. Would it be possible to create a large scale browser game with just these technologies? It should be noted that I am relatively new to programming/web development. (I have done 1 year in college and prior to that had no experience, I mostly do little projects in my own time.)

I have a great idea for a game which I think would be very popular, however I don't know if someone of my skill level could pull it off.

Anyway to get to the point:

1) Is it possible with the technologies I already know?
2) Can someone of my skill level pull something large scale off by learning the hard bits as they go?
3) Where do I start?

Let me elaborate a small bit on no. 3, how would I plan a large text based game? Obviously I want to start working on it ASAP but
I feel it needs to be planned perfectly for me to have a chance of being successful.


PS: Is it better to design web pages or program the scripts first?
I typically design web pages and then "fill in" the functionality as I go.


Thanks for reading & I'd appreciate any advice.


Thank You.

Is This A Good Question/Topic? 0
  • +

Replies To: Advice on planning a text based browser game in PHP

#2 BenignDesign  Icon User is offline

  • holy shitin shishkebobs
  • member icon




Reputation: 5915
  • View blog
  • Posts: 10,336
  • Joined: 28-September 07

Re: Advice on planning a text based browser game in PHP

Posted 12 December 2012 - 08:44 AM

Moving to Game Development. If you look around over there, you'll likely find crazy amounts of information and resources on this exact topic. :)
Was This Post Helpful? 0
  • +
  • -

#3 theonlyone2012  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 12-December 12

Re: Advice on planning a text based browser game in PHP

Posted 12 December 2012 - 08:48 AM

View PostBenignDesign, on 12 December 2012 - 08:44 AM, said:

Moving to Game Development. If you look around over there, you'll likely find crazy amounts of information and resources on this exact topic. :)/>


Thanks, will do.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8915
  • View blog
  • Posts: 33,427
  • Joined: 12-June 08

Re: Advice on planning a text based browser game in PHP

Posted 12 December 2012 - 09:13 AM

Quote

HTML, CSS, PHP, MySQL & a small bit of javascript. Would it be possible to create a large scale browser game with just these technologies?

Yes.

Quote

It should be noted that I am relatively new to programming/web development.

Well.. then, maybe not right away.

Quote

I have a great idea for a game which I think would be very popular, however I don't know if someone of my skill level could pull it off.

Ideas are great, but yes.. the trouble will be with when the rubber meets the road. Can you do it? sure.. will you do it in the next month? Probably not.

Quote

1) Is it possible with the technologies I already know?
2) Can someone of my skill level pull something large scale off by learning the hard bits as they go?
3) Where do I start?
Let me elaborate a small bit on no. 3, how would I plan a large text based game?

1: Yes, 2: Maybe, 3. *sigh* Okay you need to write everything down. Plan it all out. Start high level of mechanics, core game take aways, fun points, etc.. then go deeper with factions, classes, background stories, world environments, etc... then deeper still with how to keep the game perpetually going, items, areas, etc.. then screens on how the user will interact with teh world.. database designs, milestones, a schedule, etc... Like an onion you gotta keep peeling back layers.

For example - the planning and requirements section outlined here:
http://wangnet.org/xnatutorial.html

Quote

I feel it needs to be planned perfectly for me to have a chance of being successful.

That's where these projects tend to fail - poor planning. People want to jump into coding with only a vague idea where to go and momentum is lost without having a constrained world and core set of goals and milestones that need to get the game across (you know - before the gold plating aspect).

Quote

PS: Is it better to design web pages or program the scripts first?

It's better to plan first.. but yes - you'll need pages to hold your scripts, right? So knock out a page frame (not a lot of detail) and then add your scripts.
Was This Post Helpful? 0
  • +
  • -

#5 theonlyone2012  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 12-December 12

Re: Advice on planning a text based browser game in PHP

Posted 13 December 2012 - 10:21 AM

Hi,

I posted a question yesterday asking for advice on planning a text-based browser game.

I am aware I cannot start coding anything until I have a concrete plan of action, something I don't have as of yet.

However I am still unsure of how to go about this.

My game would have a lot of "areas" where players could go.

E.g:

Pub, supermarket etc.

When a player enters an area they can see a list of all the other players in the same area and can do a variety of

different actions like buying a drink etc. etc.

Would creating the areas be as simple as having .php pages for each ?

When a user enters the area how would that be stored/recorded?

Would it just be a value in a database that gets updated.

Eg:
   current_area  |

       Pub



Then if a user entered a supermarket, run an update query and change pub to supermarket?

Would this be an efficient way of doing it ?


I'm not looking for any code, I just would appreciate advice on the ways I could do this.

I want my game to be large and eventually have thousands of users.

I am willing to spend anywhere from 6 months - 3 years developing this and learning as I go to college.


(I'm 18, have done one year of a computer science degree)

Before that one year of college I had no programming experience so I'm relatively new to this technology,

I have some experience making small projects with PHP, MySQL, HTML, CSS & Javascript.


Do you believe in the time frame I gave, I could develop a large scale game ?

What techniques would I have to learn ?

I don't want to have many graphics in my game as it is text based.

I am somewhat familiar (or at least aware) of things like the PHP rand function.

I would use this to generate random events that could happen when players play the game?



This project is very intimidating to me right now but the game, if I could somehow pull it off, would be a hit I'm sure.



So please, any advice much appreciated.


Thanks for reading.
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8915
  • View blog
  • Posts: 33,427
  • Joined: 12-June 08

Re: Advice on planning a text based browser game in PHP

Posted 13 December 2012 - 10:30 AM

*sigh* Merging with the original topic.

Quote

Would creating the areas be as simple as having .php pages for each ?

Ideally - no. You would want one generic class that you can call that can be any area but the data you pull in and options you set make it one spot or another.

Quote

When a user enters the area how would that be stored/recorded?Would it just be a value in a database that gets updated.

A database table of user ids, foreign keys (the location's id) would be appropriate.


Quote

Then if a user entered a supermarket, run an update query and change pub to supermarket?

Yes.. you would have a table called "locations" that would link up user ids and location ids.


Quote

I am willing to spend anywhere from 6 months - 3 years developing this and learning as I go to college.
...
(I'm 18, have done one year of a computer science degree)
...
Do you believe in the time frame I gave, I could develop a large scale game ?

Sure.


Quote

What techniques would I have to learn ?

The languages, databasing, security, load optimization, level design, object abstraction, seemless updating, game scenerio writing, game stat adjustment/nerfing... etc

Quote

I am somewhat familiar (or at least aware) of things like the PHP rand function.

Then you need to be more so.

Quote

I would use this to generate random events that could happen when players play the game?

Yes.
Was This Post Helpful? 0
  • +
  • -

#7 theonlyone2012  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 12-December 12

Re: Advice on planning a text based browser game in PHP

Posted 13 December 2012 - 10:39 AM

View Postmodi123_1, on 13 December 2012 - 10:30 AM, said:

*sigh* Merging with the original topic.

Quote

Would creating the areas be as simple as having .php pages for each ?

Ideally - no. You would want one generic class that you can call that can be any area but the data you pull in and options you set make it one spot or another.

Quote

When a user enters the area how would that be stored/recorded?Would it just be a value in a database that gets updated.

A database table of user ids, foreign keys (the location's id) would be appropriate.


Quote

Then if a user entered a supermarket, run an update query and change pub to supermarket?

Yes.. you would have a table called "locations" that would link up user ids and location ids.


Quote

I am willing to spend anywhere from 6 months - 3 years developing this and learning as I go to college.
...
(I'm 18, have done one year of a computer science degree)
...
Do you believe in the time frame I gave, I could develop a large scale game ?

Sure.


Quote

What techniques would I have to learn ?

The languages, databasing, security, load optimization, level design, object abstraction, seemless updating, game scenerio writing, game stat adjustment/nerfing... etc

Quote

I am somewhat familiar (or at least aware) of things like the PHP rand function.

Then you need to be more so.

Quote

I would use this to generate random events that could happen when players play the game?

Yes.


Quote

Ideally - no. You would want one generic class that you can call that can be any area but the data you pull in and options you set make it one spot or another.


So from just one class, I could create maybe 100+ "areas" and populate the page with the relevant data?
Where would this data be stored for me to pull it in ?

Thanks for the reply by the way.
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8915
  • View blog
  • Posts: 33,427
  • Joined: 12-June 08

Re: Advice on planning a text based browser game in PHP

Posted 13 December 2012 - 10:46 AM

Quote

So from just one class, I could create maybe 100+ "areas" and populate the page with the relevant data?

Yes.. in my typical game setup I have a few layers of classes that go into it. Say an "entity" class... then that can be used to derive a item, a user, and npc. I may have a whole monster manual of creatures used to attack my players, but they are all the same basic setup. A name, level, abilities/stats, attack power, attack action, defend power, hit points, and treasure drop.

So player X comes to an area.. the random roll says a monster jumps out. I check the area (location table) for typical monsters stationed there, randomly pick one - a goblin - (creature table), go to the that creature table to get all the details of a goblin.

The creature class is generic and so the player and the creature know how to work together regardless of the specific details.

Quote

Where would this data be stored for me to pull it in ?

In a database table.
Was This Post Helpful? 0
  • +
  • -

#9 theonlyone2012  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 12-December 12

Re: Advice on planning a text based browser game in PHP

Posted 13 December 2012 - 10:52 AM

View Postmodi123_1, on 13 December 2012 - 10:46 AM, said:

Quote

So from just one class, I could create maybe 100+ "areas" and populate the page with the relevant data?

Yes.. in my typical game setup I have a few layers of classes that go into it. Say an "entity" class... then that can be used to derive a item, a user, and npc. I may have a whole monster manual of creatures used to attack my players, but they are all the same basic setup. A name, level, abilities/stats, attack power, attack action, defend power, hit points, and treasure drop.

So player X comes to an area.. the random roll says a monster jumps out. I check the area (location table) for typical monsters stationed there, randomly pick one - a goblin - (creature table), go to the that creature table to get all the details of a goblin.

The creature class is generic and so the player and the creature know how to work together regardless of the specific details.

Quote

Where would this data be stored for me to pull it in ?

In a database table.



Wow thanks for the insightful answer, things are becoming clearer already.

My game is a little different to an action type game with attacks/violence etc.

Say for example a player in my game entered a pub.

I would run an update query changing the location in the location table to pub.

Then If I wanted to do an action like, buy a drink, for example.

How would the player buy the drink ? Is is simply all database work ?
Was This Post Helpful? 0
  • +
  • -

#10 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8915
  • View blog
  • Posts: 33,427
  • Joined: 12-June 08

Re: Advice on planning a text based browser game in PHP

Posted 13 December 2012 - 11:04 AM

Quote

Then If I wanted to do an action like, buy a drink, for example.


There's a ton of ways to do this, but off the top of my head - the class would have a list of all actions you can do at a location.. when the location loads it loads what actions are available (an array of booleans or something along that lines)... then only those actions are shown to the user (and make sure the options selected are constrained to the visible options)...
Was This Post Helpful? 0
  • +
  • -

#11 theonlyone2012  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 12-December 12

Re: Advice on planning a text based browser game in PHP

Posted 13 December 2012 - 11:12 AM

View Postmodi123_1, on 13 December 2012 - 11:04 AM, said:

Quote

Then If I wanted to do an action like, buy a drink, for example.


There's a ton of ways to do this, but off the top of my head - the class would have a list of all actions you can do at a location.. when the location loads it loads what actions are available (an array of booleans or something along that lines)... then only those actions are shown to the user (and make sure the options selected are constrained to the visible options)...





If each location had, say, 7-8 actions and there were 100 locations there would be 700-800 different actions in the game.
All of which would generate random outcomes and points would be added/deducted.

I understand this would have to be extremely organized.

Would there be an actions table with everything stored in it?

Sorry to ask so many questions, I'm just trying to get a better understanding from

someone who has experience with this kind of thing and not a user manual.
Was This Post Helpful? 0
  • +
  • -

#12 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8915
  • View blog
  • Posts: 33,427
  • Joined: 12-June 08

Re: Advice on planning a text based browser game in PHP

Posted 13 December 2012 - 11:16 AM

Quote

If each location had, say, 7-8 actions and there were 100 locations there would be 700-800 different actions in the game.
All of which would generate random outcomes and points would be added/deducted.


Really? 100 unique locations with nothing sharing similar qualities? I mean just because pub A and pub B have different data does not preclude them from being the same entity.
Was This Post Helpful? 0
  • +
  • -

#13 theonlyone2012  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 12-December 12

Re: Advice on planning a text based browser game in PHP

Posted 13 December 2012 - 11:19 AM

View Postmodi123_1, on 13 December 2012 - 11:16 AM, said:

Quote

If each location had, say, 7-8 actions and there were 100 locations there would be 700-800 different actions in the game.
All of which would generate random outcomes and points would be added/deducted.


Really? 100 unique locations with nothing sharing similar qualities? I mean just because pub A and pub B have different data does not preclude them from being the same entity.


There wouldn't necessarily be two types of the same area.

There could be a:

cinema, pub, night club, supermarket, police station, library etc. etc. etc. (as many as I can think up and program)
Was This Post Helpful? 0
  • +
  • -

#14 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8915
  • View blog
  • Posts: 33,427
  • Joined: 12-June 08

Re: Advice on planning a text based browser game in PHP

Posted 13 December 2012 - 11:23 AM

Okay.. that seems.. odd, but then you can take a general 'location' object and have a bunch of inherited classes (each for your location type) derive from that. These are odd things you need to tease out with your own game design.
Was This Post Helpful? 0
  • +
  • -

#15 theonlyone2012  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 12-December 12

Re: Advice on planning a text based browser game in PHP

Posted 13 December 2012 - 11:32 AM

View Postmodi123_1, on 13 December 2012 - 11:23 AM, said:

Okay.. that seems.. odd, but then you can take a general 'location' object and have a bunch of inherited classes (each for your location type) derive from that. These are odd things you need to tease out with your own game design.


Can I ask what is odd about it? Would it normally be done another way (or the way you mentioned).
Would your way reduce the workload and be more efficient?

Quote

These are odd things you need to tease out with your own game design.


Yes. It's just quite confusing trying to figure out how my game will work (back-end wise) with a limited programming knowledge.


Just out of curiosity, how long would it typically take you to complete a large game?
(I'm assuming you're adept in the field.)
I just want to figure out a time frame for myself to finish the game.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2