Editorial - January 2009

Issue 72 cover

Looking back at 2008, I can pick one particular coding skill that changed the way I do things, and opened up a whole new world of possibilities. Once again, it was something I discovered at The Game Creators Convention, this time from Ian, forum regular, moderator and author of the Matrix1 utilities.

Stacks are my must-have technique going forwards into 2009. I knew about them already, but always thought the trade off between coding and performance was not worthwhile.  I was very wrong. Put simply stacks allow you to track a collection of entities very efficiently. Let's take the example of 10,000 potential objects (I say potential, as you may have anything between 0 and 10,000). For the stack system, you need two additional arrays of the same size, that will simply hold integer values - the indexes of the objects in the original array. When you need a new object you take it from the "objects still available" stack and put it on the "objects in use" stack. Likewise, when you have finished with your object, you put it back on the "objects still available" stack, remembering to shuffle the remaining objects in use down to fill the gap. Now, when you need to act on your objects, you don't need to check all 10,000 entities. Simply check the "objects in use" stack and go directly to the array elements that you need to be concerned with.

This is a very quick explanation of a stack system, and doesn't do it any justice. If you haven't used them before, I would recommend sitting down with the above example, and playing with the figures to see how much processing time you might save as the number of entities fall and rise. I have found it particularly useful with an effects system I have in development, where several hundred exchanges can be made in just a few seconds of processing.

In 2009, I hope to find many more useful techniques, and even revisit those that I have dismissed in the past as I did with stacks. Of course the forums will be my first port of call, they have served me well for the last 5 years and will do so for the future.

In this first issue of the new year, we have reviews of DarkBASIC Professional, Social Arcade, FPSC and FPSC X10 in terms of the progress thay have made over the last 12 months, and where they are headed in the near future. We see the introduction of Genetica to the range of products available from the TGC site, enabling seamless and animated textures at a highly professional and advanced level. There is also the usual features, including a host of videos and Lee's tip of the month covering LOD techniques. Please, enjoy this first issue of 2009, and let us all look forwards together to a productive 12 months.

Until next time,

Steve Vink, TGC Newsletter Editor

contents

(1) DarkBASIC Pro (2) Genetica (3) FPSC News (4) Social Arcade (5) TGC Store (6) FPSC Compo (7) DarkGDK & GDK.net (8) Leadwerks (9) Odyssey in 2009 (10) Tip Of The Month (11) Videos (12) PlayBasic (13) Winner (14) Outro

DarkBASIC Professional News

DarkBASIC Professional

Dark Basic Professional U71

Work had started on the new U71 version soon after the TGC convention 2008, and has not stopped or even slowed down as this increasingly large update seeks to improve features and help pages within the language. Thanks to a steady stream of suggestions and refinements from the forum public beta testers, we have been able to complete what is a great update to the Dark Basic Professional language. DBP and GDK now mergedYou can download it direct from the Dark Basic Professional main web site.

The big deal about this update is the internal merging of the DarkGDK source code, so from U71 onwards the DBP and GDK source codes are one and the same again. These code paths split over a year ago as the GDK underwent some changes that would have interfered with the smooth running of DBP and its own update cycle. Now that project is complete, we have brought the code back into a single source code base and ensured the best of both worlds made it into each product.

Although we create a rod for our back each time we substantially add to the language, we just could not resist adding a new post process screen command which allows the entire screen to be redirected to a render texture and that image rendered via an internal screen aligned quad through a shader effect to the final backbuffer which is the screen you see. The upshot is that you now have some new commands called TEXTURE SCREEN, SET SCREEN EFFECT, DRAW TO CAMERA and DRAW TO SCREEN which combine to allow you to apply a shader to the screen. This means you can do things like BLOOM, GREYSCALE, HEAT-VISION and other post process effects on your final screen in very few lines. We have also made it fully compatible with the DarkSHADER system so you can load DBS files from DarkSHADER and have them affect the screen in five lines of code.

For those who want to own every plug-in, you will notice a new module in the latest certificate viewer which shows we are about to provide official support for GreenEAR. We will announce this in more detail with examples and demos next year. All we can reveal now is that this module is totally awesome and if you ever wanted to make a game that runs on a server, but did not want the hassle of writing a game that runs on a server, this is a must have module!

In amongst the usual flood of tweaks, bug fixes and help system improvements, you will find a cool new parameter in the LOAD SOUND command which allows you to set the sound so when it plays or loops, it does so globally. That means even if your application is hidden or does not have focus, it will still play your sounds. Ideal if you are making a sound application.

You can upgrade to U71 now, by downloading the latest update.

Dark Physics Demos

Dark Physics Demos bundled with NVIDIA PhysX driversCustom PC currently features an article on NVIDIA PhysX, and how it is gaining momentum in the gaming world.

Worth noting is the mention of the demos written in DarkBASIC Professional by our dedicated forum members, and specifically highlighting Kenneth Bugeja's work on fluids and soft bodies.

 

 

Genetica - Seamless and Animated Textures

Genetica 3D Seamless Textures

Introducing Genetica 3.0, the world's most powerful editor of seamless textures, animated textures, and HDRI environment maps! Genetica is a standalone application available on Windows 2000 and above.
Genetica 3.0 is available in two editions: Basic and Pro. The demo versions of Genetica are downloadable right now from The Game Creators. When you are ready to purchase, the demos can be converted into the full program simply by entering your serial number which can be ordered directly from the Genetica 3.0 page.

The Professional edition extends these features further:

Genetica 3.0 now available at The Game CreatorsFull details of Genetica 3.0 and ordering details are available now on the product web page.

 

News from the World of FPS Creator

FPS Creator News

FPS Creator X9 and X10 Progress

A few weeks ago TGC received news of an FPS Creator game that was going to be published, and the publisher wanted to see a few tweaks. The author also wanted FPS Creator to compile his 13-level epic quickly and flawlessly, and so we decided to create a new update to provide just that.

Just launched, V1.14 is the version that introduces these new refinements and includes a significant speed-up of the build game process in the situation where lots of FPI scripts are located in the scriptbank.

We have also increased the supported bone count from 32 to 60 for all FPS Creator animated models that use shaders.

The built-in game creator store has an update to solve a crash bug when Vista attempts to upload certain types of segment.

There have been many calls for weapons to auto-equip when you start a new level or load a saved game, and this has now been implemented along with two new FPI conditions which allow you to check what level you are on. For example if you wanted to change the skybox for level three because it is a cave or underground level, you can now add a line to setuplevel.fpi to read:

:state=0,levelequal=3:sky=skybank\ww2\Gas

and a second line to read:

:state=0,levelnotequal=3:sky=skybank\ww2\Hil

Xbox Controller - Photo by BlueMintThis will use the Gas sky on level three and the Hil sky on the other levels.

As a final Christmas treat, we also decided to drop in hard coded support for the PC version of the XBOX 360 controller. The controls are fixed for this first version but we plan to allow all buttons to be configurable in a future version as we know when it comes to controllers one size does not fit all.

 

 

FPS Creator X10 

You may recall that last month we did not cover any X10 news, which may explain the thread that popped up making vocal some of your concerns over the future of X10 development and specifically when the next update will be released. The reason most of our energies have been on DBP and X9 is that we spent around 15 months developing the X10 product, and we wanted to give something back to the DBP and X9 communities for being so patient with us during that project. I think we have done a great job with DBP and the spin-off product, Dark Game Studio, and X9 now has a host of new toys and a lot of stability and performance tweaks under the hood.

We think community lead development is a great way to create products and updates, and if the X10 guys want an update then that is what they are going to get!

Now the original TGC plan was to fire up the migration work starting 2009 and blend X9 and X10 together but it would probably take at least half a year with testing. We gave the choice to the X10 guys, and almost all of them wanted to see an update to X10 before a migration version which allows them to compile to X9 systems. We think community lead development is a great way to create products and updates, and if the X10 guys want an update then that is what they are going to get!

Starting January 2009 we will fire up the X10 development machine. We will start the process of what one forum user understands as 'givin X10 some lovin' and begin work on an update that addresses some of the issues you have been experiencing. Top of the list is the compatibility issues with ATI cards, and to that end we have purchased a DirectX 10 card that actually runs on a PCI slot if you can believe it! We also want to get the store and X9 models into X10 as gracefully and quickly as possible along the way. We have some other ideas too, but wait for the beta for news on those. Our hope is that X9 and DBP guys won't mind a little side-tour to X10 land for a few months, and anything new that goes into X10 will eventually make it back into the migration version and the next revision of DBP.

Facebook's Social Arcade

Social Arcade by The Game Creators

Rick Vanner and Dave Milton visited Facebook headquarters in December, for the results of the fbFund competition. Having been awarded $25,000 USD in the previous round, it is unfortunate to report that Social Arcade didn't scoop the ultimate prize of $250,000 USD. The Game Creators appreciate the support given by the community, and the time and effort put in to continuously voting throughout November. "We were disappointed not to win but we gave it our best shot" says Rick Vanner, Financial Director of TGC. "Social Arcade will continue to be developed in 2009 after a short break."

 

The Game Creator Store - New Additions

The Game Creator Store 

Did you know that The Game Creator Store includes not just FPSC Entities and segments, but also music, sky boxes, applicatons, models and photos? The Game Creator Store - free downloadEach month the Game Creator Store grows as our approved artists upload their latest offerings. Start up your store (through FPS Creator or the standalone version) to see these and many more.

 

Scorpion EnemyScorpion

A small but very venomous scorpion that will attack the player if they get too close. Any player of modern FPS games will know that small, agile creatures are a problem in most games these days!

 

 

Wall Clock Low Poly 3D modelWall Clock

Break up empty wall spaces with a wall clock. It is often easy to miss details - or lack thereof -  such as expanses of wall, that can be easily transformed with a small number of well-placed objects.

 

 

Bat at The Game Creator StoreBat

This nocturnal menace can enrich your scenes with unexpected surprises.

The bat is a character, and can be killed like any other, with a well-aimed shot.

 

 

TGS_Gunner.jpgCiv Gunner

A 'Civilian Soldier' themed character, good for urban style shooters or as mercenaries etc. This is the fourth of a character set.

Best or suggested weapon designation includes heavy weapon, assault rifle, and rocket launcher

 

 

Police Riot Gun game model870P1 Riot Gun

Typical riot shotgun of the 1980s-1990s with top folding metal stock. Includes VWEAP and pickup weapon and ammo entities. 

Uses model pack 9-10 compatible hands. Enhancements are also included for FPSC modifications, available from the respective authors.

 

All of the above models are available to purchase and download through the inbuilt Game Creator Store in FPS Creator, and also using the standalone store for other game-making tools.

The BIG FPSC Christmas Competition

FPSC Christmas Competition 1008 

The deadline for entries into the Big FPSC Christmas Puzzle competition is now gone. The judges will be busily "working" through the many games, assessing just how well they have met the remit of a 5-room puzzle game. They will shortly decide on the ultimate winner, and of course the runners-up who will also be taking their share of the spoils from the prize pot. Here is a reminder of everything that is on offer to the winners:

FPSC Christams Competition 2008These prizes will be distributed amongst the winners. You can view the competition thread for the latest discussions.

DarkGDK Update

DarkGDK

The long awaited update to DarkGDK has been released, available from the DarkGDK website, which includes support for some of the commands that DBPro users have been enjoying plus a few things DBPro users wish they had, including the ability to launch C++ commands right at the very start of the application execution (even before initialisation of the DarkGDK system) and the ability to run commands at the very end of the application too. There is also a new command which allows the default window to be changed first time around, rather than creating one DarkGDK window then resizing it.

This update is also crucial to running the source code examples that are part of the six part Webcast hosted by Microsoft on DarkGDK. The update is also vital for a new, as yet unannounced program which we will be giving away in January. Check out the next newsletter for more details.

Download DarkGDKDarkGDK is available from the dedicated pages on the website.

 

Lee's webcasts on MSDN

The full series of webcasts by Lee Bamber on 3D game development using DarkGDK is now available to watch on demand. You can watch these individually as your schedule allows, also allowing you to digest and put into practise each part before moving on.

DarkGDK.net

The ease of DarkBASIC Professional with the power of Visual Basic.NET and C#.NET

As reported last month, DarkGDK.NET is now available, and all those who pre-ordered will now have their licensed versions of this version of our 3D programming language suite. The new version contains many improvements, including:

 The DarkGDK.NET toolkit supports the following compilers -

Now you can take full advantage of the game engine that powers DarkBASIC Professional from within any of the Visual Studio .NET Express or Visual Studio .NET Professional environments, with the DarkGDK.NET. A whole new world of possibilities can be opened up by combining the features that both Visual Basic.NET and C# offers, and the power of the DarkGDK.NET. The GDK brings the flexibility of the DarkBASIC Professional engine to the world of .NET development while still retaining the ease of use that DarkBASIC Professional offers.

Developing games with the DarkGDK.net offers many benefits:

Buy DarkGDK.netGo to the DarkGDK.net pages now to get the full details, and to order for just £20 GBP ($30 USD, €25 EUR). This licensing fee gives you the freedom to sell the games and applications you make.

Buy DarkGDK and DarkGDK.netIn addition, there is also a combined DarkGDK and DarkGDK.net license bundle available for £35 GBP ($50 USD, €40 EUR). Again, this great deal provides the royalty-free licenses required to sell your games.

Leadwerks Engine Update

Leadwerks Engine

screen-space ambient occlusion

Screen-space Ambient Occlusion

Leadwerks Engine 2.2 will be released in January.  The update will be available to all TGC Leadwerks Engine customers.  Version 2.2 will feature the following:

  

Learning Library 

You can now find more than 5 hours of tutorials, oriented towards anyone using the engine with C and C++. Leadwerks TutorialsClick here to view them now. The topics covered include deferred lighting, camera controls and mesh creation. You will also discover how to implement physics bodies, create convincing materials and introduce particles into the pool of effects at your disposal.

 

Odyssey-Creators update for 2009

Odyssey Creators 

by Frédéric Cordier 

2009 will see the introduction of some new applications from Odyssey-Creators, as well as updates to our existing range. Firstly though, we would like to announce that our established and well-loved software 3DMapEditor will become free for everyone. Look out for this soon.

2009 will see the arrival of a new DarkBASIC Professional plugin dedicated to 2D/3D game development with a set of commands never seen in DarkBASIC Professional before, we hope to release it in the middle of 2009. We also anticipate the release of a full 2DMapEditor in mid-2009, which will be compatible with DarkBASIC, DarkBASIC Professional, and PureBASIC amongst others. This editor will allow you to create multi-layer 2D Maps with precalculated light effects. It will provide source code to load and display these maps in the different programming languages.

The third product Odyssey-Creators are working on is PurePLUGIN Pro. This product should be released early in 2009. It's an improved version of PurePLUGIN (which will become PurePLUGIN Basic) that will allow you to create third party DLLs for DarkBASIC Professional without the need for the PurePLUGIN.DLL file.

Concerning our other products, we'll be releasing upgrades for eXtends, X-Quad Editor and 2DPluginKIT to improve these products as soon as possible. I hope this news is enough to keep you all interested and I wish you all a happy and prosperous new year 2009!

Lee's Tip of the Month - Fading Fast

More tips from Lee Bamber

We are going to take a quick look at a technique called 'Level Of Detail', or as we say in 3D circles, LOD. LOD is the method by which we reduce the amount of detail sent to the graphics card as an object moves into the distance so we can get more speed in our game. You get more speed because the fewer polygons you need to render the quicker you can finish rendering the scene, and the more scenes you can draw in a second, which means faster, smoother gameplay.

Implementing LOD is relatively simple. You create three or four models, each one using fewer polygons than the last so you might have 4000, 2000, 1000 and 500 being the least detail which will be used when the model is drawn in the distance. In fact, the code is so simple I can show it here:

LOAD OBJECT "highest.dbo",1
LOAD OBJECT "high.dbo",2
LOAD OBJECT "med.dbo",3
LOAD OBJECT "low.dbo",4
DO
 CONTROL CAMERA USING ARROWKEYS 0,1,2
 dx#=OBJECT POSIITON X(1)-CAMERA POSITION X()
 dz#=OBJECT POSIITON Z(1)-CAMERA POSITION Z()
 DISTANCE#=SQRT(ABS(dx#*dx#)+ABS(dz#*dz#))
 FOR N=1 to 4 : HIDE OBJECT n : NEXT n
  IF DISTANCE#<500
  SHOW OBJECT 1
  ELSE
  IF DISTANCE#<1000
  SHOW OBJECT 2
  ELSE
  IF DISTANCE#<1500
  SHOW OBJECT 3
  ELSE
  SHOW OBJECT 4
  ENDIF
  ENDIF
  ENDIF
LOOP

Replace the filenames with some model files you can load, and you will be able to see the model change to the appropriate version of the model based on your distance.

So ten minutes later you have added LOD to your game (at least for one model), and a whole pile of new art for your artist to create (which I am sure he will thank you for). There are even quicker ways to create this LOD trick, but the above serves as a good example for explanation purposes.

The above however is not the object of my tip this month. I want to go a stage further and introduce the concept of alpha blend fading. You see the problem with the above trick is the traditional 'popping' visual you get as the object suddenly looses half its polygons right in front of your eyes. You can hide the effect behind nearer objects, but sooner or later your game players are going to notice this constant popping as you move nearer and further from these objects. The solution is to smooth the transition from one object to the other using a technique called alpha blending, which we will look at now.

In itself, the code for this is also straight forward. The following smoothly blends one object to another over the course of one second:

SYNC ON
SYNC RATE 60
MAKE OBJECT CUBE 1,100
MAKE OBJECT SPHERE 2,100
FOR t=0 TO 100
  SET ALPHA MAPPING ON 1,t
  SET ALPHA MAPPING ON 1,100-t
  SYNC
NEXT t

Now you understand the command needed and the basic idea, you can imagine replacing these two objects with the two levels of LOD you are transitioning between and because the two shapes are mostly similar, the change is quite effective. The final code does get a little more complex as you then have to deal with many levels of LOD transition, and making sure the distance is set to such a value that the transition is subtle and pitched so that the right number of polygons are in the scene when you have many instances of the LOD based object. That said, the hard work pays off and you finish up with a nice fast game that is well populated with what appear to be very detailed models, and smooth transitions as you move around.

LOD Tree Models

One final trick is to make the final level of detail a simple screen aligned quad. This is a two polygon model in the shape of a cross with the image of the object textured onto it and facing the camera at all times. It will give the impression of the object in the extreme distance without having to render any of its polygons, and being so far away you do not notice. You can adapt this further to render a different image based on the angle you view the object in the distance, and a great way to do that is to load all possible images of the object in a single texture and alter the UV data of the screen aligned quad to grab that part of the texture for the image you want.

These techniques are the building blocks of success if you want a 3D game scene crammed with objects while retaining high rendering speed. It is well worth experimenting with them, just to see how complex a scene you can create. You might be surprised just how much you can cram into your scene with a little help from LOD, alpha blending and screen aligned quads!

Video Gallery

TGC Video Gallery

Night of the Glowing Balls

This is the winning entry of the Leadwerks Engine competition. It displays both physics and lighting effects in a simple but effective demonstration.

Breakable logs remakeDesigning Quests by Jeff Howard.

Many of you may recall Master Xilo's breakable logs, written using DarkBASIC Professional and Dark Physics. Now he's remade the demo using Leadwerks engine, with a little more polish thanks to a few lighting effects. Attila, the author says "Supporting older hardware is essential when programming casual games, because the client who buys a casual game is not the same client as the one buying a new PC (or GPU) for each new game. Casual games are also played at lunch time on business PCs with weaker graphic hardware."

Reflective Water in DarkBASIC Classic

This is a simple demo showing how reflection can be achieved without the use of shaders. This can be done using DirectX 7, as shown here.

Morphium demo

The demo can be downloaded and run yourself.

Morphium Forum ThreadYou can follow the forum thread here.

PlayBasic News

Playbasic News  

by Kevin Picone

There's nothing like the holiday season to bring everything to a grinding halt. After the marathon coding sessions of the previous months, December has been a relatively easy programming month, with the focus shifting from the PlayBasicFX nice shiny VM2 implementation back to an update of standard PlayBasic edition. The focus of this update has been to not only address any unearthed bugs but to improve the native image loading facilities, particularly the loader found in the LoadMapGFX.

PlayBasic V1.64g - On its way

For the new update, work has been focused upon building a new image loading library to replace the old embedded one, and of course this library will become the base image-loading service for VM2 and beyond. Currently it's making its debut patched into PB1.64, which runs on the older VM1 runtime. The library currently supports various flavors of raw & compressed BMP / TGA / PNG images types. Unlike the previous library, I decided to write the image decoders myself, so that it not only fits better into the PB framework, but it's quicker also. The new library  is stack based, which means we can support different formats just by adding them to the decoder stack.  This can even be expanded externally, allowing users (who are so inclined) to patch in their own image loaders directly into the PB frame work.

Speed-wise the new version can load and prepare the Xenon block data in about 175->185 milliseconds.  This is about 4->5 times faster than the older method, and without the very picky format issues.

The new loader code seems to be generally faster by up to four times (or in the worst case scenario about the same) than the existing decoder. One very welcome change is that we can now wedge into the loading process at any point and have better say about the types of surfaces it's loading. This means that if you load a BMP / TGA / PNG file as FX / AFX surfaces, you can avoid some serious data handling and fetching at load time. They load much faster and can consume less memory. Sadly this won't effect other image formats though such as JPG files for example, which will fall through to the older library for the time being, until it's replaced.

Apart from the faster loading and natively supporting alpha-channels, another benefit of the library is that it can now be used behind commands the like the LoadMapGfx command. This previously could only load certain types of BMP images, and was notoriously picky about the actual format, but this is now a thing of that past. To verify this, I've been testing the loading process with the Xenon 2000 map gfx. Why? Because it's the biggest slab of map graphics that I have.  The map blocks are around 4 megabytes of graphics data, therefore making the speed improvement much more noticeable. Speed-wise the new version can load and prepare the Xenon block data in about 175->185 milliseconds.  This is about 4->5 times faster than the older method, and without the very picky format issues. Map blocks can now also be stored as TGA or PNG.

Other changes coming to the new PBv1.64 release are a round of updates on the documents package, which are required as the existing version is now a good generation behind. PlayBasic V1.64 uses a completely different rendering engine than PlayBasic V1.63 and below. Consequently, it has many extra flexibilities and speed boosts. My goal for the next refresh of the 1.64 package is to get most of the differences covered in the documents. However, given that I'm writing this before the work is complete, we're hoping to get the new release out sometime before the end of December. So it should be available on our site when you read this.

Over And Out

To all those who've supported PlayBasic & UnderwareDesign.com in 2008 my sincerest thanks, I hope you've had a happy and safe holiday season. One thing is for sure though, we'll be back 2009 cluttering up internet airwaves with more techno babble than you can shake a stick it.. until then... feast !

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: qui**ly@tele2.** We have emailed the lucky winner, congratulations!

Outro

Share your news with over 19,500 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 72 deadline - January 26th 2009.