Stretching actors.

WOLFENSTEINWOLFENSTEIN Member, PRO Posts: 64

Hi again! I'm looking for technical advice.

So, well all know actors should be saved to the power of two, or be rounded up to the next power of two.
(2x2
4x4
8x8
16x16
32x32
64x64
128x128
256x256) so on and so fourth.

My question is, if I have a peice of artwork saved as 64x64 and I stretch it in the scene to something crazy like 64x3000, will this work? Or will that actor round up to the nearest power of two after 3000? Would it be better to have three actors one after the other at 1024 each?

I had another question but I'll be damned if I remember, thank you for reading!

Comments

  • Nate_SNate_S Nate - Pixel Artist - Developer - Graphics Designer Member Posts: 86

    Can you please elaborate on what your asking? It may just be me, but i'm a bit confused as to what you want to know.

    **Nate - Pixel Artist - Developer - Graphics Designer **

  • SocksSocks London, UK.Member Posts: 12,822
    edited June 2015

    @WOLFENSTEIN said:
    Hi again! I'm looking for technical advice.

    So, well all know actors should be saved to the power of two, or be rounded up to the next power of two.
    (2x2
    4x4
    8x8
    16x16
    32x32
    64x64
    128x128
    256x256) so on and so fourth.

    I'd throw in a few caveats here . . .

    1) The numbers you have are square, but the powers-of-2 (Po2) rule works independently for the X and Y dimensions, so an image asset that is 256 x 64 pixels is as memory optimal as a 128 x 128 pixel image. That is to say, when you round up to the next Po2 value you don't have to increase both dimensions if you don't need to.

    2) The Po2 rule is only a recommendation, you can often ignore it, for example if you had a 400 x 400 pixel actor it probably wouldn't be desirable (aesthetically) to shrink it to 256 x 256 pixels, and enlarging it to 512 x 512 pixels wouldn't offer you any advantages memory wise, so in a case like this you'd probably be better off just using your 400 x 400 pixel image (assuming that's the size you actually wanted) - using a non-powers-of-2 sized actor doesn't cause any technical issues other than a less than optimal use of memory, so in a game with 1,200 actors this might be something worth bearing in mind, but in a game with just a handful of actors it's not going to make a noticeable difference in the majority of scenarios.

    3) The Po2 recommendation will become irrelevant from GameSalad version 14.1 onwards, due to the way the new rendering system handles images.

    @WOLFENSTEIN said:
    My question is, if I have a peice of artwork saved as 64x64 and I stretch it in the scene to something crazy like 64x3000, will this work?

    It's not clear what 'work' means in this context ? Do you mean will GameSalad allow you to stretch a 64 x 64 pixel image (applied to a 64 x 64 pixel actor) to 64 x 3000 pixels, if that's the question, then the answer is yes, you can stretch an actor to whatever size you want.

    @WOLFENSTEIN said:
    Or will that actor round up to the nearest power of two after 3000?

    GameSalad doesn't round actor sizes up or round them down or change their dimensions in any way whatsoever, if you make an actor 64 x 3000 pixels, it will be 64 x 3000 pixels.

    The next Po2 value up from 3000 is 4096, is the idea that if you drag an actor out to 3000 pixels wide and then release the mouse button it would jump to 4096 pixels wide !? That would be weird, very weird ! :smile:

    An actor's size has no bearing on an image's size, your 64 x 64 pixel image, applied to a 64 x 3000 pixel actor is still a 64 x 64 pixel image - there would be no reason for GameSalad to want to (presumably automatically) change that to a 64 x 4096 pixel actor with a 64 x 64 pixel image !!

    Have you ever seen this happen in practice, an actor's size changing from what you had set it to ?

    @WOLFENSTEIN said:
    Would it be better to have three actors one after the other at 1024 each?

    It's not clear what 'better' means in this context.

    @WOLFENSTEIN said:
    I had another question but I'll be damned if I remember, thank you for reading!

    Was the question 'how did the chicken crossy road' ?

  • WOLFENSTEINWOLFENSTEIN Member, PRO Posts: 64

    Yeah, I get that it can be 256x64 if I was so inclined, I guess I should have been more specific, what my question was, does this rule apply to actors or just imported artwork

    I'm creating a platformer, and I'm looking for the best way to have the ground running along the bottom of the screen. Would it be best to have four actors all side by side at 1024x64. Or can I have one actor at 5000x64, (the artwork for it will be 64x64 but tiles so it repeats).

    will this make a difference? Will one freakishly large actor mess with my game? Will this cause any bugs and errors? Or is it as cool as mint toothpaste.

  • ArmellineArmelline Member, PRO Posts: 5,357

    The power of two rule is massively over-pitched. Unless your game is super-resource heavy, it just isn't going to matter enough to dictate design decisions. This is true for most of the recommendations that bandied around here, really. Only in big games do you need to start pushing all the little optimisations.

    I'm pretty sure @Toyman recently said the new rendering engine negates this recommendation anyway.

  • SocksSocks London, UK.Member Posts: 12,822

    @Armelline said:
    The power of two rule is massively over-pitched.

    +100

    Actually that really should be +128.

  • SocksSocks London, UK.Member Posts: 12,822
    edited June 2015

    @WOLFENSTEIN said:
    Yeah, I get that it can be 256x64 if I was so inclined, I guess I should have been more specific, what my question was, does this rule apply to actors or just imported artwork

    Just to image assets.

    @WOLFENSTEIN said:
    I'm creating a platformer, and I'm looking for the best way to have the ground running along the bottom of the screen. Would it be best to have four actors all side by side at 1024x64. Or can I have one actor at 5000x64, (the artwork for it will be 64x64 but tiles so it repeats).

    That's really up to you, whatever works best in your particular project, both ways only use a single 64x64 image asset.

  • WOLFENSTEINWOLFENSTEIN Member, PRO Posts: 64

    Cheers socks plane and simple. I'm building quite a big game so I want to try to reduce file size as much as I can.

  • SocksSocks London, UK.Member Posts: 12,822

    @WOLFENSTEIN said:
    Cheers socks plane and simple. I'm building quite a big game so I want to try to reduce file size as much as I can.

    If it's a big game (read: a game that you won't have finished in the next few weeks) then you might be better off abandoning to whole Powers-of-2 thing and start to think in 64 x 64 pixel tiles.

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,161

    FYI the idea of the power of twos thing is mostly about RAM and GPU memory. Make your image the size they need to be. When it matters most is near the borders. Like if you have an image with a dimension of 1040, then it's gonna take way more memory than if you had one with a dimension of 1024, so scale it down.

    My rule of thumb is if it's not the main player actor and the larger dimension is within 25% of the next lower power of 2, scale down. And while the general idea is to have 3x images on super high-res devices, most of those devices have small enough screens that you can usually get away with 2.5x or 2x if it gets you to that power of 2.

    Basically, don't make your images insanely big (like over 3x bigger than the actor) and you should be good.

Sign In or Register to comment.