Modding Discussion high-def sprites

Discussion in 'Starbound Modding' started by Conir, Dec 12, 2013.

  1. Conir

    Conir Void-Bound Voyager

    hey, this is simply a question, dont flame me. i have no experience in modding and i really lack any talent (and time) to get into it.

    but what i was wondering is: is it possible to make the sprites a higher resolution? like my avatar image for example. wouldnt this allow for more detail on the chars and environment?

    again, i am not suggesting this to be done - i am just curious :)

    thanks for your time.
     
    Kenode likes this.
  2. Kenode

    Kenode Void-Bound Voyager

    I'd also like if someone could work on this. I can deal with the amount of pixelation on the world/decoration/weapons, but it bugs me to see such huge squares on characters. However, I bet this would be a big job for a single person, not sure if anyone would be willing to do it... but the game has been released less than a month ago. Maybe in the future... :)
     
  3. cardstocks

    cardstocks Tentacle Wrangler

    This will probably be possible later in the game when the inner workings of the animators are revealed. Right now, we've only got the assets and .lua files to work with, really.

    I think if we were able to edit the animation scripts in the game, we could then tell them to look for images that are larger (and thus higher resolutions) but right now they're stuck looking at very low res images.

    I'll still fiddle around with it though and let you know what I find!
     
  4. Kenode

    Kenode Void-Bound Voyager

    Essyx likes this.
  5. Essyx

    Essyx Void-Bound Voyager

    From what I researched, it is going to be very difficult to do. I spent many hours yesterday trying to figure it out! Here are some facts before we get into detail:

    • Sprites of characters are arranged into .png files referred to as a sprite sheet.
    • The sprite sheets are basically grids that the source code references.
    • There are "frames" files that define how large each square of the grid is.
    • For players or avatars, the graphic is made of overlapping grid squares. This includes the hair, clothing, front arm, body, and back arm. All of these are coded to overlap each other at the right spot because the origin and size of all the grid squares are the same.
    • Grid squares are measured in pixels.
    Now, this is where I'm stuck:

    I can double the size of the grid squares which gives me double the resolution of the graphics, but when I go into the game, the image is also double the size and instead of the avatar's feet being aligned on the ground as it should be, they are clipped into the terrain. What this means is that the developers have taken a very small resolution and magnified it on the screen to render the final game. This is done to make a game that is not tiny on the screen, and also to save on the framerate. The more pixels you tell the game engine to render per tick (like a thousandth of a second), the lower the framerate is going to be.

    What does it mean?!

    Well, it means that in order to make a same sized image appear on the screen with double the pixels, then you will have to change the basic way that the game engine magnifies the resolution. If you find a way to do this, please let me know, as my goal was to create a whole new texture pack at x2 the current resolution.

    Hope this helps!
     
  6. Essyx

    Essyx Void-Bound Voyager

    Hey that's my thread! ;)
     
  7. Essyx

    Essyx Void-Bound Voyager

    FYI, here is a pic of what I am talking about. The player avatar is supposed to be standing on the transporter pad.
    [​IMG]
     
  8. Kenode

    Kenode Void-Bound Voyager

    Yeah haha, I tried replying to it, as getting characters with a bit more of resolution is something that perks my interest. I'd really like to see this progress.

    Also, your experiment makes me think, if it was possible to make the engine render sprites at different sizes than default, imagine something like a tech mod making a character increase or decrease their size, or maybe slight height differences on characters (Would require offsetting to compensate the difference though). That'd be quite funny and cool as well.

    Ugh, my post got all mangled earlier when hitting submit
     
    Essyx likes this.
  9. Essyx

    Essyx Void-Bound Voyager

    I assume this is the same method that the developers used to make the boss sprites.
     
  10. Kenode

    Kenode Void-Bound Voyager

    That's where I wanted to get. But for that I guess we would need access to a feature that allows us to tell the game how much we want to scale the character.
    (Again, I don't completely understand the way the Starbound engine works, just referring to experience with previous engines I've worked with.)

    It'd be ideal if we could also make higher res sprites work with additional species mods though, like, selectively telling the engine which species/characters/image files themselves to scale
     
  11. Terraziel

    Terraziel Astral Cartographer

    whilst i don't have the opportunity to test anything at the moment, i suggest investigating two files

    default_actor_movement.config
    and
    default_movement.config

    those seem to contain info pertaining to the collision box of player sprites
     
  12. Conir

    Conir Void-Bound Voyager

    well, if this is true then the solution must be near... since the mini-boss sprites dont clip trough the floor. or am i wrong?

    also, you could try to write bartwe or omni for suggestions - they made the engine afaik
    http://starbounder.org/OmnipotentEntity
    http://starbounder.org/Bartwe
    they are probably able to push you in the right direction.

    i am really sorry i cant contribute more to this, but i would love to see this happen :)
     
    Essyx likes this.
  13. Kenode

    Kenode Void-Bound Voyager

    I've been considering about doing some 3D models of all species in Starbound, give them an anime/toon look, and try to animate them as close as possible as they are in the game whenever they add support for sprites with a higher resolution, it would ease a lot the animation part, in fact, it could even be used to make new species using high-res sprites with all animations done already... Although since it'd have more detail now, it would be nice to have additional options in the customization panel, name it eye colour or whatever. I also need to figure out how the coloring works in the game engine as well.
     
  14. HoaxRumors

    HoaxRumors Phantasmal Quasar

    From some cursory exploration on the subject (as blathered about in my suggestion thread) the miniboss mobs are affected by a scale variable in the .monstertype file ("scale" under "variantParameters") that doesn't seem to have an equivalent for humanoid models. I managed to come to the same end as Essyx during an extended period of no internet last night, but wasn't able to post anything about it until today.

    All the edits Essyx did to the .frames files does is determine the "bounding boxes" for where the renderer looks for each individual frame of the sprite sheet. You could make the sprite sheet ten times larger, and if you multiplied the "size" and "dimensions" in "frameGrid" accordingly, the sprite would then render as ten times larger! But the physical collision of the sprite seems to be entirely determined elsewhere, and digging through every presumably relevant file (both manually and with searches for "scale", "size", and "render") produced nothing of note.

    The game engine appears to render sprites as-is, their relative placement determined by the humanoid.config file and visible size determined entirely by the size of the sprite itself on the sheet, rendering 1:1. The way the engine makes everything bigger is to multiply the size everything renders at, as determined by the "zoom level" in the options menu. From what I saw in another mod, it's possible to set that to 1 and get true pixel-perfect render sizes, but unless you're running at a really low resolution (or on a really big monitor) that'll just make it really hard to see what's going on. (Or maybe it'll make it feel like Risk of Rain. Not sure.)

    Essentially, what I put forth as a suggestion was a simple flag (defaulting to 1) that would tell the render what number by which to divide the render size. For example, f you were using a sprite sheet twice the standard size, you would plug it into the definition "spriteScale" under "frameGrid" as "spriteScale" : 2, and it would then know to render the sprite at half dimensions (because 1 divided by 2 is .5, after all) and it would default at 1.

    That way, rather than having to adjust a dozen values across different files (frames files for the sprite size, humanoid.config for collision, et cetera) a modder would only have to edit one number in the frames files to achieve the result. The engine mechanics don't care about sprite size, as evidenced by how you can have a tiny head and arms on a giant body if you only edit the body.frames files (as I had done) and the way the player still animates and collides as if it were normal sized, so why take the long way around to do what could be done with a single value? But I don't know how much work on the dev side of things that would be.

    Of course, I might be entirely missing something obvious; this is all just from six or so hours of poring over things in between sorting out how to affect NPC clothing (mostly because NPCs don't undress when getting into beds, but player characters do? What the sensemake?). But, there's my two cents on the matter.
     
    Essyx, Kenode and banthesun like this.
  15. Russy

    Russy Pangalactic Porcupine

    [​IMG]
     
    DJYawe, Hrasko and Kenode like this.
  16. banthesun

    banthesun Subatomic Cosmonaut

    I took a bit of a dig and found a "collisionPoly" in default_actor_movement and in the .monstertype files. It sounds like it's the right thing, but I wasn't able to get any results from changing it (except a moment of lag on collisions). It might be worth looking into more.

    Everything else in Hoax's post is spot on from what I can see.
     
  17. sirylcat

    sirylcat Scruffy Nerf-Herder

    I think you should test player.config in the lines that says:

    "techControllerSettings" : {
    "baseMovementParameters" : {
    "standingPoly" : [ ....... ],
    "crouchingPoly" : [ ....... ],
    ......
    }
    },

    the name confusingly says of tech but, I guess it's worth testing.
     
  18. Kenode

    Kenode Void-Bound Voyager

    I might start doing my attempts at editing those files as soon as I get some assets (I also need to research about achieving a non-exceedingly harsh looking cell shader), although I hope these changes in the game files don't break the game look for people who don't have the mods, because it would be mostly ideal for this mod to be client-side.
    It's going to be hard to model species other than the human and maybe apex though, as there's very few to no decent references to follow. I'll check about it when I have some more time.
    Where's that from? I love how it looks!
     
  19. sirylcat

    sirylcat Scruffy Nerf-Herder

    [​IMG]
    I've succeed in making of 2x2 sized sprites working but can't find how to modify the offset of the sprite though......

    BTW the character does not wear clothes because I didn't take extra effort on redrawing clothes sprites too. =X
     
  20. HoaxRumors

    HoaxRumors Phantasmal Quasar

    The only thing I could guess at, in altered collision to work with the larger sprites causing issues, is if servers receive collision data from modded clients to send to other clients. In a case like that, changing the collision rules to apply to these double-sized sprites could potentially cause things to go pear-shaped, because the servers would be receiving data meant for nonstandard player size and sending that to clients trying to parse them as standard.

    Best case scenario under such an assumption would be that to everyone else you'd be floating about one body length above the ground and taking up twice as much space as you should be. Worst case scenario is the receiving client throws a fit (because, let's be real, code does some wacky stuff when n != n) and possibly crashes. But, again, this is all conjecture; without a way to cut up the engine code and see how it works, until someone tests the system we're stuck working in the ethereal realm of "may be" and "should be" and "probably", and reality doesn't always conform to such expectations. It could be that the server just looks to see if you're standing on the ground or moving or whopping something with a hammer and discards all other data.

    Presumably, since what we're trying to do is just make it scale the sprite, it would be an entirely aesthetic effect, similar to how someone playing with modded hairs can play with someone without the same modded hairs, just that the un-modded client would show a bald head (or whatever the vanilla piece in the slot is).
     

Share This Page