Certain zoom values create pixels above character sprites?

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
860
Reaction score
384
First Language
Javascript
Primarily Uses
RMMV
Can someone please help me out?

Problem:
Can't seem to figure out why certain zoom values such as 2.25 create pixels above the character sprites (events/player).
Code:
$gameScreen.startZoom($gamePlayer.screenX(), $gamePlayer.screenY(), 2.25, 1)
zoom issue.png

Meanwhile zoom 2.4 & 2.6 work nicely:
1576728568349.png

Is there a solution to this besides simply avoiding such zoom values?
Any insight is much appreciated.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,649
Reaction score
13,261
First Language
English
Primarily Uses
RMMV
It looks like it's taking a row of pixels from the image above. This might be something to do with the height of each individual cell in your character sheet.

Does it do this in a brand new project with NO plugins active? What if you use sprites in the $spritesheet format (only one character per image, 3 columns, 4 rows)?

What if you try 1.26 rather than 1.25?
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
860
Reaction score
384
First Language
Javascript
Primarily Uses
RMMV
@Shaz Thanks for reply. Any help is much appreciated :)

Does it do this in a brand new project with NO plugins active? What if you use sprites in the $spritesheet format (only one character per image, 3 columns, 4 rows)?
Yup yup just tried a blank project and tried the $spritesheet format still happens.


What if you try 1.26 rather than 1.25?
1.24 & 1.26 both good no extra pixels
1576739961467.png
1576738860296.png
1576739536213.png
1576740138274.png

Demo of the issue (clean project, no plugins, freshly created): Click Here to View
 

Attachments

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,649
Reaction score
13,261
First Language
English
Primarily Uses
RMMV
So I didn't download your demo, but I tried the same thing on a new map in a project with no plugins, and was able to reproduce the issue.

I also created a $single version of the one character, and it also had the issue, but only in one direction.

I haven't looked very much at the scripts, but I had a feeling it might have had something to do with the number of pixels in height for each individual sprite. So I copied the Actor1 and my $single version, enlarged the canvas by 8 (and 4) pixels, and moved each row down accordingly (row 8 I moved down 8 pixels, row 7 I moved down 7 pixels, etc). After this change, it all worked fine.

I suspect there's something in the scripts that's recalculating the frame size and having a rounding issue - either because of the odd number on the end, or something to do with not being divisible - haven't looked any further at it.

If nobody else gets a solution for you, I'll look a little further over the weekend. I can't concentrate well enough right now to figure it out, and tomorrow I have other things happening.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,890
Reaction score
8,243
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
860
Reaction score
384
First Language
Javascript
Primarily Uses
RMMV
@mlogan Thanks for moving it. :cutesmile::thumbsup-right:

I suspect there's something in the scripts that's recalculating the frame size and having a rounding issue - either because of the odd number on the end, or something to do with not being divisible - haven't looked any further at it.
Same thoughts just not really sure where to begin with this one...
If nobody else gets a solution for you, I'll look a little further over the weekend. I can't concentrate well enough right now to figure it out, and tomorrow I have other things happening.
No worries I totally know how that one is. I'll take any help with this. I'm quite stumped... perhaps something helpful can be found in rpg_core.js or maybe pixi.js
 
Last edited:

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,890
Reaction score
8,243
First Language
English
Primarily Uses
RMMV
@ct_bolt Yeah, I moved it because of your report. The blue messages are just automated.
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
860
Reaction score
384
First Language
Javascript
Primarily Uses
RMMV
Hmm... I'm really leaning towards something in pixi.js or pixi-tilemap.js being an issue...
1576772253797.png

1576772361339.png
...no clue what I'm looking for really though.
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,649
Reaction score
13,261
First Language
English
Primarily Uses
RMMV
So the following change in pixi.js (starting line 10649) stops the extra lines, but messes with the focus point.

Code:
    TransformStatic.prototype.updateTransform = function updateTransform(parentTransform) {
        var lt = this.localTransform;

        if (this._localID !== this._currentLocalID) {
            // get the matrix values of the displayobject based on its transform properties..
            lt.a = Math.floor(this._cx * this.scale._x);
            lt.b = Math.floor(this._sx * this.scale._x);
            lt.c = Math.floor(this._cy * this.scale._y);
            lt.d = Math.floor(this._sy * this.scale._y);
However, before I made that change, I noticed when zoomed in, the mouse destination became faulty, and the camera didn't follow the player correctly. So I'm not sure if you want to continue along those lines, as there are multiple other issues that would also need to be addressed.

Did you take a look at some of the other camera zoom plugins to see how they handle it, and if they have the same issue?
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
860
Reaction score
384
First Language
Javascript
Primarily Uses
RMMV
So the following change in pixi.js (starting line 10649) stops the extra lines, but messes with the focus point.
Hmm.. interesting... thanks for the info.
Did you take a look at some of the other camera zoom plugins to see how they handle it, and if they have the same issue?
Yup I looked over a few others and it seems all the other ones I came across had the issue still.
I did however come up with a fix for this now also. Mind testing? Maybe there are other issues this causes?

Fix:
Changing this.x & this.y in function Spriteset_Base.prototype.updatePosition
Code:
Spriteset_Base.prototype.updatePosition = function() {
    var screen = $gameScreen;
    var scale = screen.zoomScale();
    this.scale.x = scale;
    this.scale.y = scale;
    this.x = -screen.zoomX() * (scale - 1); // Default:   this.x = Math.round(-screen.zoomX() * (scale - 1));
    this.y = -screen.zoomY() * (scale - 1); // Default:   this.y = Math.round(-screen.zoomY() * (scale - 1));
    this.x += Math.round(screen.shake());
};
More specifically removing the rounding of the values.
ExtraPixelFix: Plugin - Click Here to Download/View
However, before I made that change, I noticed when zoomed in, the mouse destination became faulty, and the camera didn't follow the player correctly.
That feature and many more incorporated into an upcoming plugin. ;):thumbsup-right:
PS. Sorry for the delayed reply, somehow missed the notification.

*** EDIT ***@Shaz
The fix I posted seems to fix some values but not all... and may have other issues...
...still need help with this. :dizzy:
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

And now since I've got the whole game parts working, the *contents* await.

I've invented a cheap way to manipulate weather. Should I get it patented?
It's change from frikin' hot to beautiful at the cost of only 4 beers.
I think is french enough.
Yanfly told me the new earth all animations in MZ look a bit like summoning potatoes and now I can't unsee it. halp

Forum statistics

Threads
100,588
Messages
977,537
Members
132,186
Latest member
layer6ai
Top