You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of now the map change takes quite long because of loading data.
This is because every enemy instance loads and parses the config files on its own.
So the more enemies the longer it takes to load.
We should load one enemy type only once and any created instance of that type will just copy the memory of the preloaded type. The only adjustments to be made are the position and direction?
The text was updated successfully, but these errors were encountered:
Position and direction are the only differences, as far as I know.
This mechanism needs to be in the EnemyManager, when it's reading the new enemy queue from the Map object.
The way I planned to do it: before loading an enemy file, check to see if we've already loaded this enemy type during this map. If so, create a copy of those values instead of loading the same file(s) again from disk. Starting from a blank cache and doing this process on each map load would be a big improvement. We sort of do something similar for the enemy art/sounds, but those have a single copy in EnemyManager anyway.
If we wanted to get fancier, we could keep base copies of the enemy info in EnemyManager even across map loads. Then after loading all creatures for a new map, dump enemies not used during this map out of the cache.
As of now the map change takes quite long because of loading data.
This is because every enemy instance loads and parses the config files on its own.
So the more enemies the longer it takes to load.
We should load one enemy type only once and any created instance of that type will just copy the memory of the preloaded type. The only adjustments to be made are the position and direction?
The text was updated successfully, but these errors were encountered: