Treadon
8th August 2006, 03:13 AM
One of the most common questions I get, at least once a day is, “I’m interested in making a game, but I don’t know where to get started, can you point me in the right direction? Can you help me make a game?” The answer to the first question is yes I’ll help you get started, that is why I’m making this post. The answer to the second one is no; Although I’d like to see more high quality unique (not just DopeWars knock-offs) games with creative ideas, it’s just not possible for me to sit down with everyone who wants one, between work, school, my social life (:O) and my own websites it’s hard to make the time, and I’ve also found that most people just don’t go through with it once they realize the amount of work involved, meaning any time invested was just wasted!
So, ya wanna make a web-based game, eh?
There are 4 main components to a web-based game:
1) The Code
2) The Database
3) Users
4) Hosting
3 is a simple concept, for a multi-player game to live, you need players. Marketing isn’t an easy task, and you’ll quickly find that any method where you get “something-for-nothing” doesn’t produce any results. I often get, “Can you place a link to my game from DopeWars?” It is possible something can be worked out, but like I said, don’t expect something-for-nothing. If you look at DopeWars there aren’t very many links leaving the site, we are not going to clutter the pages with links that offer nothing to our users or the game, a link swap is just clutter unless the partner has a significant user base to reciprocate traffic.
So where can someone get users for a new game, should they spam the forums? NO! If you want to build a real user base, you need to make a real effort. Start with friends, get it on search engines, place it in directories, etc. Banner-exchanges, link-swaps with other sites of your own size, search engine submission can all work together, just remember, the top way a game grows is by word-of-mouth.
Hosting, number 4 is also simple. To make your site available to others, you need to put it “on” the internet. You can develop it locally by installing a web-server on your own system, but eventually you’ll need online hosting. You can get away with a “free” web host; just make sure they support your code-language and database. I cannot list any free hosts because I don’t know any, this is because truthfully I think if you are serious about running a game, then you should get a real, paid host. Basic hosting will cost as little as $4 per month for a start-up game, as it grows you can upgrade packages and eventually get your own servers, but I think one of these small, administered packages is a good place to start. Every paid host will support the essential languages and databases required to run a game.
The code?!?! WTF? Coding a game is not easy, it requires hundreds of hours, plenty of patience and a PhD in Advanced Thermo-Nuclear Dynamics. The third requirement is optional, but I do think you should have some computer background beyond the resume classics of Word, Excel and PowerPoint. Before I started DopeWars I had already worked in two coding jobs and three computer jobs, currently I am a few classes away from a degree in Computer Science. The “code” is the logic that runs the game. The HTML code of a website contains the layout information. Where images are, what images are displayed, what to write, etc. The server side language manages incoming data, and produces the HTML. In the case of DopeWars, the code (server side language) is written in a language called PHP, they have an extensive documentation on their website, www.php.net (http://www.php.net); read it if you choose to use PHP, don’t be lazy, don’t expect someone to sit around and answer all your questions because you don’t want to put the effort in to read a few hundred page manual. PHP is all FREE! There are also paid alternatives, such as ColdFusion and Microsoft’s ASP, they are great choices, I prefer PHP for not just the price, but also the simplicity, as a matter of fact, all the DopeWars/Global Conflict coding is done using Notepad. If you have absolutely no coding experience, look in to ColdFusion, my understanding is they provide a graphic environment to create data driven websites (such as an online game). Based on your coding background, be prepared to spend weeks to months playing with code, reading documentations for the language and working with examples before you create anything related to your game. Coding is NOT EASY. Don’t expect to wave a magical wand and have all your code created for you. YOU WILL need to invest months of time, YOU WILL need to read boring documentations and YOU WILL need to bang your head on the desk when you can’t figure something out. Here I’ve included a small PHP snippet to act as your first example; this will also let you see the difference between your server side language (PHP) and the HTML code.
<?php
$variable = 'hello world';
for ($i = 1; $i <= 10; $i++)
{
echo '<B>'. substr($variable, 0, $i).'</B><BR>';
}
?>
The entire segment is the PHP code, starting with the “<?php” tag and ending with the “?>” tag. A variable is a piece of data stored in memory, surprise: $variable is a variable set to ‘hello world’. The “for” statement is a “for-loop”, it will cause the code between the braces {} to be executed 10 times, it will require another variable, $i, to keep count of the number of times the code has been executed, we can borrow this variable for the next line of code. Echo means create some output, your output will almost always be HTML. <B>, </B> and <BR> are all HTML tags, you need to learn HTML, it’s simple, there are millions of sites that will help you, Google it. Substr is a function, short for sub-string, to output part of a string, in this case, the string (of characters) is $variable. The function is instructed to start at character 0 of $variable and display the next $i characters. So the first time that line of code is executed, $i is equal to 1, so it will output ‘<B>h</B><BR>’, this HTML is will write the letter “h” in bold on a line of the client's web browser. What will happen the next 9 times this code is executed?
The final component is the data, a more abstract concept. To store and retrieve data, you should use a database. You may have heard of the big-boys, such as Oracle or DB2. There is a free alternative which almost all of the browser-based gaming sites are using known as MySQL. This is a third language you will need to learn, check out www.mysql.com (http://www.mysql.com) for the documentation, again, read it, learn it, don’t be lazy. Like PHP, MySQL is also free. PHP comes with a set of functions (like substr from above) that will allow your code to interact with the database, a common one is mysql_query($sql_code), which will execute a “query” on a database and return the result to PHP. What kind of data goes into the database? Anything that changes and often times, things that will never change; the usernames, passwords, users’ email addresses, drug names, coat pocket contents, working junkies, messages, cartel information all go into the database. You use PHP functions to store data into the database, as well as retrieve data from it.
Well that’s making a game in a nut-shell. Maybe this document told you nothing you didn’t already know, or it is well beyond you, in the latter case, don’t worry, just try to extract to main concepts from here and start 1 step at a time. My recommendation is learn HTML first, once you got that down, then work on the basics of PHP, once you got that, start doing PHP that involves database interactions. Once you got ALL that, then make simple applications, such as accepting input and storing it, while retrieving some other data and displaying it, only after being able to do all that, should you make a game. Good luck and have fun!
So, ya wanna make a web-based game, eh?
There are 4 main components to a web-based game:
1) The Code
2) The Database
3) Users
4) Hosting
3 is a simple concept, for a multi-player game to live, you need players. Marketing isn’t an easy task, and you’ll quickly find that any method where you get “something-for-nothing” doesn’t produce any results. I often get, “Can you place a link to my game from DopeWars?” It is possible something can be worked out, but like I said, don’t expect something-for-nothing. If you look at DopeWars there aren’t very many links leaving the site, we are not going to clutter the pages with links that offer nothing to our users or the game, a link swap is just clutter unless the partner has a significant user base to reciprocate traffic.
So where can someone get users for a new game, should they spam the forums? NO! If you want to build a real user base, you need to make a real effort. Start with friends, get it on search engines, place it in directories, etc. Banner-exchanges, link-swaps with other sites of your own size, search engine submission can all work together, just remember, the top way a game grows is by word-of-mouth.
Hosting, number 4 is also simple. To make your site available to others, you need to put it “on” the internet. You can develop it locally by installing a web-server on your own system, but eventually you’ll need online hosting. You can get away with a “free” web host; just make sure they support your code-language and database. I cannot list any free hosts because I don’t know any, this is because truthfully I think if you are serious about running a game, then you should get a real, paid host. Basic hosting will cost as little as $4 per month for a start-up game, as it grows you can upgrade packages and eventually get your own servers, but I think one of these small, administered packages is a good place to start. Every paid host will support the essential languages and databases required to run a game.
The code?!?! WTF? Coding a game is not easy, it requires hundreds of hours, plenty of patience and a PhD in Advanced Thermo-Nuclear Dynamics. The third requirement is optional, but I do think you should have some computer background beyond the resume classics of Word, Excel and PowerPoint. Before I started DopeWars I had already worked in two coding jobs and three computer jobs, currently I am a few classes away from a degree in Computer Science. The “code” is the logic that runs the game. The HTML code of a website contains the layout information. Where images are, what images are displayed, what to write, etc. The server side language manages incoming data, and produces the HTML. In the case of DopeWars, the code (server side language) is written in a language called PHP, they have an extensive documentation on their website, www.php.net (http://www.php.net); read it if you choose to use PHP, don’t be lazy, don’t expect someone to sit around and answer all your questions because you don’t want to put the effort in to read a few hundred page manual. PHP is all FREE! There are also paid alternatives, such as ColdFusion and Microsoft’s ASP, they are great choices, I prefer PHP for not just the price, but also the simplicity, as a matter of fact, all the DopeWars/Global Conflict coding is done using Notepad. If you have absolutely no coding experience, look in to ColdFusion, my understanding is they provide a graphic environment to create data driven websites (such as an online game). Based on your coding background, be prepared to spend weeks to months playing with code, reading documentations for the language and working with examples before you create anything related to your game. Coding is NOT EASY. Don’t expect to wave a magical wand and have all your code created for you. YOU WILL need to invest months of time, YOU WILL need to read boring documentations and YOU WILL need to bang your head on the desk when you can’t figure something out. Here I’ve included a small PHP snippet to act as your first example; this will also let you see the difference between your server side language (PHP) and the HTML code.
<?php
$variable = 'hello world';
for ($i = 1; $i <= 10; $i++)
{
echo '<B>'. substr($variable, 0, $i).'</B><BR>';
}
?>
The entire segment is the PHP code, starting with the “<?php” tag and ending with the “?>” tag. A variable is a piece of data stored in memory, surprise: $variable is a variable set to ‘hello world’. The “for” statement is a “for-loop”, it will cause the code between the braces {} to be executed 10 times, it will require another variable, $i, to keep count of the number of times the code has been executed, we can borrow this variable for the next line of code. Echo means create some output, your output will almost always be HTML. <B>, </B> and <BR> are all HTML tags, you need to learn HTML, it’s simple, there are millions of sites that will help you, Google it. Substr is a function, short for sub-string, to output part of a string, in this case, the string (of characters) is $variable. The function is instructed to start at character 0 of $variable and display the next $i characters. So the first time that line of code is executed, $i is equal to 1, so it will output ‘<B>h</B><BR>’, this HTML is will write the letter “h” in bold on a line of the client's web browser. What will happen the next 9 times this code is executed?
The final component is the data, a more abstract concept. To store and retrieve data, you should use a database. You may have heard of the big-boys, such as Oracle or DB2. There is a free alternative which almost all of the browser-based gaming sites are using known as MySQL. This is a third language you will need to learn, check out www.mysql.com (http://www.mysql.com) for the documentation, again, read it, learn it, don’t be lazy. Like PHP, MySQL is also free. PHP comes with a set of functions (like substr from above) that will allow your code to interact with the database, a common one is mysql_query($sql_code), which will execute a “query” on a database and return the result to PHP. What kind of data goes into the database? Anything that changes and often times, things that will never change; the usernames, passwords, users’ email addresses, drug names, coat pocket contents, working junkies, messages, cartel information all go into the database. You use PHP functions to store data into the database, as well as retrieve data from it.
Well that’s making a game in a nut-shell. Maybe this document told you nothing you didn’t already know, or it is well beyond you, in the latter case, don’t worry, just try to extract to main concepts from here and start 1 step at a time. My recommendation is learn HTML first, once you got that down, then work on the basics of PHP, once you got that, start doing PHP that involves database interactions. Once you got ALL that, then make simple applications, such as accepting input and storing it, while retrieving some other data and displaying it, only after being able to do all that, should you make a game. Good luck and have fun!