Editorial - June 2008

Issue 65 cover

Some things in life, I'm sure, are designed with me in mind. As someone with a lot of ideas and a lifetime of projects on scraps of paper, I need organising. I like Google Desktop, and I like Google Mail and Google Notebook. It puts my life in one place, and I can get to it wherever I go. I tried old-fashioned paper organisers and even their electronic counterparts in the past, but they never seemed to be where I was just when I needed them. In fact, they were often somewhere I could no longer recall, disabling my ability to do anything for days at a time.

The introduction of The Game Creator Store is another no-brainer in my quest for organisation for very little effort on my part. You can read about it in this edition of the newsletter but needless to say, it's a fantastic step forward in ensuring you can get to what you want, when you want it. I don't even need to refer to my Google Notebook for my favourites list.

As well as the Store, we also have news on PureGDK, a meeting of the power of two great development products. The second Official Convention is announced, and needs you to join us. Andrew Vanbeck continues his platformer tutorial whilst Adam Plumbley reveals more graphical techniques in a second video. Lee Bamber's Tip of the Month leads to a small challenge, and of course there are all of the regular features too.

Until next time,
Happy Coding!

Steve Vink

contents

(1) TGC Store (2) Convention '08 (3) DarkBASIC (4) Dark Physics (5) PureGDK (6) DB Book (7) FPSC News (8) DarkGDK OOP (9) Videos (10) DBP Tutorial (11) Lee's Tip of the Month (12) Tutorial - textures (13) PlayBasic (14) From the Forums (15) Winner (17) Outro

The Game Creator Store is Open for Business

After months of hard work, testing and fine-tuning, The Game Creator Store is now here! Put simply, you can now access a library of over 1,000 game objects directly from within FPS Creator. The volume of media will increase still further as our enlisted artists keep working, new artists come on board, and we ultimately introduce new media types to the library. Music and sound is planned for a future release.

Here we have a quick start guide to the Store, to illustrate just how easy it is to use. One of the main focuses during development has been ease of use, allowing you to concentrate your efforts on game building, rather than struggling to find the right resource at the right time.

The first step is to download the latest FPSC update to enable the new functionality, and then purchase a number of store points, a simple process also embedded within the store. By working with points, our younger users and those without facilities can ask a friend/relative to top up their account, to be spent whenever they have the need later. Early users have already expressed a desire for points as presents!

Opening the Store

The Game Creator Store - 3D models and media

In FPS Creator, there is a new button in the bottom left corner, below the library panel. Click once and the store opens. At a glance, you can see the latest additions, most popular items and the highest rated products. Every item is rated by the users, and the number of downloads is also displayed.

 

 

Browsing the media

The Game Creator Store - 3D models and mediaOnce in the store, you can browse the media by artist, and then by subcategory to find the exact item you are looking for. So if you like the Medical Model Pack by Simon Benge, you can now check it out one item at a time. Clicking on an item opens the detail window, where you can see a more in-depth description, polygon count, cost and a number of screenshots.

 

Evaluating the models

The Game Creator Store - 3D models and media

As you browse through the catalogue, you will get a good first impression from the thumbnail images. Beneath each one you will find it's cost in points and the user rating. Some items may not rate as highly, but the low cost can still make it a worthy addition to your less prominent scenery.

 

Account Tracking

The Game Creator Store - 3D models and media

The Game Creator Store keeps track of your account, making sure you are aware of what you already own. The cost is replaced by an indicator that you bought a particular item on a previous visit. This is a great way to locate and retrieve lost items too; you can download your items again (up to five times), safeguarding you against disaster.

 

Watching what you spend

The Game Creator Store - 3D models and media

As you shop, each item is placed in your cart. If you've shopped online - as most people have these days - you will be comfortable with the way you purchase from the offset. As well as marking up the items as being in the cart, you can preview all items chosen so far, as well as the points you are about to spend and how many you have at your disposal in your account.

Advanced browsing

The Game Creator Store - 3D models and media

Many of the contributing artists cover many different genres of media. As such, you might find suitable media across a range of folders in the browsing panel. An alternative method of finding what you need is to use the search tool, which will return a window of all items across all artists related to your keyword search.

 

Final Steps

The Game Creator Store - 3D models and media

Once you've found your media, you obviously want to use it. Clicking the Buy Cart button will seamlessly transfer your purchases into your local folders. Your account will be debited with the points required for your new items only (any items already owned will not be charged) They will be immediately available through the standard entity system in FPS Creator. You will find a new folder named Purchased items, and within that the same folder structure from the Store, populated with your new stock.

If you need a little more enticement, there are a number of free items, made available from the artists who have given you the opportunity to sample their range before investing. The library contains many objects costing less than the price of a stamp, making The Game Creator Store the most cost-effective way to stock your game with brand new, quality media. Also note that all assets are royalty free and come with their own commercial use license!

FPS Creator 1.09, including The Game Creator StoreThe earliest version of FPS Creator that includes the store can be found here. We urge you to download it now and take advantage of the free models, even if you don't need anything else right now!

The TGC Official Convention 2008

The Game Creators Convention 2008, Hinsley Hall, Leeds 

2008 sees the return of The Game Creators' Official Convention. Last year was a great success, with a great turnout and fantastic presentations by the TGC team. The date this year is the weekend of the 11th and 12th October, with accommodation available from the Friday. The venue will once again be Hinsley Hall in Leeds, West Yorkshire. It proved to be an ideal spot with good amenities, and lively local nightlife. The bar provides a perfect venue for socialising and talking business with the team, and is exactly where many updates to the products were formulated and devised at the last convention.

Hinsley Hall

Once again, this is your chance to meet the people behind the products and get a unique insight into the future of the company. The successes of last year will be built upon, as well as tailoring the weekend to the suggestions and feedback received.

The two options remain the same. You can take advantage of bed, breakfast, lunch, evening meal, tea/coffee and the convention as a package, with only your transportation to organise. You can also attend as a day delegate, which includes lunch, and morning/afternoon tea and coffee.

Convention Day Rate - £32.00 per day (£64.00)

Convention Attendance
Tea/Coffee/Biscuits throughout the day
2-course Buffet Lunch

Full Weekend Rate - £180

Convention Attendance
Tea/Coffee/Biscuits throughout the day
2-course Buffet Lunch
Accommodation (Friday/Saturday evenings).
3-course, self-service Evening Meal (Friday/Saturday)
Breakfast (Saturday/Sunday Morning)

Most of the accommodation is en-suite, but it is advisable to book early to guarantee your room. Other parties will also be using the facilities and booking rooms.

You can download the booking form here, and return it with a small deposit to reserve your place. We are very excited about this event, and hope that you will take advantage of this unique opportunity. Find more details and join in the discussions on the forums.

DarkBASIC Professional Round-up

DarkBASIC Professional

The Coding Challenge

By Richard Hoddinott 

The DBPro Coding Challenges have been running for over three years, since February 2005.  Since then, the thread has been viewed 128 000 times, had nearly 6000 posts and has seen 83 challenges. More importantly, the challenges have inspired members of the DBPro community to create some really great work.

The challenges are designed to improve your coding skills, either by having a go yourself, or by learning from other people's attempts. The challenges are both educational and fun, and it's always interesting to see how people come up with their own innovative ways of solving the problems each challenge poses.

Challenges are set regularly, usually every two weeks, and everyone is welcome to participate whether you're a complete novice or an advanced programmer. No media is used in these challenges - they are all about coding techniques. The idea isn't necessarily to create a fully fledged game - a challenge may concentrate on a particular area of game design, which is why taking part in them can be so useful in improving and extending your coding skills.

Here are just a few of the many entries the challenge thread has seen over the years

Top down racing game: March 2007

Author: Daemon

Download the code for this entryTha Game Creators Coding Challenge ThreadThere are a few tricky things to consider when making any kind of racing game - collision detection and response, artificial intelligence, track layout and a good control mechanism.  This game, although it looks simple, combines all of these elements to create a playable top-down racing game, with a few added extras including three tracks, a cool speedometer, speed boosters and even some basic sounds to get the game started.

 

Projectiles game: October 2006

Author: Acelepage

Download the code for this entryThe Game Creators Coding Challenge ThreadThis is a turn based artillery game, based on such games as Tank Wars and Scorched Earth, where you must make adjustments to the power and trajectory of your cannon in order to hit the enemy. Making a game like this is a great way to learn the basics of game physics and this neat version demonstrates how a little bit of polish can go a long way.

 

Traffic Simulation: July 2007

Author: Gadgetfreak 66

The Game Creators Coding Challenge ThreadDownload the code for this entryNot all challenges are about making complete games - although some of the results can certainly be used within games. This is a really nice example of a traffic simulation, where you can add roads, cars and traffic lights to your layout in real time and watch the traffic negotiate your map. If you're planning on making the next GTA, making something like this would be a great starting point. Click on the screen to lay your road, and hit enter to add a car. Traffic lights can be added at crossroads by first clicking on the traffic light icon.

Marble Rolling Game: September 2007

Author: Ric

The Game Creators Coding Challenge ThreadDownload the code for this entryCreating realistic physics doesn't always need a physics plugin.  Searching through the code snippets forum can often turn up some real nuggets, such as Lower Logic's rotation functions used in this challenge entry.  The aim is to roll the marble using the arrow keys onto the purple square by guiding it along the green pathway.  (Space key nudges the ball incase it gets trapped in a corner).  It's fiendishly difficult as a game, but it shows what can be done with native DBPro commands alone, including some effective lighting and reflection techniques.

Asteroids: February 2006

Author: Bill R

Download the code for this entryThe Game Creators Coding Challenge ThreadIf you're new to game programming, a great place to start is by remaking one of the many classic arcade games of the 70's and 80's.  This neatly coded version of Asteroids, with some pretty explosions and particle effects to boot, is an example of the kind of thing you might want to try before embarking on that MMORPG you were planning.  Controls for the game are described in the first few lines of the code.

 

3D Modelling competition winners

Species winner - click for larger viewCongratulations to Agent Dink, winner of the "Make a Species" modelling competition. Sincere thanks also go to the other participants, without whom there is no competition.

 

Agent Dink: 14 votes
Jasiek: 8 votes
Wolfman: 2 votes
Dan958: 2 votes
Ruccus: 2 votes
Dragon Assasin: 1 votes

Species ForumOn the forum: http://forum.thegamecreators.com/?m=forum_view&t=127720&b=3

New Drivers, New Demos, One great Offer

darkPhysics.jpg

NVIDIA have released the latest updates to the PhysX drivers. In the package you will find five demonstrations of the power of PhysX, all of which have been written using DarkBASIC Professional.

After experiencing the demonstrations, keep an eye out for the unbeatable offer in the closing credits. Click through to take advantage of DarkBASIC Professional bundled with Dark Physics to bring NVIDIA Physx to your games.

NVIDIA PhysX Drivers for Dark PhysicsYou can download the NVIDIA PhysX Drivers from the site now.

DarkBASIC for PureBasic

PureGDK for DarkBASIC Professional

PureGDK is a 3D game and application developer's dream come true -- it streamlines the entire process of incorporating powerful DirectX 9 capabilities into your software. Create and update your software faster, with more time to focus on fun. With PureGDK you can get instant results with human-readable code without the difficulty imposed by other languages and hard-to-program graphics APIs. Build the software you want now!

What is PureGDK?

pureGDK - applications for DarkBASIC ProfessionalPureGDK is an intermediary compiler and a set of command libraries that interfaces the DarkBASIC Professional and PureBasic language at compile-time. This allows DarkBASIC Professional commands to be compiled to an executable and debugged right out of the PureBasic IDE. It also brings a powerful new command set to both PureBasic and DarkBASIC Pro users alike. Both DarkBASIC Professional and PureBasic are required to compile.

PureGDK Advantages

PureGDK homepagePureGDK can be purchased as a complete package with both PureGDK and DarkBASIC Professional, or as an upgrade for existing owners of DBPro. Visit the product page now for full details and to purchase this exciting combination of programming tools.

DarkBASIC Programming for the absolute beginner

Adding to the library of books available to the hobbyist games programmer is this new title from Jerry Lee Ford, Jr. The author has written many technical books, a number of which are aimed at the absolute beginner. This particular publication fits comfortably into that category.

New DarkBASIC BookJerry starts at a much more basic level than one has come to expect from similar books. As well as pointing the reader to the trial download and places to purchase, it explains the fundamental requirements and how to get the most out of the language. It also has a useful summary of the differences between the versions and why you might choose one over the other. In a break from the standard format, it also covers the installation, IDE and links to other useful resources to get you started.

Hints, traps and tricks are highlighted throughout. Through these additional snippets, you can quickly build up peripheral knowledge to speed up the learning process and venture out on to your own projects a little quicker. A further, very useful feature is the section on finding and fixing application errors, or debugging as it's known to the seasoned programmer.

The chapters are centred around small projects, and along the way you'll find yourself creating some - if not all - of these:

In summary, this book is truly aimed at the absolute beginner, both to programming and the world of DarkBASIC. It is best described as a perfect accompaniment when buying either version of the language. The book will answer the majority of questions you have as you progress into your first standalone project. It is currently available from Amazon, on both the UK and US sites and possibly others too.

News from the World of FPS Creator

FPS Creator News

FPS Creator Upgrade 1.09

Together with the significant release of Game Creator Store, there are also a number of new features to be discovered in V109. Many months ago we ran a poll to find out the top ten things you wanted to see in the next update and you will find most of them in V109.

They include a reduction in load time by pre-calculating more at build time so final executables load faster, and have the additional benefit of combining all texture files into a single file to protect your custom media. You can now change the default background music in your level on the fly to create dramatic switches in mood created by the audio. You can now cause the blood splats to fall on the floor rather than the walls, and player gravity has been improved for more realistic falling.

A host of new FPI commands have been added to bolster what you can do with the internal scripting system. These include allowing the player jump height to be changed, which is great for power-up and power-down items. A command to freeze the player on the spot, ideal for booby traps and special enemy attacks. The intensity of the dynamic lights can now be changed in real-time during the game on a per light basis to allow illumination tricks such as lights fading in and out. Perhaps the biggest addition to the scripting system is the introduction of 100 local and 100 global variables to the system, allowing a variety of new techniques previously impossible when controlling entities. Watch this space for a slew of new scripts tied to entities using these features!

A number of new scripts have been included with V109 which take advantage of these and other commands including melee combat scripts for characters without weapons. A new collision mode for entities has been added which allows greater control of non-colliding entity parts, such as trees which require a solid trunk but with walk-through vegetation. A number of new materials have been added to the software so future entities can benefit from a greater range of surface types such as cobbles, gravel, ancient wood and ceramic tile.

Finally, the issue of legacy BIN and DBO files has been solved with the introduction of a cleaner application that runs during the installation of each new update. The cleaner will remove all BIN and DBO files from your installation meaning there are no old data files to cause instability and other issues the next time you run FPS Creator.

We plan to release a minor update to resolve any issues relating to the store and the new features released in V109, and then onto the development of the much anticipated migration version which will see full Vista compatibility and a unification of the technology we have developed thus far into the next generation of FPS Creator.

To illustrate the technology boosts incorporated in the latest update, take a moment to study the implementation of Dark Lights technology. This gives much faster light mapping speeds, and much better end results than before. The version of Dark Lights now built into FPS Creator fully supports both dual and quad core processors. This means if your CPU allows, you can lightmap your scenes significantly faster. Our test results show dual core systems mapping scenes at up to 70% quicker than single core. The bigger the game scene, the larger the speed increase.

FPS CreatorTo view the full list of updates and download, visit the FPS Creator site.

FPSC Weather System

Jim Logan (Rolfy) has created and published the FPSC Weather System, a great new model pack to add atmosphere and a comprehensive set of new segments to your game. Included are:

Brick Tunnel for FPSC Grassy Terrain for FPS Creator Tiled Tunnels for FPSC

FPS Creator Weather SystemThe pack is available now from Jim's website. Check out the video section in this newsletter for previews of the pack.

Atmospheric Sound Pack

Nickydude has compiled the Atmospheric Soundpack, which is a great accompaniment to the Weather System above. In fact, the ambience in the preview video is from this pack. As well as the stormy track, there are numerous others, including:

Alien Forest - Alien Ship
Blizzard - Dripping Dungeon
Eerie Room - General Ambience
Grave Yard Shift - Haunting Wind
Horror Passage - Jungle
Light Rain - Light Wind
Main Frame Room - Psychiatric Ward
War Background - Windy Tunnel

Atmospheric Sound Pack for FPSCYou can purchase the sounds as a compilation from the website. There, you will also find a number of sample tracks to try.

DarkGDK for Microsoft C++ Visual Studio Express 2008

DarkGDK for Microsoft Visual C++ 2008 Express

JGC Library 1.0 - An Open Source OOP Solution 

JGC Library in action.The Jegas Game Classes Library (JGC) created by Jason P Sage is an open source collection of classes designed to effectively wrap most of the entities that are found in DarkGDK, including objects, images, bitmaps, sprites, sounds, music, terrain, meshes, memblocks, effects, and vectors. JGC also contains all kinds of information taken from TGC product documentation, forum discussions and other sources embedded in them, making it a practical encyclopedia of various Dark Basic, DarkGDK and general 3D graphics programming techniques rolled up into one code base. 

Apart from its wrapper functionality, the JGC has a few gadgets of it's own to help you maximize your DarkGDK experience. Amongst them are Unique Terrain Systems, USGS Satellite Data Conversion Utility Functions, 3D Menu Systems, Sky Systems, LOD and Culling, and GUI.

The classes have been developed with the beginner and novice programmer in mind, as well as the more seasoned power users. All of the code written to produce the classes in this package can also be used to learn C++, DarkGDK, and object-oriented concepts. It is heavily commented throughout. The modular programming style will help users write good code and in turn, great games.

JGC Library"I have been developing JGC for approximately six months", says Jason,  "and with 1.25 megabytes of source code spanning over 32,000+ lines, it is still a work in progress!" He is also very grateful to the combined efforts of the forum members. "Many of you have helped test this system and have identified bugs, some of which weren't even reproducible on my machine, yet you helped me isolate and squash ‘em! Thank you all!"

JGC Library Home PageThis library is free and open source, released under the Mozilla Public License 1.1. You can download it now from Google's Codebase.

JGC Library Forum DiscussionKeep up with the discussions around JGC Library on the forums, where you will find answers to any questions you may have.

OOP Forum DiscussionThere is also an extensive, ongoing forum discussion regarding DarkGDK and Object Oriented Programming.

JGC demo DownloadJason has compiled a demonstration of the functionality, and it is available for download here.

DTSP Simulator in the news

Driving Test Practical SimulatorAs Scotland gears up for an overhaul of the driving test system, the Sunday Post reports on how it should have a significant impact on safety and accident reduction. Alongside, their reporter comments on the use of training aids, specifically Driving Test Success Practical Simulator:

"One of the easiest ways to get in some training is on the computer...For the Playstation generation [DTSP] is ideal as the simulator works very much like a video game to take the novice through 10 modules that represent real-life driving situations. The only difference is if you get it wrong on the simulator, you don't end up with a bashed car".

DTSP Simulator is available from Focus Multimedia.

Video Gallery

TGC Video Gallery

New Products Video

If you haven't visited the home page of The Game Creators site for a while, you will have missed our new promotional video. Packaged together into one reel, interleaved with showcase games, it's surprising just how wide the TGC range now reaches.

The Game Creator Store 

Take a video tour of the Game Creator Store, explore the features and experience the easy user interface.


Weather Effects and Soundtracks

Earlier in the newsletter we reported on Rolfy's Weather System and Nickydude's Atmospheric sounds. This video previews the two together.

DarkBASIC Professional Tutorial - Building a Platform Game Part IV

DarkBASIC Platform game tutorial 

by Andrew Vanbeck

Download Tutorial Project

We continue to expand on the game editor, literally laying down the building blocks that will ensure the game itself is much easier to develop. Download the code to accompany the tutorial, which this month introduces some additional concepts including file saving and loading, parsing game data and designing game data files.

Saving the World

Last month we left off with the basis of our level editor, this month we have to look into a way to store this information. The entire game world data will be stored in memory as it's only 20x10 screens, and they wont all be used. This way we just need to save to a single level file, and can cut a lot of corners in the editor, there's no need for a level selector but we can have an undo feature.

Level formats can be a nightmare to get right first time, so to make life a little easier if things change, a parsed level format is being used. This means that the data is stored as ascii, and split up when loading then distributed to the map array. Typically a map block will represent 1 line of text in the world map file, this specifies the map location, block type, collision status and a text marker setting. The text marker will be used for special script commands in the future, to allow parts of flooring to disappear for example.

Each map location that has a block has its data saved to the world map file as a single string of text. This is passed to a function called parse(), which will tokenize the string and analyse the components.

For example, let's say map location 50,239 has a ladder in it:

MAP(50,239,0,3,H)

DarkBASIC Professional Tutorial - Mapping the levelThis is split up using the ascii characters: round brackets (parentheses), commas, and the "=" sign, so that the components can be stored in the var() array. This is a typed array with allowances for string, integer, and float data types, referred to as .S, .I and .F respectively. Once the strings have been parsed into var().S, they are converted to integer and float versions. This data could be converted as it's checked but converting everything after reading it can make code easier to read.

Currently there is only 1 header, but this system will be used for more functions and setup. It also promotes a readable data format, so it pays to go to these lengths.

Once the parse() function has split up the string, each segment is checked with a Select Case statement.

case "MAP"
      map_delete(x,y)
      map(x,y).col=var(3).i
      map(x,y).block=var(4).i
      map(x,y).marker$=var(5).s
endcase

Once all the data has been read in from the file, the screen is forced to update simply by setting the variable REFRESH to 1).

Saving the File

When saving the map file, it's a matter of constructing a string of text for each map location with a block, the 'MAP(' header is followed by the location, block number, etc. Each element is separated with a comma, which is added to the end of each piece of data.

Pressing the 'S' key will save the map, pressing 'L' will load it up. If you mess up and would like to reset the current screen, press 'U', this is that undo feature I promised earlier (albeit a fairly limited one!).

Moving between screens can now be achieved by holding shift and using the cursor keys to select a screen. A map preview system can be created later to help improve navigation.

Selecting Blocks

Before very long there will be a lot of different blocks to sort through, so it makes sense to expand on the block type:

type blocktype
 col as byte
 mode as byte
 special as string
 textureimage as integer
 filename as string
 group as string
 marker as string
endtype

These new additions will allow for better block selection; there is a group variable so the different parts can be organised together, and the filename will be alphanumerically sorted. The marker string is used to set the default in the map array and will allow different blocks to be treated the same. For example there will be various types of ladders sharing the same handling code. A preview image of each block is stored so it will be quite clear which block is which when editing the map.

So, we now have a couple of new keyboard commands to remember. To summarise:

Next month we'll look into improving the block selection system as well as adding some real media.

Lee's Tip of the Month - Recursing through Files and Folders

Lee Bamber Conehead!

Renaming a hundred files manually has to be the most annoying and irritating task you can ever set yourself. At some point during games development, you will want to create a tool to perform a batch process that would otherwise take you days to do by hand.

There are easier ways, and I am going to introduce two of them. I must place a health warning on them however as these techniques will unleash your program on multiple files so be very careful and always make plenty of backups of your important files.

The first is a relatively simple command which creates a checklist of files from the current working folder, but does not do folders. The second is a recursive function which will scan every file and folder starting from the current working folder. The simple version is as follows:

perform checklist for files
for c=1 to checklist quantity()
   print c;" ";checklist string$(c)
next c
wait key
end

The above code creates a list of the files, then creates a for/next loop to print each list item to the screen, then finally waits for the user to press a key before ending the program. Once you have access to the filename, you can perform any number of operations to it, including copying, renaming, deleting or moving. You can even launch other programs with the file as a parameter for operations such as image conversion and even launch different programs based on the construction of the filename.

The second, more complex approach is to use a recursive function to navigate through folders as well as list files. An example program has been provided which you can compile and run to see how this works, and the basic principal is quite simple. A recursive function might look like this:

PRINT myfunc("")
WAIT KEY
END

FUNCTION myfunc( s$ )
   IF LEN(s$)<10 THEN s$=myfunc( s$+"X" )
ENDFUNCTION s$

As you can see that under a certain condition it will call itself. Study the code, perhaps type it in and see what happens. Can you guess what it will do before you run the code?

The downloadable zip file contains an actual program to remove all temporary files from an FPS Creator installation, so you will see the program locate and delete all DBO and BIN files. My advice is to strip down the program and replace the section which deals with each file for your own purposes. I have used a variation of this technique hundreds of times over the years, and I can assure you it beats managing files manually almost every time!

Take up the Recursion Challenge!

Recursion is a very powerful tool. Lee has used it to good effect in his file renaming tool, and the visualisation of folders and subfolders is a good representation of what recursion is all about. Other complex uses include resolving puzzles that involve repetitive tasks or brute force, and setting levels of difficulty by allowing the AI to iterate through the options to varying depths. Chess is a prime example, where the computer must look ahead several moves and calculate all of the possible moves. Deepen the recursion and you increase the challenge.

This month, we are putting out a challenge to illustrate other uses of this method. Using any of the languages available through TGC, show us how you can put recursion to work in an effective way. It could be a function with a simple interface to show the outcome, or a graphical demonstration. Whatever it is, post a zip file of the code, media and a compiled executable in the forum thread for this challenge. TGC will award a prize for the entry that is deemed to be the most effective use of the method. If you are stuck for ideas, here are two more examples, written using DarkBASIC Professional.

Fibonacci Sequences 

This is a classic example, often used to demonstrate recursion. Supply the program with a sequence number, and it will return the associated value within the Fibonacci sequence. You can copy, paste and run the code to see it in action. Although seemingly impractical, this sequence has many uses in games for simulating real life using a simplistic formula:

sync on: sync rate 0
sync






` Define the starting point for the fibonacci series
n1 = 0
n2 = 1

` Request the fibonnaci sequence
input "Enter Fibonacci Sequence # to return : ", MyVal$
n = val(MyVal$)
MyVal = fibonacci(n, n1,n2,2)
cls: text 5, 100, "Your value is " + str$(MyVal): sync

wait key
end
function fibonacci(n, n1, n2, current)
    cls : text 5, 50, "Iteration " + str$(current) : sync
    if escapekey() then end
    myVal = -1
    this = n2 + n1
   
if current >= n
        exitfunction this
    else
        ` Make a recursive call to this function for the next sequence
        inc current, 1
        n1 = n2
        n2 = this
        MyVal = fibonacci(n, n1, n2, current)
    endif

endfunction MyVal

Maze Solving

Ian Mold (IanM) has written the following practical demonstration of recursion in action. The function at the centre of this example systematically works it's way through a maze until the correct path is found. It has been written to visually illustrate the code in action, highlighting the path-finding as it happens. It has been deliberately designed to find the actual path last, so that the recursion can be clearly seen. Watch carefully as each path and all of it's branches are exhausted before moving on to the next.

Maze Recursion Example

global StartX as integer
global StartY as integer
`
dim Grid$(64, 32)
dim Checked(64, 32)
`
for y = 1 to 32
   read Line$
   for x = 1 to 64
      Grid$(x, y) = mid$(Line$, x)
      if Grid$(x, y) = "s"
         StartX = x
         StartY = y
      endif
      select Grid$(x, y)
      case "*" : ink rgb(255, 255, 255), rgb(0, 0, 0) : endcase
      case "." : ink rgb(0, 0, 0), rgb(0, 0, 0) : endcase
      case "s" : ink rgb(0, 255, 0), rgb(0, 0, 0) : endcase
      case "e" : ink rgb(255, 0, 0), rgb(0, 0, 0) : endcase
      endselect
      DrawBox(x, y)
   next
next
wait key
Search(StartX, StartY)
wait key
end
function Search(x, y)
   if Checked(x, y) = 1 then exitfunction 0
   if Grid$(x, y) = "e" then exitfunction 1
   if Grid$(x, y) = "*" then exitfunction 0
   wait 5
   Checked(x, y) = 1
   ink rgb(0, 0, 255), rgb(0, 0, 0)
   DrawBox(x, y)
   if Search(x-1, y) = 1 then exitfunction 1
   if Search(x+1, y) = 1 then exitfunction 1
   if Search(x, y-1) = 1 then exitfunction 1
   if Search(x, y+1) = 1 then exitfunction 1

wait 5
   ink rgb(128, 128, 128), rgb(0, 0, 0)
   DrawBox(x, y)
endfunction 0

function DrawBox(x, y)
   box x*8, y*8, x*8+8, y*8+8
endfunction
data "****************************************************************"
data "*s......**********.......................................*******"
data "*******......*****.*************************************.*******"
data "************.*****.**...............................****.*******"
data "*........***.*****.**.*****************************.****.*******"
data "*.******.***.*****.********************************.****.*******"
data "*.**.***.***.*****..................................****......**"
data "*.**.***.***.*****************************************...*******"
data "*.**.***.***.**........................................***.....*"
data "*.**.***.***.**.**********************************************.*"
data "*.**.***.***.**................................................*"
data "*.**.***.***.**.***.******************************.*****.*.*.*.*"
data "*.**.***.***.**.*.*.*.*..........................*.*...*.*.*.*.*"
data "*.**.***.***.**.*.*.*.*.************************.*.*.*.*.*.*.*.*"
data "*.**.***.***.**.*.....*.*.**********************.*.*.*.*.*.*.*.*"
data "*.**.***.***.**.*******.*........................*.*.*.*.*.*.*.*"
data "*.**.***.***.**.*.....*.**************************.*.***.*.*.*.*"
data "*.**.***.***.**.*.***.*............................*.....*.*.*.*"
data "*.**.***.***.**.*.***.******************************************"
data "*.**.***.***.**.*.***..........................................*"
data "*.**.***.***.**...***.****************************************.*"
data "*.**.***.***.********.*.........................**...........*.*"
data "*.**.***.***..........*.***********************.**.*********.*.*"
data "*.**.***.***.***.******.*.....................*.**.*.......*.*.*"
data "*.**.***.***.***.******.*.*******************.*.**.*.*******.*.*"
data "*.**.***.***.***.******.*********************.*.**.*.........*.*"
data "*.**.***.***.***.******.......................*.**.***********.*"
data "*.**.....***.***.******************************.**.............*"
data "*.**********.***................................****************"
data "*.**********.***************************************************"
data "*.............................................................e*"
data "****************************************************************"
data ""

A forum thread will be created in the forums (Geek Culture, as this spans various languages) for you to post your discussions and submissions. There are 2000 store points (or equivalent voucher) and the admiration of your peers to be won for the best submission.

BiggAdds Tutorials - Seamless Textures

Biggadds video tutorial for games programmers

Adam Plumbley designed the latest convention banner. This video shows how it was done, and reveals a few more techniques to add to your graphical arsenal. If you haven't torn yourself away from the preset effects just yet, this tutorial might just help you to make the move.

 

PlayBasic News

Playbasic News  

by Kevin Picone

It's been another busy month locked away in our cave, organising our 2008 PlayBasic game making competition. This year's competition is our biggest and most attractive ever, with a potential prize pool of around $1,000. Considering you can enter with no outlay, that's nothing to sneeze at. Programming-wise, we've been tweaking the PlayBasic Learning Edition and retail editions of the product. Both updates should be available by the time you read this.

Heroes Quest - 2008 PlayBASIC game making competition

Heroes Quest Competition

Ever wanted to create your very own action hero like Indiana Jones or Lara croft ? Well if that's you, then you're going to love our 2008 PlayBASIC Game Making competition. In this year's theme, contestants are challenged to design a character-based platformer, where the player guides their hero in search of sacred treasures to save the world - as always. Designers are free to choose any type of platformer representation that see fit, be it side on, top down, isometric or even 3D if they're up to the challenge.

So if this sounds like fun to you, and you have enough grit and determination for yet another game making competition, then head over to the competition site to get started.

Competition Sponsors

While we have a growing list of sponsors for the Heroes Quest competition , we would love to expand it further. So if there are any vendors out there who want get involved, then contact Underware Design as soon as possible.

Over And Out

Until next time, I'm off to continue bashing bits in some other dimension, Otherwise known as sitting at my dev pc :)

From the Forums

A few links you may have missed over the past few weeks...

What is so good about Halo?

This is not a Halo-bashing contest, but an open discussion on how to emulate the success of a AAA game. The Game Design Theory board was made for threads just like this one.

The Little Arcade Pack - Game 1

This aims to make an arcade pack comprising 5 games; Blockbuster is the first. It's a variation on the falling block theme, with bonus points and powerups for successful runs.

.

This month's Winner

Each month we pluck one lucky subscriber from the newsletter mailing list and award them a free copy of DarkBASIC Professional. The email address of this month's winner is: ronal??jss@yahoo.com.?? If this is you then send us an email to claim your prize.

Outro

Share your news with over 17,000 active games developers!

If you have something you'd like featured in a future issue then please get in touch and include as much information as possible (including where applicable: screen shots, URLs and zip files).
Issue 66 deadline - June 26th.

"It may be a touch unlady-like, but I'm gonna crush you I am."
Baldurs Gate