Week 7 - Simplying Needs & Saving a Path
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 & merging!
On the right path
Last week, a problem with saving a path to a component was discovered. This week, the cause of this issue was discovered, and it's all down to exactly how a component is saved to an entity. To save a component, all of its internal fields are copied & placed on an identical component. The serialization system uses a variety of copy strategies to pull this off. The 'Path' field was made extending ArrayList, so the serialization system used the "ListCopyStrategy" class. This class assumes that any list can be saved as an ArrayList. So when a Path is saved, it is converted internally to this form. However, when the copied 'Path' is saved back to the component, the system fails, since the converted array list is different from a pure path.
This is a very complex serialization issue (and one that took many hours to determine). This can be solved by either changing 'Path' is some way, or by changing 'ListCopyStrategy in some way; this will be determined in the weekly meeting.
Over the Next Week
- From the solution determined in this weeks meeting, fix the Path serialization error.
- Writing a detailed module description for the readme file, to be displayed on Github.
- When these items are done, starting development on factions!
PRs & Issues
- https://github.com/Terasology/MetalRenegades/pull/11 Need Based behaviors
- https://github.com/Terasology/MetalRenegades/pull/16 Starting implementation of Final Characters
- https://github.com/Terasology/MetalRenegades/pull/17 Add module authors and a brief description to module.txt
- https://github.com/Terasology/Behaviors/pull/18 Listen for path calculation in FindPathToNode