Tileset optimization and interacting

I apologize if I explain this poorly or missed a previous post, I have a brain injury so i can miss things easy, but searching has not revealed any similar post. I’m having a tileset dilemma, ive thought of some fixes but I dont know about which one will be better for optimization.

I need some tiles to be interactive (IE the door vs a wall) the few ideas for tackling this i had were:

  • If possible, use 1 tileset and mark certain tiles to be interactive (i dont know if this is possible or how to go about this)

  • Layer tilesets and have the interactive tileset on top (although this doesn’t help with the problem that id need tiles to do different things [computer shows dialog, shelf spawns item, door changes scene])

  • Keep all interactive items as separate sprites and just use tileset for background

  • Use 1 tileset and place invisible sprites where I want them to be (in front of door) and use interactions with those to trigger responses

Ive used the last two and they work, but i worry about how many sprites i would need to use throughout the game, and I am hoping to make a fairly large game so im really thinking about optimization from the beginning. Is there one of these options that are less of a strain on resources? I dont want to start building my game with poor choices and have to go back and optimize later. Is there an option i didn’t think of?

Many thanks :slight_smile:

hello!

could you provide an image of what it looks like? how many tiles are un-interactable vs interactable?

how big are each sections in your game? if each “levels” is one screen wide then there should be no problem.

also useful info: i don’t think that we can do custom shaders using GPU. this means that most custom visuals effects are simply objects (sprites) and must be handled by the CPU. a final polished look should mostly come from the beauty of the assets themselves IMO.

Can you explain what difference it would make if there are 100 tiles in total
And 10 of them are interactable while 90 are not
VS
40 being interactable and 60 are not
?

Where did you get information that we can’t have custom shaders?
Even better question
I did use ctrl F (after reading op message 3 times line by line just to be sure) and i cannot find word shader anywhere else than in your message
Nobody mentioned it other than you

hello! im not a gdevelop pro. i can absolutely make mistakes.

my idea with interactable tiles is that if there are very few of them, he could have most of his background be a tilemap like he himself proposed. but if most of them are, it would make sense to make all of these tiles single objects. (especially if the game would be procedural).

overall, we have not enough info to say whats the most optimised for his game IMO.

can we make custom shaders using the GPU? please enlighten me. i’m interested, really. (you can also dm me if you think that it is away from the post’s suject) (also… layer effect, although uses GPU, are not custom shaders)

and btw, my info about shaders was just a side note. and i think that shaders are optimization related. (the OP what concerned about optimization)

Are you pro or not does not matter here
What matters is either you tell stuff to sound smart while you know nothing
Or you tested something and are sure about it which still leaves room for mistakes and you just made one
I just wanted to know which of the two you are

Issue is not with how many objects someone have but what and when someone is doing to them

Imagine solitaire game
Do you need to spam each frame checking if cards in hand match all other cards on table?
Or you just need to check if they match card in position on which you want to drop them?
And then do you need to spam it each frame
Or only at moment when player press a button to drop cards?

Correct answer will let you have 100 000 cards and not lag your game
Bad answer will make your game lag even with 500 cards

Nothing stopping tilemap from having tiles be detected per tile
So if you have door tile you could 100% interact with it even if its part of one tilemap and around are deco tiles like walls furniture or whatever else and/or another intractive tiles

I think his game is not the thing which you don’t have enough info

I got them both form just asking claude and chat gpt to create heat and snow effects purely with JS which would work in gdevelop

Not a problem to ask them to make them work in some area or on some object instead of whole screen

I just add js block and paste whatever BS they threw at me and results are in link above

And if we are talking about actual post processing shaders
I asked claude for xBrz shader
I needed to go to extension dependencies and include resource JS file from my assets folder and then increase resolution for it to even work
And i decided its too much effort to be worth it
BUT 100% achieveable

Still i have no idea how shaders would solve anything here
Most likely neither do you

whoops my bad! i mistook tile maps with tiled sprite. i did experiment with tiled sprite but not tilemaps.

as for shaders, i did searched for a way to do custom shaders but did not find something that satisfied me.

anyway. thats my last comment on this topic because i don’t want to clog this topic.

You can inject GLSL shader code into pixi.js using javascript.

Sorry for the delay in responding!

My game is based on rpg maker games so theres a bunch of smallish rooms (approx screensize) done with 16x16 and 32x32 pixel sprites. In the demo there will be 10-12 scenes to explore. In the full game im hoping to have 32-34 scenes, neither including menus.

Im hoping to have:

Collectables (health packs, lore peices, weapons, keys etc)

About 5 main characters (only 1 playable tho)

Different minigames related to the computer/sci-fi sprites in the game

And several types of enemies

Im still working on the art for it so there isn’t much to show beyond the basic walls and floor, working on the interactive sprites is what made me question the best way to do it.

Rn I suspect i will use a tileset for the base, and use sprites for the interactive elements. Idk whether reducing an items transparency effects performance or not (i think hiding it helps but means it cant be used for interaction triggers until its unhidden [but I could be way off base] so I think I would just have to set transparency to 0) but ill play around with animated sprites vs plain sprites vs invisible sprites.

I also dont know if having an 8 pixel sprite scaled to 32 pixels is any different performance wise that just starting with a 32 pixel; if it is easier then I should use more invisible triggers, if not, just sprites will probably be the same anyway.

Thank you guys for taking the time to try and help. I hope i included enough and if i figure something out ill add it incase someone else is wondering! I really appreciate it :]

Tilemap is way to go
Because there is one object
And you can swap tiles as you please
More sense would be to have two tilemaps actually

There is condition for checking tile at position

So yo could check if tile in front of player = something
When player try to interact with it

Animatiing tiles would be just changing tile ID at some positions with TimeDelta()

But maybe just for that having sprite objects would make more sense

Tilemap saves A LOT of performance cause its just one object so most of the math is done for just one object and not multiple tiles for each object

Think like this determine color of 100 balls in your room which are small

Or have there one huge ball and determine its color
That is exactly the difference here
Or if you actually like numbers then
I was making autotile out of sprite objects
And i got fps lag at around 2k sprites in game
With one tilemap object
When checking after how many tiles my game would start to lag
I was bored after placing over 8m tiles and i just decided that is way more than i will ever gonna need and with 8m and solid 60fps i don’t need to check if it can handle more