• entries
  • comments
  • views

Entries in this blog


In a previous developer blog I showed how I use spline paths inside the Leadwerks editor. The cool thing about splines as that they are extremely multipurpose. I started working on generating meshes based on the splines.  Think about ropes, wires, rivers, rollercoasters and of course roads

Ropes and wires are in progress because I find them the coolest. Especially rope bridges are awesome to make and see in play. They require a lot of finetuning so I have put that on halt for now. In the meantime I also started working on road nodes. The Return to the Zone project uses terrain textures, but the original scene from Leadwerks 2.3 used the in-editor road tool. Time for some new roadfeatures.

The generic nature of the splines allows easy creation of meshes based on the spline. Constructing basic geometry was relatively easy. However, getting the road to appear on the terrain properly proved a little harder. When there is no terrain, the generation of the road is instantaneous. The roads that are created snap perfectly together and it is really satifying to see the result. Per node you can't only tweak the road with the spline handlers, but you can set a road width, a material and several terrain alignment options.

When the node has to deal with terrain allignment the performance on startup is little slow at the moment, but the first results look promising. I want to add this feature to my winter game "On the road again", which makes cool random tracks from CSG brushes.  

Another cool automatic feauture is that the road still functions as a path spline. You can attach a car to the road spline and it will follow the generated road. 


Ropes and wires

For a next video I will show the progress on the ropes and wires, with hopefully some working physics. Here is an older image based on the earlier splines to give you an idea on what I am going for:



Paid scripts
I am looking in to publishing paid scripts to the workshop. There are 2 script collections that others might find interesting:

  • Advanced Third Person Controller
    • Many tweakable options: from double jumping, to camera offset, camera snapping, smoothing, speed controls etc
  • Spline paths
    • Not just useful for camera paths, but also for instance factory belts, vehicular movement (static cars, trains etc), airial paths (birds, planes), VR on rails.

Tutorials and Patreon
The newer tutorials (part of Project OLED, ) do not have a lot of visitors. Perhaps my focus on tutorial subject is just not right or people don't like the way it is setup. Perhaps the focus on editor tutorials is far more important. Who knows... With the lack of feedback in the past months I am quite hesitant in recording new videos, thats for sure.  

The patreon page was an experiment to see if people would be interested in donating to the tutorials project OLED. There hasn't been much activitity on it, so this is something that I probably will discontinue.  A big thanks to ones who did support me though :).




The easiest, but none the less effective, way to optimize a large outdoor scene is setting a view range for an entity. Here are some basic rules that I used during the rebuild of the Return to the Zone project.

  • Max: Here you can think of essential buildings and large structures. Think about distant buildings, powerlines, bridges and entities that stick out above the vegetation or water plane.
  • Far: Here we have the larger props: containers, trains, vehicles, walls, statues. This also contains props that are exposed in open areas. Think about road side props like stone piles, crates or oilddrums.
  • Medium: Props that are placed inside buildings can have either Medium or Near as a view range. When a building has several large indoor areas or contain a lot of windows and doors use the medium setting.
  • Near: Tiny props, like cans, toys, garbage and pretty much all props that are placed inside confined rooms.

Also, a few static camera points showcasing the Zone:



Back in 2010 Josh Klint, creator of the Leadwerks Engine, asked Dave Lee to create a part of the exclusion zone. 7 years later, this project has been revisited and rebuild.

Original footage from Leadwerks 2.3


With Leadwerks 3 I asked Josh if I could convert the assets to the new engine. Most assets were uploaded to the workshop, but they lacked proper physics, materials etc. Back then the Leadwerks 3 engine didn't have the vegatation editor and no deferred renderer. So building the entire map was not pointless.

Now in Leadwerks 4 the tools are perfect to recreate this beautifully designed scene. Josh gave me once again all the assets, and I started rebuilding the zone piece by piece. Many hours later in just the time span of 2 weeks we have some good results.

Step 1: Terrain import and basic terrain painting. 


2. Painting general layout and some first vegatation


3. Placing the first bridges


4. Placing the first large buildings. as you can see the texture are missing. 



5 Reapplied building textures. Holy **** that was a lot of work. Some textures did get applied automatically, but a lot of the textures were combined in larger shared folders. A lot of manual searching and applying the right textures.


6 Props, props and even more props. The more I started placing props, the more respect I got for Dave Lee's original design and prop placement. The amount of props is growing significantly. Here is a comparison of Bober station, with and without the building.


7. Fine-tuning terrain textures and terrain.

8. Adding more vegatation and rocks.

9. Swamp emitters.

10. Some more props.

11. Performance optimizing. View distance, billboards etc. More on this in the next blog.

12. Adding some post effects and sound.


13 Some missing things: due to a tight deadline, no time for physics yet. Except for models that have box physics or where physics do not really matter that much. Optimizing and organising the scene is also far from done. I came across a nasty bug where all my assets were removed from the filters I had in place. That was painful.



The final reveal of Return to the Zone project will be done by Josh. In the mean time...enjoy....






I started out 7 months ago with splines and it turned in to one of those annoying projects you start but then fail to finish even to it is in the back of your head the entire time. The reason this time was that I managed to delete my online repository and my local files, leaving me with nothing of the work I had created. I finally had the spirit to sit down and start rebuilding.



I am currently looking into some 2d basic/arcade game tutorials which might follow up on the OLED project once all the lua basics tutorials are done.


Think about games like:

  • Minesweeper
  • Tetris
  • Pong
  • Bejeweld (match 3)
  • Asteroids
  • Snake
  • Arkanoid (breakout)


Minesweeper is already finished:




Replicating all these games myself gives a great indication on their complexity, even for arcade games. Grid based games like minesweeper, bejeweled and tetris are the easiest and share a lot of functionality. So doing all of them might now prove usefull. Pong is great in the sense that it introduces vector mathematics. All these game have their own little mechanics. The trick in making the tutorials is also finding the right game order.


One game that you might find missing in the list above is Pacman. Although certainly doable, the ghosts have their own behaviour which makes them a little trickier for beginnners. All in all it is a good way to really start tinkering about lua once you'r done learning the basics.



What are your favorite arcade games?


We have seen a lot of statistics on the forum recently. I thought I'd share some from my Youtube account.


The stats below are from the past 365 days, including only videos that are relative to Leadwerks.



Geo stats



Something that has always been a time consuming process is getting the audio right in my recordings. Although I have a very decent headset, recordings allways contained a lot of static noise and voice 'pops'. To get an acceptablequality I required a finetuned microphone placement for every recording. 1cm to the left could make a big difference. The recording software that I use has some build in noice reduction filters, but they do not always guarantee a smooth audio track.


Since there are going to be many new videos to be recorded I finally invested in a good recording setup. I bought a studio microphone which could be placed on a small stand which would be placed in front the keyboard. A bit weird when simultaniously typing but I will get used to that.


The first recording had a much better default recording sound than the headset. The static noise is pretty non existent but there are some occasonial pops. So I went ahead and also bought a popfilter (never relly bevieved how a simple' piece of synthetic fabric could improve sound quality). But the 'pops' in sentences have been significantly reduced.


While I was on a spending spree anyway I also just went ahead and bought a good recording stand, which I can adjust freely without getting in the way of typing.


Here is the final setup.



This is the final blog post for my game entry this tournament.



I am really happy the way the GUI came together in the end. UI really isn't my strongpoint so being able to produce something doable is a great reward.


Car physics

Although most car tracks can be finished with a car, it is not an easy task. The car tumbles over far to quickly. There is also a bug left were loading a new car level causes the car to glitch. Since I am reusing the same car here, I have no idea what is further causing this. I didn't have this in my first demo so there must be something on my end.

The ball's swept collision physics have been disabled. There is a bug where object with swept collision collide with each other even if one of those items has the collision type set to none.


Final version

Although I released a final version, there have been 4 or 5 updates already. But then again that is one of the common phrases in the IT world: you are never done programming.


Game Play Tournament

I think I want to organise a little game play tournament with On the road again. There will be a couple of pre-selected levels and the person with the highest score per track will get a steam key for a game.


All in all I am happy with the end result and I am looking forward to see that leaderboard fill up. I have also enabled the game analytics. I wonder what kind of conclusions we can draw from it.




I have uploaded a new version containing save games and some improvements regarding restarting a level, going to back menus etc.



Every time you finish a level, a property is set to keep track of the levels you finished. Only downside when using the launcher is that this will only get set, when the game is closed. So when you finish 4 levels, it will not become clear you finished these levels until after you have restarted the game. But still a pretty nice feature to have.



Track generation

The level generation has been altered for the first time since the first blog. Nothing too complicated though, just a different seed when using a car or ball (One variable is called ballSeed ha). The tracks also now have a weighted percentage added to them, meaning that some track segments have a little less chance to get picked over others.



The ball, just like the car, now has a corpse everytime you reset the level. Corpses of the car and the ball are now removed when going back to main menu to prevent cluttering up the game world.




Sound has been added, but they are ogg files. So for now, you wont hear anything yet in the game launcher.


Car physics

The car physics are driving me crazy (no pun intended). I got a reasonable/playable result but it is not entirely there yet. Ah well, it will do for the tournament. Everytime I get a combination of decent properties, there is always something wrong. Either, accelaration, steering, jumpiness, crash sensitivity (

) or rolling over with the slightest road curve. I think I have spend more time on the cart, than on everything else combined. Maybe I will give it one last go this week and otherwise I will have to revert back to the basic car.


Only 1 more week to go everyone! Good luck.


Here I thought that I would be done with my entry in no time. Finetuning everything turned out to be a pain to be honest. Luckily the GUI was set up rather quickly and most of the game state switching worked almost instantly.



Tired of the tires

The real time consumers came when suddenly my tires wouldn't update with the vehicle. Spend a good time trying to figure out what I was doing wrong, but eventually just decided to leave it until the very end.



I added Josh's new analytics api to the game to see what kind of information I would be getting. So far I can see the kind of seeds people are using and how often levels are reset. I guess it will be really interesting after a couple of people have actually played the game.





Again I got stuck here far longer than I had anticipated. For some reason the highscores get updated with a new value. Meaning, that no matter your track time, the highscore table will always be set by it. I can do it manually, but it should happen automatically. Another downside is that I can't do any querying on which seeds were popular overall or last week. I would love to add that to the game as that is really what would make this game so powerful. Unfortunately, there are no means for me to do this right away.


Game player

The game has been uploaded to the game player now. Everyone can try it out and fill in a random number to get a unique track. The seed number should give people an identical track though. Looking forward to seeing some results. That way I can also finalise the highscore leaderboard after you reach the finish. There are plenty of bugs, missing features and graphical incompletions, but important is getting those highscores from other players right now.



When you are racing, you can WASD for car movement and your mouse for the camera.

Use R to reset the level. When you have finished the level you can either reset or go back to main menu.


If you could try it out with seeds '1337' and '1234', that be great.



Finally done moving to my new house and today I got my computer setup again. And as a start, I thought, lets give it a go for the winter games tournament.


It is a little racing game where the tracks gets randomly generated on the given seed. I think I will call it "On the road again", named after the song and because of the fact that the level generation allows you to skip parts of the track if you simple fall down on the track below you.




Time and time again

The past 30 days have been very hectic but fun none the less. While it all started with the thought that I would have some time to spare, it became one of the busiest months of the year. It started with a non-Leadwerks project, where I am currently working on with 2 artists. I was done with the coding for the current sprint (we are using scrum). This meant simply waiting for the artists to do their part. The sprint ends December 14th, so that would mean time for a new project.


Back to Leadwerks

I hadn’t touched Leadwerks for a solid 6 months so it was time to download it again and see how things were going. I started working on a new big Leadwerks project. Something that I want to work on with other Leadwerks users. For this project I needed camera paths and BAM! Before I knew it I was working on a new project creating tracking lines, curved splines, camera paths, ropes, cables (joints and everything). It is one of the up- and downsides of programming (or game development in general). You get an idea and before you’r even properly halfway through, your attention falls on something completely different.


Lines and Splines

The splines project became a lot more versatile than I had anticipated and I realized I had to tone it down a little. So no ropes and cables for now. The lines and splines are done at last. I had some issues with fine-tuning everything but the end result is pretty slick. Only thing left to do is recording some videos/tutorials and it is ready to be published. I want to make them available for a few dollars on the workshop. If it is successful I wil think about other useful tools that people might want. However time is not on my side...






My girlfriend has a new job and that means that we are moving. We have been looking for a house and this week we actually managed to get the keys. That means that free time will be very scarce as it will all be spend on moving and finishing the new house. It also means that releasing the splines and camera paths will be postponed a bit.



If I want to take a break from programming there is always that other hobby which consumes a lot of time: playing games. And boy are there some time consuming bastards out there this month. At first I bought Cossacks 3. Massive armies and spending some later hours on the battlefield against the AI is what I love about this game. Then there is also Transport Fever. A great indie title game for the transport tycoon lovers. I already played their previous game a lot (train fever) and by the looks of it, this game will keep my busy for a long time to come. Not even mentioning Planet Coaster which looks awesome as well…


Transport Fever (with Leadwerks logo)







When the new Leadwerks UI is done, I think it is time to do some new Lua tutorials. The existing videos are getting outdated very fast. I really want to help boost the community and with the upcoming winter tournament and existing monthly script challenge it will only get better. For the latter one I am afraid I will have no time left. A shame, because Thirsty Panther did a great job on its preparation.


I downloaded the Saturn tutorial project yesterday to see how the project was holding up after all this time. After some bug fixing and adjusting some of the scenery ingame, I came to the conclusion I really liked the parcours part of the scene. So I thought lets just turn it in to a run and jump game real quick and add it to the winter games tournament.




Terrain tutorials

There are 2 new video tutorials on how to use the terrain editor.


Sculpting terrain:


Terrain painting:



Tutorials: Project Saturn

It has been a while since I made a tutorial for Project Saturn, but that will change in the near future. Since there are so many new members using Leadwerks I am going to make some free time for some new tutorials. In the past 3 months there were only a handful of viewers and that didn't quite way up to time spend on making the tutorials. That said I also upgraded from a parttime to a full time job which obviously really cuts in to my Game dev time.


The first new video tutorials are already here:







Lua beginner tutorials

I am also going to make some tutorials for the absolute beginners. For those that have very little to no experience, theses lessons should be very useful. Although these are Lua tutorials in general, they will be aimed towards usage in Leadwerks.



I took the plunge in to selling my own Lua GUI library for Leadwerks: FlowGUI. Selling scripts/code for Leadwerks is something I wanted to do for years but I never really had the guts to actually try it. Now that I have made an initial release via webdownload, I am glad I did. I am happy with the amount of licenses sold so far, which makes it also a lot more fun to work on upcoming features such as inventories.

I also hope that by providing extra downloadable content for Leadwerks, we will attract more people, were Leadwerks on itself will only benefit from. Last but not least it might also inspire other developers/artists to start selling their own work as well. Maybe when payed items are added to the workshop, this will really kick off.


Jorn 'Aggror'




Saturn and Tunnels

If you don't know that the blog title exists out of game names, you are probably a little confused smile.png. My upcoming job interviews are almost 2 weeks away, which gives me plenty of space to do some development stuff on the side from my main project. Besides my main project I have been working on the tutorial project Saturn as well as reviving the the Tunnels demo from Leadwerks 2.


Project Saturn

I didn't think I would have so much fun making project Saturn. It proves that making gameplay can be done very quickly. At the moment of writing this blog, there are 13 video tutorials. There are enough subjects left to cover, so if the videos gain some more popularity, I will start making some more.

in the meantime you can also download the source from my website and you can even play the game directly via the workshop game player. Here are some topics that are in the queue for possible upcoming tutorials:

  • Healthpacks
  • Ladders
  • Inventory
  • Camera on rails/cutscene





The tunnels and Island scene from Leadwerks 2 are made me fall in love with Leadwerks in the first place. Having a go at reviving the Tunnels scene is therefor extra motivating. With some scary sounds and a dark ambience, the tunnels demo is nice little demo for the Leadwerks game player. Expect some more updates on this project later this week.


Jorn 'Aggror'




Getting a job

So school time is over. I graduated from the Hogeschool of Amsterdam as a Game Developer which means I can officially put 'ing' (from engineer) in front of my applicant name. Now that the 'study' period of my life is over (although it isn't really, right? I mean when do you ever stop learning!) it is time to get a job and start earning some money.


Guerrilla Games

For the past 6 months I did my thesis internship at Guerrilla Games. Which was awesome. I was surprised at first that they offered me a internship and being it was an opportunity of a lifetime, I gladly accepted it.

I spend most of my time on research rather than doing programming. But still, I spend a solid 2 months digging myself in to the engine, tools and what not the company has been developing over the years. Overwhelming, insanely complex and mesmerizing at the same time, I slowly began to understand the enormous process of making a AAA game. How they are able to produce games like Killzone is, from my point of view, a pure miracle.

I did gain a lot of new experience in C++ since I was stationed between the Game coders. Working with Game designers was a lot of fun since I never ever worked in a team before which had team members which had such focused tasks. I met some very cool people along the way. One of them was John Gonzalez, who was the lead writer for Fallout New Vegas. It was so inspiring and awesome to have such people surrounding me. Also really cool: the building was located in the centre of Amsterdam near a beautiful canal.





Looking for work

So with a certificate in my pocket and a cool intership on my resumee it is now time to start seeking a job. Game developer jobs are not super scarce but it is not that you get a job without making any effort. I have yet to send out my first job applications but remarkably I did get a lot of offers to work as a software developer or web developer. That is kind of motivating and I am sure that if a job in the game development stays out, I will go for one of those. But my passion lies with games and a job in the game industry would have my preference. We'll see how it goes..


Tutorial project Saturn

In the mean time I am busy on my own project as well as a new tutorial series going under the name of 'Project Saturn'. The idea here is that we make a playable level and in each video we see the development take a direction. Nothing is really predetermined in to what kind of game it eventually should turn out to be. All assets and scripts needed for the tutorials are either created during the tutorials or they are already part of the Leadwerks SDK. If you have some nice gameplay mechanic that would be a good idea to add, you can leave a comment. Maybe it is something we can add if it is not to massive to implement during a video.


See the first video here:




The last year of my Game Development study has already started. With only one year to go it is time so look ahead and view the possibilities that are available.



The coming 20 weeks I am following a minor in advanced software engineering and Game Technology itself will be put in the background. Game development will mostly be something I will do in my spare time. I thought that this year would be really busy one but so far it has been very quiet. The focus of the minor lies on Java, the Spring framework and web applications. I don't have much experience with those so that might come in handy for later. After those 20 weeks I will start my graduation trainee ship, although I first have to find a decent company where I can actually learn something.


Starting a career

I am a little nervous about comes after finishing my study. I could study further if I wanted to, but the experience I have had so far is that you just have to sit down and make something. Especially if you have someone (either friends or colleagues) that can help you develop your skills. I want to start my own game company but I do have a small college debt that I need to pay of first. So most likely I will start seeking a job withing the Gaming or Software industry.



My main project is still in combination with Leadwerks. Especially now that terrain has arrived I can really test out my work that I have been preparing for it. Progress has been going really well, although actual gameplay is still really far away. My game will be playable both singleplayer as multiplayer which adds an extra level of complexity and delay to the development and gameplay.



It is really nice to see more activity and interest with the Leadwerks Tournament. Although it can be really difficult to actually make something work in the amount of time you have available, it can be just the push you need to produce something. I have to admit that I was very enthusiastic about a themed tournament but in the end it didn't really helped much at all. Anyway, the third tournament will be a big one and has yet to be announced. The prizes will be even bigger and the length of the tournament will be extended to 3 weeks.



I haven't made a tutorial in a while although I do still want to make at least one of them (Particles). When the terrain has had some patches and/or new features, I will make some videos about that as well. I have created a nice little Tower defense game entirely with Lua. This game will be rewritten from scratch in a large video tutorial set. I am thinking of making this a paid tutorial set, which I can make available to users for a small fee. I have yet to see whether this is worth its time, but experimenting with it can't hurt.



Besides the tutorial set, I'm also thinking about releasing FlowGUI as a simple GUI library for like 2/3 dollar. That depends a little on whether people would be interested in it or not. I stopped working on it when Josh announced a GUI editor with the Kickstarter, but since it might not be part of the engine for a while, it might be worth taking a look at it again. All scripts would be freely accessible and could be altered to a persons desire.



Let me know what you guys and girls think.



So now that game week is over lets have a look back at how things went.


Game play

Gameplay itself was done really quickly. The idea for Lenga is basically Jenga with a twist of colors. I thought of creating an AI that would remove blocks based on a calculation. However I though it would become really boring. So instead I let the player remove a block of a specific color.


Scripts on the wrong entity

At some point during testing I came across a script error. I lost a good hour trying to figure out what I was doing wrong in my script, but as it turned out it was something else: a lua script was somehow attached to a different entity even though I never attached a script to that object. It did turn out that I am not the only one experiencing this.



Lua script editor

A very annoying thing about the Leadwerks 3 script editor is that every new line starts without any indenting or tabs. This is really frustrating. Whether you enter for a new line or when you want to move your function one line lower. It breaks the flow and you are wasting a lot of time making sure that every line is aligned correctly.



The performance of the physics is just bad. There is not much else I can say about it. The newton 3 demos that you can play show a lot more physics activity and that without any fps drops or weird behavior. On my laptop I can barely run the game (For the record: I can play GTA 4 on my laptop). As soon as the tower falls over (24 blocks), the game slows down to 3 fps.

After the game was finished I recreated it in C++, just to see if the physics performance would be better. Unfortunately that is not the case. I even went back to Leadwerks 2 (with newton 2) to do the same test. The performance is so much better. I can have 200 boxes in a tumbling tower without any fps drops.


I am 100% certain that there is something wrong with the integration of Newton 3 into Leadwerks 3. Ofcourse this is really difficult to pinpoint but it sure is a showstopper. It isn't the first time this happened in a project with Leadwerks 3.


Some new possibilities

I have spend another evening on my in game console and it is shaping up nicely.



To-do or not to do

I am happy with how the console works right now. There are enough things that I could implement to make it even more usable but I don't need those (right now) for my project. Possible to do's

  • Intellisense.
  • Saving command log to a file.
  • Adjusting color, settings and size of console via commands.


After creating my Component based engine structure for my main project, I have now moved on to the next stage of development: an in-game console.



To sum up what you can do with it, here is a little video demonstration.



On the To-Do list

Although the core of the console is finished and working the way I want it to work, there are some slight improvements.

  • Grapics are simple boxes at this point. I want to go for Valve's in-game console look , which looks simple but suits its purpose really well.
  • console.jpg
  • Used command are stored and can be retrieved with arrow keys.
  • Error message or help text should be displayed above the command line.
  • Show a cursor.
  • Adding useful commands, like toggle sound, sound volume, load level, set players health, ammo, armor etc.
  • Trying to build the console as a library so that it can be easily included in other projects.


Besides making tutorials I am also working on my own project. It is my biggest one yet, but I think I have enough knowledge to get at least really far. Right now I am building my own engine on top of Leadwerks 3. The entire project is written mainly in C++.


Component Based engine design.

Since Leadwerks is very flexible you can do a lot of different things with it. The Lua scripts in the editor are a good example of component based design. However if you switch to C++ you don't have this directly at your disposal for C++. That means you would have to implement it yourself. Of course there are tons of ways of doing this but this blog shows how I do it in my project.

Instead of Component Based Design you can also choose to go for 'Direct programming' like Josh describes in his blog here. Both approaches have their pros and cons. The reason I am going for Component Based Design is because I want to create code that is highly flexible and can be interchanged between projects.


The GameObject class

The current system that I have is a combination of direct (hierarchical) and component based design. The following image shows how it starts.



The first class is the GameObject. The gameObject is completely empty at first, meaning it doesn't contain any models or textures. The only thing that it contains are components. Every frame all the updates that are enabled are being updated and/or drawn. This is the core of the component based design. Lets say we create a Player Gameobject. We can add several components to it:

  • ModelComponent
  • WalkComponent
  • JumpComponent
  • FPSCameraComponent
  • HealthGUIComponent

Now lets say for instance that we want to have TPSCamera instead of a FPSCamera. All we need to do is remove the FPSCameraComponent and add a new TPSCameraComponent. Not only is this system very flexible, it allows us to create components that can be easily shared throughout your project and perhaps even other projects that also use this component based design.


The Component class

Every component is derived from the Component class. The component class itself is abstract and thus can not be instantiated.



Increasing complexity

When you look at the first 2 images, you will notice that some functions and variables are exactly the same. Most programmers will come to the conclusion that this is a bad design. So for that reason we enhance our design as follows:




This means that a GameObject is also a component. The complexity hereby increases but works a lot better when it is properly integrated. (Note that the images are toned down a bit to simplify the idea.)

It is debatable whether GameObject inherits from Component instead of the other way around. I decided to go for Component since it is called a Component Based Design and not a GameObject Based Design.


FSM and Components

At some point I came to the conclusion that it is not always necessary to create an entire component structure to get the desired hierarchy in a level. For instance in a menu it is easier to create a (finite) state machine rather then having to switch between components. Although components work perfectly well for menu's, I think it is a good principle to think about where to use FSM's and where to use Components.


The Scene class

The component based design is far from finished but the basics already work. The last thing that I show in this blog is the scene class. The scene class inherits from GameObject (and thus also Component) and contains a list of Components/GameObjects. Every gameObject that is created needs to be added to this list in order to be updated or drawn. I specifically want a scene to have a camera so that I allways know that when I load a new scene, a camera is being created.





Thanks for reading.



blog-0736658001363902877.jpgIn follow up to Andy, I also want to do a little blog on my experience with Leadwerks 3 so far. The first week after purchasing I didn't have much time to spend on it. Luckily after that week, there was quite some time left for the start of a new adventure.





In contrary to Leadwerks 2.3, I now want to lay most of my focus on C++. That is kind of Ironic, since a lot more people are interested in Lua now that Leadwerks 3 has arrived. It is not that surprising since the advantages of using Lua have improved quite a lot. Ofcourse we have debugging and stepping through Lua scripts which is a huge gain. And the other thing is the flowgraph editor. Rick has provided me an extra motivation boost to try out the flowgraph editor, with his cool scripts. (Of which the volume trigger is my personal favorite smile.png ). I tried to create a little script myself and within minutes, real simple gameplay interaction was set up.(Gravity activator) Something that was a lot harder to do with Leadwerks 2.3.



C++ and Shaders

For my own portfolio and skill set I started with C++ and the LE3 API. Just like with LE2, the API is very easy to use. Chris and Josh have done an excellent job on describing commands for both C++ and Lua. Pretty much every command comes with a working example. In the future I also hope to learn more about shaders. Shadmar has allready created severall of them, which you should check out.



A good way to teach yourself something, is to try teaching it to others. Thats the motto I have been going with since I have started creating tutorials for Leadwerks 2.3. The road is wide open again with the arrival of Leadwerks 3. The first 5 video tutorials for using C++ with LE3 are uploaded on youtube and more are on their way. Eventually I hope to reach a point were we will create a game that uses a combination of C++ and Lua. For a complete overview of tutorials, have a look here:



Future updates

There are plenty of things that can be improved with Leadwerks 3. Thats a fact. I am not talking about the deferred rendering with dynamic shadows. It is really the little things that count. I am more than confident that these issues will be dealt with in the near future. As soon as Josh is back from the GDC, there will probably be updates every other day. For now, I am really happy with my purchase of Leadwerks 3. I am looking forward to all the cool stuff that this community is going to create.





For loop optimization

Today I learned a pretty basic but very usefull programming principle. It is about declaring multiple initialisers in a for loop. I am working with a mobile application and speed and memory are more of an issue than on computer right now. My application is finished when you look at its functionality and construction, but it has to be optimized.


Here is a narrowed down example of what I am doing:


for(int i = 0; i < veryLongArray.length(); i++)

This is very basic coding right here that can be found in many language.



What I didn't know is that you can declare multiple initialisers. It is very simple but has increased the speed of the for loop (which is pretty huge) immensly. This is how it looks now:

for(int i = 0, j = veryLongArray.length(); i < j ;i++)

By initialising the j variable at the start of the for loop, we can save a little time. Instead of checking the length every loop we can simply refer to the j variable. ofcourse you can store the length of the array outside the loop as well, but this is so much nicer. One catch though: If the length of the array is dynamicly changed during the loop, then you shouldn't be using this.


So simple, yet, I have never come accross it before.