Minor Optimisations to the Mob, Boss and Item Views Blog
Back to blog
Everyone 18 views

Minor Optimisations to the Mob, Boss and Item Views

An adjustment aimed at reducing unnecessary operations on the entity view side. It provides a minor clean-up, particularly regarding mobs, bosses and items.

In short, the logic is as follows:
As the player moves around the map, the entities around them are added to the view list. With this fix, item entities are no longer unnecessarily attached to mobs or other non-PC entities; instead, they are kept more focused on the player. Additionally, for non-PC entities visible to the player, it prevents the state machine from being triggered unnecessarily if the target is already dead.

What does it achieve?
Cleaner entity view management
Reduction of unnecessary visibility relationships for items
Elimination of unnecessary state machine operations for dead mobs, bosses or other non-PC entities
A slightly cleaner flow in crowded scenes

Of course, this system alone does not deliver a massive performance boost. However, I believe it is a sensible fix in terms of clearing out small details that create unnecessary overhead within the source code.

Those wishing to use it can add it after checking it against their own source structure.

Downloads