Research System

Laboratory

The research task requires the Laboratory building to be present in the village. This building has a Bookcase which consists of books with various research recipes i.e the blocks required and the block it would result in.

Cookie Crop Research Recipe

In order to add a Research task the player takes a book from the case can read it for the recipe then has to place this book in the Pedestal next to the case. This renders a ‘bouncy’ exclamation point over the pedestal indicating that a Research Task has been added to the Holding which can be taken up by the Oreons. The player has to now add the blocks required to the building’s chest, when the task is assigned to the Oreon it checks for these blocks and then performs the task which adds the final block to the chest.

Rendered exclamation point after Research Task addition

The logic behind the system

The Research will also contain the tier definition for all the upgradable resources in the village and the difference in effectiveness of these tiers.

Animated building construction

The building construction up until now involved just placing the whole building at a specified location, where is the fun in that :D. So to make this a bit more interesting I dug up two old PRs in the StructureTemplates repo which implemented such an animated construction. One of the PRs constructed buildings in a bottom up fashion layer by layer the other made the whole building appear as if falling from the sky. I merged both these branches for some extra magic(this required some serious merge conflict resolution). Next I made the layer-by-layer construction the default way of constructing STs and modified the falling blocks logic to spawn blocks after the previous one has fallen all the way. So, blocks now fall one after the other though this takes some time to construct a building but it is worth watching the process :). As expected this led to some bugs in other modules which use ST construction, resolving these is still a WIP.

Animated construction

Though the above implementation works in most cases with the other modules using it but it gives rise some bugs like adding items in the chest of these buildings among others.

Better fence construction

I modified the fence construction logic related to the Build task. Now, every time the player selects a region and assigns it for a building’s construction, its ST prefab is used to calculate the area required and the region selected is modified accordingly. The fence then placed around this new area.