Hi!
I have around 6 factories (actor blueprints) in my game each factory has 4 assembly lines and one staff (in the form of a struct containing worker detail such as name, skills level and etc) assigned for each assembly line at work and unlimited products (actor blueprint) will create in production lines, during the course of gameplay.
My data formats and management:
- Staff Array: each staff assign to factory assembly lines by its array index
- Products Array: each product is unique in form of an struct items with different properties and assign to a factory assembly line based on its array index.
- production cost and preparation time will calculate based on products properties and staff skills.
- Manager_BP is a blueprint in charge of time and cost calculations, assembly lines products assignment and set data in ui widgets.
My Question:
I want to know which approach is more efficient.
-
centralized approach: I keep all my info such as assembly line data, staff data, products data in the form of Struct Arrays in my manager, to prevent too many blueprint references in calculation time and cost and etc.
-
decentralized approach: separate all calculations in my factory blueprint (and create a child blueprint for each factory) and have a reference of my Staff and Products array in my manager in side factory Blueprint, calling custom events and functions for assembly lines assignment inside the factory blueprint.