Duck Game pixel scaling

Discussion in 'Programming' started by GlitchCrew, Jun 21, 2016.

  1. GlitchCrew

    GlitchCrew Member

    Joined:
    Jun 21, 2016
    Posts:
    22
    Hello!

    I'm working on a pixel-styled game and I'm facing scaling problems. I want to make my game look like the Duck Game which has perfect pixel graphics. In Duck Game pixels of any sprite look perfect even if the sprite is rotated at certain angle and camera is zoomed in or out.

    Any ideas how can I achieve this?

    I have already tried upscaling my sprites (x2, x4, x8), porting view x2 from actual view in the room, setting application surface equal to current view width and height, but still it doesn't look like Duck Game scaling and pixels look distorted.

    GMX: http://www.mediafire.com/download/98j1o0756ajbv9u/test.gmx.zip

    EDIT: I have already turned off interpolation.

    First picture - Duck game. Second - my game.

    http://imgur.com/f84oNxU
    http://imgur.com/ncrXfHW

    EDIT: Here is the picture of rotated sprites in Duck Game:

    http://imgur.com/HhjfMwm
     
    Last edited: Jun 21, 2016
  2. 2Create

    2Create Member

    Joined:
    Jun 20, 2016
    Posts:
    17
    You probably need to turn off Interpolation Between Pixels in the global game settings.
    I can't see your images, by the way.
     
    Sam likes this.
  3. RangerX

    RangerX Member

    Joined:
    Jun 20, 2016
    Posts:
    2,594
    I don't see any sprites being rotated in your Duck Game example.
    In any case, nothing is wrong with your game there. If sprites doesn't pixelise like that in Duck Game, this indicates you their game is higher res than yours or they have some much better interpolation.
    A way out of this (outside upresing your game) could be to have your sprite on a surface and rotate that surface. Some people must know how to make a shader maybe that could interpolate the rotated graphics better.
     
  4. GlitchCrew

    GlitchCrew Member

    Joined:
    Jun 21, 2016
    Posts:
    22
    Hey RangerX,

    I've added an example with rotated sprites in Duck Game, that's exactly what I want to achieve.

    Thanks for your answer, I'll try to use it but I'm not sure that this is the exact solution.
     
  5. SuperSlim

    SuperSlim Member

    Joined:
    Jun 20, 2016
    Posts:
    43
    RangerX is right. You need to drastically increase the resolution of your game. Also you could try to make different sprites for each range of angles in your rotation. I would do this by rotating your original sprite in an image editor and putting a new layer on top of it where you would redraw the sprite. Hope I made sense!
     
  6. Nujuat

    Nujuat Guest

    Yes... To make your game render at a higher resolution (but keep the pixel art look), try and increase the size of the application surface. That should do the trick :)
     
    Carnivius likes this.
  7. GlitchCrew

    GlitchCrew Member

    Joined:
    Jun 21, 2016
    Posts:
    22
    Ok, here is the gmx. The example is really simple, code is commented.

    http://www.mediafire.com/download/98j1o0756ajbv9u/test.gmx.zip

    I tried to increase sprite and it looks great at x4 but at x2 (which is better for my case since I don't want my sprite to take a huge area of screen) it doesn't look very good. Increasing application surface changes sprite appearance but doesn't really help. Am I doing something wrong or is it just impossible to do in game maker? I believe that's possible because the guy who made Duck Game created perfect scaling but I just can't understand the concept behind his implementation. Can someone improve my code please? I'm really stuck...
     
    Last edited: Jun 21, 2016
  8. RangerX

    RangerX Member

    Joined:
    Jun 20, 2016
    Posts:
    2,594
    You're doing it wrong because you don't seem to grasp what is actually going on.
    Your view size is the resolution of your game. The application surface size is the actual "on screen size" that your view is displayed at.

    Now, what happens when a sprite is drawn at another angle than its original angle? The engine tries to draw it best it can but pixels are square, a sprite drawn at an angle might need more pixels to actually appear fine. The less pixels are available (lower res), the less your good your sprite will be drawn at an angle. The more pixels there is available, the best your sprite will be drawn at an angle.
    In the duck game, the pixel size is not what you see on the sprites. Its just art. The actually resolution can be seen by the jaggies created by the sprite's rotation (which are alot smaller than in your game) and the reason why the jaggies are smaller is because the resolution, pixels available, are many more in that Duck game.

    Now you have 2 solutions. None are easy.

    1- You draw all the angled frames yourself and make them looking good. (your sprite rotation basically become an animation!)
    2- Your scale up ALL your assets.
     

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