RafaelBarbosatec / bonfire

(RPG maker) Create RPG-style or similar games more simply with Flame.
https://bonfire-engine.github.io
MIT License
1.18k stars 177 forks source link

[question]: Multiple Tilesets in a map? #493

Closed baconjuggling closed 1 month ago

baconjuggling commented 4 months ago

How can we help?

How do I make a map using multiple tilesets? when I use a map using multiple tilesets, the game does not display the map like the editor does. all tiles from the 2nd tileset are being replaced by tiles in the first tileset.

Is there a way to do this properly, or should i just make a single giant tileset?

RafaelBarbosatec commented 4 months ago

Hi @baconjuggling ! Could you give more information? Or give me the json file generated by Tiled. At the moment Bonfire there is support to multiple tilesets.

aruhant commented 4 months ago

multiple tilesets work perfectly with bonfire. The bonfire examples use it, and I also use multiple tilesets in my game, if you want to check it for reference: https://github.com/aruhant/rpg

baconjuggling commented 4 months ago

Hi @baconjuggling ! Could you give more information? Or give me the json file generated by Tiled. At the moment Bonfire there is support to multiple tilesets.

my apologies, i should be more specific, I'm trying to use two tile sets on a single map.

These images show my issue, check the dirt patch: What I'm expecting:

Screenshot 2024-02-26 at 05 39 50

what I'm actually getting:

Screenshot 2024-02-26 at 05 39 11

here is my tmj

{ "compressionlevel":-1,
 "height":256,
 "infinite":false,
 "layers":[
        {
         "compression":"",
         "data":"REMOVED DUE TO GITHUB ISSUE COMMENT LIMIT"
         "encoding":"base64",
         "height":256,
         "id":1,
         "name":"canvas",
         "opacity":1,
         "type":"tilelayer",
         "visible":true,
         "width":256,
         "x":0,
         "y":0
        }, 
        {
         "compression":"",
         "data":"REMOVED DUE TO GITHUB ISSUE COMMENT LIMIT",
         "encoding":"base64",
         "height":256,
         "id":5,
         "name":"behind player",
         "opacity":1,
         "type":"tilelayer",
         "visible":true,
         "width":256,
         "x":0,
         "y":0
        }, 
        {
         "compression":"",
         "data":"REMOVED DUE TO GITHUB ISSUE COMMENT LIMIT",
         "encoding":"base64",
         "height":256,
         "id":3,
         "name":"infront of player",
         "opacity":1,
         "properties":[
                {
                 "name":"type",
                 "type":"string",
                 "value":"above"
                }],
         "type":"tilelayer",
         "visible":true,
         "width":256,
         "x":0,
         "y":0
        }],
 "nextlayerid":9,
 "nextobjectid":19,
 "orientation":"orthogonal",
 "renderorder":"right-down",
 "tiledversion":"1.10.2",
 "tileheight":32,
 "tilesets":[
        {
         "firstgid":1,
         "source":"tileset\/forest_tiles.tsj"
        }, 
        {
         "firstgid":257,
         "source":"tileset\/dirt_wang.tsj"
        }],
 "tilewidth":32,
 "type":"map",
 "version":"1.10",
 "width":256
}
baconjuggling commented 4 months ago

multiple tilesets work perfectly with bonfire. The bonfire examples use it, and I also use multiple tilesets in my game, if you want to check it for reference: https://github.com/aruhant/rpg

i should have been clearer I'm looking to use multiple tilesets in the same map, I couldn't see an example of that in your code base, Although i found an example, in @RafaelBarbosatec turn_game

https://github.com/RafaelBarbosatec/turn_game/blob/main/assets/images/map/map1.tmj

our tilesets are declared differently in our tmj's.

RafaelBarbosatec commented 4 months ago

Yes, at this project is different because the tileset was embedded. At .JSON file that you sent us, it's right. It's must work well. It's strange not working for you. Take a look this example:

https://github.com/RafaelBarbosatec/game_island

RafaelBarbosatec commented 3 months ago

Hi @baconjuggling ! Were you able to resolve this issue?