How does the engine set tiles?

Orichalcum+

Veteran
Veteran
Joined
Apr 17, 2015
Messages
72
Reaction score
52
First Language
English
Primarily Uses
What I'm trying to figure out is how the engine makes tiles from the data array In a map's JSON file. I tried playing around with a map, but I'm not seeing any real patterns in the array's values.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,187
Reaction score
6,758
First Language
German
Primarily Uses
RMMV
I suggest you search on himeworks.com for the scripts to change tiles, they also include a bit more about how the engine handles those changes. It is not easy to explain, especially not the autotiles because they are handled based on the surrounding tiles and not on their own.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,445
Reaction score
12,011
First Language
English
Primarily Uses
RMMV
The data is based on map width x map height x 6 layers.

If your map width is 30 tiles and your map height is 40 tiles, then the first 1200 values (30x40) are the ground layer, the next 1200 values are the ground cover layer, the next 1200 values are the first upper layer, the next 1200 values are the second upper layer, the next 1200 values are the shadow layer, and the final 1200 values are the region layer.
 

Orichalcum+

Veteran
Veteran
Joined
Apr 17, 2015
Messages
72
Reaction score
52
First Language
English
Primarily Uses
I suggest you search on himeworks.com for the scripts to change tiles,
I didn't MV plugins that handled autotiles there, but yeah it looks complicated.

The data is based on map width x map height x 6 layers.

If your map width is 30 tiles and your map height is 40 tiles, then the first 1200 values (30x40) are the ground layer, the next 1200 values are the ground cover layer, the next 1200 values are the first upper layer, the next 1200 values are the second upper layer, the next 1200 values are the shadow layer, and the final 1200 values are the region layer.
ahhhh, okay. thank you for the help.

a related question, where does MV set sprite for each tile?
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,445
Reaction score
12,011
First Language
English
Primarily Uses
RMMV
In the rpg_core.js script, you're looking for the Tilemap and ShaderTilemap classes. Each of those has a function called drawAllTiles or something like that.
 

Orichalcum+

Veteran
Veteran
Joined
Apr 17, 2015
Messages
72
Reaction score
52
First Language
English
Primarily Uses
Those two are exactly what im looking for thank you lots and lots.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

suspended on twitter for calling an ahole an ahole & appealing the tweet; furious at myself for being even slightly upset with my suspension: oh no, you've been temporarily banned from hell. GET OVER IT, me.
how can you download the tiles from a forum post here? HELP
That moment when you post the wrong download link to your game and wonder why it got so few downloads... :mad:
Trying to make it so my map is cleared of "random" events after the player leaves the map... to little success >.< I think I might need to ask help for this.
Had my first interaction with a legit homophobe concerning one of my games today. Tempting to engage, but pointless.

Forum statistics

Threads
94,245
Messages
919,368
Members
123,959
Latest member
CecilGP
Top