Thursday, September 17, 2009

Organize for ease. Part 1 - Coding

One of the main reason I prefer game makers is the ability to organize your resources. Resources pile up, I look at my old projects and am always suprised at how many resources are in it. From graphics(majority) to sound effects, it all ads up and it all can belong to different catagories. Of course even with a handy program to sort the stuff in your application, the original resources need a home too.

Now I can't quite say I have an exact system, its more an evolving one really. So let me break it down into a few catagories, for now on coding...

There are many different languages out there to code in. C, Python, Ruby, basic, and so on. They can be similar and different in the way code blocks are structured. Some require ending with ; or containing blocks with {} and the worst off is how some use different symbols to control arrays. That always gets me when jumping from one to the other.

Since I'm no expert coder, just a decent one, I can't give advice on making your code faster, more powerful and the likes, but organizing it will make bug fixing and upgrading much easier.

1) Indents - Without it it would be a wall of gibberish, with it you can seperate your routines, statements and all that junk. Normally editor have indents set to 4 spaces, which I think is twice as much as it needs to be.

2) Comments - Commenting is not just good for other coders to learn from your code, but also a good reference when you get lost in the thick of it. Commenting your predefined variables always helps, as sometimes you may use short names or coded names for them. Routines should also be commented as to seperate them from the rest of the code. Using a comment as a page break is also nice, simply creating a line of * or = or - to split up different sections of the code like start, looping, routines.

3) Sub Routines and Includes - These are your best friends, breaking up commonly used code into subroutines and packaged in include files saves your main program of a lot of unnesscary characters.

4) Folders - If using a more traditional language, or doing it old-school with notepad and a compiler, making folders in your project directory to sort your code and resources is a must. The more complicated and more content, the harder it will be to sift through it.

A generic folder structure I use:

(.. representing prior folder name, * meaning all sub folders)

..\..\Working (for multi-layered/editable graphics)
..\..\RAW (for processing images into textures)
..\..\Done (completed graphics)
..\..\*\System (UI, mouse, ect.)
..\..\*\Game (Items, portriats, ect.)
..\Archive (for old builds)

So thats how I organize my files and coding, next time I'll cover my graphical procedures.

Wednesday, September 16, 2009

Game is Art.

Coding is a crucial part of making a game, but at esence theres alot of engines already made. Engines that are better than those who try to make their own, at least when the majority is concerned. Theres a lot of elements in code that make up a game, graphic handling, audio managament, data resources, ect.

Even though the code(the engine) is what sets a game apart from a slideshow, it is ultimately the visuals and audio that wins over the player. However it is not how realistic a game is, but how well it fits. A common problem with indie games(the majority not the minority) is a lack of consitancy in art style and audio. A consistant art style and fitting audio(if needed) can make a buggy game more attractive than a well coded but horribly slapped together with clip art and different art of different styles.

I'm not trying to short change the coders though. Its not easy work. I've had a few attempts, but when it comes down the graphical and audio handling I'd rather leave it to the more experienced. I'm more of a creative type, but I do enjoy coding the game itself.

I focus on the visuals because to me a game is a piece of art. At root its art, it can also become a story, lesson or challange. Unfortunatly high demand has made First person shooters the dominate game of todays consoles and pcs, kind of killing the art aspect when everyone is trying to do realism. The alternative? Usually top-down or 3rd person games. The 2d world is almost forsaken by big industry.

Nintendo has thankfully not gone against its art style. Which to state they even handled the transition better than most. 3d graphics were all the rage when they began to grow, but if we really look back some of the transition some games made or even new ones provided a crappy use of 3d, showing its limits. We now need computers far faster than ever to come close to decent. Even emulating cartoons is more work on the computer than displaying frames.

Focus on making the game a game was begining to fade the more advanced visuals and audio got. The industry began to forget how to make games and just how to clone them. As a result you get games like Oblivion, who had to be aided by user content and lacked the most features of all the Elder Scroll series. Sure you can buy a house(very few) and ride a horse, but sacrafices for graphics cost a lot for that title. Another good example is the much forgotten DeusX 2 and Thief 3. Both originally were very great games but sacrafice a lot due to the 'realism' wars amongst game companies.

While I don't hate realism, I do enjoy it, its just if every game looks real then isn't every game the same?

Saturday, September 5, 2009

Shield Breaker, making something sellable.

It started sometime last year during a local competition at, although I can't recall the entire details of the contest, it was to be limited by time and several factors like the inability to regain life, thus play til you drop. This gave me a great idea of making a game were you try and survive as long as possible and rack up points. Within the first day I had already drew up the basic concept on a half-sized piece of note paper and then constructed a simple monotone version. Thus Shield Breaker was born.
The concept was simple, a new spin on BreakOut so to speak, were losing the ball wasn't the problem, but being hit by it was. Blocks were draw in unique ways for a specific reason, pixel-perfect collisions. Throw some rotating and shifting blocks in and you have a very unpredictable field for which your ball will bounce. Bonuses were awarded depending on how long the ball was in play and how many blocks it hit or busted. Technically the game had no end, except on slower computers the frame rate would begin to drop as levels contain blocks equal to the level number *20, take in Game Maker's limits, you can expect to see slowdowns in levels past 50.
After your shield is gone, the game is lost, except for Hardcore mode, you are allowed to restart the current level minus half your score.
The original will remain free, but unsupported.

Now I've began to recreate and improve it, going by Shield Breaker EX, ex standing for extended, I'm going to attempt to create a sellable game. Aside from some basic graphic overhuals, new elements are being added to the game including more bonuses, powerups and the addition of 'Pandora Boxes' which randomly release obsticals that can either trap or destroy your ball, or put offensive projectiles into the playing field. In addition your maximum balls in play is now dependant on your score and the ball launch speed has been increased, although it still isn't quite finalized.
To save some time, I've began using graphics I had made for Rick Jason, a space shooter, but at twice the resolution. Originally I had made the graphics in raw form twice the size of what they were to be in RJ, although not everything will be used like the ships. Mostly just tiles and some background art will be used.

Another concept I am playing with is game created music, to a certain degree. I have yet to fully decide if this is what I shall do, mixing loops between levels and having beats added in by certain blocks. I half like how the experimenting has gone, but may do something slightly different. Recently obtained some mixing software to make some more complex/longer loops. Of course the added stress of audio will have an effect on the speed of the game, so I've resorted to trying out two indie dlls for audio. I'm not quite sure what the authors positions on commercial products are fully, but I strayed away from ones that request license and down payments as I don't have income for making this game.

Keeping in mind that this is a casual game and nothing too advance I'm looking at a maximum of $10 charge for the final version to sell for. I've also been using my Acer Aspire(8.9") laptop to produce the remake so I can use the laptop as a benchmark to keep the frame rate stable and the amount of computers that can play it high. Adding the music mixing has caused some slowdowns but that just bugs and the fact that its using Game Maker's audio system. Luckily GM6.1 has the ability to use a dual-core, as during some test I use an attached monitor to play and the laptops screen to display task manager's CPU and Memory logging, I noticed that it used both cores while running. So as long as I maintain the course on how much the game consumes in processing and memory, any computer as fast as an Atom should run the game fine.
I've had less success testing in the GM8 beta release when audio was involved, and no noticable difference in running speed. Just another reason to stick with what I'm using. There are issues reguarding running GM6 games on Vista but a converter easily fixes this problem.
There are limits of producing this in GM, and thats mostly protability. Although GM is going to Mac, I don't have a lot of faith in the new company that runs Game Maker and may move to recreating the game again in C# or another more portable language.

To see prior versions check my side panel under my shamelessly added ad space(we all need some income) and let me know what you would like to see. Additionally you can ring in your opinions on whether or not this would be something you'd buy for the stated price above.