Thursday 14 November 2013

GED Blog #5 - 3D Engine Fundamental

Most of the games we play nowadays is made with an game engine. So we took a deeper look into engine on what it is and how it works in class one day.






Game Engine
The various options of available game engine that can be found online.

A game engine could be the system programmers design as they develop their game, then they can soon modify the code to develop more similar type of the game. An engine is there to manage the game data and its flow as there will be many information going on when the game is running. Therefore, it is important for an engine to be able to organize the data in an efficient way and ensure its components are able to be reuse again and again. Moreover, the engine should provide very low-level tools and be flexible, where users are able to create not just one specific thing or game. As mentioned in the lecture, games were developed without the concept of using an engine. However, developers would not want to make a game from scratch every time they want to make a game. Thus, an engine should be easy to navigator and help the users to make game easier with its re-usability.

The game engine includes many things that will be used in the game. For example, the graphics, physics, collision, animation, input method, audio, scripting, etc.. Some engines such as Ogre3D, Havok, and so on, would provide more functionality and control for users on a focused area. Nonetheless, an engine should have the core utilities such as managing memory, data, file I/O, and many other possible utilities.


Scene Graphs
A scene graph is a data structure that is commonly used in computer games. It is to specify the relationships between objects in the game. The graph shows the hierarchy of the objects and how they relate to each other through the use of the nodes.

A scene graph example.


The reason a scene graph is useful because it organizes and groups the objects in a way that the program can access the data easily to render things on the screen. Also, it is easy for the programmers to understand, implement, and manage memory.


Version Control
A game is often developed by more than just one programmer, so there is a version system to keep track of the changes users make. It becomes easier for the users to keep track on the changes and debug as it only saves the differences of each version. So, the users can always track back or revert to a previous version if anything goes wrong.

A version control diagram example.

The above diagram simply illustrates how the version control system works. Usually, there is a repository where users can store their codes, in my case, we use Bitbucket. Then, we have our project at its original form. As we make changes, they become the branches that represent the different versions the game has changed to, and we use tag to label the project with the accepted changes. Sometimes, we might run into problems and need to revert to the last version. In this situation, the branch would become a dead end on the graph.


Design Pattern
Often in development, designers would have to solve problems or perform a task using the classes and objects. For this reason, the design pattern is the solution to help solving the common problems. It is also useful because it makes code becomes more readable, higher re-usability, and easier to debug.

Singleton
An example of a singleton class.

A singleton is a class has a single static member variable that gets instances of other classes for the users. Instead of making it a global object, users can use singleton to have multiple instances from different classes. Also, it ensures that users only have a single instance of the class. In the provided examples from the slide, the game would only require one renderer, openGL or DX. The singleton is to create an instance to use among them and persist the value it gets so that only one renderer is being used at a time.


Facade Pattern
Facade pattern is a manager class that makes it easier for subsystems to communicate with each other and users to use without going through all the details when trying to implement something. For example, when we want to change the channel of the TV, instead of going through and modify all the wires and switches to switch the channel, the facade class would act as an button where users can simply press it to switch channel.

Factory Pattern
Factory pattern is something completely different from facade pattern. Facade pattern focuses on the structure whereas factor pattern focus on the creation. It acts as a "factory" and creates things such as shapes, or models for you. It becomes very useful as users can easily add new functionality without changing much code.

State Pattern
State pattern helps users to keep track of the game state. As there are many different stages during the game, a manger of a state class helps to manage the state logic and switching, and any information that both states would be sharing. It is also useful for A.I. to switch its behaviour from one to another.

1 comment:

  1. This post is really nice and informative. Rigging animation refers to the process of creating a digital skeleton or framework for a 3D model, which allows animators to manipulate the model and create movement. It's a crucial step in the animation pipeline, as it enables characters or objects to be posed, animated, and controlled in a realistic and efficient manner. For comprehensive insights into our automated rigging, please click here to visit our detailed page and explore how it can meet your needs.

    ReplyDelete