August 13, 2009

The new face of a conspiracy

Posted in Computer Graphics tagged , , , , , , , , , , , , , , , , , , at 6:48 pm by sagito

Hi everyone! It was a long time since I posted something new here, because my network keeps going down… But this time, I’m bringing you news about the Conspiracy engine. Missed him? Me too… πŸ˜› Well, it has a brand new face since many new features have been added that make him stand much higher then before.

To start, a small problem with the vertices was corrected. Somehow the vertex data was getting scrambled all the way through the CMOL (Conspiracy Mesh Optimization Pipeline), and I ended up removing some of the optimization routines that could be handled in another way by DirectX himself. And by doing so, the GenerateAdjacency problem was also solved! This way, the meshes are more perfect and faster than ever! πŸ˜€

Also, I’ve implemented a XML parser system from scratch. With that, I created implicit support for something else: Scene graphs! And this is a very important part of the engine, as some objects might now be loaded directly through a simple configuration file. This is great for scenarios, lights, etc., but also for the future creation of a visual editor for the engine!

With so many new features, something logical occurred! A game is being developed on top of it and I can guarantee that it is already in a very advanced state! Stand by for more news! πŸ˜‰


August 10, 2009

The piano…

Posted in Computer Graphics tagged , , , , , , , , , , , , at 6:38 pm by sagito

Hello again! πŸ™‚ This time I’m bringing you an amazing short story, created in CG by Aidan Gibbons, from Aniboom. The film is about a grandfather who is telling his story to his grandchildren through the piano music. Although very simple, I found it really great. Hope you like it:

August 3, 2009

Fallout 3

Posted in games tagged , , , , , , , , , , , , , , , , , , at 10:27 pm by sagito

Bringing you a new section in this blog, and as I finished this game yesterday, I’m posting my opinion on it today! Fallout 3 is all about atomic bombs and nuclear power. In a distant future, the united states were devastated by a nuclear war and pretty much everything lies in ruins now… Before the war, a powerful company named Vault-Tec built some underground, radiation-proof bunkers where people could live in the case of such a war happening, named Vaults (wow, surprise!). The story begins with the birth of our character which is followed by a (not so) brief tutorial until our avatar reaches the age of 19. At this age, our sweet daddy doctor runs away from the Vault where we were born and guess what… We must find out what happened to him…

Now, the box says that we have the freedom to choose our story… Well, I tried to do that, really did… If the character’s father wanted to go to hell, that was his problem! I wanted to stay in the vault… However after a short time, some dumb guards showed up and without further questioning just shot the hell out of an unarmed 19 year old boy, which obviously resulted in a game over… Ok, so I really had the freedom to choose! Either I pretend to be a good son and get out of the vault searching for daddy or I get killed because I was following the Vault’s rules and stayed there… Way to go, Bethesda studios!

A note to the VATS Targetting System: Brilliant! Loved the concept and it didn’t make the game any easier… Well, maybe a little, but I welcome such a system with great pleasure! Basically, for those who didn’t play the game, it consists in a system that stops the action during combat and lets the player decide where to point the shots at. The chances of hitting depend on your stats, of course, but it eases the pain of pointing and shooting when using a XBox 360. It was an innovative system that realy brought a nice feature to the game.

Anyway, the game has some pretty nice graphics, using great particle and lighting effects, specially during combat. Also, the quality of each death makes the game not only visually stunning but awesomely fun to play. Β I kept going back to some of the metro stations just to shoot the head out of some Feral Ghouls. Also, the missions are not boring… When I thought they were getting repetitive then the game came out with something really surprising… And this reveals a kind of attention that I really appreciate in video games. However, there are some bugs that could have been easily corrected, but are not really relevant… The animations when playing in third person are so bad that I would prefer to hide my characted in some dark spot and throw three grenades to my feet then to actually play with this perspective… Nevertheless, the good guys at Bethesda gave us a first person view, which is awesome, so that bug is pretty much forgettable… A somehow serious bug happened when I arrived at Rivet City. I wandered around the boat for a while until I found a door that lead to the wrecked outside. At this point, collision detection below my feet just failed and I fell to God knows where… All I knew is that I was receiving 5 rads per second, wherever the hell I was! Of course, I ended up dying, but at least I should look like a beacon with so much radiation on my body. Final bug, (but I loved this one), the final boss… He was protected by some minor guards, which were easy to deal with as soon as I had my reliable plasma rifle. When I killed these guards… There was no boss! Where did he go? This was answered on top of the stairs… Somehow the bunker door closed on top of him, blowing him to smithereens! Pretty easy to kill! πŸ˜€

The overall game is pretty good… The story is completely forgettable and now that I think about it, its sort of a nonsense… Who the hell are the enclave? Why did I risk my life to get to my father after all? How the hell did that general survive to the intense radiation? What was the enclave doing in those labs? However, I must say that if we forget the story, this is really a great game and above all… Its fun as hell to play it! And isn’t that what matters most? πŸ˜€

So, here is my veredict:

Story: 3/5

Gameplay: 4.5/5

Graphics: 4.8/5

Atmosphere: 4/5

Longevity: 4.3/5

Fun-niness: Β 4.9/5

Final Score: Β 4.25/5

July 31, 2009


Posted in Computer Graphics tagged , , , , , , , , , , , at 11:11 pm by sagito

Hi everyone! After some absence due to the lost of someone who was very close to me, I’m back to posting… This time to talk about a constraining system that I will attempt to implement within the Conspiracy Engine.

I have been having some problems with some DirectX functions, namely GenerateAdjacency and OptimizeInplace. These functions just crash unexplainably in some memory address that is not in my addressing space. Also, neither the DirectX debugger nor the PIX (tried it in despair), not even the Visual Studio 2008 debugger could do anything to show me the problem… So, I analyzed the assembly code, to find out that something inside the mesh is not properly set. However, I don’t have the means to find out what, so I just commented out the functions and moved on until I have the patience to deal with Microsoft’s brilliant lack of information.

So, I decided to implement a constraining system. Now, what the hell is that? Basically a system of something that constraints something to some other something. πŸ˜› Ideally, this will, for example, stick a camera to a travelling object! Imagine a car in a racing game. We want the camera to be able to follow the car along the track as it moves, otherwise the camera would just be left in the beginning of the track.

It is important to say that… I never, ever, whatsoever, tried anything even near such a thing… My basic idea so far is really making an object stick with other… You could say that this can be achieved using hierarchy. Yes it could! However, I think some more flexibility is desirable… For example, if I want to attach a gun to my vehicle, I would probably like to place it in the door or in the roof… I need something that allows me to control its position and the constraining system will hopefully give me that kind of offset.

I know that there is a huge number of possible constraints to be implemented. However, I will stick to this one at the moment, but I will create a solid enough structure that can be expanded to some other constraint types further on… For now on, I will be keeping you posted! πŸ˜‰

July 26, 2009

Octree in DirectX

Posted in Computer Graphics tagged , , , , , , , , , , , , , at 11:27 am by sagito

Hello everyone! Back to some news from the Conspiracy… πŸ˜‰ This time I’m implementing a feature that is quite new for me. An octree! Ok… Wait… What’s an octree? Well, an octree is basically a technique for dividing the drawing space. You start with a huge cube which surrounds the entire scene. If there is something inside it, then you subdivide that cube in eight smaller and identical cubes. Then, for each of these cubes, we must check if there is something inside them, if there is we subdivide them again, and so on…

Ok, now… Why is this so useful? Lets consider rendering… It is not necessary to render everything that we don’t see (because its behind us for example). This seems quite logic to me. But, the DirectX backface culling and occlusion system should be capable of doing this, right? Yes and no! In a matter of fact it really does not render the objects that we can’t see… However, it sends them to the graphics pipeline, executes a draw and only checks if they are visible afterwards. Only at this moment it decides if it really sent to the screen or not. With an octree, we are actually able to avoid such a thing, because we just don’t sent the objects which belong to an octant that we cannot see to the pipeline, avoiding some unwanted overhead.

Another example is the picking! Why try to perform picking on something that we cannot select? It is a heavy operation and we want to be able to ignore such operations if they are unnecessary!

However, there is a small problem, at least, with my implementation. I can reach 6 iterations of depth in an admissible time… Seems that these are few iterations, and maybe they really are… But if we think it through, each subdivision creates 8 space divisions. So, for 6 iterations, that stands for 8^6 = 262144 divisions (maximum). After doing the maths, this seems quite acceptable now… πŸ˜›

So, standby for new updates, as they are coming fast! πŸ˜€

July 12, 2009

C++ Reflection

Posted in Computer Graphics tagged , , , , , , , , , , , at 10:48 pm by sagito

Today I faced a different problem while trying to build an external interface for the Conspiracy Engine… As it was built on C++, which is a compiled (not interpreted) language, the compiler does not have the concept of reflection. In the first place, what is reflection? Reflection is a technique that makes a language able to know, observe and modify its own structure and behaviour. For example, if I have a class A that wants to know which methods and variables are in class B, I just ask the compiler to tell me. This happens, for example in C#, where we can ask the compiler for class methods, variables, and even execute the methods if we want.

Problem is: There is no direct support for this in C++… However, I need that, because my intention is to build an external editor that can interact directly with the engine like the CryEditor, for example. So, I’m trying to find a solution! There are several ways of attempting such a thing. The first one is to read through the debug information… This is not viable because different compilers use different approaches for debug and the program would have to be always built with debug information (which is huge).

Second solution would be to create a compiler that supported reflection for C++… I have already create one (not for the C++ language!) and I guarantee that it is not something neither pretty to see nor easy to implement. Third solution: Create a specialized pre-processor that could build over the class descriptions… This solution could be viable… However, parsing the C++ language is not trivial and would require a two-pass-process which would introduce a huge overhead.

So, there is no solution for this problem? What if the engine had a specialized class that would store the data for reflection? Every class that derived from this base would register their variables and methods in a global storage that could be accessed from any other class. This is not the real reflection that we are to, but it seems like a nice approach. And it contemplates the cases in which a variable (or class) is sealed, i.e., not accessible through reflection. In that case, the class simply does not register its variables or methods! This approach seems to be the best one so far and I have already implemented it on Conspiracy.

So far it is working fine! πŸ˜€ I should give you some news very soon about the new editor for Conspiracy! πŸ˜‰

July 8, 2009

Sky is not the limit!

Posted in Computer Graphics tagged , , , , , , , , , , , at 9:40 pm by sagito

After a short break due to WordPress maintenaince, I’m back to post about the new stuff that I implemented in the Conspiracy Engine! It now features skybox support, collision detection and a very complete particle engine!

Implementing a skybox was pretty easy. For those of you that do not know what a skybox is… Well, it is pretty much that, a box that represents the sky. So, what about that, why can’t it be just a cube with some texture mapped like every other object? Because unlike other objects, the skybox must move with the viewer… I.e., the user cannot get out of the box as the skybox itself must move with the camera. Just like a person can’t reach the horizon! So, how can one implement a skybox? Pretty easy, you get the view matrix (through IDirect3DDevice9::GetTransform(D3DTS_VIEW, &view);), reset the last row to 0.0 except for the last value and set the new view matrix. After that, the world matrix must be set as an identity too in order to remove any unwanted transformation. Then we can render the skybox! After rendering, we put back the old view and world matrix.

For collision detection, DirectX already provides some very useful functions that automatically calculate the bounding box and sphere for a given object! After that, I just took some optimization measures and converted the bounding box to an axis-aligned oriented bounding box (see for more info). Then, the objects are tested for collision… If a collision happened, it is propagated through a chain of responsability to some entity that handles the event or discard if no one does…

Finally, the particle system was based on a tutorial from CodeSampler ( The system described in this tutorial is awsome and very complete! Also, the code is very well structured and commented, so it was pretty easy to implement this too.

To end this (already long) post, here is an image of the engine with the skybox and the textured cube:


July 7, 2009


Posted in Uncategorized tagged , , , , , , , , , , , , at 12:06 am by sagito

After a long, long day of work, I’m proud to announce that the Conspiracy Engine now feature textures (finally)! Well, textures do not use to be such a pain, why did it took so long this time? The answer is quite simple… When exporting the object data, 3D Studio Max exports the (X,Y,Z) vertex data and the (U, V, W) texture coordinate data. However, I was surprised to see that I had 8 vertices in my object and 12 sets of texture coordinates… Well, this made sense, because a vertex shared between edges may hava different texture coordinates along each face!

The problem is that 3DS does not keep any kind of relation between one vertex and its texture coordinates. So, we must first ask the face which vertices and which texture coordinates it uses and only then attempt to relate both these kinds of vertices. I could have done this the easy way by just ignoring repetitions of vertices and letting DirectX handle the optimizations. Of course that I chose not to…

So, I had to create two auxiliar data structures to aid me: An Hash Table (with customizable rehashing) and a Pair. With the Hash Table I was now able to set keys for each vertex individually, thereby removing repeated indices and vertices with ease! The Pair was just a helper utility that I used to handle some data more easily. However, I think that these structures will prove worthy in the future, as they did now! πŸ˜€

Well, here is the actual result from all this work:


Tomorrow I will be working with collisions, although that should be a pretty simple matter to handle… πŸ˜‰ As promised, I will be keeping you posted!

July 4, 2009


Posted in Uncategorized tagged , , , , , , , , at 10:30 pm by sagito

This time, I’m bringing you something quite different! Kiwi is a short CGI film, created in Maya, that tells the story of a Kiwi Bird who wanted to fly. The graphics aren’t wonderful, but fit pretty well in the overall look of the movie. However, that can be easily forgotten due to the wonderful (although sad) story behind it and to the great animations.

Just loved this video, hope you also will:

July 3, 2009

3D Model Loading

Posted in Computer Graphics tagged , , , , , , , , , , at 12:07 am by sagito

Hi all! πŸ˜€

After a small time without posting anything, due to an exam which happenned today, I’m now proud to say that the Conspiracy Engine is already capable of loading Β three-dimensional objects from the CMF format defined below. It still does not try to load neither textures nor materials, but the geometry is already being properly loaded!

In the past, I have tried to create a mesh from a format other than .X and I failed because I just couldn’t get access do an ID3DXMesh* vertex buffer correctly. Either the data was scrumbled and corrupted or the mesh would just not grant me access to the buffer. This time, I tried to adopt a different system and I created the mesh with different pool and memory flags. Apparently, this did solve the problem! πŸ˜› However, I’m still looking forward to see if that really stands when I try to put some animations within!

I will be posting some screenshots very soon! The Conspiracy engine is now getting really solid and robust. I could even say, that even in such an early development stage it already is more robust than all of my Enoch engines all together!

So, what is it needing now? From my perspective, mainly two things… A scene file loader, which takes a file and builds a scene from it, and a graphical editor. This graphical editor should be a tool that would let me import new things into the game world, position stuff, create AI routines, etc… Something like all real engines have! And I’m looking forward for the challenge of developping such a thing.

Will be posting news pretty soon, stand by… πŸ˜‰

Next page