Problem with multiple walkable areas and scaling

Started by Murchad, Tue 08/07/2014 21:56:08

Previous topic - Next topic

Murchad

Hello friends. I have some problem. I tried to find the answer on the forum, but could.nt find it. I hope I didn't missed it somewhere.

I'll explain what is my problem on this sketch.


Crimson Wizard

Something that just appeared in my head: you can try using blocking invisible room objects to block the disabled areas. This is not a very elegant solution, but I am afraid current version of AGS does not provide much options here (the future version of AGS we are planning will allow up to 256 walk areas, but that is under development now).

Another way is to use Regions. They have "walk on" event that triggers when player character walks on it. You can script it so that character will walk back to main area. Although this is not exactly like "disabled area".

Murchad

This first solution is working in this case, so thanks a lot for help :)

AnasAbdin

I'd create four walkable areas like the third example. Then it's a matter of math. Get the y coordinates of the top and bottom edges of the all walkable areas and calculate the scaling needed for each of the walkable areas according to the distances between the y coordinates to create three different continues scaling.

For example:
Blue walkable area: 30-40
Red and Yellow: 40-50
Green: 50-100

and then you can turn off any walkable area you need with:
Code: ags
RemoveWalkableArea(areanum);

Slasher

#4
Hi,

this is indeed a good question and it brings up a mathematical question regarding using continuous scaling true [n] [n] and relating to walkable area length.

Has anyone ever figured out the maths, if it is of course possible to work out?

Other than that it's a case of trying [n] till it looks right.

;)


HandsFree

I've seen a very practical solution for this. Maybe it's frowned on by the experts but if you just put one pixel of each walkable area in the front of the screen (somewhere out of the way/at the side if possible) and one pixel at the back, you can set the scaling for all walkable areas the same. 100% to 30% in op's example.

AnasAbdin

#6
HandsFree That's a very smart solution (for this case). I love it 8-)

Edit:


Crimson Wizard

#7
The scaling formula in AGS is very simple. Basically, you take height of all area in pixels (Hpx) and range in "scaling units" (dS) (between top & bottom of scaling area).

Hpx / dS = pixels per scaling unit.

For example, if you have scaling from 100 to 0, and area of height 200, then you will have: 200 / 100 = 2 pixels per 1 scaling unit. If you have area height = 50, then it is 50 / 100 = 0.5 pixels per scaling unit, or 1 pixel per 2 scaling units.
And so forth.
Knowing this factor you can assign scaling for separate areas.


Quote from: HandsFree on Thu 10/07/2014 10:44:06
I've seen a very practical solution for this. Maybe it's frowned on by the experts but if you just put one pixel of each walkable area in the front of the screen (somewhere out of the way/at the side if possible) and one pixel at the back, you can set the scaling for all walkable areas the same. 100% to 30% in op's example.
I think this is a very nice workaround!

Murchad

Quote from: Crimson Wizard on Thu 10/07/2014 10:51:15
Quote from: HandsFree on Thu 10/07/2014 10:44:06
I've seen a very practical solution for this. Maybe it's frowned on by the experts but if you just put one pixel of each walkable area in the front of the screen (somewhere out of the way/at the side if possible) and one pixel at the back, you can set the scaling for all walkable areas the same. 100% to 30% in op's example.
I think this is a very nice workaround!

Looks nice. Thanks :)

Snarky

Quote from: AnasAbdin on Thu 10/07/2014 10:49:03
HandsFree That's a very smart solution (for this case). I love it 8-)

Edit:



Yes, it's quite clever. Of course, with this approach you don't even need the yellow and blue (in fact, isn't that exactly the benefit?), it can all just be green.

Khris

HandsFree, that's awesome! I'll take me a few hours to not be pissed I didn't think of that :-D

HandsFree

It's not my invention either. I saw it in the King's Quest 4 remake, done by Akril.

SMF spam blocked by CleanTalk