Hey, I’m serious about one thing that appears fairly daunting proper now, wished to get your ideas.
In my soccer sport, I load a single spritesheet for every crew at first of a sport (one wears white jerseys, the opposite wears coloration jerseys). In consequence, each participant on the sphere has the identical jersey quantity. The mod creators and I nonetheless have the psd information which use numerous layers for enhancing, and we are able to take away the jersey numbers and put these in separate information (a separate spritesheet for every presumably quantity, 0-99).
We’ve been batting across the thought of utilizing actual numbers on jerseys. Right here’s my preliminary thought on how, and I’m undecided it’s possible for efficiency and reminiscence.
• we modify the sprite sheets not embody jersey numbers
• the mod guys create 100 sprite sheets of jersey numbers (0-99) matching each participant body, ideally with two colours that I can hopefully swap on the fly (one for the jersey quantity and one for the define). These are in all probability black (define) and white (quantity), and I’d swap the colours on the fly.
• earlier than animating a play, I load 11 sprite sheets for the offense and 11 for the protection, based mostly on who’s on the sphere.
• for every body, for each participant, I load his present picture from his crew’s sprite sheet and likewise load the corresponding jersey quantity sprite from the sprite sheet. I then coloration the quantity and description of that jersey quantity sprite based mostly on his crew and lay that sprite on high of the participant sprite. So, for instance, I would coloration the quantity navy blue and the define black or white.
I’m afraid this won’t be possible due to reminiscence and maybe due to efficiency, and possibly there’s a greater means to do that?
My query is, will this kill reminiscence, since I’m loading 22 spritesheets into reminiscence. Since I set the GL context to 24 bits at first, my concern is that each spritesheet could load as 24 bits. Properly, now that I give it some thought, I suppose I do want to permit that jersey quantity to be a minimum of 8 bits, possibly 16.
My spritesheets are fairly massive, with every sheet 3840×2640 in measurement. That’s 10MB every (for one-bit) earlier than I even contemplate the depth.
Additionally, would I exploit
SpriteFrameCache::getInstance()->addSpriteFramesWithFile();
for all 22 jersey numbers?
I load all 22 jersey numbers, as a result of the groups will differ relying on who’s on offense, somewhat this can be a punt, whether or not some subs are within the sport, and many others.
Now, I would be capable of scale these pictures right down to possibly 60% if that’ll assist.
Any concepts on this?
thanks!