Option for Modders: Sprite scale designation

Discussion in 'Other' started by HoaxRumors, Dec 17, 2013.

?

Sprite size designation function for the purpose of increased character resolution, yes or no?

  1. Heck yeah!

    92 vote(s)
    98.9%
  2. Heck no!

    1 vote(s)
    1.1%
  1. HoaxRumors

    HoaxRumors Phantasmal Quasar

    The Explanation:
    From what I've been able to figure out via the time-tested technique of "look for something that sounds relevant, change something, see what happens", sprites are rendered to a sort of as-is degree. That is to say, it's possible to double the sprite size and redirect the references in the .frames appropriately by doubling the "size" values (to what extent the "dimensions" values affect things, I haven't yet sorted out, as they don't seem to do anything), but the result is that the game renders your sprite at double size.

    Remembering that there are "miniboss" monsters that are much larger and deadlier and seem to have all their collision relatively intact, I even tried to find if there was a simple "scale" function, perhaps to fudge the sprite size with that, and then then alter the "collisionPoly" values in default_actor_movement.config to compensate. No dice: not a single sign of a scale option anywhere. (I haven't even touched collisionPoly yet to see if it would do what I assumed.)

    The Proposal:
    What I would like to propose is a simple value, spriteScale, which would tell the game what size to render a given sprite set at, right in with the frameGrid class in the .frames files. 1, obviously, would be default; 2 would be double-size sprite sheets (thus rendering at half scale), maxing out at, say, 6 (because over a certain point, it's like 4k televisions: the increase in detail is so minimal that its not worth the trouble.) Being that pixels are a fixed size, you wouldn't even have to give it a way to render larger than the given size: if someone wants to lower a sprite's resolution, it's entirely possible to do so now, whereas raising resolution is hampered by engine constraints.

    This would allow increased sprite resolution and detail for those who want it, as well as make it possible to change things piecemeal: if you've only got higher resolution character sprites, you won't have the clothes and armor rendering funny (unless of course you've altered the overall sprite silhouette, but that delves into unnecessary detail for the matter at hand). As to whether it would put extra strain on the engine, I can't say. I would assume little to none considering it's such a minimal thing (the size of the sprite doesn't in any way inform non-visual game functions).

    I also have a suggestion/request for the ability to crawl while crouched (partly due to how many times I've been wedged into inhospitable geometry by hostiles, and partly because the chest-high wall I made to protect myself from gunfire in an Avian temple was entirely useless while I was getting back up to it), but that doesn't really have any bearing on this, and will be logged elsewhere.

    The Short Version:
    Sprite render scale designation function in .frames files (and accompanying game engine element) pretty please, so we can make our characters as pretty as we feel like without being limited to the existing resolution.
     
    Atheon and Aeon like this.
  2. HoaxRumors

    HoaxRumors Phantasmal Quasar

    Little topic bump. I myself would love this to happen, and there's at least a few others that are interested in making higher resolution sprites. I also had an idea of an alternative, instead of implementing a function designation, a simpler method for the modders: have the engine look at the sprite sheet dimensions at game launch, and run a quick division problem. Say sprite sheets are 10x10 by default, and the game reads the sprite sheets as being 20x20, it would plug that in as 10 / 20 | 10 / 20. The result, obviously, would be 0.5 for both, at which point that value would get plugged into the spriteScale function (a simple 1*n equation) that the renderer looks up. If the X and Y values don't match, it will spit out a value of 1, rendering the sprite at standard size (because 1*n where n = 1 results in 1). If they do match, the renderer will take the result of 1*n and scale sprites by that value (ergo the example 20x20 sprites would render at half size, effectively producing double resolution.)

    A little more work on the developers' behalf, obviously, but it would make things easier on the modder's end of things.
     
  3. Force2Reckon

    Force2Reckon Phantasmal Quasar

    I don't do much graphically as a "modder" don't know if I can call myself that since I've only done two small mods to date, but as a, sort of, coder I'm surprised you didn't see one in there, I sorta assumed that there would be one cause I figured that's how the minibosses worked the same as you, sine the particles were all much bigger and such I figured it just scaled everything up. Maybe check and see if you can find the minibosses and see if there's something magical in their files that's not in others? If there isn't I concur this would be useful... it would also mean I can make things a bit bigger and scale them down so that the two bits of art I made aren't just solid blocks of color. I'm a terrible artist but if I could scale stuff down I could at least put some detail into it big than let the scaler figure it out for me.
     
  4. HoaxRumors

    HoaxRumors Phantasmal Quasar

    I've already been looking into that, actually, though the grand majority of the discussion has happened over in this thread.

    To summarize what I've found (so you, or anyone else, doesn't have to wade through my inability to explain things in ten words or less as quite clearly displayed in that thread), there is a scale option that seems to be implemented for monsters, but not for humanoids. Monsters being composites of a collection of sprite chunks, they seem to have a different way of handling them in the engine, and actually have a "scale" designation in the code which seems to handle their collision and sprite size simultaneously. (Either that, or the collision is handled in a way I haven't sorted out, because the values I thought were collision don't apparently do anything if changed on humanoids.) Even the regular monsters have it, which is why you can get little creatures with the same parts as big creatures, but in the Minibosses it's set to a higher value.

    I eventually got to the point where I was just plugging "scale" : 2, and "size" : 2, under every possible header in everything that had to do with humanoids in the game. Being the way it is, the game code doesn't do anything with something it has no value for; what I was effectively doing was setting a value that was not being called anywhere for any purpose (so if there was something in the code looking for a scale value, or a size value for that matter, it would've produced a result). If there was a call anywhere in the humanoid renderer for a "scale" value, unless it's set to look somewhere asinine like in a world render file (which I highly doubt) the likelihood is that it's simply not there because it wasn't considered necessary. I know I probably wouldn't think about it while building a game's render engine, my mind would be on more pressing matters like making sure it doesn't put legs where the head goes and ensuring the collision box and the sprite are relatively matched.

    From a direct logic standpoint, if certain sprites are going to be drawn at scale, there's no real reason to have a handler for alternate sizes of those sprites in their render code unless it's something that handles more than just those sprites. The base game expects all humanoids to be roughly the same size (to allow for homogeneous armor/clothing sprites), so there's no reason to have a way to tell it otherwise, unless of course higher resolution sprites may be considered for use, thus the request to have such a function added. :D

    As for me, I can't art worth beans, but I at least know how to edit pixels to some degree. (As evidenced by the Podotheca mod I made over the past couple of days.) It's honestly one of the reasons I wanted to find a way to render sprites at something other than 1:1 pixels, because it would make it far easier to detail the scales and talons with that added degree of sprite resolution.
     
  5. Force2Reckon

    Force2Reckon Phantasmal Quasar

    and this'n xD but yeah, that's nice to know thanks!
     
  6. Egzekiel

    Egzekiel Big Damn Hero

    Since like 3 days, i'm searching for how to make items sprite (like a sword) bigger or smaller, can someone explain me how to do this ?
     
  7. HoaxRumors

    HoaxRumors Phantasmal Quasar

    Long story short: Can't, yet, except for directly modifying the sprite (and if you're at 1 pixel = 1 pixel, you can't make it any smaller.)
     
  8. Egzekiel

    Egzekiel Big Damn Hero

    If i modify directly the .png where the item is and make it bigger, the item will be bigger or it won't do anything (like 1 pixel is like 4 times bigger= 16 pixel) ?
     
  9. HoaxRumors

    HoaxRumors Phantasmal Quasar

    Yes, you can make the sprites as big as you want. You just can't shrink them below 1:1 pixel ratio. For instance, if you take a sword sprite and double it in width and height, it should appear in game at 4 times original size. The game renders sprites at their exact size.
     
  10. Egzekiel

    Egzekiel Big Damn Hero

    Ok so if you know the dragonballSB mod, you see the weak punch ? I made it like 4 times bigger, but the only problem is damagePoly, i don't really understand the coordinates.
     
  11. HoaxRumors

    HoaxRumors Phantasmal Quasar

    That's something I'm a little fuzzy on, but if I'm thinking right, the coordinates are the rough "size" of the projectile. If you made the projectile 4 times bigger, you could probably double the coordinates and get the results you're looking for... this is just a guess, though, I've only messed with sprites, not projectiles.
     
  12. Count_Sombra

    Count_Sombra Scruffy Nerf-Herder

    I really hope this happens as it would allow for so much more, even just multiplying the resolution of a sprite by 2 would let me add so much more detail while still keeping the "retro" feel...
     
  13. Agent Abbott

    Agent Abbott Subatomic Cosmonaut

    Having an option to set a sprite's scale would be fantastic. I have some really high quality sprites I use for my guns, but they're all 3x bigger than the player, and resizing them with Paint.net just makes them blurry.
     

Share This Page