Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(2 edits) (+1)

Very neat! Yes, the music did get blasted, of course:D

Having had some experience with this kind of game myself using object pooling should fix the issue you’re facing with the swarmlings.

Simply have an array of swarmling nodes:

# Pop elements from this array
var swarmling_buffer: Array[Swarmling]    = []
# Into this array when you need a new swarmling, then set properties
var swarmling_instances: Array[Swarmling] = []
var swarmling_scene = preload("res://path_to_swarmling_scene.tscn")

func _ready():
    for i in range(1000):
        var swarmling = swarmling_scene.instantiate() 
        # Or Swarmling.new() if using script-based instances
        add_child(swarmling)
        swarmling.hide()
        swarmling.set_physics_process(false)  # Pausing physics
        swarmling_buffer.append(swarmling)

This approach makes it so the swarmlings don’t have to enter and exit the game tree a lot, which causes lag. It’s better just to pause processing and hide them when not in use. Then when you need a new one you unpause, set properties to be correct (position, internal parameters etc.) and unhide it.

Cheers!

PS: The background is probably also nodes, which probably cause more lag than the swarmlings? I’d make sure to disable as many unnecessary features on those as possible to reduce lag. Perhaps even using a dedicated shadermaterial to draw the sprite could be good. For instance you could relatively simply stack the texture on top of itself and squish it into a trapezoid shape. (might be easier than lining up polar transformations, though you could find code online for that!)

I appreciate your feedback !

I actually did implement object pooling on the swarmlings, though since I didn’t know how many I would need I made sure my system could add more to the buffer on the fly, and while testing I set the buffer to 0 and forgot to set it back, so the first few swarms that spawn are actually spawn, then being pooled for later.

The background is actually just 36 polygons as ‘slices’ which I rotated 10’ each. I did this to save time on the background effect I wanted, but unfortunately I wasted a lot more than I’d like to admit trying to get gimp to squish the repeated texture the way I wanted…