Snap to "virtual pixels?"

linai

  • *
  • Posts: 28
Hello,

I'm currently playing around with making a very low resolution game. I would like to use the Scale: 4x setting to scale the game 4x. Works great... mostly.

Here's the issue: when scaled to 4x, the actors no longer snap to the new "virtual pixels." So, if i have an actor moving at a speed slower than 1px per frame, it can move physical screen pixels, which are less than my new, 4x scaled up, "virtual pixels." Is there any way around this other than somehow rounding the drawing coordinates before drawing each actor?

I've attached a small .gif to illustrate what i'm talking about.


Thanks!

« Last Edit: May 05, 2014, 08:46:48 am by linai »

linai

  • *
  • Posts: 28
Juuust wondering if anyone has any insights on how to accomplish this...

Attached is an example of what i am looking for (not from Stencyl.)

« Last Edit: May 06, 2014, 05:20:31 pm by linai »

sdieters

  • Posts: 2068
i'm still note sure what you want to achieve, but cant you use "move self to x: () y:() with () speed" << cant remember the actual block
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

linai

  • *
  • Posts: 28
Thanks for your reply!

My issue is that I want everything to move (or more specifically, to be rendered) in whole "enlarged pixel" steps. If you look at the first animation, the clouds are moving in screen pixels when the game is scaled up, due to the fact that they are moving less than one "coordinate" (unscaled pixel) per frame.

I am wanting a way to maintain a whole "virtual, scaled pixel" rendering (as you can kind of see in the location of the clouds moving as the camera pans in the second animation.)

Thanks!

(I'm aware of the move self to... blocks, but that will not suffice as i would have to use a whole number speed to achieve the effect i'm looking for when scaled up. A speed of 1 is far too fast for these drifting clouds.)

sdieters

  • Posts: 2068
okay so if i am correct, you want to give it that non-smooth look my moving them 4 pixels at a time?
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

linai

  • *
  • Posts: 28
Yes, though keep in mind that it is actually only one pixel at a time as far as the game is concerned. I'd like to be able to have speeds of less than one, but render as if you literally scaled the unscaled 1:1 screen 4x. i.e. everything is now rendered on a 4x4 grid.

I can do it in other engines, I just can't figure out a way to force Stencyl to render this way (at least without some seriously inconvenient trickery, like manually storing coordinates in an attribute and manually moving the actor to the rounded coordinates. This of course, adds a lot of extra hassle and does not play nice with anything else in Stencyl that is coordinate based, such as speeds, physics, tweens, etc etc etc.)

NobodyX

  • *
  • Posts: 1228
This has been something that's bothering me a lot (in combination with the fact that rotating/resizing actors will also visually break the "pixel grid") and I've been raising the issue (complaining) a lot, but the fact is it's just not working right for now and it doesn't appear it will be in the near future, apparently it's a lot of work to fix. So unfortunately it's REALLY annoying for this jam, personally I'm working around the issue by creating the game in 1x and a much higher resolution than 32x32, and then taking just the 32x32 middle portion of the screen and blowing it up to fill the screen using the image API blocks. It's working okay for me (the game runs slower than it should ideally) but it's kind of a really wonky solution, but if you want a solution to this problem that you can use immediately then I'm not sure what else to suggest.

linai

  • *
  • Posts: 28
Thanks much for your reply! I'm looking into the image API as we speak to try the method you're describing. (Ideally, this is how i think the "Scale" setting should work... or at least how I expected it to work... Taking the main buffer and simply scaling it to fit the window.)

Granted, using the image API to accomplish this isn't ideal, but may suffice for this since it's so low res anyway (it should be able to keep up.) Plus it'll give me an excuse to explore the image API finally. :)

Dnilo

  • *
  • Posts: 23
I'm also looking for this problem to be fixed, has anyone found a proper solution?