• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

 Suggestion: Texture Page Inheritance (one asset on multiple pages)

S

SayBaconOneMoreTime

Guest
Hello,

It has recently come to my attention that there is no real efficient way to handle texture pages in a top down Hyper Light Drifter-style game. Since the draw order matters so heavily for rendering everything in perspective, it becomes impossible to have any real semblance of sanity in terms of necessary texture swaps if one plans to reuse multiple assets across multiple levels.

For my game, most sprites, excluding things like GUI elements and whatnot, which are obviously easy to optimize in terms of texture pages, are divisible into three types. First, we have backgrounds/major geometry, which are hand-drawn and will only ever appear in one room. Then, we have props/level elements which will appear in multiple rooms (think a tree that appears in multiple different forest rooms). Then, there are player/major character assets that could appear in any room at any time.

At first, my plan was to separate all the player/major character sprites onto one texture page, keep all "themes" for props/level elements to their own pages (one page for stuff that goes in a forest level, another page for stuff that goes in a desert level, etc), and then have one page for each hand-drawn background (has to be split up into multiple parts because, once again, it's a top down isometric game). However, with this method, I'm getting 20-40 texture swaps in one room, and I completely understand why. Since it is drawing things from 3 different texture pages in order of increasing Y value, things from all 3 texture pages are being drawn together with no rhyme or reason.

My solution to the problem? Make parent-child inheritance for texture pages! I know this is already technically a thing, but it is useless for anything other than multi-platform stuff. The idea is, any sprite accessible on a parent texture page is also accessible on all of its children texture pages. With this system, for my game, I would make all my "props" texture pages inherit from the character sheet, and then make all the backgrounds inherit from the appropriate props page. That way, all sprites for any given room are all accessible from one texture page, speeding up performance. I think this would be a great help for people like me trying to develop HLD-esque games to more easily reuse assets from room to room. Questions/feedback/"Yoyo pls" are all welcome responses. Thank you.
 
Top