I know this is old talk, and there are various ways to fix it.
Just in case you don't know, you can change the player's move speed to something like 2.5, you will see the events shake while the map is scrolling.
But it appears the root problem is pixel rounding in the tilemap class.
Taking a look at the code, it seems a roundPixels property for ShaderTilemap class was added.
Turning it off seems to fix the jittering issue (in webgl mode).
There is no such property in Tilemap class, which is used by canvas mode. So I assume it is there for a reason.
I'm wondering if there's a paticular reason why roundPixels is not turned off in the first place. Are there any potential bugs I haven't discovered?
Edit*
It seems MZ uses a different approach, it uses Math.ceil to round the position.
MZ
MV
Just in case you don't know, you can change the player's move speed to something like 2.5, you will see the events shake while the map is scrolling.
But it appears the root problem is pixel rounding in the tilemap class.
JavaScript:
function ShaderTilemap() {
Tilemap.apply(this, arguments);
this.roundPixels = true;
}
Taking a look at the code, it seems a roundPixels property for ShaderTilemap class was added.
Turning it off seems to fix the jittering issue (in webgl mode).
There is no such property in Tilemap class, which is used by canvas mode. So I assume it is there for a reason.
I'm wondering if there's a paticular reason why roundPixels is not turned off in the first place. Are there any potential bugs I haven't discovered?
Edit*
It seems MZ uses a different approach, it uses Math.ceil to round the position.
MZ
JavaScript:
//ShaderTilemap.prototype.updateTransform
const ox = Math.ceil(this.origin.x);
const oy = Math.ceil(this.origin.y);
const startX = Math.floor((ox - this._margin) / this.tileWidth);
const startY = Math.floor((oy - this._margin) / this.tileHeight);
this._lowerLayer.x = startX * this.tileWidth - ox;
this._lowerLayer.y = startY * this.tileHeight - oy;
this._upperLayer.x = startX * this.tileWidth - ox;
this._upperLayer.y = startY * this.tileHeight - oy;
MV
JavaScript:
//ShaderTilemap.prototype.updateTransform
if (this.roundPixels) {
var ox = Math.floor(this.origin.x);
var oy = Math.floor(this.origin.y);
} else {
ox = this.origin.x;
oy = this.origin.y;
}
var startX = Math.floor((ox - this._margin) / this._tileWidth);
var startY = Math.floor((oy - this._margin) / this._tileHeight);
//ShaderTilemap.prototype._updateLayerPositions
this.lowerZLayer.position.x = startX * this._tileWidth - ox;
this.lowerZLayer.position.y = startY * this._tileHeight - oy;
this.upperZLayer.position.x = startX * this._tileWidth - ox;
this.upperZLayer.position.y = startY * this._tileHeight - oy;