BydoEmpire Posted March 31, 2022 Share Posted March 31, 2022 Hi all. @aaron1677 and I are trying to get something working using mapfiles generated with Tiled in a banked 7800basic game. First, the sample tileset is in xml format (attached). I'm not sure what it's looking for. odyssey_tree_test.tmx code is: incgraphic gfx/tilesets/tileset_trees.png 160A 0 1 2 3 incmapfile gfx/tmx/odyssey_tree_test.tmx Error is: I must be doing something silly. Second, the tmx file is referencing individual "tree" tiles. Can I assume naming limitations exist (no spaces, special characters) and is it recommended to have each tile be its own png, or can we make one big tileset containing them all, the way we'd do with alphadata? Quote Link to comment Share on other sites More sharing options...
RevEng Posted March 31, 2022 Share Posted March 31, 2022 The png files you use in Tiled need to be the same png files (with the same names) that you're using in 7800basic. It doesn't really matter if you use a bunch of png files, or one big one, but you just have to use the same files for tiled and 7800basic. And yes, no spaces in the filenames - you need to name them with the same naming restrictions you would follow if you were dim'ing a variable. 2 Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted March 31, 2022 Share Posted March 31, 2022 Couple of extra things I'd suggest to also check : Check you have XML set correctly in the map properties on Tiled. It should look something like this : Where you load the .png file in 7800Basic to use with a tilemap from Tiled, you also need to define the palette number to be used for the png. e.g. : incgraphic gfx/tilesets/tileset_trees.png 160A 0 1 2 3 number Where "number" is the palette you will use for that .png 3 Quote Link to comment Share on other sites More sharing options...
BydoEmpire Posted April 5, 2022 Author Share Posted April 5, 2022 @aaron1677 - with the latest version I'm getting the same error. Is there anything Muddyfunster posted above that might help? The tmx file you most recently sent sure looks right to me, it's certainly an XML file. I tried with 7800basic-0.19 just to see if it's something broken in whatever older version I happened to still be using, but I get the same error either way. Quote Link to comment Share on other sites More sharing options...
+Pac-Lander Posted April 5, 2022 Share Posted April 5, 2022 16 hours ago, BydoEmpire said: @aaron1677 - with the latest version I'm getting the same error. Is there anything Muddyfunster posted above that might help? The tmx file you most recently sent sure looks right to me, it's certainly an XML file. I tried with 7800basic-0.19 just to see if it's something broken in whatever older version I happened to still be using, but I get the same error either way. Ah...this may be the culprit. The default was set to "CSV" and not "XML". These were my previous settings: I've now updated them to this: @BydoEmpire I'll send you the updated .tmx and .png files in our other thread. Hopefully this solves it! Thanks to @RevEng and @Muddyfunster Forest_Map_20x14_R2_xml.tmx 3 Quote Link to comment Share on other sites More sharing options...
BydoEmpire Posted April 15, 2022 Author Share Posted April 15, 2022 (edited) Two steps forward, one step back. I got a tilemap loaded (above) and sort of running with the XML(deprecated) format so that's good. Aaron gave me 3 more screens, two of them build fine. The 3rd one gives me this error but I don't see anything particularly wrong with the file. Here's the asm: .L0427 ;; plotmapfile gfx/tmx/forest_20x14_screen1.tmx currentmapdata 0 0 20 14 lda #(<plotmapfiledata19) sta temp8 lda #(>plotmapfiledata19) sta temp9 jsr plotcharloop jmp skipplotmapfiledata19 plotmapfiledata19 .byte <(currentmapdata+0), >(currentmapdata+0), $2c, 0, 0 .byte <(currentmapdata+20), >(currentmapdata+20), $2c, 0, 1 .byte <(currentmapdata+40), >(currentmapdata+40), $2c, 0, 2 .byte <(currentmapdata+60), >(currentmapdata+60), $2c, 0, 3 .byte <(currentmapdata+80), >(currentmapdata+80), $2c, 0, 4 .byte <(currentmapdata+100), >(currentmapdata+100), $2c, 0, 5 .byte <(currentmapdata+120), >(currentmapdata+120), $2c, 0, 6 .byte <(currentmapdata+140), >(currentmapdata+140), $2c, 0, 7 .byte <(currentmapdata+160), >(currentmapdata+160), $2e, 0, 8 .byte <(currentmapdata+178), >(currentmapdata+178), $1e, 288, 8 <-- this line .byte <(currentmapdata+180), >(currentmapdata+180), $0c, 0, 9 .byte <(currentmapdata+200), >(currentmapdata+200), $0c, 0, 10 .byte <(currentmapdata+220), >(currentmapdata+220), $0c, 0, 11 .byte <(currentmapdata+240), >(currentmapdata+240), $0c, 0, 12 .byte <(currentmapdata+260), >(currentmapdata+260), $0c, 0, 13 .byte 0,0 skipplotmapfiledata19 I don't know what each parameter in that line represents, nor why one row would have an out of bounds value. Here's the file in question. There's nothing unique about the 10th row versus other rows in the tilemap as far as I can tell. forest_20x14_screen1.tmx FWIW, here's one that does not give me the same problem. Same tileset. forest_20x14_screen2.tmx Edited April 15, 2022 by BydoEmpire Quote Link to comment Share on other sites More sharing options...
BydoEmpire Posted April 15, 2022 Author Share Posted April 15, 2022 For the one that does run (screen2) I'm not sure exactly why it displays a whole screen of tile 0 (the tree). Any thoughts on that? I'm wondering if it's something with the data, or something else I'm doing in code. Tilemap in Tiled: Screenshot using plotmapfile gfx/tmx/forest_20x14_screen2.tmx currentmapdata 0 0 20 14 Looks like this (nevermind the one empty tile in the center column, I manually plot that) Quote Link to comment Share on other sites More sharing options...
RevEng Posted April 16, 2022 Share Posted April 16, 2022 Have you actually drawn graphically blank tiles in tiled, rather than leaving the tiles unused? 1 Quote Link to comment Share on other sites More sharing options...
+SmittyB Posted April 16, 2022 Share Posted April 16, 2022 I don't use plotmapfile much so I don't have any definite answers, but I did notice a couple of things. Firstly in your maps you have tiles that aren't explicitly defined so that they're listed as '<tile/>' rather than for example '<tile gid="1"/>' and presumably 7800basic interprets these as zeroes but it may be best to specify. Secondly, in your plotmapfile call you're telling it to read the tile data from 'currentmapdata' instead of 'forest_20x14_screen2' so unless you're copying the tile map across at some point I believe it'll use whatever tiles are set at currentmapdata while splitting the objects and palettes based on the contents of the TMX file. 2 Quote Link to comment Share on other sites More sharing options...
BydoEmpire Posted April 16, 2022 Author Share Posted April 16, 2022 (edited) 18 hours ago, RevEng said: Have you actually drawn graphically blank tiles in tiled, rather than leaving the tiles unused? They were unused, and that was most of the problem - both with the one value being 288 and the screens not displaying properly. I replaced the empty tiles with a 'solid color' tile and it mostly worked, except: 18 hours ago, SmittyB said: in your plotmapfile call you're telling it to read the tile data from 'currentmapdata' instead of 'forest_20x14_screen2' so unless you're copying the tile map across at some point I believe it'll use whatever tiles are set at currentmapdata while splitting the objects and palettes based on the contents of the TMX file. This was the other part. I was still using plotmap to plot currentmapdata afterwards. When I just did this: plotmapfile gfx/tmx/forest_20x14_screen5.tmx forest_20x14_screen5 0 0 20 14 it showed up correctly! Thanks for your help, getting these things to finally work is so rewarding! -Bydo Edited April 16, 2022 by BydoEmpire 4 Quote Link to comment Share on other sites More sharing options...
BydoEmpire Posted April 18, 2022 Author Share Posted April 18, 2022 Can you share a tileset across multiple maps? For instance, if we had a tileset for the status bar, or common trees or something, could we share that across a screen (tilemap) that also has its own unique tiles? Or does each screen/tilemap need its own independent tileset. Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted April 18, 2022 Share Posted April 18, 2022 21 minutes ago, BydoEmpire said: Can you share a tileset across multiple maps? For instance, if we had a tileset for the status bar, or common trees or something, could we share that across a screen (tilemap) that also has its own unique tiles? Or does each screen/tilemap need its own independent tileset. Yes is the short answer I think. With E.X.O, each world/level had a bunch of maps all using common tilesets (usually 20 screens for each world). Not all maps used all tiles. For example, I would usually have a background tileset, foreground tileset (sometimes 2 or 3), font/UI tiles, detail or greeble tiles. These were shared across all maps in that particular world, all the reused assets like ship, explosions etc, went in the last bank. E.X.O. World 1, 2 & 4 had 6 shared tilesets, World 5 had 8. I'm working on a new project where for a given screen, I have the common tiles shared by all screens in the level, then a couple of screens also have an extra tileset present, but only on those couple of screens. 2 1 Quote Link to comment Share on other sites More sharing options...
BydoEmpire Posted April 18, 2022 Author Share Posted April 18, 2022 41 minutes ago, Muddyfunster said: Yes is the short answer I think. With E.X.O, each world/level had a bunch of maps all using common tilesets (usually 20 screens for each world). Not all maps used all tiles. For example, I would usually have a background tileset, foreground tileset (sometimes 2 or 3), font/UI tiles, detail or greeble tiles. These were shared across all maps in that particular world, all the reused assets like ship, explosions etc, went in the last bank. E.X.O. World 1, 2 & 4 had 6 shared tilesets, World 5 had 8. I'm working on a new project where for a given screen, I have the common tiles shared by all screens in the level, then a couple of screens also have an extra tileset present, but only on those couple of screens. @aaron1677 - we should try having a tileset for common tiles like the status bar, "walkable" tiles, etc. and see if we can share that across different screens. It'd also let us use a different palette for the status bar which would be huge. 2 Quote Link to comment Share on other sites More sharing options...
+Pac-Lander Posted April 20, 2022 Share Posted April 20, 2022 On 4/17/2022 at 6:28 PM, BydoEmpire said: @aaron1677 - we should try having a tileset for common tiles like the status bar, "walkable" tiles, etc. and see if we can share that across different screens. It'd also let us use a different palette for the status bar which would be huge. Good idea. Question about the top status bar that is shared throughout the entire game - can that be on black? Is it possible for that background (the top 3x20 tile area) to be black, while the actual game background is a different color? I'm creating it with a unique palette, so just thought to ask. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.