Making Video Games

Game Programming Tutorials – Making RPG Games – Chapter 2 Part 2.

by Charles on Sep.25, 2009, under Game Programming

 

This is the second chapter of the RPG game programming tutorials (click and drag inventory and action). Get the GM source code: right-click, save target as. If you just got here you should start there!

 

Game Programming tutorial – Making RPG games chapter 2, part 2.

 

Before we look further into actual programming, it is very important that we dedicate just one small part to organizing your work.

 

As the game grows, things can quickly get messy. The scripts add up, as well as the other components when we get further into the game.

 

First we’ll see how you can organize. Then we’ll see how that organization needs to be based on the game loop.

 

Make games efficiently by organizing the components – game programming success depends on workflow!

 

To organize components efficiently, you’ll need to put them into folders, or groups. Some of these groups will also have sub-groups.

 

 Create folder

 

Let’s see how the scripts are organized.

 

 Script folders

 

Scripts are quite simply grouped by function. When something happens, the first to run is character_control(). It will check if there is something to do where the player is located because he pressed Space. If it determines there is nothing to do, it will run the nothing_to_do() script.

 

Other player actions will lead to other scripts. The inventory management scripts are located in the inventory folder. Scripts that react to game interaction in room0 in the game reactions by room group.

 

Taking the time to name groups and sprites with long, descriptive names is worth it. SnS has 164 scripts. As your game gets larger you can very easily waste a lot more time looking for the right script to work on than the time you dedicated to writing explicit names.

 

The same goes for all other components (sprites, sounds, backgrounds, paths, fonts, time lines, objects and even rooms if you have a large game world that can be cut up by geographic location. We will see that some rooms can be created for a whole other purpose than showing a part of your game world, and such rooms belong in a separate folder as well.

 

You might be able to get by without paying attention to this part for a small game, but game programming gets interesting, fun and profitable when you start making games large!

 

Back to Game Programming.

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.


Leave a Reply

Creative Lab

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

    Archives

    All entries, chronologically...