What are good approaches or patterns to structure a dynamic spawn system ?

It should be able to "create" entities by their type-ID based on a set of rules which are able to change dynamic during runtime.

For example... A spawner which spawns special "summer mobs" if the generated entity lays in a certain area... Or to have the chance to spawn all available entities during day, but during night an other modifier kicks and which only spawns "black super mobs"...

My current spawner is based on a pipeline, which looks like this...

Pipeline<SpawnerData, List<Entity>> spawnerAlgorithm = new PositionSpawner().pipe(new EntitySpawner());

Its a common java pipeline pattern, it works... But its not dynamic due to the input/ouput of each step...

What architecture would you choose for a spawner which is able to extend its possibilities during runtime ? Any tipps and tricks ?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.