Click for full size cover image

Welcome to another months worth of action-packed newsletter info. This issue sees the official announcement of The Game Creators programming competition 2004! This is probably our biggest competition ever (certainly in terms of the prizes we've got to give away) and also we feel one of the first to be structured in such a way that beginner programmers as well as experienced coders will get a chance to win something. Unfortunately our competition does clash with the Retro Remakes competition deadlines (read more about it this issue), but we do not want to hold back any longer - it's time you all started coding again :)

After a little hiatus the FPSC Insider returns this month. Specifically we're looking at the Map building part of FPS Creator including the painting options, lighting effects and more. You'll also see some new concept artwork from the 3D artist we've got working on the WW2 theme pack, that guy knows how to string polys together!

Other news this month sees the release of DarkBASIC Professional On-line. Now you can get the full thing without having to wait for postal delivery. There's also a new package out called Character Shop which will help with those of you struggling to animate your models in a realistic manner. Geoscape3D receives a significant update which adds lots of new functionality, there are some new WW2 Model Packs on the horizon, a few games, plenty of new releases, thousands of forum posts, Part 1 of a tutorial on creating DBPro DLLs with Purebasic and lots more!

A number of people have been wondering why the newsletter is getting later and later each month. To be honest the reason is that more and more is happening! Unlike magazines, our release date signifies "what has happened during the month of ..." and should be viewed as mostly a summary of the months activities, as well as a heads-up on what is to come. Magazines tend to review games that are soon-to-be available and hence publish a month in advance. Our current schedule works well for us, so please try and refrain from all the "where is the newsletter?" posts in our forum, thanks. Got something you'd like to share for issue 20? Then now is the time to get in touch.

TGC Competition 2004!
DBPro Online
WW2 Model Packs
Sync On 2004
DBPro Upgrade 5.5
FPSC Insider
The Developer Diaries
DBPro Activation Guide
Character Shop Released
Retro Remakes Compo
gameSpace Service Pack
DarkBASIC IRC Chatroom
Geoscape3D 1.2 Released
Nuclear Network
DBPro DLLs with PureBasic Part 1
From the Forums
This months winner
Outro

Jenga Jenga
Jenga: A PC version of the classic block stacking game! With accurate physics and great tower toppling action.
Beware the Moon Beware the Moon
Haunting sounds arise from the village of Cuesta Verde, you have been deployed to discover why all the special agents have vanished.
The Game Creators Competition 2004

Welcome to The Game Creators Programming Competition 2004! The last couple of competitions have been resounding successes, aided by the great prizes given away. This year is no exception and we actually have more prizes than ever before. The chances of you winning something simply by entering is significantly higher than any previous year. This is because we have no less than 87 prize packs to give away, a grand total of 131 unique items from top sponsors including: ATI, Live Publishing, Caligari, Shockwave Sounds, Focus, Fast Trak, SW3D Games, Binary Moon and of course ourselves.

The competition this year has been split into three distinct areas. As a company we decided upon three classic game types that represented all of the core values of a good game - fun addictive gameplay, the opportunity for some awesome graphics and sound, and most of all the programming experience required to code each of the games varies dramatically. The end result is that of the three game types on offer we feel that the first is well aimed for all beginner / new developers to attempt. The second is that little bit more complex that Intermediate developers can give it a shot and finally the third game type requires more experience. So, what are the three game types?

Snake / Nibbler Scorched Earth Operation Wolf
Snake (aka Nibbler) made infamous by Nokia mobile phones, is the classic "keep eating stuff, growing in length until you hit yourself, a wall or complete the level". It's also a good starting point for those new to game design because the core game element is quite straight forward, but there is still much room for enhancements and innovation. Perhaps even a built-in level designer or level randomiser? Different objects could change the gameplay and you could include enemies and bonuses. Your Snake variation can be either 2D or 3D. Scorched Earth is a game that has been delivered under many names - some of you may remember it as "Gorillas" from the Q-BASIC days, others of you as "Tanks" from the 8/16 bits, but the same basic elements remain: You fire against an opponent across a landscape and must take into consideration the wind speed and vary your shot power to hit the target, typically taking it in turns. This game is great for an intermediate developer who can pull off a good weather / gravity / velocity system and landscape deformation. As with Snake it too offers great room for enhancement and AI. This game can be 2D or 3D. Operation Wolf. Originally released in the arcades and with many similar sequels (Operation Thunderbolt, Space Gun, etc) it saw you mowing down hundreds of soldiers while trying to rescue hostages. You aimed with the mouse and let rip with bullets and bombs, it was a precursor to the FPS games of today. Now fundamentally this game could probably be considered almost as easy to write as Snake! However the twist we've added is that it MUST be in 3D. As well as scrolling along the landscape, you could be driving into a Jungle or laying waste to the baddies across a sci-fi environment. FPS controls are allowed and we feel this requires an experienced developer because you have to deal with a large amount of 3D objects and collision, but the opportunity is there to open up a whole can of special effects.

What exactly do I have to do in order to enter this competition?
Pick one of the game types above then set about making your own version of it in either DarkBASIC or DarkBASIC Professional. If you do not own DarkBASIC Professional then a special trial version of it has been made available which will last for the duration of the competition.

We are not looking for pixel-perfect clones of the original, we're looking for variations on those themes - but do not diversify too much! Points are going to be awarded to each game out of 100 as follows, with 10 bonus points also available:

Points Available Description
20 Graphics
How well your game looks overall, i.e. the quality of your pixel work, use of textures, models, etc.
20 Sound
Do the sound effects fit the action? Do guns fire with a hearty boom or fizzle out with a whimper?
20 Music
Is the music suitable for the game?
30 Gameplay
Lots of points available here! We're looking for games that are FUN to play and at the end of the day it doesn't matter too much what your game looks like, so long as it is enjoyable.
10 Presentation
Does the title screen fade nicely into an options area? Or does it flicker and flash all over the place? Presentation is important so we'll rate it induvidually.
BONUS
10
Source Code
We are going to be actively encouraging all entrants to include the source code to their games. This is so that others may learn from your code. You do not have to provide ANY of the media you might have created to qualify for these 10 bonus points, but if you include your full source code we are going to award your game an extra 10 points automatically. If you include say half of the code (a few choice functions?) then we'll give you 5 points. If you just include one (useful!) routine, then we might give you 1 or 2 points. If you don't want to give any source away at all, then we understand that choice but you do forfeit the chance of gaining extra points.

How are you going to ensure only Beginners enter Snake games? Etc
We're not - it would be impossible to do or enforce (after all, who has the authority to say how good another programmer is?) If a long-time programmer wants to enter a Snake variant then we will let them, and if a Beginner wants to write Operation Wolf 3D then all the best! The reason for the three game types is that we feel they represent a good experience range. It is also not "open-ended", for this competition you don't really have to think about what game to make, instead you just go ahead and make it and then spend your time thinking how to enhance it.

I've never heard of any of those games!
Fear not - this is likely to be the case for a few of the younger developers. We will be providing as much information as possible about the three game types on the official competition web site, including screen shots, details and downloads (where possible). Also feel free to ask about them in the General Talk Forum, there are going to be lots of people who can help.

How far from the original can I deviate?
Pretty far! But keep it in perspective. For the Snake game the object of the game is to "eat" items that increase your length and to avoid hitting you or other objects. You don't HAVE to make the central character a snake, it doesn't have to be stuck in a maze either - but the core game must be obviously "snake" at heart. The same goes for the other two - Scorched Earth doesn't need to be tanks, Operation Wolf doesn't need to be soldiers, it could be set in space with robots, or in Prehistoric times with dinosaurs. Use your imagination (we'll award points for it!) but just keep the CORE game elements intact.

The Prize List
Here is the complete prizes list that will be distributed amongst the winners and the fantastic sponsors who donated them:

What is the deadline and where are the official rules?
The competition officially starts on July 31st 2004. It ends at 13:00 GMT on October 31st 2004. Winners will be announced in the November newsletter (and there are going to be a lot of them!). The FULL competition rules will be made available on the TGC Developer Network site before the official start date.

There is a very definite incentive to enter the competition this year - lots and lots of prizes! Infact there are so many we've haven't even yet decided how they are going to be split out, but we do know that AT LEAST 50 different people are going to win something. That should be a great reason to enter! So, all the best and see you over on the forum where we'll try to answer all questions.

For more information visit: //www.thegamecreators.com/
DarkBASIC Professional On-line

The perfect way to get started in game programming at a rock-bottom price! DarkBASIC Professional On-line is an extremely powerful and versatile package. It contains ALL of the same features, commands, help files and functions that the boxed version of DarkBASIC Professional contains. The difference is that you get less media and example projects to explore and of course no printed manual or box.

This version of DarkBASIC Professional is ideal for those of you who don't need the printed manual and can get by with the built-in help files. The help files list all of the commands by category and are available from within the editor at the touch of a key. Because there are no packages to send, you get the same programming language at a vastly reduced price and without the usual wait for the mailman to deliver your goods. The version of DarkBASIC Professional you will receive is 5.4 - the latest at the time of writing - so you won't even need to upgrade it.

As a very special introductory offer you can buy DarkBASIC Professional On-line for only $54.99 (44.99 Euros, £29.99) and you'll also get a FREE copy of DarkMATTER Electronic with it. Please note that this special price and offer will not last for much longer - so order now to secure your copy.

For more information visit: //www.thegamecreators.com/?m=view_product&id=2000
World War 2 Model Packs on the way

This months newsletter cover is a fantastic grubby render of a selection of models from the WW2 Model Weapons pack currently on-sale. The reason for featuring this beauty is that there are even more WW2 packs on the way. As you can see from the image associated with this article there is a WW2 Vehicles pack coming, featuring a German Half-track, JagPanther tank, Willys MB Jeep, GMC 6x6 truck and Kubelwagon.

Also on the WW2 horizon are Character Models and Music Packs. The Character Models will feature a variety of infantry while the music will add a mixture of perfectly themed ambience and intensity to your battle action. More release dates and previews will be published when available, but you can buy the first two packs on-line already.

For more information visit: http://ww2media.thegamecreators.com
Sync On Convention 2004

Each year the active German DarkBASIC community hold a convention and this year is no exception. Sync On 2004 will take place in Bamberg, Germany on Saturday the 7th of August. Personally we at TGC have always loved the demos that come out of the previous years demo coding competitions and are glad there is another compo this year. The entries can run for a maximum of 5 mins, must include some of the provided media, be 20MB or smaller, use copyright free media and of course be written in DarkBASIC or DarkBASIC Professional.

As well as the competition there will be talks, work-shops, games playing and interviews through-out the day. Lee Bamber of The Game Creators should be in attendance. Don't worry too much about not speaking German as nearly all of the people present are fluent in English! If you cannot make the event but still want to submit your demo or game to be displayed, then contact the event organisers via their web site below.

For more information visit: http://www.colorarts-data.de/syncon2004
DarkBASIC Professional 5.5 Beta Released

Following on from last months 5.4 Upgrade for DarkBASIC Professional, we released the first public beta of the 5.5 Upgrade a few weeks ago. This upgrade resolves a number of issues and improves stability for those suffering from the globstruct related bug introduced in 5.4. Although still not yet the official release you can grab the file from our BetaFiles download area. At the time of writing this (26th July) a new 5.5 Beta has been finished (fixing the language character issue and the particles/math's conflict) and will be released in the next few days. It will signify the end of the 5.5 point release for the month of July. 5.6 development will commence the week starting 2nd August with a final release ETA for the end of August. Therefore if you have found any significant problems with 5.4 (or even the 5.5 beta) then please post about them in our Bug Reports board. By doing so our developers can ensure they are fixed in future Upgrades.

Download from: http://betafiles.thegamecreators.com/dbpro
FPSC Insider
Destroyed Tank
Lockers
Operators Chair
Binoculars
Ammo Box

FPSC Insider is back! Sorry for the short absence last month, but there was more than enough juicy information to make up for it. By now most of you will have a very good idea exactly what FPS Creator will allow you to do. Development on it is still progressing at full steam - we've hired another 3D artist to work on prefabs and entities for us and the new Windows based editors are starting to look really good too. You can view some of the new scenery work-in-progress art to the left of this text. This month we're going to delve a little deeper into the Map Editor itself.

The single biggest issue we had with most other map editors out there is the complexity of them. You literally have to piece rooms together wall by wall, stair by stair and creating a kick-ass looking level is often very difficult, requiring a level of architectural knowledge oft reserved for the CAD world. We have made every effort possible to make the map editing process of FPSC as simple as possible, because this is where you as the game builder will spend the largest portion of your time. All of the key tools have been kept on one screen and at its most basic level there are just two areas: one to select items from and another to paint on.

The "painting" environment is fully 3D. The 3D area sitting comfortably within the Windows based editor and being controlled by the icon/menu panels. As mentioned before the process of creating a level has been made as simple as possible: rather than have to crate every single wall for your room - you can drop entire rooms onto the map. Select a door object and you can punch into the wall of your room and it will re-adjust the walls accordingly and insert the relevant trigger points so the door opens upon approach for example. With a single key press you can move "up" a level in your map, paste a new floor, drop in a stair well and you've now linked your two rooms. If you do not wish to use an entire room prefab, then you can paint directly with just a wall object - each time you place a wall segment onto the map, it will automatically link itself to the wall segment it touches. This works around corners as well and the various painting tools (line, square, circle) allow you to literally paint your map instantly using one of three core types of element: Prefabs, Segments and Entities.

PREFABS
Prefabs are what you typically start with - i.e. a prefab might be a "dungeon" or a "basement". They are typically entire rooms that can be chained together to build your level. You can literally drop in single prefab or say a basement and then test your game and charge around the room.

It would be fair to say that Prefabs are the selections which require the least amount of work to use. The majority of the design has already been done for you and they are an ideal starting place for those very new to game design who just want to be able to drop in an entire corridor section or an ops room. Although they are "easy" to use, prefabs are still intelligent in nature. For example you cannot lay a corridor segment down the middle of a room. You must place prefabs onto grid segments that are empty. A prefab isn't just a single tile segment either - they are large multi-segment, sometimes multi-height blocks. If you could imagine a railway set - the prefabs would be the track pieces, the corners, the surrounding buildings, etc.

SEGMENTS
Segments are used to make Prefabs, they are the "lego blocks" of the FPSC world. However segments are not necessarily just a single mesh at all. A segment might be a flat roof section, or a slanted roof section, or a piece of roof with a chimney in it. All of which might be combined together to form a roof Prefab, or painted onto the map induvidually. Essentially a segment is anything that contributes to a static area of the map. They are entirely indestructable as well, so you cannot destroy a roof segment.

Segments can however contain dynamic elements. For example a typical segment might be a door. It could contain a window which, when shot, shatters. This window would be the dynamic element. You are not limited in your use of segments or where they may be placed. As can be expected - a Prefab maker will be supplied that allows you to link together Segments and save them out again.

ENTITIES
An entity is pretty much everything else used in your game. Entities will be split into core categories to help layout your workspace. Although the category list is not yet confirmed it is likely to be: Players, Enemies, Markers, Scenery and Items.

Players: These are the actual characters you'll play in your game. Enemies: The ones that will try and hunt you down! Markers: An invisible coordinate such as a player spawn position or a transportation node. Scenery: Scene objects such as acid smoke, lazers, curtains, etc. Items: Small objects such as apples, ammo clips, documents, etc.

A good example of the difference between a Segment and an Entity might be a lava pool. The lava itself would be a segment, but you could have a plume of toxic smoke rise from the lava every now and again. This smoke would be an entity included within the lava segment.

LIGHTS
Lights can be either static or dynamic. They are a type of entity and you can move them around, set the colour, strength and other values from the map editor. Using lights you can easily create strip lights, wall lights, door lights, ambient lights, lights that follow the player around and other types. Static lights are burned lights - that is, lights that get baked into the scene when FPSC light maps your level. They are always point lights and there is no (realistic) limit to the number of them you can place in your map. Dynamic lights control the illumination of a scene (you could set the strength of a light to be 0, i.e. off until the player walks into a trigger zone, when it could turn on).

It is important to note that both types of light (static and dynamic) will effect every single entity in the game, lighting up the guns, the people and the objects. A new blending technique will compute the approximate lighting element for the scene, including colour. For example place a red-coloured static strip light in to the left of the player and a dynamic blue light on the right and FPSC will calculate a purple coloured middle point for you. Video cards are usually limited to 8 hardware lights, but this technique means you can place as many of them as you like. As you might expect, the ambience of any light can be controlled via an AI script.

TRIGGER ZONES
As soon as a player enters a trigger zone a change in the game can occur based on an extra zone property that will then be set. Any object that can move can have this zone property. This means you could make a room have a zero gravity effect, floating the player around. Or a trigger zone could be set-up so if you were to aim carefully and fire through a set target, an event could be started. Not only players can use trigger zones, but enemies also. If you are being chased by an enemy down a corridor with a chasm in it, you as the player know to press jump to leap across. The enemy however would fall down the chasm - but perhaps this isn't what you want? Instead you can define a trigger zone that, when reached, forces the enemy to jump so they can continue the chase. Similar zones could allow enemies to climb ladders, use lifts, press buttons, go up ramps, etc.

Another more common use of Trigger Zones would be to create water. When the player enters the water zone the camera can shift differently, the audio files could be played via an underwater EAX filter, the animation changes to include swimming, gravity is altered and perhaps a "breath" counter decreases. Alternatively a trigger zone could activate a wind tunnel - grenades thrown into it could fly back at you, crates and light objects might be ripped off the floor across the room and anythin that zone is effected.

That's all for this month...
The key to maps in FPS Creator is: They can be as big as you need, to make the level as big as you want. We're not going to pretend you can do things like build Far Cry style terrain - remember, FPSC is primarily an indoor experience, there will be no "hills" to wander over. That doesn't mean you cannot create street scenes like those used in Return to Castle Wolfenstein of course - that isn't Terrain, it's just excellent map design - something we hope to make as easy as possible for you to achieve.

  For more details: Read next months newsletter!
Developer Diaries are Live

We made a number of promises in the last newsletter and we have delivered them and will continue to do so. One of those promises was that the Developer Diaries from DBDN (the DarkBASIC Developers Network) would be made available for all to read. This has happened and you can now catch up on the mindful ramblings of Lee Bamber, Mike Johnson and Richard Davey over on the Developers Network site. The diaries are still constantly updated: for Lee that usually means once a day, for Mike once every few days and for Rich once every blue moon - but still, you'll get the latest insight into exactly what is going down at TGC here.

For more information visit: //www.thegamecreators.com/
DBPro Activation Guide

With the release of the on-line version of DarkBASIC Professional Internet activation became the norm. As used in hundreds of other software packages, we use it to track the number of people actively developing with DarkBASIC Professional and allow them to use our new enhancement packs. However some people ran into problems and to that end we produced a step-by-step illustrated guide taking you through the entire activation process from beginning to end. All common problems are included with their resolution. You can read the guide on-line or print it out for reference.

For more information visit: //www.thegamecreators.com/?m=view_product&id=2000
Character Shop Now Available

Character animation is arguably the hardest step in development for most games. It's very common to see demos with beautiful but strangely unpopulated environments, or with only a few stiff animations. How can indy developers be expected to create these? Animation tools are expensive, hard to use, and take many hours to get quality results. That was until Character Shop.

Character Shop is the solution to this long-standing difficulty. The program contains 80+ professionally produced animations that can be applied to any humanoid mesh scaled to the fit the skeleton. This means you don't have to do any of the animation work yourself - it has already been done for you by professionals. You simply rig the skeleton to your models and save the end results. The vertex weighing process is straightforward, with powerful selection tools to reach every nook and crevice. Use the auto-attachment feature, then view the mesh deformation in real time and make final adjustments to the vertices.

Character Shop is available to buy now for only $49.99 (39.95 Euros, £26.99) from the web site below. There is also a free trial version available.

For more information visit: //www.thegamecreators.com/?m=view_product&id=2094
Retro Remakes Competition 2004

The Game Creators have long been fans of the Retro Remakes web site and were responsible for sponsoring a large part of their very successful programming competition last year. This year the competition is back with a vengeance and once again TGC have put up some great prizes, which when combined with the others on offer, means winning this years contest will see a veritable gold-mine of software delivered to you! Over to the Retro Remakes boys to tell you the rest:

"Welcome to the second Retro Remakes competition. After the massive success of last year's competition it was decided to make it an annual event but it was touch and go this year, hence starting a month later than planned. In an effort to make the prize pool bigger and better than last year we decided to widen the net and approach the bigger fish. However, the bigger fish don't want to know. Out of the 20 or so big companies we approached we have not received a single reply, not even one saying "Thanks, but no thanks"."

"We'd almost given up hope, when you lot came to the rescue. Along with some of last year's sponsors, as well as following up the suggestions made by you, we have amassed a large varied prize pool comprising both Hardware and Software. While the total value doesn't quite match last years total, I think you will agree that this year's prize list is one worth competing for. Thank you to everyone who helped us gather in such great prizes. Once again we have prizes for the best three remakes as decided by the judges, as well as a number of category prizes. Also this year we are introducing Judges prizes which will be awarded for the little things that impress us."

"So come on - what are you waiting for ? Get those coding fingers going, impress us with your remaking skills and win a prize, its as simple as that. You will find the rules are very uncomplicated, this has been done purposely to give you all a fair chance. You've got three months .... starting NOW :p"

TGC do realise that this conflicts with our own programming competition, so you'll have to decide which you'd like to enter most of all - although to be honest, some of the game types allowed for our competition would probably be classified as Retro enough to be entered for both :)

For more information visit: http://www.remakes.org/website/comp2004.php
gameSpace 1.5 Service Patch 1.1

Caligari announced the release of Service Patch 1.1 for gameSpace 1.5 (phew, what a mouthful!). It addresses a few issues regarding the export of Shockwave file formats and the Windows help file (CHM) manual has been updated and includes images. All existing customers will have been sent details on how to download this, but if not - get your Caligari username and password at the ready and visit:

Download from: http://forums.caligari.com/track/link.asp?name=GS15SP1.1&code=1
Official DarkBASIC IRC Chatroom

The guys responsible for running the official DarkBASIC IRC Chat Room have moved it over to a new server / network. Apparently this new network/server will provide a better chatting experience for all - anyway, drop on by and chat to the people that hang out in there.

Point your IRC client weapon of choice to: darkbasic.chattingaway.com (or lightning.chattingaway.com) and join the #darkbasic room.

For more information visit: //www.thegamecreators.com/
Geoscape 3D 1.2 Released

The Geoscape3d product line is a suite of products designed to create realistic virtual terrains with output aimed specifically for use in computer game and simulation development. No longer edit your terrains in a multitude of different applications, just use Geoscape3d to improve your productivity and efficiency.

1.2 addresses the issue of the learning about the terrain texturing engine with the addition of preset terrain textures. These allow the user to quickly texture terrains with premade texture settings allow almost instant terrain texturing.

1.2 now has markers. These are simple, coloured geometric shapes that can be attached to the terrain and can have user-data associated with them. For example, use the muti-marker placement tool to quickly generate forests of markers which can represent trees in your terrain.

The 1.2 release sees a significant improvement in both functionality and user interface. Much care has been taken to increase the usability of the product with the main editor receiving a major overhaul. New functionality includes:

  • Load raster GIS data from various formats
  • Corrosion tool - deform your terrain with fluvial or thermal erosion and then use the deposition map to texture your terrain
  • Fixed rotate view mode
  • Terragen .ter file importer and exporter
  • Glacial and canyonising filters
  • 3D Gamestudio HMP exporter
  • Improved plugins
  • Enhanced Select tool - add to current selection by holding the shift key - remove from current selection by holding the control key down. Selection shows on the 3d view.
  • Tool marker now wraps to terrain in the 3d view
  • New aspect constraint allows texture layers to be limited to certain directions of the terrain texture.
  • New data entry component simplifies entering values
  • Custom terrain editing brushes - specify art style brushes for creating your terrain
  • Crop or extend terrains

Download the 1.2 Upgrade from the Geoscape3D web site or buy on-line today.

For more information visit: //www.thegamecreators.com/
Nuclear Network

Nuclear Glory as well known for their excellent Collision DLL. But the range of services and software on offer is ever increasing and the new Nuclear Network is testament to this. Nuclear Network is a multiplayer service designed to allow you to get your multiplayer games up and running on-line as quickly as possible. Signup and registration is free of charge and you are provided with the network plugin that opens up the network commands required. Your game is written around the network plugin commands and ultimately your players can subscribe to, and play your game.

This is a very novel way to approach network support in games and we would be interested to hear from anyone who has a game working via this system. Full details, costs and registration can be found on the Nuclear Network web site below.

For more information visit: http://www.nuclearglory.com/nn/
Third Party Commands with PureBasic - Part 1

TGC have been fans of PureBasic for a long time now, its powerful command set and small exe files make it a dream to create applications in. However you can also use it to make Third Party Command DLLs for DarkBASIC Professional and this is Part 1 of a complete tutorial on doing this written by Frederic Cordier.

1. Prepare the .pb to receive your DLL

First we must create a new project file. In your Purebasic IDE create a new file and call it, for example "MyTestTPC.pb". Now we must tell to Purebasic that we want to create a DLL instead of a Win32 .exe file. Jump to the COMPILER / COMPILER OPTIONS menu. You will find the program format (it's WINDOWS). Replace it with SHARED DLL. Validate your choice by clicking "OK".

Now that we have defined our DLL file, we must define our DLLs content. It must be structured this way:

  • 1 / Structures and DATA define
  • 2 / Internal Procedure(s)
  • 3 / DLL Commands/Functions

1.a - Structures and DATA define.

In the first part, we will need to insert the DarkBasic Professional Global Structure called: GlobStruct. From Patch 5.4 and newer, the structure is the one defined in file globstruct.pb available with this tutorial. It will be mainly used for memory allocation for Strings that you'll receive from DarkBasic Professional and for Strings you'll send to DarkBasic Professional. Once you have added the GlobStruct.pb in your DLL, you can ADD data you'll need. If you need extra data, you'll have to define them here. For example: Global MyData.L .... Dim MyData.DimStruct( 5 ) ..... ) You can look the TPCSkeleton.pb file to see how the DLL is structured.

1.b - Internal Procedure(s)

These procedure will be simple Purebasic's procedure defined like follow:

Procedure MyProcedure()
 ...
EndProcedure

They will not be available for people that open the DLL and look for functions. That's why we call them internal procedure. The interested of these procedure is to make tasks that will be used many times in your DLL ... Imagine that your DLL use Cosinus and Sinus. DarkBasic Professional use DEGREE and pure use RADIAN so, you'll need to convert your data from DEGREE to RADIAN. For example:

Procedure.f Deg2Rad( Angle.f )
  AngleFinal.f = ( Angle.f * 3.14159265 ) / 180.0
  ProcedureReturn AngleFinal
EndProcedure

That simple procedure change a Degree angle to Radian format.

There are 3 internal procedure that must be present here: ProcedureCDLL Constructor(), ProcedureCDLL Destructor() and Procedure.l InitialiseCorePtr(). These procedures will be explained in part 2 of this tutorial.

1.c - DLL Commands and Functions

This is the main part of your DLL ... you will add all your "ProcedureCDLL" commands and functions that will be used to create DarkBASIC Professionals new commands sets here. Each ProcedureCDLL created will have its part in the DLLs STRING TABLE to create a new command.

2. Initializing (Constructor(), Destructor() and InitialiseCorePtr() functions)

Constructor()
By default this procedure is empty, but if your program needs to initalise extra data then you can initialize them in this function. It will be executed when the main DarkBasic Professional program you've compiled is launched.

Destructor()
By default this procedure is empty too. But if it contains some code this code will be executed when your DarkBasic Professional Program is over / finishes. Imagine you want to make a starscroll under interrupt. You'll have to initialize the interrupt in Constructor() and stop the interrupt in Destructor().

InitializeCorePtr()
This function take the real *GlobStruc pointer to use it within the *GlobStruct defined in Part 1a. Here is the procedure:

Procedure.l InitialiseCorePtr()
  If OpenLibrary( 3 , "DarkBasic ProfessionalCore.dll" ) 
    coreptr_handle.l = IsFunction( 3 , "?GetGlobPtr@@YAKXZ" )
    *GlobPtr = CallCFunctionFast( coreptr_handle );
    CloseLibrary( 3 );
  EndIf
  ProcedureReturn *GlobPtr
EndProcedure

Don't forget to include that procedure inside your DLL as explained in part 1B. As you can see, that small procedure opens the DarkBasic ProfessionalCore.dll and looks for the GetGlobPtr function. It calls it and Sends back *GlobPtr. You must use that procedure at the beginning of each of your ProcedureCDLL that will use the *GlobStruct to be sure it will be initialized before using or your DLL will simply crash when the command is called.

In the next issue of the Newsletter we will show you exactly how to create a DarkBASIC Professional command and provide the required source code to get started, please note that for Part 2 you will require DarkBASIC Professional 5.4 and the full version of PureBasic installed.

For Purebasic information: http://www.purebasic.com
From the Forums

We recently moved our forums to a brand new dedicated server. The extra processing power and bandwidth has increased the forum speed for nearly all European users and also allowed us to be a bit more flexible with regard to the server. This means we will start allowing forum file attachments shortly. As always though our community forums is proving to be an interesting place to hang out! Here is a short summary of very interesting threads that you may wish to take a look at and perhaps participate in?

Waypoint Editor - Dennuz666 released a 3D waypoint editor for DarkBASIC Professional. It includes all of the usual functions (place, move, rotate, delete, load, save, etc) that you need and a piece of sample source.
Read more: Waypoint Editor

133 Line BSP Style Collision - Aura posted this code onto the forums which basically provides for good sliding collision against .X or .3DS models. The code is only 133 lines long and you can test it out with pretty much any model you have laying around.
Read more: 133 Line BSP Style Collision

Female LowPoly Model Pack - Psionic has released his female model low polygon pack with some shots and renders on the forum. As he says "It's basically 4 versions of a bikini babe ideal for those racing games or surrounding your villains' swimming pools with, She also has some climbing, fighting and shooting anims ;-)".
Read more: Female Model Pack Thread

Fractalesque Terrain - The ever prolific Van-B has released his source code for creating fractal styled terrains (as used in his game Stoked) which may prove useful for the new Advanced Terrain Plugin. Grab the code and try it out for yourself.
Read more: Fractalesque Terrain

Mercenaries in Space - David T has released shots (and actually a playable demo now) of his new sci-fi space based shooter. It's looking really good (although PC performance reports vary) and reminded us of Homeworld, check it out for yourself and leave your comments.
Read more: Mercenaries in Space

2D Shoot 'em Up Engine - Skeletor released all of his source code to the forums around his 2D shoot-em-up engine. Basically it's a complete game engine including loads and loads of comments, so hopefully it'll be easy enough for you all to follow and modifying it for your own games should be simple.
Read more: 2D Shoot 'em Up Engine

Visit our forums: http://forum.thegamecreators.com
This months winner

We've plucked one lucky subscriber to our newsletter and for you a completely free copy of DarkBASIC Professional is yours for the asking. The winner is richyread@???????.com - just email us and a free copy of DarkBASIC Professional is yours.

For more information visit: //www.thegamecreators.com/?m=view_product&id=2000
Outro

The gauntlet has been thrown down, the challenge set - you now know the inside scoop around The Game Creators Programming Competition 2004 - time to get creative :) There is a very good chance of winning a prize this year, infact a significantly higher percentage than any previous year ever. So get coding! We'll look forward to seeing your work in progress shots in the forums.

Got something you want thousands of people to read about in the next issue? Then get in touch! Email me: rich@thegamecreators.com or use our Feedback form.

Contact us: //www.thegamecreators.com/

Famous Last Words: "I throw the sticks of dynamite into the great arc of electricity to create a diversion so that we may flee!"
(C) Copyright The Game Creators Limited 2004