SlinDev
"A hobby programmers diary"



Studying computer science now, I thought that there might be some other people at university that are interested in game developement and happily I really found some motivated folks and we decided to get started with a simple 2D jump and run game. The game is about Lilly, Santas daughter who has to save christmas because the bad easter bunny knocked Santa out and stole all the presents. We are releasing the game as an advent calendar with usually one level a day, sometimes more.
Technically, the game is written in Javascript and uses the HTML5 canvas element into which we render using WebGL. While I really enjoyed programming with WebGL in Javascript, this is some pretty new technology and currently only supported by default in Chrome and Firefox. Safari has WebGL as an experimental feature, which has to be enabled by the user, it is probably similar in Opera. Internet Explorer doesn´t support WebGL yet and will probably take the longest, as for now Microsoft sees some security issues in WebGL. So the recommended browser for the game is Chrome as it seems to run Javascript MUCH faster than Firefox, which means that 10 fps in Firefox can usually still mean stable 60 fps in Chrome. The game tends to behave a bit buggy at low framerates...
The controls are arrow left and right and space to jump, or alternatively WASD.
You can read the story and play the game at http://lilly.slindev.com
Also the quite hacky code is hosted open source on GitHub for those interested: https://github.com/Slin/Webgine
No Comments
I am trying to close some of my webbrowsers tabs and found some random links, I don´t want to lose :)
Some link collection for SSAO and other nice things
Solutions to all the math problems I can´t solve myself and more :)
Very old, but nice overview about some gamedev basics
Gewerbe anmelden, betreiben, infos
iOS audio conversion and playback with OpenAL
iOS generating email via url
iOS image resizing
Water as post processing effect
Random terrain generation
Radiosity Normal Mapping explanation
No Comments
Some link collection for SSAO and other nice things
Solutions to all the math problems I can´t solve myself and more :)
Very old, but nice overview about some gamedev basics
Gewerbe anmelden, betreiben, infos
iOS audio conversion and playback with OpenAL
iOS generating email via url
iOS image resizing
Water as post processing effect
Random terrain generation
Radiosity Normal Mapping explanation
No Comments

Lately I needed the possibility to draw an outline which is then filled with polygons. While drawing the outline, was a matter of minutes, I didn´t expect generating the polygons out of it to be such a problem. And while I still have problems if the outline is crossing as for example in an eight, this list of links helped me really a lot: http://vterrain.org/Implementation/Libs/triangulate.html
The left problem should be easy to solve by splitting the outline at intersections, but because this won´t make my code any nicer, I decided to wait for it until the project is at a state where we can decide if the drawing feels good or if we anyway don´t need it.
What I use from the list is this: http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml It was very easy to implement and works very stable in all none crossing cases.
No Comments
Finally some update…
Posted by Nils Daumann in All,General,iPhone,Projects on 11 September 2011 at 01:12
Posted by Nils Daumann in All,General,iPhone,Projects on 11 September 2011 at 01:12
I again haven´t updated my blog for a long time... So here is finally another post :).
During that time, many things happened, as I was finally living far away from my parents in Frankfurt am Main for the six months of my intership as programmer at DECK13. For me it was a great experience to work in a smaller professional team, doing a fulltime programming job and still being able to work freely through quite wide tasks. I can´t really say that I learned much new programming wise, but I finally understood how much more usefull good debugging tools can be than printfs and how to setup visual studio and xcode projects without just trying until it works :). At least as much worth is probably also the experience I gained working on a very big, unknown codebase. And of course all the great people I met there :).
Happily they also seemed to appreciate me and/or my work quite a bit as they kept telling me that I should come back :P.
What I also take away from this is, that I still really like the idea of maybe somewhen working in a games company for more than an internship.
An interesting experience was also the GamesCom where basicly the whole company went to for two days. And while the day for trade visitors was already too crowded for my taste, I at least was able to see and play quite a few games like for example Rage, Batman: Arkham City, Prey 2, the PS Vita and several others. At the first day for the public however, there where like 100 times as many people and I was really happy that I didn´t go there the last years as public visitor, as I intended to several times already. I may go there again, but only if I again get the chance as trade visitor...
Also we had our third(?) gamestudio community meeting in Bielefeld, this time with a livestream :). It was really great and I can´t wait for our next AckCon :P.
All in all, I really, really enjoyed those 6 months.
The very big drawback for this year to become one of my favourites so far was and is especially now that I am back home, that my best friend Ragnar got killed in a car accident. In the third class at elementary school we wanted to create a dinosaur documentation movie. Later we tried to build custom levels for Morrowind and then he finally dug out Gamestudio A5 at Ebay which kinda is how I got started with making games. But there are of course also many other things where he influenced and supported me whenever I needed it. R.I.P.
Happily my life goes on and I still have many dreams to realize :). I finally matriculated for computer science at the university in Lübeck, where I will start in october and until then hopefully also manage to find a room in Lübeck.
Next weekend is the Gamescamp, which I hope to get another nice experience and exchange, although less dev oriented than I would like it to be.
I of course also started several projects I did not finish (yet!?) and improved iSDGE, which for example finally got functionality for audio playback using OpenAL.
Started projects are mainly a realization of Pappenheimers "Fish on rolls" based on iSDGE, an improved version of Santa Hunting using iSDGE as well as a sequel with additional gameplay modes, a new story and hopefully more content. Also together with Sidney Just I started writing a voxel engine for iOS and OSX called Vinter, which however is on hold for now as I didnd´t figure out a good way to effectively render volumes without polygons and without 3d textures and we also were too lazy to implement a suitable octree or something similar. Instead we decided to give creating a 2D game another try for which mainly Sid developed Vinter2D and I helped with some rendering and math related problems he had.
The following are some random pictures of some of that stuff.









Also somewhen in april my3d 360° sharks came out in the appstore, for which I wrote a couple of shaders.
Now I hope to get Santa Hunting finished soon and to hopefully also find the motivation to prepare and add more shaders for my shader shop :).
No Comments
During that time, many things happened, as I was finally living far away from my parents in Frankfurt am Main for the six months of my intership as programmer at DECK13. For me it was a great experience to work in a smaller professional team, doing a fulltime programming job and still being able to work freely through quite wide tasks. I can´t really say that I learned much new programming wise, but I finally understood how much more usefull good debugging tools can be than printfs and how to setup visual studio and xcode projects without just trying until it works :). At least as much worth is probably also the experience I gained working on a very big, unknown codebase. And of course all the great people I met there :).
Happily they also seemed to appreciate me and/or my work quite a bit as they kept telling me that I should come back :P.
What I also take away from this is, that I still really like the idea of maybe somewhen working in a games company for more than an internship.
An interesting experience was also the GamesCom where basicly the whole company went to for two days. And while the day for trade visitors was already too crowded for my taste, I at least was able to see and play quite a few games like for example Rage, Batman: Arkham City, Prey 2, the PS Vita and several others. At the first day for the public however, there where like 100 times as many people and I was really happy that I didn´t go there the last years as public visitor, as I intended to several times already. I may go there again, but only if I again get the chance as trade visitor...
Also we had our third(?) gamestudio community meeting in Bielefeld, this time with a livestream :). It was really great and I can´t wait for our next AckCon :P.
All in all, I really, really enjoyed those 6 months.
The very big drawback for this year to become one of my favourites so far was and is especially now that I am back home, that my best friend Ragnar got killed in a car accident. In the third class at elementary school we wanted to create a dinosaur documentation movie. Later we tried to build custom levels for Morrowind and then he finally dug out Gamestudio A5 at Ebay which kinda is how I got started with making games. But there are of course also many other things where he influenced and supported me whenever I needed it. R.I.P.
Happily my life goes on and I still have many dreams to realize :). I finally matriculated for computer science at the university in Lübeck, where I will start in october and until then hopefully also manage to find a room in Lübeck.
Next weekend is the Gamescamp, which I hope to get another nice experience and exchange, although less dev oriented than I would like it to be.
I of course also started several projects I did not finish (yet!?) and improved iSDGE, which for example finally got functionality for audio playback using OpenAL.
Started projects are mainly a realization of Pappenheimers "Fish on rolls" based on iSDGE, an improved version of Santa Hunting using iSDGE as well as a sequel with additional gameplay modes, a new story and hopefully more content. Also together with Sidney Just I started writing a voxel engine for iOS and OSX called Vinter, which however is on hold for now as I didnd´t figure out a good way to effectively render volumes without polygons and without 3d textures and we also were too lazy to implement a suitable octree or something similar. Instead we decided to give creating a 2D game another try for which mainly Sid developed Vinter2D and I helped with some rendering and math related problems he had.
The following are some random pictures of some of that stuff.









Also somewhen in april my3d 360° sharks came out in the appstore, for which I wrote a couple of shaders.
Now I hope to get Santa Hunting finished soon and to hopefully also find the motivation to prepare and add more shaders for my shader shop :).
No Comments
From now on my Shadershop is online!
There is not much content yet, but that will hopefully change in the future.
The target of this shop is to provide heavily optimized, high quality shaders for all kind of engines and devices including Unity and Unity iPhone.
Most shaders are very specialized to offer the best performance possible for the situation they are used in.
For the beginning there are only three basic shader bundles, especially designed for Unity iPhone and Unity Android for basic shader based rendering.
For more information, have a look at the shop!
For the first one or two days you will be able to use the coupon code FIRST DAYS OFFER which will save you 50% of the real price!
1 Comment
iSDGE Bullet physics implementation
Posted by Nils Daumann in All,Articles,iPhone,Projects on 02 April 2011 at 20:57
Posted by Nils Daumann in All,Articles,iPhone,Projects on 02 April 2011 at 20:57

I am currently working on implementing Bullet into iSDGE which is meant to be used for collision detection, raytracing and physics. The basic implementation was very comfortable to do and now it is even more easy to use from within iSDGE :P And as long as there aren´t more than 10 objects colliding at once, the performance is no problem at all.
The following video was taken from within the simulator, which means that it looks better also runs much faster on my iPhone 3GS.
No Comments
As there wasn´t any update on my blog for quite some time, I now want to at least share what I did on iSDGE lately.

A few weeks ago I implemented a basic particle system for iSDGE, which so far works great fast and seems to be quite flexible. Each particle is represented as an instance of a predefined class, which has the basic properties "Position", "Color" and "Size" as well as a flag which has to be set if the particle is meant to be destroyed. The particle class also has an onDraw method, which is updated every frame. Now the user has to create such an instance and register it to a particle emitter, which is responsible for updating the particles and the material shared by all its particles. This particle emitter object also dynamically creates a mesh from all its particles in worldspace which can then be easily drawn with one draw call. While this can be cpu hungry when dealing with MANY particles, the particles are rendering really fast and I anyways wouldn´t use more than 1000 particles at once. Well, maybe more on an iPad 2 ;). The partcle emitter is btw also able to sort the particles from back to front. Next thing I will add here is the possibility to specify the uv coordinates for each particle, to be able to use a texture atlas, so that nearly all particles can be rendered at once and not just those having the same look.

I also finally implemented some stable and well working view frustum culling. It isn´t optimized at all at the moment, but there are anyways other, parts, which need the optimizing much more. What I just do is first a Sphere-Sphere check, creating a sphere around the view frustum, to early sort out every object clearly out of sight. In a second step I just create the view frustum planes and check each of the left objects against them using the hessian normal form. This brought me a big speed up with many created objects but only few visible ones.

My latest change is the switch to a binary file format for models. The vertex data is now exported interleaved from within blender, including normals and if wanted also tangents. This allows me to directly read the data into my mesh instance all at once with one read instruction, which is very fast. The next step here will be to also include the shadow preprocessing to the exporter to heavily speed up the loading of objects throwing stencil shadows. And actually also for occluders which I am going to implement in a hopefully soon future, as those are going to use the same preprocessing as the shadows.
As you may noticed there now is a "Shadershop" section on my blog now, which is currently in sandbox mode, but which I plan to open as soon as I am happy with the amount of content to start this with. There will probably also still be some free shaders in between or extra or whatever. I like the idea of a hopefully growing shader shop with all kind of different, ready to use effects, so that noone has the need to do some ugly messing with the few free and often badly coded shaders around, and I hope that you do so too :).
Oh and I am now btw doing an internship as programmer at the german studio "Deck 13", to close the gap between alternative service (working at a rehab center instead of doing military service) and university. This is pretty cool as I now get to know game developement within a professional team consisting of more then 2 persons, and working with all together at one place :). Well, the first month is already over and I feel as if I just started yesterday :).
No Comments

A few weeks ago I implemented a basic particle system for iSDGE, which so far works great fast and seems to be quite flexible. Each particle is represented as an instance of a predefined class, which has the basic properties "Position", "Color" and "Size" as well as a flag which has to be set if the particle is meant to be destroyed. The particle class also has an onDraw method, which is updated every frame. Now the user has to create such an instance and register it to a particle emitter, which is responsible for updating the particles and the material shared by all its particles. This particle emitter object also dynamically creates a mesh from all its particles in worldspace which can then be easily drawn with one draw call. While this can be cpu hungry when dealing with MANY particles, the particles are rendering really fast and I anyways wouldn´t use more than 1000 particles at once. Well, maybe more on an iPad 2 ;). The partcle emitter is btw also able to sort the particles from back to front. Next thing I will add here is the possibility to specify the uv coordinates for each particle, to be able to use a texture atlas, so that nearly all particles can be rendered at once and not just those having the same look.

I also finally implemented some stable and well working view frustum culling. It isn´t optimized at all at the moment, but there are anyways other, parts, which need the optimizing much more. What I just do is first a Sphere-Sphere check, creating a sphere around the view frustum, to early sort out every object clearly out of sight. In a second step I just create the view frustum planes and check each of the left objects against them using the hessian normal form. This brought me a big speed up with many created objects but only few visible ones.

My latest change is the switch to a binary file format for models. The vertex data is now exported interleaved from within blender, including normals and if wanted also tangents. This allows me to directly read the data into my mesh instance all at once with one read instruction, which is very fast. The next step here will be to also include the shadow preprocessing to the exporter to heavily speed up the loading of objects throwing stencil shadows. And actually also for occluders which I am going to implement in a hopefully soon future, as those are going to use the same preprocessing as the shadows.
As you may noticed there now is a "Shadershop" section on my blog now, which is currently in sandbox mode, but which I plan to open as soon as I am happy with the amount of content to start this with. There will probably also still be some free shaders in between or extra or whatever. I like the idea of a hopefully growing shader shop with all kind of different, ready to use effects, so that noone has the need to do some ugly messing with the few free and often badly coded shaders around, and I hope that you do so too :).
Oh and I am now btw doing an internship as programmer at the german studio "Deck 13", to close the gap between alternative service (working at a rehab center instead of doing military service) and university. This is pretty cool as I now get to know game developement within a professional team consisting of more then 2 persons, and working with all together at one place :). Well, the first month is already over and I feel as if I just started yesterday :).
No Comments
This was a forum post by Hummel, which I do not want to get lost:
In the following I´m going to talk about different light attenuation algorithms which are commonly used in todays graphic pipelines.
I´ll show in how far these techniques give more and less natural results and how a good approximation for lights with limited range can be achieved.
In some cases the use of a limited light coverage is unavoidably, f.i. when a light pre-pass renderer shall be implemented which was eventually the reason
for developing the attenuation equation I´m going to present later.

2 Comments
In the following I´m going to talk about different light attenuation algorithms which are commonly used in todays graphic pipelines.
I´ll show in how far these techniques give more and less natural results and how a good approximation for lights with limited range can be achieved.
In some cases the use of a limited light coverage is unavoidably, f.i. when a light pre-pass renderer shall be implemented which was eventually the reason
for developing the attenuation equation I´m going to present later.

2 Comments
Rendering of big terrains on iPhone.
Posted by Nils Daumann in All,Articles,iPhone,Projects on 04 Dezember 2010 at 17:58
Posted by Nils Daumann in All,Articles,iPhone,Projects on 04 Dezember 2010 at 17:58



Finally another post, although just some random notes regarding iSDGE, I hope that someone may considers it interesting ;).
During the last few weeks, I implemented a terrain system into iSDGE as well as some (as I just found out not correctly working) view frustum culling.
My ultimate goal is a nice looking, very big island scenery with some palmtrees, and reflecting water rendering at at least 30fps on current devices.
My first decision was to generate such terrains from heightmaps, which allows easy generation of chunks and LOD steps as well as maybe some effective ways to cull objects covered by mountains.
The second decision was to use chunking, to effectively sort out not seen vertices.
And my third decision was to not introduce a special object for terrains, but to implement it into my already existing object structure (which actually needed some adjustments ;)).
This means that a terrain object consists of a couple of submeshes where each one represents a quadratic chunk of the whole terrain. They ideally share the same material, but can also have individual ones, which theoretically could allow some kind of mega textures. The normals are generated from the heightmap, to allow for smooth transitions between the chunks. LOD steps are generated at terrain creation time for each chunk with a quarter of the previous steps vertex count as extra meshes. To hide holes betwen different LOD steps, I simply added a border to LOD meshes, which is just a copy of the previous border vertices but placed several units below. This will probably break the shading a little bit and can look a bit strange in extreme situations, but it allows for static vbos for very optimized rendering and keeps the vertex count low compared to other alternatives I had in mind. And I don´t consider dynamic LOD generation at runtime an option on current mobile devices. This runs really fast so the only restricting factor for terrain sizes is the systems memory.
A solution for my habbit to trade rendering speed against system memory, may is to cache stuff on the harddisk and use some kind of streaming in some cases. But I will have to experiment with this somewhen later. I also noticed that the depthbuffers precision is kinda limitting the possible viewing distances.
As I also already implemented reflecting water, some notes on that as well:
It basicly works very fine and the shader is cheap. But for some reason, my swapping between the frame buffers to render into is kinda slow. And the biggest problem here are custom clip planes. A good solution would probably be special terrain meshes used only for the reflection, but I don´t think that this would fit my general design, which is meant to stay quite general. So the only solution left is to use discard in the terrain shader, but this removes the possibility of some optimizations for most graphics chips, and really slows things down in a quite noticable way on my iPhone 3GS. My solution will be to provide a possibility to switch the materials depending on the camera rendering next. So that I can take advantage of all optimizations for the final rendering with a terrain shader without discard and use another shader when rendering the reflection including a custom clip plane, by discarding pixels below the water surface, but without a detailmap, to at least simplify the shader a bit.
The water won´t be part of the engine, as it is something too special for my taste, as well as some more advanced terrain rendering, but I plan to provide stable templates for such tasks and use such example projects to add needed low/mid level features to the engine, which are meant to allow for different implementations of more specialized things in a flexible way.
Have a look at a video of the current stage of the terrains example level. It is recorded from the iPhone simulator, as this allows for better quality and is a lot easier. But it is a lot slower than the device and seems to be a bit buggy too. It runs with a minimum of 35 fps on my iPhone 3GS and the base terrain resolution is 512*512 vertices.
I also uploaded a video presenting my shadow example. It is also recorded from the simulator.
No Comments

The third part is done. It probably lacks some information, but is hopefully still helpfull. It deals with keyboard and mouse input, movement, rotation, collision detection, raytracing, gravity and manipulating the camera by showing the creation of a basic player code.
Lite-C and A8 Part3: Player and Camera
You can download my example project together with the pdf file here.
No Comments









