I started my GSoC project work this week, fast forwarding my timeline by about 2-3 weeks, because of which my start was a little shaky. My mentors, who are quite active in the slack channel #restoration-100, helped me sort timeline and work distribution. So, let’s get to this week’s activities.

Getting some Points in the Pool

I started this week by creating a new module, named PointPool to track multiple “pools” that can be instantiated. Idea behind this was to create a central module for all points related systems, such as Hunger, Thirst or Mana to depend on this module.

I added a PointPoolComponent with basic configs like poolValue, maxPoolValue and poolType to track points. I added the corresponding system to be able to perform functions such as filling, draining, instantly filling and instantly draining, and a function to view pool status, and a command system to test these functions in-game. I added a delta to add the PointPoolComponent to the player entity to test out the functions.

Testing Commands

The Pull Request adds the functions into the system:

However, after doing so much, I came to know that we cannot add multiple components of the same type to any entity. This ensured a discussion on how to make the PointPool module support other systems. There seemed two stark options: one to make it central module where other systems have to register themselves with some “key”, which would be used for identification of events of that pool. The other option is to have individual modules, systems, events for every pool.

Since I couldn’t grasp in-depth comments of Immortius and Josharias, the conclusion (by Cervator and Jellysnake, who simplified those comments and helped me understand them) was to go ahead with the plan of creating a separate module for extracting Health from the Core, only change being it not dependant on the PointPool module, and based on the knowledge acquired, decide on how to go ahead with point/meter system for other pools.

This leads us to the next topic…

Gaining Health

So after the discussion, I started working on extracting Health out of Core. I created the Health Module to support all health functions. The PR that I worked on:

I moved the HealthComponent and healing events, which are BeforeHealEvent, DoHealEvent, OnHealedEvent, HealthChangedEvent and FullHealEvent to the new module, adding docs and comments explaining the usage or requirement of parameters and methods, and removing things (constructors?) which are not needed.

I also added a test using the ModuleTestingEnvironment for testing the functioning of HealthAuthoritySystem. This will make sure that the changes made further down the project will not be breaking-changes.

What Next?

The next task is to extract out the damage set of events and to add tests and docs for them. With the current pace, I think I would be able to do this faster and add more granular tests for both heal and damage set of events. Also, the weekly meet is ahead and weekly status and review underway, I think I will have lots of things (maybe?) to write in the next post …