Summary Post :
In this post I would like to give a short Summary on what tasks I had planned to accomplish so far vs what has been accomplished and the status of other tasks. I will also cover what my project aimed to accomplish and how I have gone about reaching those goals.
The project 'Genome Expansion' was aimed to be a content specific project which integrated certain gameplay elements and added a layer of depth to a simple process of breeding and traits. The Genome module already existed in Terasology before I began my project, however it was not in a state that was usable off the bat, nor integrated with any of the more core modules. Likewise, SimpleFarming also existed in Terasology pre-GSoC but it was not in a state to directly work with Genomes or any other additional module for that matter. To get into the specifics of what I changed with each modules, the weekly posts above may serve as a better communicator but I would like to cover the more broad implications of what I have added. Along the way few bugs/gaps were found in the engine as well which were then fixed to allow a smoother process of adding new features to the mentioned modules. My project serves as a base and allows easy addition of traits and other things in the future. Here is a list of the tasks I achieved and what impact they have :
Simple Farming :
- Breeding algorithms are now registered per trait. This allows for different kinds of traits to be added to an organism rather than forcing the traits to be of a single type
- New breeding algorithms were added to allow more flexibility in defining traits for an organism
- Adding new breeding algorithms to Genomes should be an easier process now since there is a template that can be followed. The tests written for the new breeding algorithms will serve as a good driver for test based development in the future
- After traits were added to SimpleFarming, adding traits in a similar manner to other organisms will be much easier since there is a process that can be mirrored
- New systems were added to Genomes to handle optional modification of traits based on what modules are activated. This again serves as a template for adding new handlers in the future, making the process much easier.
- A new system was added to handle Genomes via an optional dependency (GenomeAuthoritySystem)
- This system adds traits to seeds and handles all gene-related activities of bushes. It assigns a random gene value on the first harvest of a bush and then the same genes persist through all planting/harvesting cycles of that seed.
- If Genes were to be added to vines or any other organisms, the same procedure as followed here can be followed to make things much easier. For vines the GenomeAuthoritySystem can be used with the addition of just a few lines of code
- The filling traits of a seed is now affected by the genes of the seed. The procedure for adding this will be documented properly and therefore adding more such traits in the future will be a very easy process since the handlers, events and entire flow has already been taken care of.
- Seeds can be bred using the SeedWorkstation to get more desirable traits. At the time of writing this post there is a small bug with this which should be fixed in coming days.
- New recipes have been defined for breeding purposes. A future goal is to move this to another WorkStation.
- Filling values of seeds in EdibleFlora will now be affected by the Genes. More such traits can be added very easily.
- Added a new event which is thrown when an item is produced. This event can be handled by other modules which would like to have an impact on the breeding process by modifying the final product in some way.
- A template which can be followed exists in the GenomeAuthoritySystem as the genes affect the breeding process of seeds
- Fixed a bug with duplicate items not finding the correct slots.
- Fixing a bug with the order of the ingredients having an impact on the output.
- Modified cooking so that any modules having an effect on the ingredients of a recipe will also affect the cooked item.
- This has been used in Genomes and will work for any such modifiers
- Changed the filling in FoodComponent to a ModifiableValue type which can be used by any components to create an easily modifiable data member without ever modifying the base value but rather modify current value using 3 different kinds of modifiers
- This has been used in Hunger and EdibleSubstance and can be mimicked in other modules that wish to use this type for their components
Upcoming work :
- Fixed a bug with RetainComponentsComponent not affecting the components to be retained in the EntityAwareWorldProvider. This now allows entities to carry forward the values of desired components even if they are changed in state.
- Fixing this RetainComponentsComponent bug allows any components to be given to bushes and have them persist past each growth stage.
- Added the ModifiableValue type which can be used effectively with any components which contain data members which may be modified by other modules in different ways
- Added a TypeHandler for the ModifiableValue type to handle proper deserialization from prefabs and serialization of the type.
With around 2 weeks left on the GSoC timeline, here are the tasks I have planned to complete :
Post GSoC :
- Add Biome integration with SimpleFarming, this would affect the growthRate of plants in unfavourable biomes
- Modify WildAnimalsGenome code so it is working properly with the updated Genomes module
- Readme and Wiki documentation of my modules, additions and templates that should be followed to add new traits etc
I don't plan on going anywhere post GSoC and therefore I will keep contributing to Terasology beyond this project. Post GSoC I would like to start on the stretch goals I had planned for this project like thirst integration and juices, as well as contributing to other areas of Terasology