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 generation now works as expected!

Well buildings spawning correctly!

In testing this issue, I found another issue with building generation. When buildings are generated in the world, they aren't place directly; rather in a buffer. This buffer is then unloaded at a constant rate to avoid lag. When the game is paused, the buffer doesn't unload, but buildings are still placed inside the buffer. When the game unpauses this buffer rapidly unloads, like the city was developing the entire time the game was paused! This will likely require a change next week of the timestep used to generate buildings.

Interrupting Motion

Now that the pathfinding system is working, a practical integration into the behaviors of Metal Renegades is required. In most cases the citizen will be travelling to a static location, such as a building. But one behavior requires the tracking of a moving object; the social need. To follow a moving character, the pathfinding nodes must be able to be interrupted in the middle of travel. The current pathfinding nodes do not allow for this, and a strange collection of errors and movement bugs ensue. These nodes will need to be updated or replaced to have a practical integration.

Over the Next Week

  • After #11 is merged, start on character factions & faction aggression, the last major task in the proposal!
  • Create a test character for pathfinding inside Terasology/TutorialBehaviors, and then implement the tactics used in this character into Metal Renegades characters.
  • Continuing the development of player needs, specifically hunger, rest, etc.

PRs & Issues

Comments

Popular posts from this blog

GSOC 2019 Final Report

GSOC 2020 Final Report

Week 7 - Simplying Needs & Saving a Path