Rotating Pixel Graphics

Discussion in 'Game Design, Development And Publishing' started by Oxyloged, Oct 8, 2018.

  1. Oxyloged

    Oxyloged Member

    Joined:
    Apr 30, 2018
    Posts:
    2
    Hi,

    I'm fairly new to GM:S and starting work on my first project. It's going to be a top down shooter/rpg hybrid, I'm currently designing some placeholder sprites so I can get started properly. Now the player's sprite is going to be using a four directional sprite that will change based on where the mouse is pointed, but the weapons are going to be a single sprite that pivot on the spot to point at where the cursor is, they will have a full 360 degree range of movement and there won't be any art for different directions. I'm pretty bad with words so I've uploaded some images to show what I mean.

    The top sprite was rotated at it's original size (And then blown up so you can see it better) and the bottom sprite was blown up before being rotated. The bottom image is the effect I'm looking for, even if it doesn't line up with the rest of the pixelated sprites.


    low res rotation (1).png
    rotated.png

    Now I know i can achieve this easily by making all my graphics 128x128 but I'm wondering if there's anyway I can achieve this effect while keeping all my graphics at 32x32, keeping in mind that the game will be zoomed in most of the time so there will certainly be enough pixels on screen.

    Thanks for any help you guys can give me.
     
  2. RangerX

    RangerX Member

    Joined:
    Jun 20, 2016
    Posts:
    2,587
    Keep it logic my friend. There's one and only reason why the second gun stripe is smooth. Its only because the resolution is higher. That's all there is to it.
    So you have your answer already, can't do it 32x32 because you need MUCH more pixel to draw the gun smooth.
     
  3. NeoShade

    NeoShade Member

    Joined:
    Jun 21, 2016
    Posts:
    166
    @RangerX is right, there's no way to rotate a low-res sprite and have it look clean like the effect you're going for.
    If you only want the game to look low-res though and don't mind doing something that wouldn't have technically been possible at lower resolutions, you could scale your graphics up first and then rotate the gun like you've done above to achieve the smooth look. This would of course result in much larger graphics across the board and therefore larger file sizes and reduced performance.
     
  4. sylvain_l

    sylvain_l Member

    Joined:
    Sep 18, 2016
    Posts:
    705
    not automatically,
    @Oxyloged you just handle the rotation programmaticaly, not in a spritesheet. Just use a high res application surface; use your 32px sprite; and apply a *4 scale ratio to all of them. File size would be the same. RAM too. Only the VRAM and a bit of more GPU power would be required. But nothing that can't be handled easly by modern hardware.
     
  5. JackTurbo

    JackTurbo Member

    Joined:
    Oct 19, 2016
    Posts:
    821
    Could always draw it to the gui layer, would be a bit of a pain.

    Personally I'd reccomend against it. It'll look pretty awful imho. Approach number one will look more natural in game I think. Take a look at HLD, they approached this in a similar manner to no.1 and it looked fine
     
    sitebender likes this.
  6. sitebender

    sitebender Member

    Joined:
    Sep 13, 2016
    Posts:
    780
    32x32 seemed fine to me. No one even notices:

    [​IMG]
     
    Toque likes this.
  7. Oxyloged

    Oxyloged Member

    Joined:
    Apr 30, 2018
    Posts:
    2
    Ahh okay. I'm still trying to wrap my head around surfaces. I've been looking into how the application surface works a bit more after reading your response. I think I get it now. The way I'm thinking about it is I can place everything in the room normally and then adjust the scale and position of my images by 4 times (or whatever the current zoom level of the game is, I intend the player to be able to zoom in and out with the mouse wheel). Then just make sure the application surface, or whatever other surface I find myself drawing to, is the same size as the window right?

    Does the application surface need to be resized manually or does it automatically match the size of my window? I've seen some conflicting reports from people online.

    And thanks for all the help from everyone.
     
  8. TrunX

    TrunX Member

    Joined:
    Jun 30, 2016
    Posts:
    142
    As far as I know GM is doing automatically the highres rotation if you scale your game up with the port on screen settings.
    (Which I never understood btw as it's not what you normally want in a scaled up game)
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice