Dynamic Scaling Demo - Tutorial in the works!

Discussion and feedback on Construct 2

Post » Sun Jul 27, 2014 2:52 am

This is very helpful. Thanks!
B
12
S
3
G
1
Posts: 35
Reputation: 838

Post » Sun Jul 27, 2014 3:48 am

I do have a quick question about scaling down. I noticed that when I do, it's jagged (and this maybe due to the fact that I'm set to point sampling). But is there a easy way to scale in C2? I've been doing my scaling outside of C2 and re uploading each time which can be time consuming.
B
12
S
3
G
1
Posts: 35
Reputation: 838

Post » Sun Jul 27, 2014 9:20 pm

@Weleavefossils Glad you enjoyed the post! As for scaling down, if your resized image is jagged the there's a good chance you are using point sampling. When you downscale with linear sampling, there typically isn't any noticeable difference from the original - it's just smaller. You can check which you are set to in the project properties, which you can get to by clicking your project name in the "Projects" box on the top right of the C2 screen. Once there you should see this box on the left side of the screen where you can set your sampling type:

Image

If you reference the concepts from the blog post, then I talked about an "original, high resolution image" to start with. Depending on the resolution of your game, you'll want to load in that asset, or at least one that is larger than what you need so you can test what image size you will need.

From there, you can resize the image inside of construct, or you can scale it. The difference here can be thought of in terms of permanent, or temporary.

When you resize an image from 1500x1000 to 150x100, then that image is now 150x100 - if you resize OR scale it back up to 1500x1000 the image will look terrible. Here's a couple images showing how you resize an image in C2 after double clicking your sprite - this is the only method you can use to resize your image inside of C2, everything else is used to scale the image:

Image Image

When you scale an image from 1500x1000, that that image can be scaled to any size, but its still keeping the color information from the 1500x1000 asset, even if you scale it to 150x100 in your game, you can scale it right back to 1500x1000 no problem. You can scale the image with lines in the code, setting the numbers manually in the object properties box (when you select your sprite), or by dragging the corners of the sprite.

Image
Image

So, RAM and performance issues aside - for best visual fidelity, you should resize your image to the size you think will be the largest you will show that image in the game, depending on how the image is scaled (larger than 100% or smaller than 100% original size).

example: If you have a 150x100 asset, and scale it to 300x200, it will be very blurry. But if you have a 300x200 asset and scale it to 150x100, it will look fine.

However, having larger images in your game will cause it to use more RAM and impact performance more heavily, so you should try to find a balance. I find that you can typically scale an image to 120% it's actual size without much noticeable difference (won't be too blurry).


Hope this answered your question!

Also, you shouldn't use an image anywhere near 1500x1000 in your actual game, you should try to stay 512x512 or lower for the most part! I was just using some random assets for an example :P
ImageImageImage
B
16
S
3
Posts: 45
Reputation: 2,188

Post » Mon Jul 28, 2014 4:09 am

@sigmag thanks so much for all the details. I feel so OCD about resolution and image scaling.
B
12
S
3
G
1
Posts: 35
Reputation: 838

Post » Mon Jul 28, 2014 5:16 pm

@Weleavefossils No problem! Feel free to ask other questions, I'll try to answer as best I can.

I've also updated the title and OP with newer information, and once I can knock out the dynamic scaling blog post, it'll be added to the OP as well.

Sorry again guys for all the delays on the write up, one of our publishers is demanding a really weird change to one of our games that is going to take a week or two to fix. :(

By the time I finish fixing that issue however, the dynamic scaling technique will have further expanded functionality.
ImageImageImage
B
16
S
3
Posts: 45
Reputation: 2,188

Post » Mon Jul 28, 2014 10:49 pm

[quote="Sigmag"you must do it by code however - I am not sure if that is how most people do it, but I rarely position objects using the layout editor. The only other limitation I can think of the system is that you cannot use "Is on Layout" behavior, because the layout is always on the left and does not change from it's initial pixel value.

Here is what I mean in case it isn't clear. The red outline represents where the actual layout is at a layout size of 320x480, and the window is stretched to something larger (I think 976x558 px). This is using scale outer for the project setting "Fullscreen in browser" for reference.

Image[/quote]

Just to add that using unbounded scrolling, the display of the layout can be centered more easily, that combined with a use of the anchor behavior can help starting out (of course your approach is still valid, but to beginnyou might want to look into simpler methods first), that also will make the layout view useful (placing everything by code can be done, but the layout view is easier to do this kind of work)
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Thu Jul 31, 2014 5:59 pm

@Aphrodite Man! I really wish I knew about that setting a year ago, how did it escape me this long...

Thanks for the tip! Fixing to overhaul my system to work with unbounded scrolling for ease of use.
ImageImageImage
B
16
S
3
Posts: 45
Reputation: 2,188

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests