SFML community forums

General => General discussions => Topic started by: Notion on March 23, 2021, 01:19:14 am

Title: Best Practice? Lots of Icons/Symbols/Bars for players and npcs
Post by: Notion on March 23, 2021, 01:19:14 am
Hey everyone,

not sure if it's a help request, it's more like a "what do you think about" kind of thingy, so I hope the general category fits.

I try to develop for lower end machines and I use C#. Hate me, hunt me, but I got my reasons :) Most of my game ideas include about 5-15 small icons and bars and such for buffs, resistances etc of RPG like creatures or player characters. Given 10-30 units on screen at once that's kind of too many render calls and its a mess to manage all the offsets.

Many games do similar things though - how? What does best practice look like in those cases? Is each unit a vertexarray with the upper quads of the array being reserved for icons? Categorizing different vertexarray quads for different uses seems to be tedious as well. Is it just me being lazy and more of the RenPy/RPGMaker-Guy?
Title: Re: Best Practice? Lots of Icons/Symbols/Bars for players and npcs
Post by: Stauricus on March 23, 2021, 02:15:25 am
a vertexarray can only have one texture at a time. so, probably fits for your bars and such (if they will look the same), but for characters... just make a texture and sprite for each one. 30 is still an acceptable low number for draw calls, to be honest.
Title: Re: Best Practice? Lots of Icons/Symbols/Bars for players and npcs
Post by: Nexus on March 23, 2021, 11:44:20 am
A few hundred draw calls should be OK, did you encounter any problems? I wouldn't make code more complicated than necessary.

Otherwise, can you tell us a bit more about how the effects/icons are drawn? Are they static? Are they part of a shared texture? Animated?