Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaling algorithms and scaling controllers. #639

Closed
Isakku opened this issue Aug 11, 2022 · 0 comments
Closed

Scaling algorithms and scaling controllers. #639

Isakku opened this issue Aug 11, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Isakku
Copy link

Isakku commented Aug 11, 2022

Is your feature request related to a problem? Please describe.
Ikemen developers have done an awesome job by adding scaling algorithms to the engine:
I'm talking about the "shaders" options where you can choose HQ2X orHQ4X and such.
https://en.wikipedia.org/wiki/Image_scaling

But chars also have a scaling in their constants file, in their [Size] section
you can set it like
xscale = 1 ;Horizontal scaling factor.;
yscale = 1 ;Vertical scaling factor.;

However some chars (such as the ones I have worked on) usually have a double sized version

xscale = 2 ;Horizontal scaling factor.;
yscale = 2 ;Vertical scaling factor.;

But when such scaling is done on the sprites (on the fly when loading) it's only done with the default way of scaling sprites
(Nearest-neighbor interpolation)

Describe the solution you'd like
Ikemen already has the scaling algorithms, it's just a matter of enabling them to be used for this purpose.

it should be possible to have a parameter in the data section to be able to choose beyond the current default

like this:

scaling,algorithm = "HQ2X" ; Scaling algorithm to use when scaling this char's sprites

and it would be included in the constants like this

[Data]
life = 1000 ;Amount of life to start with
power = 1000 ;Amount of power
scaling,algorithm = "HQ2x" ; Scaling algorithm to use when scaling this char's sprites

[Size]
xscale = 2 ;Horizontal scaling factor.;
yscale = 2 ;Vertical scaling factor.;

If the scaling,algorithm parameter is ommited it would default to the usual Nearest-neighbor interpolation algorithm that such scaling usually uses.

Additional context
Adding this capability would greatly enhance the options for char's creators and editors as they could then be enabled to simply change the parameter if they don't like how the char looks for them.
Additionally, any and all state controllers that are capable of scaling would benefit from having a scaling algorithm. For example the angledraw stctrl would have it set to use whatever is set in the constants by default, but could also be changed like this (to have an enhancement when enlarging an object such as a helper )

[State 245, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = FVar(0), FVar(1)
algorithm = "HQ2X"
ignorehitpause =1

If the algorithm parameter is ommited it would default to the scaling,algorithm parameter in the constants and as already mentioned If the scaling,algorithm parameter is ommited at the constant it would then default to the usual Nearest-neighbor interpolation algorithm that such scaling usually uses.

Again this would benefit many other controllers. Another example would be the explod controller where it could be included like this

[State 80, Smoke]
type = Explod
trigger1 = Command = "holdfwd"
trigger1 = Anim = 80
sprpriority = 10
scale = const(size.xscale), const(size.yscale)
algorithm = "HQ4X"
postype = P1
ownpal = 1
ontop = 1
anim = 1000080
pos = ceil(15 * const(size.xscale)),0
ID = 1000080

In this example I have used a different scaling algorithm than the one used for the char as a whole
algorithm = "HQ4X"
So this explod would be scaled with a smoother shader than the rest of the char's sprites.

In short not only the characters but also any state controller that uses scale parameters would be enhanced by being able to control the scaling algorithm being used for such scaling.

@Windblade-GR01 Windblade-GR01 added the enhancement New feature or request label Aug 14, 2022
@ikemen-engine ikemen-engine locked and limited conversation to collaborators Jan 22, 2023
@K4thos K4thos converted this issue into discussion #921 Jan 22, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants