[ugold227i] Making a sprite sheet out of fonts, maybe?

Discussions about everything else
Post Reply
User avatar
ANUBITEK
Adept
Posts: 261
Joined: Sun Dec 28, 2014 1:10 am
Location: Anubitek

[ugold227i] Making a sprite sheet out of fonts, maybe?

Post by ANUBITEK »

So I have more important things to pound out right now, but I just thought of a way to store my sprites for my animations better: make fonts. So let's say I use 0-9 for animations, each number would return a sprite frame of my character instead of a number as ASCII text. I haven't tested this at all yet, just a thought I had yesterday. But this would reduce my overall textures loaded from 22 down to 4 per rotation angle, 8 rotation angles, so from 176 textures down to 32 font textures.

I got this idea from seeing damage text being spawned and bouncing off of pawns in UnrealSP2D. An actor spawned, was assigned a string, then launched in a small arc off of the targetted actor with falling physics, so that means that text can be drawn for an actor's draw type and either texture or sprite. From there, just use Higor's anim manager and an array of sprite references ( f= font(texturename), frame1= f.0?)

For now I have to rewrite optimize previous code.
<<| http://uncodex.ut-files.com/ |>>

Code reference for UGold, UT99, Unreal2, UT2k3, UT3
Additional Beyond Unreal Wiki Links
wiki.beyondunreal.com/Legacy:Console_Bar
wiki.beyondunreal.com/Exec_commands#Load
wiki.beyondunreal.com/Legacy:Exec_Directive#Loading_Other_Packages
wiki.beyondunreal.com/Legacy:Config_Vars_And_.Ini_Files
wiki.beyondunreal.com/Legacy:INT_File
User avatar
papercoffee
Godlike
Posts: 10443
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: [ugold227i] Making a sprite sheet out of fonts, maybe?

Post by papercoffee »

You mean sprite-sheets? I thought that's how you've done it in the first place.
User avatar
ANUBITEK
Adept
Posts: 261
Joined: Sun Dec 28, 2014 1:10 am
Location: Anubitek

Re: [ugold227i] Making a sprite sheet out of fonts, maybe?

Post by ANUBITEK »

No, what I have now is an .INT-parsing system that searches for the owner of the actor that will display the animated texture (Pawn is the owner of SpriteActor). If the actor's name is found in an .INT, the individual frames of the animation are stored in an array, so it is like:
object=name=RPG_Puppet[...]description=dir=8

anim[0].walk[0] = sprite_Puppet.walk0_0 -> anim[0].walk[7] = sprite_Puppet.walk0_7

This is my array of sprite frames for walking forward. The idea now is something like anim[0].walk[0] = 0 -> anim[0].walk[7] = 7, then converting that number into a name or string and doing some sort of setting of text while appending this number to a font name. Let's say the font is called 'walk0', so appened '_'+spriteframenumber or something like that. I haven't written any code yet, just an idea. The idea is to use a texture atlas instead of multiple textures.
<<| http://uncodex.ut-files.com/ |>>

Code reference for UGold, UT99, Unreal2, UT2k3, UT3
Additional Beyond Unreal Wiki Links
wiki.beyondunreal.com/Legacy:Console_Bar
wiki.beyondunreal.com/Exec_commands#Load
wiki.beyondunreal.com/Legacy:Exec_Directive#Loading_Other_Packages
wiki.beyondunreal.com/Legacy:Config_Vars_And_.Ini_Files
wiki.beyondunreal.com/Legacy:INT_File
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: [ugold227i] Making a sprite sheet out of fonts, maybe?

Post by Feralidragon »

In UT99 at least, you cannot draw text in a an actor, unless the actor is set with a scripted texture, since it works almost like a canvas, therefore in such a case you don't even need to make it into a font, you can use a scripted texture to render it like you want, including rendering only a specific part of a bigger texture.
The only downside of this is that scripted textures are global, in the sense that if you spawn 2 actors sharing the same scripted texture, what you draw in one will also appear in the other, given that they both share the same texture reference, so you would need to create multiple scripted textures and manage those, even if you used a font for this.

Other than that, given that this is such an Unreal-centric question, potentially using their specific features, this is probably a better question to make at OldUnreal instead.

But what problem exactly are you trying to solve by using a single texture instead of multiple (I can imagine why, but I didn't understand your own specific reasoning very well thus far, which could help in contextualizing what you really want).
User avatar
papercoffee
Godlike
Posts: 10443
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: [ugold227i] Making a sprite sheet out of fonts, maybe?

Post by papercoffee »

Feralidragon wrote: But what problem exactly are you trying to solve by using a single texture instead of multiple (I can imagine why, but I didn't understand your own specific reasoning very well thus far, which could help in contextualizing what you really want).
As far as I have understood, LannFyre wants to reduce the amount of textures used for each character (pawn).
Post Reply