Skip to main content

Item Creation (Shaping Stage)

Item creation within V0.8.X of CIVIL-AI-SYSTEM is currently clunky, needs code editing and causes friction in development. The aim of this roadmap item is to improve this flow and make less friction when developing behaviours.

Proposed Changes

  • Rework of Item properties
  • A new Editor Window which allows for the creation and management of items
  • Point of interest on items
  • Item Editor Window
  • Variations of items
  • Instancing and object pooling of items within the scene to improve performance

Scope of Proposed Changes

Rework of Item properties

The item system currently uses enumerators for certain properties (name, type and size). This makes the system rigid and requires code changes to update possible values. To improve this experience these values will be updated to be keys. These keys will refer to collections which will be updatable and can be expanded via editor menus.

New Editor Window

This window will be a table view which will display all the current items within the project with the ability to add new ones. To start with filtering will be limited to just names but this could be expanded in the future. This will be used going forward to add items to the users scene so should be easy to spawn new items into scenes. There should be a short cut within the item selection on actions in the behaviour tree editor to create a new item.

Point of Interest

As items have evolved in the tool more specific locations on items have been developed to allow for more control of the use of the item; for example a handle point for holding the item and a storage point for how the focal point the item should interact with a non use agent item slot.

As these are similar behaviours these should be a unified organised system for this. The proposal for this is points of interest (POI). Each POI will have a transform property and a type assigned. These can then be fetch by any system wishing to interact with items and the specific domain logic can be handled there instead of on the item. This work will then allow the addition of more POI which could include a using position.

Item Editor Window

The current item component editor window is auto created within Unity showing the public variables. To improve usability and flow this will be updated. Items should not be for the most part unique. This means most settings will be moved into the creation flow editor window. A shortcut click will be provided from the new item editor window to create a new item using the currently selected item. There could be editable properties but this should populate to all items which are this setup and a warning should be displayed.

Variations of Items (TDB)

The ability to have different versions of the same objects grouped and randomly used by the system would add more variations to the behaviours. This would work by having children items which would just have a reference to the parent for the details excluding the points of interest and the model.

Instancing and Object Pooling (TBD)

As items will be under better management with the additions above the system can do more complex behaviours. This could be using instancing as well as limiting the count of objects displayed by using object pooling. This could have good performance improvement for item heavy scenes.

Risk / Open Questions

  • Changing of the item properties might need some porting? - That or either a way of casting between them
  • Should items be in collections or should all Item object be included in the editor window? (TBD)
  • Do I need a porting system for the POI work? - I think so, should be small in scope

Delivery

This work will be delivered over serval updates over the coming month or two. The work will be broken at least into the proposed changes but some steps might be broken down even further.

Summary

The overall proposed changes should provide a high quality of life improvement to using the tool. This is because no code changes, recompiling or syncing of items will need to done by the end user. These changes should make it easier designing behaviours and remove friction in the system.