Currently working on a Space game in which Players are able to visit Planets; the Planets are loaded as ‘chunks’ upon visiting and are therefore Client-Sided.
I was wondering how could I create an Enemy system that Displays for all Characters within the chunk rather than essentially having it seem as if Players are fighting nothing?
I would create the enemies on the server and have them fully transparent and then when the client loads in a “chunk” they would also load the enemies that are associated with the chunk being loaded in.
Doing this though - Surely the hostile enemies would fall through the maps that aren’t there as they haven’t loaded?
EDIT:
I was thinking perhaps having the Map itself on the Server, then seperated by the Client depending on locations etc; Pretty sure this would effect performance tho.
I think it would be best to have the map on the server but fully transparent - I am like 90% sure if it is fully transparent it doesn’t affect performance - and then when a player gets close enough or meets the conditions to load in a “chunk” it just tweens in the transparency of that section of the map.
If you do it like that then you could create the enemies the same way
Intriguing idea - Except for some parts of the builds Transparency is not necessarily 0 nor 1; Considering this concept, would I need to store the transparency of each Part in a table?
Within the Chunks I’m setting designated ‘SpawnPoints’ for the NPCs to spawn around.
I’m managing this by whenever a new Chunk is rendered; it creates a Table of the positions of the SpawnPoints and passes them through a RemoteEvent that will spawn the NPCs in the area
[ Given the Chunk limit of NPCs hasn’t been met. ]
Following on from this, instead of using Humanoids - I will be moving my NPCs through the use of BodyMovers that should hopefully nullify the falling through the ground issue.