Web Based Game Essentials

Looking to make a game? Then this is a must read

  • (2 Pages)
  • +
  • 1
  • 2

22 Replies - 32021 Views - Last Post: 22 September 2013 - 12:48 AM Rate Topic: ***** 8 Votes

#48 JBrace1990  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 110
  • View blog
  • Posts: 760
  • Joined: 09-March 08

Re: Web Based Game Essentials

Post icon  Posted 01 July 2009 - 09:33 AM

*
POPULAR

First off, i'd like to link to this post. It includes many of the things needed for a game to be developed, though not as detailed as my guide.

Throughout this guide, i'll discuss what is needed for a game world to progress, as well as skills that are needed for such things.

1. Basic Development Skills


To make a game, the first think you need is to decide on which programming language to go with. Since this is the PHP Forum, most of what i'll talk about is PHP and other web based languages, though games can be developed in practically ANY language.

1.1 Coming up with an idea

To make a game, you first need an idea of what it is you want to build. For example, is the game going to be based on an island, or in the far reaches of space? You need to know where it takes place before you start anything else, as it influences your decisions.

For example, in Star Wars, a lightsaber isn't very useful if the movie was made around ship battles instead of inside the ship.

An idea for a game should be something unique. If there's already a game out there with the idea you want, then you need to really promote it for it to be successful, especially if it's based off of player versus player interactions.

1.2 PvP versus PvE

In any game, there's one of three ways to do it, either PvP, PvE, or a combination of both. To help you decide, here's a list of them:

1.2.1 PvP (Player versus Player)

PvP is a biggie in the game world, and also requires the most knowledge to make successfully. While usually combined with PvE, it can sometimes be used by itself. In PvP games, the game itself is based on Player interaction where one player is up against another player. For example, oGame, a popular Space game, is pure PvP. The entire universe runs on players attacking each other, banding together into alliances, and helping out other players that are your allies.

While pure PvP can be fun to some, for others it's too fast paced and unforgiving, which leads us to our next one.

1.2.2 PvE (Player versus Environment)

In PvE games, a player plays against the computer. Think of single player in your favorite game, that's what this is. While there may be interactions, it's usually with an AI (or Artificial Intelligence) that responds to certain inputs with certain outputs (think of it as a math function. If you put in 2, you'll get out 4.). Many times what the player says or does can affect the outcome of his game (once again, think of a game you've played that has multiple endings (Fable for me)).

1.2.3 PvP & PvE

Many successful games combine both PvP and PvE environments to make a game for players that want to do both. Think of very popular games such as Eve
Online
and World of Warcraft. It's up to the player to determine which he wants to play, though they can switch back at any time. For example, in WoW (the common abbreviation for World of Warcraft), players usually start off with PvE elements to level up and unlock new abilities. Then, at higher levels, they can play in PvP matches and try to beat other players characters (with their consent of course).

1.3 Calculations

All games need some type of calculations, whether they're simple or complicated, that's up to you. Any game that has damages, luck, or anything else needs a type of calculation.

Calculations usually use a LOT of math and can take a while to perfect. Don't be afraid to ask for help, DIC is here for that, and as long as you're trying, DIC will be there for you.

Calculations can raise in simplicity from adding, multiplying, etc., all the way up to exponents, functions, trigonometry, etc.. For example, in a baseball game you would need Geometry and Trigonometry to deal with the shape that makes up the baseball diamond. To make it lifelike you would require very complicated algorithms that make use of actual trigonometric functions.

2. Getting the game down


Now that you have a general idea of what you want the game to be, now you need to work on actually making it. If you don't know a programming language, stop right here and go to either W3Schools or Tizag and start learning. Games are an advanced step of programming which requires many of the languages functions, and should not be undertaken by novices.

2.1 Where to start

Where to start is relative to who you are. I know programmers that start with the Database first, and I know ones who start with the scripts. I start with the scripts, and edit the database as I go along to reflect what i've added.


2.1.1 Functions

Functions are the backbone of any well programmed and methodically laid out game. Functions are scripts of program that you use multiple times, and are needed if you use OOP (Object Oriented Programming).

Functions themselves are usually in an included file, to make the code on the actual page easier to read.


2.1.2 Scripts

Scripts are definitely needed for any type of game. They include hard coded things that the player can do, as well as security precautions to protect your database. Just remember that the Database is accessed through your scripts, and that everything needs to be sanitized before it becomes introduced to your database.

2.1.3 Database

The database is the main element of the game, as it stores data to be recalled at another time. Databases can be hacked, however, so i would suggest backing it up daily if possible.

An actual database consists of Tables (which hold rows and columns). The rows are what contains the actual data, and the columns declare what that data is. In a table there's several types that you can declare for it, so make sure that you're using the correct type. For example, if you're storing a true or a false, why use a varchar that can store anything? Just make it a Boolean expression.

2.2 Aesthetic Improvements

The main part of a game is how it looks. if it's a simple text based game with no images, most modern day players would choose another game that is more aesthetically pleasing to them. While the old MS DOS programs that were pure text were nice, and usually had better stories than most modern day games i've played, The gaming Genre has changed from the story of the game to how it looks. Breathtaking cinematics in games such as Final Fantasy have changed gaming forever.

So why have a game that is only text?

2.2.1 Photoshop

Photoshop is the main program for most developers for graphics. It's relatively easy to learn, and does a lot of the work for you. While having a rather large price tag, there's many tutorials online to get you easily started.

2.2.2 Gimp

Gimp is basically a free version of Photoshop. While not designed by the same company, Gimp aims to take out Photoshop and has many of the same features (though it also lacks many).

2.2.3 Blender

Blender differs from the other two in that it produces three-dimensional images (that's right, 3D). Blender is also another free program, and while I don't know many developers that need 3D art, it's worth mentioning to those of you who want that extra aesthetic "kick" to your game.

3. Progressing the game world


All game worlds need to move along, especially if you're making a PvP game where players from around the world can join.

3.1 CronJobs

If you're making the game Web Based, than you can make use of something on most servers: Cronjobs. These are used to execute certain scripts at certain times (IE: every minute, every 5 minutes, every 15 minutes, hourly, daily, Etc.).

If you're making a game that has ranking, then ranking updates can be daily. If you're making one with resources, you might want it to be done every couple of minutes.

3.2 Another Method

While cronjobs are nice, if your server doesn't support them, or you can't figure them out, there IS another option, which i'll try to explain as best I can.

Think of it this way: If no one is online in the game, does anything HAVE to update? You might be saying yes: Resources. But you're wrong. Resources would only need to be update when someone would see them.

So, if you add a time column to your database, and store the last timestamp when it was update, all you need to do is make a script that will update it when it needs to be updated.

For example, lets say you add turns every 5 minutes. A player logs on at 3:00 PM. He plays until 3:20 PM. That means he has updates from 3:00, 3:05, 3:10, 3:15, and 3:20. Now, if he logs on again at 5:00 pm, he would be missing the time from 3:20 to 5:00, which is 20 updates. Using my method, the script would see that he is missing 20 updates, and would account for that, adding in his 20 updates.

Just think: What's he gonna do with his resources while he's offline?

4. Adding Extra Elements


While the game is now complete (or at least it is in your mind), you might want to add more elements to it. For example, since PHP is Server Side, maybe you want to add in a client side language (think Javascript) that can change things. For example, wouldn't it be really nice to have the server time constantly update without refreshing the page?

5. Tips
  • Don't expect your game to take off immediately. Every website takes a while to get going, but if you have a nice game going, it will grow and get much larger than it started as.
  • Don't be afraid to sink some money into it. Few of us are a jack of all trades, and many of us are one trick ponies. What i'm saying is you probably can not do everything yourself. For example, I am horrible at graphic arts. I know how to use Photoshop, I just don't have the eye for it.
  • Search Engine optimization is a must. This makes it easier for the search engines (google, yahoo, bing) to cache your page and make it available to people searching.
  • Keywords should be added throughout the page. Don't add in junk keywords that don't emphasize your game.
  • Above all: Have Fun! You're making a GAME, it should be fun. If you find yourself getting stressed out, then take a break. Rome wasn't built in a day, and if you're developing a game on your own, it will take a while. most of the games out there were not made by one person.
Can a mod please sticky this? Thank you ~ JB
Was This Post Helpful? 26

#49 Quin  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 19
  • View blog
  • Posts: 382
  • Joined: 16-October 08

Re: Web Based Game Essentials

Posted 02 July 2009 - 12:23 PM

This was Tweeted to me.

I like!

I'd have to say that this can fit in with any programming language, not just PHP (as it is in the PHP Programming Help).

It was a nice read... descriptive and fun to read.

This post has been edited by Quin: 02 July 2009 - 12:24 PM

Was This Post Helpful? 2
  • +
  • -

#50 JBrace1990  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 110
  • View blog
  • Posts: 760
  • Joined: 09-March 08

Re: Web Based Game Essentials

Posted 02 July 2009 - 05:52 PM

I agree, it's not completely PHP, as it's more the method, but I don't really know where it should go.
Was This Post Helpful? 0
  • +
  • -

#51 ayman_mastermind  Icon User is offline

  • human.setType("geek");
  • member icon

Reputation: 126
  • View blog
  • Posts: 1,860
  • Joined: 12-December 08

Re: Web Based Game Essentials

Posted 06 July 2009 - 02:14 AM

@JBrace1990, thank you for this very nice over view of online game development, this was very helpful and informative :)
Was This Post Helpful? 0
  • +
  • -

#52 JBrace1990  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 110
  • View blog
  • Posts: 760
  • Joined: 09-March 08

Re: Web Based Game Essentials

Posted 06 July 2009 - 08:25 AM

Thank you for the feedback =)

And remember guys, please mark the post as helpful if it's informative
Was This Post Helpful? 0
  • +
  • -

#53 lukelb15  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 09-July 09

Re: Web Based Game Essentials

Posted 09 July 2009 - 12:35 PM

Great guide for pepole who are looking to start a new game
Was This Post Helpful? 0
  • +
  • -

#54 Nykc  Icon User is offline

  • Gentleman of Leisure
  • member icon

Reputation: 729
  • View blog
  • Posts: 8,642
  • Joined: 14-September 07

Re: Web Based Game Essentials

Posted 09 July 2009 - 12:42 PM

Thanks for the read!
Was This Post Helpful? 1
  • +
  • -

#55 JBrace1990  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 110
  • View blog
  • Posts: 760
  • Joined: 09-March 08

Re: Web Based Game Essentials

Posted 11 July 2009 - 06:13 PM

Thanks for the replies and the thanks guys =)
Was This Post Helpful? 0
  • +
  • -

#56 phpaccountant  Icon User is offline

  • New D.I.C Head

Reputation: -9
  • View blog
  • Posts: 1
  • Joined: 05-November 09

Re: Web Based Game Essentials

Posted 05 November 2009 - 03:58 PM

Hi

Can someone guide me please in helping on understanding how I can build a web based Online Accounting system. You talk about building a game application building and I as an Accountant clueless about programming want to know if you could help me in understanding how do I make simple program.

Take for an example I would like to build a simple accounting program where you can record sales by adding customers, add suppliers , pay the bills , add the online bank statements etc and can calculate numbers like profits , post journals etc.

I know there are open source programs there but I want to do it myself and will be very grateful if you could help.

This post has been edited by macosxnerd101: 17 August 2010 - 01:26 PM
Reason for edit:: Removed excess whitespace and quote.

Was This Post Helpful? -9
  • +
  • -

#57 GillBate  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 18-October 09

Re: Web Based Game Essentials

Posted 09 June 2010 - 06:05 AM

Good topic. BTW I still never code function yet for my game. I dont know if newbie like me can write function. I've just write raw codes.
Was This Post Helpful? 0
  • +
  • -

#58 JBrace1990  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 110
  • View blog
  • Posts: 760
  • Joined: 09-March 08

Re: Web Based Game Essentials

Posted 20 June 2010 - 08:57 PM

Functions are just a way to separate code. You don't need to use them, but they will help you set it up a lot if you do.

And thank you, I put a lot of work into it.
Was This Post Helpful? 0
  • +
  • -

#59 ShaneK  Icon User is offline

  • require_once("brain.php"); //Fatal error :/
  • member icon

Reputation: 240
  • View blog
  • Posts: 1,224
  • Joined: 10-May 09

Re: Web Based Game Essentials

Posted 21 June 2010 - 10:02 AM

View PostJBrace1990, on 20 June 2010 - 08:57 PM, said:

Functions are just a way to separate code. You don't need to use them, but they will help you set it up a lot if you do.

And thank you, I put a lot of work into it.


Also, easily reuse...

For example, if you wanted to multiply a number by 5.2 and then round it every time x action happened, would you really want to have to do all that every time x action happened? Wouldn't you rather call a function that does it for you?

Functions keep your code clean and easier to use.

Yours,
Shane~
Was This Post Helpful? 1
  • +
  • -

#60 oneal.michaels  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 4
  • View blog
  • Posts: 116
  • Joined: 25-June 10

Re: Web Based Game Essentials

Posted 06 July 2010 - 04:45 PM

Functions definitely keep code cleaner, and make it reusable, i use functions for most database input as it makes it a lot easier to write the fucntion and then every time something needs to be put in the database just use my simple function, and also i would like to say that i am interested in developing online games and this was a very helpful post, thanks!
Was This Post Helpful? 0
  • +
  • -

#61 Ajdija  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 21-February 10

Re: Web Based Game Essentials

Posted 17 August 2010 - 01:25 PM

Great tutorial I agree with all tips. Especially with SEO marketing. As it's said SEO is must have. SEO urls and meta tags are just needed to well going.
Was This Post Helpful? 0
  • +
  • -

#62 Coding Monkeh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 04-October 10

Re: Web Based Game Essentials

Posted 05 October 2010 - 01:19 AM

Very good post, but you know you'll still get people coming to you asking "can you make a game for me and co own" Quite annoying lol :P
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2