GSOC 2019 Final Report

SummaryAfter more than 12 weeks of development, it is time to close this summer of code 2019 project! Over 30 total pull requests have been made over the course of the project, with 58 commits & approximately 8000 lines of code added to the Metal Renegades repository alone! It has been an incredibly busy few months.

This project involved taking a new gameplay module proposal posted on the forum here, and implement the technical backbone of the world, so that the core gameplay can be built on top of it. This ended up primarily consisting of AI characters, but also included other aspects, such as player needs, and getting rid of some underlying technical issues.

This repository has been worked on in collaboration with Wabadump in their GSOC project. We both happened to make proposals in the same area, so we cut out as much overlap as possible & both worked on different sections of the module. In some areas the proposal tasks were slightly altered due to it already being completed…

Week 12 - Finishing up!

A Divided World All the characters thus far have been very friendly with each other, the friendliness has been going on for too long! This is Metal Renegades, we need conflict in this world! Enter the new faction system. Now, each settlement is given a faction alignment on creation (from Good, Neutral, and Bad), and only characters of that specific alignment can spawn in those buildings.
Citizens inside a building, both in the 'bad' faction
Each faction has a specific aggression relation with every other faction. A 'good' citizen will be aggressive with a 'bad' citizen, and neutral citizens are aggressive with nobody. When a citizen finds an enemy nearby, they both charge at each other and attack.
Enemy citizens attacking each other!
The last part of the faction system was the player's faction alignment. Unfortunately, this could not be finished in time for the programs completion, so it will be finished post GSOC. A Thirst in the Town After the hunger integ…

Week 11 - Engine Changes & City Timesteps

A Change to Serialization & Health This week two major changes have occured in the Terasology codebase. In the engine, a new serialization system was merged into master, which reads and writes all the assets & save files more efficiently. The number of changes in the serialization pull request.... oh my!
This update required many changes to multiple modules in my workspace, which took up more time than expected. If you recall from three weeks ago, I had some troubles with pathfinding serialization, where the game would throw errors when a path is saved to a character. With this new system, the errors have reoccured again.... Except this time, the game doesn't only throw errors, it crashes entirely with a NullPointerException. The current cause of this is unknown, and must be fixed as soon as possible.
In addition to this change, vital changes have been made to the Terasology/Health module as part of another GSOC project, which changes the way that events are used in regard…

Week 10 - Citizen Tooltips & Pathfinding Successes

Building around the clock Last week, an issue involving the DynamicCities building generation cycle was discovered. In short, buildings continued to spawn while the game is paused, which is not intended behavior. I looked at the generation system this week, and it turned out that generation ignored the current paused state of the game. This system subscribes to the game update cycle, which provides the delta time (the difference in time since the last update). This time becomes 0 when the game is paused, but unfortunately this delta time was not used by the system. I changed this system to use this delta time, solving the issue. On the right path, sort-of... In the last blog post I talked about the current pathfinding capabilities of the behavior nodes, and how these nodes don't support interruption. As well, I talked about how this could cause problems for integrating this pathfinding into the Metal Renegades characters.
In order to fix this, it turned out I needed to make two n…

Week 9 - Proper Template Generation & Interrupting Navigation

Buildings on the Ground About three weeks ago, a very strange issue involving bulding placement was discovered. When a building is defined as a structure template, the building placement fails, and the template is seemingly placed randomly across the world.
Buildings generating in the sky
After some investigation, this placement turned out not to be random. Rather, it was a problem with the rotation order. The problem is best demonstrated with the diagram below:
The top rotation matrix order was the intended order for placing templates. The building is initially at the origin, (0,0,0), rotated/transformed to fix the destitation parcel, then translated to the parcel. The bottom is what actually ended up occuring, where these two steps were flipped. The template was rotated unnecessarily around the origin, ending up in a totally different location than where the parcel was. With this order changed, and a few tweaks made to ensure the template is at the centre of the parcel, the building…

Week 8 - The Path Less Traveled & Hungry Players

Saving Paths In regards to last week's Path problem, the determined solution was to change how the Path class was structured. This class no longer extends ArrayList, which seems to have done the trick; the crash no longer occurs. Pathfinding now works on basic characters!
Now, another issue has risen in regards to Pathfinding. I attempted to integrate the existing nodes into Metal Renegades. After a long runtime however, the performance hit skyrockets, hitting over 500ms delay in the BehaviorSystem. This doesn't seem right.... I'm thinking that a behavior node is running wild by accident; perhaps calling the pathfinding operation over and over again. This is another pathfinding issue that needs to be solved in the coming weeks. Citizens in the Sky With the new need-based behaviors, a few more issues with standard character movement is becoming apparent. This week, I took a bit of time and researched the issues present with character motion and put them inside of a new iss…

Week 7 - Simplying Needs & Saving a Path

Simpler Needs Last week, the need-based behaviors pull request was created. This quickly grew into the largest pull request of the project, with almost 1500 additional lines. This became very hard to manage & review (sorry mentors), so I had to shorten it down/generally make the code look better. This was accomplished in two different ways: For all needs, there was a different target action & fulfillment action for each. I changed the code to merge these common sections together into common target selection & need fulfillment actions; greatly reducing the complexity and size of the pull request.The need based pull request was technically in two parts; the addition of new characters, and the addition of the need-based behaviors. I made a second pull request and separated these two pieces to be reviewed in two different spots. This cut about 500 lines from the pull request alone. With these two changes, the need-based behaviors pull request is finally ready for review & …