Does MV render things outside of the camera view?

peq42_

Yeet
Veteran
Joined
Feb 5, 2016
Messages
540
Reaction score
326
First Language
Portuguese(BR)
Primarily Uses
RMMV
My question is pretty simple but since I still dont understand very well how MV works "under the hood", and I couldn't find the answer on google, I felt I needed to ask:

does MV render things outside of the area viewed by the game camera?
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
1,544
Reaction score
1,034
First Language
Polish
Primarily Uses
RMMV
Yes, all data in game are JSON files including maps, when MV load files it reads them throughly.

Scratch that
 
Last edited:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,812
Reaction score
9,117
First Language
Indonesian
Primarily Uses
RMVXA
I googled this question and I found a relevant answer
This came from 2014 which is kinda close to the release date of MV

Also this from 2017
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,715
Reaction score
15,839
First Language
English
Primarily Uses
RMMV
I'm not sure about sprites (events), but the map itself is only rendered to the window size plus a 20 pixel border. This is a function of the Tilemap and ShaderTilemap class, and nothing to do with Pixi.
 

peq42_

Yeet
Veteran
Joined
Feb 5, 2016
Messages
540
Reaction score
326
First Language
Portuguese(BR)
Primarily Uses
RMMV
I googled this question and I found a relevant answer
This came from 2014 which is kinda close to the release date of MV

Also this from 2017


I saw those, but they dont help much. Pixi may not come with auto culling, but MV could have implemented that

I'm not sure about sprites (events), but the map itself is only rendered to the window size plus a 20 pixel border. This is a function of the Tilemap and ShaderTilemap class, and nothing to do with Pixi.
Would ya happen to know where its done? I'm guessing the sprites for each of the events are saved within an array which is probably iterated on every update, but after some time searching I couldn't find exactly where it is or if the system works like that.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,715
Reaction score
15,839
First Language
English
Primarily Uses
RMMV
Spriteset_Map is the container for all the different types of sprites you see on a map. The parallax, tiles, characters, weather, etc. All of those things are children, and each individual item is a sprite.

There are two aspects to character (event, player) sprites - one is the logical - what file is used for the image, what row, what column, what is the map X and Y coordinate, is it animating, and which frame of animation should show? Those things are just data, and are updated on every frame. The other is the drawing of the actual sprite.

As far as rendering, there's a _renderWebGL and _renderCanvas function in the pixi.js Sprite class. I haven't looked much to figure out when those functions get called from the inheriting classes.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,607
Reaction score
3,880
First Language
Java's Crypt
Primarily Uses
RMMZ
ShaderTilemap._paintAllTiles; It receives the starting X and Y position and then calculates the width and height based on it's own size (screen size + 40px, both vertically and horizontally).

That's only for the map though; Events are handled in a different way.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,624
Reaction score
502
First Language
German
Primarily Uses
RMMV
Indirectly related Starter Info, but good to know:
Event NPC can still Move even if far outside off the visible Screen.
On standard setting they stop Moving if a few maptiles outside of the visible screen.
but:
If the Event got his Moveroute through another Event, it continues moving even if miles outside of the visible Screen. (Very usefull for Cars moving in a big City)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
35,806
Reaction score
9,465
First Language
German
Primarily Uses
RMMV
does MV render things outside of the area
I think it would help if you explain why you're looking for this answer, because there are two different mechanics involved here.

"rendering" is usually a term that applies to display functions - especially in 3D, but it works a bit different in 2D displays. As such the map display is only created with a small border beyond the viewport and the rest of the map is not rendered.
However that does not mean that the rest of the map is completely ignored - event movement is calculated outside the viewport (depending on anti-lag features that decide which events to process and which not).

So if you're asking purely because of the display the answer to your question will be different than if you're asking about what happens to events outside the viewport.
 

peq42_

Yeet
Veteran
Joined
Feb 5, 2016
Messages
540
Reaction score
326
First Language
Portuguese(BR)
Primarily Uses
RMMV
I think it would help if you explain why you're looking for this answer, because there are two different mechanics involved here.

"rendering" is usually a term that applies to display functions - especially in 3D, but it works a bit different in 2D displays. As such the map display is only created with a small border beyond the viewport and the rest of the map is not rendered.
However that does not mean that the rest of the map is completely ignored - event movement is calculated outside the viewport (depending on anti-lag features that decide which events to process and which not).

So if you're asking purely because of the display the answer to your question will be different than if you're asking about what happens to events outside the viewport.
I am aware of the fact that not rendering things outside of the viewport doesn't stop things from running. What I was trying to find with my question is what parts of MV do render things that way(I already expected it to work like this) so I can try changing that, since maps in my game could, theoretically, have over 100 events easilly(since each player on a server equals 1 event) and 256x256 size, so I'm trying to keep things as performant as possible.
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,637
Reaction score
1,463
First Language
French
Primarily Uses
RMMV
the answer it NO, rmmv or pixijs don't have native CULLING system.
So yes all thing out of viewport are alway rendering and computed.
You need create your own culling system.

Example of system, this is one i made for pixi-proj, but you can also use it for rmmv.
Take a look on line : 244

Culling is a very important thing for a game engine optimisation.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,715
Reaction score
15,839
First Language
English
Primarily Uses
RMMV
So yes all thing out of viewport are alway rendering and computed.
No, "all things" are not rendered. See my reply above. It does cull the map, but maybe not event sprites.
 

Latest Threads

Latest Profile Posts

hmmm. an art of mine was removed from reddit, for a reason not even listed.
Going to try my luck with Rust programming language. C++ is just way too gosh darn frustrating.

Forum statistics

Threads
121,887
Messages
1,144,913
Members
160,138
Latest member
Deruta
Top