So here’s some footage of a new puzzle game I’ve been working on:
Mainly, I’ve been focusing on programming individual object classes, a lot of which you see in the video. Turrets, mines, wall crusher, laser, magnets that pull magnetic objects towards itself, and barrels that can explode depending on environment.
I purposely put a large number of turrets on a random level to see how the game does performance-wise, and script activity definitely does increment slightly, it goes up around 3-4% utilization.
I’m not saying I have a desire to create super large levels with tons of these game objects, however I feel like optimization may be necessary at one point or another to assure smooth gameplay.
Currently what I’m doing is for every game object, I create a new “class” instance depending on object type. Each class has different implementations such as an :Update()
method, which will be ran every frame or so to update that object depending on its needs. However, I implement tick()
timers to assure an object only runs necessary functions (like raycasting) when it’s necessary.
not every class has an implementation of :Update(), as it’d be stupid to update a Mine every frame as it’s specifically wired to explode upon contact with a player, so I used an initialization event for stuff like that to set up .Touched events, or so fourth.
Not 100% sure how I could optimize what I’m doing, because honestly I think I’ve done a decent job considering how complex these game mechanics are.
I’ve also rendered the entire game client-sided for optimal performance. Definitely not the best option but for the type of game that I’m making, it’s more about player experience.
Any help is appreciated, I can clarify if needed. Thanks for reading