Tag Archives: design

Camera class system in game engines

The game’s camera system is nearly as vital as the player mechanics, it can make or break the entire experience, after all the most important aspect of a game is first and foremost being able to see what you’re doing.

Each game genre has its own camera control style according to how the gameplay will play out. There are several different types of cameras throughout games:


You have Look-at cameras as seen above which rotates around your target point which is usually the playable character. Follow cameras that are usually in platformers and vehicle-based games. Unlike the Look-at camera that can be adjusted, this camera’s motion tends to lag around the playable character.


The Follow camera is programmed with collision detection and avoidance logic in order to provide the player with some sort of control over the camera.


First-person cameras are self-explanatory; its camera angle is at your character’s eye as you see the world from their perspective. The direction of sight translates directly into the aim direction of the player’s weapon. We move onto the RTS (Real-time strategy) cameras where the players’ points of view is from above the terrain looking down at an angle.


Finally we have cinematic cameras; lots of games nowadays, particularly the big budget titles like God of War have cinematic moments where the camera moves in a filming manner which contrasts with the straightforward camera works of gameplay sections.


Of course you can easily switch between both of these camera systems with the usage of camera states and a trigger system to switch between them.

A camera object in 3D gaming akin to a camera in a movie studio; you’re always switching from camera to camera, angle to angle by design of trigger systems and basic movement physics. It represents the window that players can look into and observe the objects, events and actions in the game.


The OGRE viewport corresponds to a clipping region where the contents within view of the camera will be rendered in the window for each frame. Once a scene manager has been created using createSceneManager, the WinMain method is continued by creating a camera object along with a viewport object.

The camera object is created using the createCamera on the SceneManager, and developers must then create a viewport based on the same camera. The camera is a view into a scene and therefore depends on a scene manager for its existence. As a result, SceneManager objects are to be rendered before the cameras. In OGRE, camera are encapsulated in the Camera class using the createCamera method in the SceneManager class.

A brief overview of the Havok Physics Engine

At 2K Czech, games demanded a physics solution that can scale efficiently and handle highly detailed interactive environments. Having recently moved to the next generation of Havok Physics, Havok’s new physics technology is able to make highly efficient utilization of all available hardware cores with a very lean runtime memory footprint. This combination allows us to deliver the high quality simulation at the scale we need and we are really looking forward to making some incredible games with the new technology.” -Laurent Gorga, Technical Director at 2K Czech.

Laurent Gorga, 2K Czech’s Technical Director, further added that “At 2K Czech, our games demand a physics solution that can scale efficiently and handle highly detailed interactive environments. Having recently moved to the next generation of Havok Physics, we’ve been blown away by how Havok’s new physics technology is able to make highly efficient utilization of all available hardware cores with a very lean runtime memory footprint.”

Developed by the Irish company Havok, the eponymous Havok Physics is a physics engine designed for video games to allow for real-time interaction between objects in 3D. The engine uses dynamic simulation to allow for ragdoll physics. The company was founded by Hugh Reynolds and Dr. Steven Collins in 1998 in Trinity College Dublin where much of its development is still carried out. Dr. Steven Collins currently acts as course director to Interactive Entertainment Technology in Trinity College Dublin, as well as lecturing in real-time rendering. Havok can also be found in Autodesk 3ds Max as a bundled plug-in called Reactor. A plugin for Autodesk Maya animation software and an extra for Adobe Director’s Shockwave are also available.

As a result Havok offers the fastest and most robust collision detection and physical simulation technology available, which is why it has become the ideal physics engine to go to within the games industry and has been used by leading game developers in over 400 launched titles and many more in development.

Havok Physics is fully multi-threaded and cross-platform optimized for leading game platforms including, Xbox 360™, Playstation® 4, PlayStation®3 computer entertainment system, PC Games for Windows, PlayStation Vita®, Wii™, Wii U™, Android™, iOS, Apple Mac OS and Linux.

In 2008 Havok released details of its new Cloth and Destruction middleware. Cloth deals with simulation of character garments and soft bodies while Destruction provides tools for creation of destructible and deformable environments. Havok Cloth was the company’s most widely adopted and bestselling piece of software to date.

At GDC 2009 Havok showcased the first details of its forth coming artificial intelligence tools which will allow for better performing AI in games without the need for the developers to create their own AI models.

Whenever people say “Havok Physics”, all I can think of is The Elder Scrolls: Oblivion.  One of its major selling points was Havok Physics.  Anyone who has played that game knows how messed up Havok Physics can get, and how silly of situations you can create with it. Grand Theft Auto 4 also uses Havok Physics.

It was also used throughout the Halo games from Halo 2 onwards. In the Halo 3 engine The Halo 3 physics engine runs calculations on every single frame of animation, similarly to the collision detection engine. The engine is capable of calculating, among other things, elasticity on portions of character models; and bullet ricochet.

Character models are quite elastic at points, a characteristic that is clearly demonstrated by the Character Stretch Glitch’s presence in the game. The elasticity helps to improve realism at slower speeds. Only some parts of a character’s model are elastic; if you look closely at screenshots of the aforementioned glitch, you will find that the rigid parts of Spartans’ and Marines’ armor don’t stretch.

The physics engine utilizes an optimization found in many video game physics engines: objects that remain at rest for several seconds are temporarily exempted from physics calculations (but not collision detection) until they are disturbed again; this is why floating Crates and Fusion coils can remain floating in the air until the round is restarted or the items are disturbed. An object is considered “disturbed” if it is moved, picked up (in Forge), or if something collides with it.[5] The optimization is likely based on the premise that an object that isn’t moving now isn’t likely to move in the near future unless something moves it or it moves on its own.

Havok has announced the launch of the third major iteration to its Havok Physics technology that features “significant technical innovations” in performance, memory utilization, usability, and is a “major leap forward” for in-game physics simulation. The release is specifically targeted towards next-generation consoles, mobile devices, and PCs with full compatibility and support for current devices.

According to Andew Bond, Vice President of Technology for Havok, this version has resulted in a “new engine core built around fully continuous simulation that enables maximum physical fidelity with unprecedented performance speeds. Beta versions of the technology have been in the hands of a number of leading developers for some time and we have seen dramatic performance gains with simulations running twice as fast or more, and using up to 10 times less memory. Additionally the new core’s performance is extremely predictable, eliminating performance spikes.”

The game engine I am destined to create

Every aspiring game developer has hopes of making the next great game, or for those who are more realistic, make a game that can be enjoyed by people while paying your light bill. Strangely enough, it’s usually those starting out in their game development school who think the former while people with more education in the field along with more experience tend to sway towards the latter.

Does it necessarily have to do with the fact that our youthful energy is being syphoned out of us as we progress?


Considering it is university yes, however the main reason is as we mature we develop a more realistic outlook on things which makes us set realistic goals. How you set the scope for your projects may make or break it with carefully consideration of your resources, talents and limitations.

Hence why we’re studying Game Engine Design and Implementation, to culminate all our coding knowledge so far to be able to put together a workable engine that can support graphics, animation, gaming mechanics and all our gaming knowledge. So for this blog, I will talk about how I would design the engine of a standard platform game.

The term game engine was coined in the nineties in which it was referring to first-person shooters such as Id’s prolific title Doom due to how intricately its architecture was defined. With separation between core software components, art assets and gameplay mechanics, this is when developers started licencing games and re-tooling them into newer games which opened a whole new world for independent studios and other small organizations.


The game in question will be based on Uncharted’s engine along with the player mechanics of the Spiderman games and the recent Ninja Gaiden games. Given that the engine in question contains many of the ideal mechanics required to put out a solid platformer on the level of Crash Bandicoot which was also created and published by Naughty Dog.

I intend to use this engine as a template for other types of games such as adventure and fighting games since those are the types of games I intend to make and both games require the following:

–       A third-person view camera that follows your characters and stays focused on the players general area in order to focus on its location and the surrounding radius to alert the player of incoming hazards.

–       A camera collision system to ensure that view points never go into places it’s not supposed such as into the background or into a mountain.

–       A rich set of animations rendered for all sorts of commands from climbing to fighting.

–       User inputs that allow players to execute all sorts of tasks.

I mentioned earlier that I aim to include the player mechanics of Spiderman from the Spiderman games and Ryu Hayabusa from the Ninja Gaiden games. Why you ask? Because both characters both characters can do virtually anything; from jumping to climbing to fighting. More than most characters, they do the best job of making the player feel like their capabilities are limitless.


Spiderman for the Playstation, the game the developers of Superman 64 wish they’d made.

There has never been a concrete measurement or assessment of how a game can be good as games can be good for several different reasons, in my opinion, I think the ultimate way to determine a game’s quality is to identity how deeply you can immerse players into the experience and what better way to do so that with a character who can do just about everything.

This is why user inputs is very important, the possibilities of the game’s world is placed in their hand and the transition from one action to the next should be seamless and effortless on the part of the player.

In order to ensure an acceptable framerate it’s important to design the engine so that it can manage all the objects on screen without slowing down the action. In this regard we can take a page out of Insomniac’s hit title Spyro which managed to create massive worlds with distances that expanded to the horizon without relying on fog effects, this was done writing code that would decrease and increase the polygon count of far away objects relative to your character’s distance. This way objects can be slowly loaded over time so as not to overload the console.


Platformers tended to be drawn and designed in cartoon like manners with little emphasis on realism. I grew up with cartoons and platformers such as Mario, Crash Bandicoot and Sonic, so I intend to use such a style. Many of these games relied on principles of animation such as anticipation, squash and stretch, pose to pose, timing and exaggeration in order to achieve the cartoon-like style they were aiming for.

Most of these games were made before Smilebit’s Jet Set Radio spearheaded the use of toon shading in games. I like the toon shading effect because it gives games the comic book feel that I like, however since most of these games were animated and rendered the way they were prior to cel-shading, it’s important to realize that just combing them would be overkill, so it’s important not to just throw them together but to create a balance.

Motion capture generally results in the smoothest and most realistic movement animations so I appoint to utilize it with motion capture artists who can capture the exaggerated movements of cartoon characters in conjunction with the model rendering to capture the less feasible principles such as exaggeration when it comes to characters changing size for the sake of humor.

That’s all for now, it’s still pretty early in the course with much to learn on game engines hence my immature knowledge of the subject, so I just gave you may basic understanding based on previous education and a lifetime passion for gaming. Stay tuned to my blog and see how far I come with my understanding of the topic.