Skip to main content

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

The progress bar is already not a part of the structure sprite, and the game does draw the rectangle above the structure. I don't know if calculating and rendering vertices is faster in this engine, maybe it is, but it's fine now. The rectangle function that I made uses a white pixel on the texture page that is already loaded, and stretches and recolours it to make a rectangle for things like the progress bar, so there are no swaps (basically works the same as the built in rectangle function, but without swapping pages). Drawing more sprites doesn't impact performance that much, so it's fine.

If I should optimize, it would be other parts of the code at this point. The crafters for instance start at the top of an array containing the recipes in the form of arrays of items, and check every one of those arrays against their inventory until they find an array whose items the inventory contains (and then they start the crafting countdown). This is really inefficient, and is probably having a much larger performance impact than the same structure drawing an additional sprite as a progress bar.

Conveyors do already use a shader to swap colours.

I hope I'm understanding your points properly, and not speaking past you. If you want you can add me on discord, it could be easier to talk there.

(1 edit) (+1)

Oh, that would be nice if you could add me to discord. I will send you a request when I can, I probably don't understand the language of your engine, but having someone to talk about game dev and engine stuff would be really nice for once and maybe I can help you with some stuff. 


The thing I was getting at is that texture swaps are apparently really expensive. I was just naming examples to reduce them. And conveyor belts with 2 sprites are much more expensive as you build a lot more of them and are always active than just a building with 6 sprites that are only active when you place items in them.

I've just sended you the friend request. It's under a different name because I would've never expected to get someone to talk with over this account.