Tower Defense | How to start?

Hello! I am making my own tower defense game, but here’s the thing, I am unsure where to start. I have my enemy, and I have the path, waypoints and end point set up.

I am unsure where to begin the coding however, as I want to immediately be on the right track to an optimized game.

Is the module for spawning meant to be in replicated storage? Should it even be the module? How do I do client-based rendering?

UPDATE: Found a reply from someone who was aparently a dev for ‘Toy Defenders’. A part as a model on the server, the actual model on the client.

I have made a tower defense game in the past, and I have a few tips.

On the server, have a part, on the client have the model visually.

Use tweening, or lerping for movement (lerping is more performance heavy, but allows for nice turns between waypoints. (I think))

if your model has a humanoid, set HumanoidStateEvaluateMachine to false. (I think this is mainly for keeping a humanoid up, and deciding physics, but since you will be tweening or lerping, you shouldn’t need this.)

I’m not sure, but when an enemy “dies”, you should save him, and re-use him as another enemy later in the game.

So, use tweening for performance (on the client, I’m guessing?), disable state machines, and clone the enemy or something? Wouldn’t it be simpler to destroy the enemy and clone another?

Additionally, how do I make the clientside rendering to be exact? Is it - when an enemy should spawn fire an event to the client to add a model?

It would be simpler to clone a new enemy, but I’m pretty sure it saves resources of something if you re-use an already used enemy.

Yes, when an enemy spawns, you should fire an event to the client. If you want it to be exact, you would get the player’s ping, multiply it by the speed of the enemy, and teleport the enemy that much farther down the path. (100 ping, speed is 10 studs per second., you would do .1 x 10 = 1, and then move the enemy 1 stud forward on the path, and that should be near exact.)

Suphi has made a great tutorial on tower defense games that are actually optimized (unlike gnome codes!)

Is it Suphi Kaner? If so, I checked out their projectile physics tutorial and I have never felt so enlightened in my life other than the chemistry test I did today.

Genuinely amazing tutorial, holy crap.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.