Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Best Practice? Lots of Icons/Symbols/Bars for players and npcs  (Read 7970 times)

0 Members and 1 Guest are viewing this topic.

Notion

  • Newbie
  • *
  • Posts: 17
    • View Profile
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?

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: Best Practice? Lots of Icons/Symbols/Bars for players and npcs
« Reply #1 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.
Visit my game site (and hopefully help funding it? )
Website | IndieDB

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Best Practice? Lots of Icons/Symbols/Bars for players and npcs
« Reply #2 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?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything