Tremble

Custom Engine

16 weeks Team of 7 people

April 2017

Engine Architecture, PhysX integration

C++, PhysX


Project Brief

Tremble is my first stab at making a game engine. I worked on it for half a year. Me and other 2 other people started making the project, other 4 joined halfway through.

The engine at first was aimed to be specialized for fps games.

Project Result

Even though the engine is far from perfect, in the end we managed to get some multiplayer fps combat going. It was very interesting to see how such a complex structure as a game engine can get assembled, and made me think about all the ways how can it be done better and how the AAA game studios do it.

My Contribution

Scene Graph

I made a scene-graph, that is integrated into everything in our engine. Objects are able to be parented and all the usual transformation logic is available to the person, using the engine.

Entity-component system

With a heavy use of templates in C++, I made an Entity-Component system that you could use much like Unity's. All components that the user writes are able to have functions like Awake, Start, Update, and so on, and the system will detect them and run them when needed.

Memory Management

I also made a memory-managemement system for the engine. Different types of allocators are available to the user. Among other things, the engine itself is using a stack allocator for managing subsystems and pool allocators to keep components of the same type.

PhysX Integration

Integration of PhysX into our engine was done by me as well. It is fairly limited because of time constraints - not all PhysX api is properly exposed, but the user is able to create static and dynamic objects of various shapes, including meshes, apply forces, and raycast.

Engine Architecture and Project Oversight

I've done a lot of other small things to pull the engine together, such as the input system, or delta time. Besides my direct responsibilities I also, of course, helped my teammates with problems that they had, participated in discussions about the overall structure of the engine, and did my best to make the development process go smooth for everyone.

class PickUp : public Component
{
public:
void OnTriggerEnter(const Component& other_component)
{
	if (other_component.GetType() == typeid(CharacterController))
	{
		other_component.GetNode()->FindComponent()->OnPickUp(amount, pick_up_type_);
		renderable_->SetActive(false);
	}
}

void Start()
{
	SetOnTriggerEnter(&PickUp::OnTriggerEnter, this);
	//load model and set renderable
	renderable_ = GetNode()->FindComponentInChildren();
	renderable_->SetActive(true);
}

void Update()
{
	if (renderable_->GetActive() == false)
	{
		if (respawn_timer_ >= respawn_time_)
		{
			renderable_->SetActive(true);
			respawn_timer_ = 0;
		}
		else
		{
			respawn_timer_ += Get::DeltaT();
		}
	}
}

    Renderable* renderable_;
    std::string pick_up_type_ = "Health";
    float amount = 10;
    float respawn_timer_ = 0;
    float respawn_time_ = 2.5f;
};
                  
Code that one of my teammates wrote for pickups using my system. Notice that the start and update functions will trigger properly if the component is placed in the scene, no other setup required.