How could I develop client-sided Enemies?

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?

A similar method is used in:
https://www.roblox.com/games/3575829988/Star-Wars-Legacy-RP

Any help would be much appreciated.

@RellBad

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.

2 Likes

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

1 Like

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?

1 Like

Been messing around with this -

So, this is just a basic Zombie from ToolBox. But it’s set to spawn Server-Side whereas the Baseplate is loaded on the Client.

As you can see, the first two times the Zombie falls through the Baseplate however on the third respawn it is able to walk on it.

https://i.gyazo.com/cbbb6f19caabf0629aacd0b11ea08d7c.mp4

How could I change this to remove the falling?

is there a baseplate on the server that is transparent and cancollide true?

No, but if that’s what needs doing?

Issue this, I’m using this for Planets - all of which will have different levels of ground etc. :confused:

Idea I’m currently working on:

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.

Thoughts?