DrawMap and TileStudio Help

Topics on software tools like TileStudio, comments on documentation and tutorials (or the lack of) should go here.
soshimo
Posts: 51
Joined: Thu Jan 08, 2009 10:10 pm

DrawMap and TileStudio Help

Post by soshimo »

Sorry to be such a pain with this. I'm so close to having a complete toolchain and I'm very happy :mrgreen: . One thing keeping me moving on though is this cantakerous Tile Studio and the fact that what I see is most decidedly not what I get. I've followed as many tutorials that I can find. The only difference is that I'm making my own artwork as I go (using the Tile Studio drawing tutorial - a very handy tutorial that BTW). I've set the palette depth to 6 bits and have otherwise followed the examples to a 'T'. Well, my tile size is 32x32 - would that make a difference? I'll attach sample code and a serious of screenshots. They are large and I'm too lazy to resize them or I would post them inline. Descriptions are as follows:


The map in progress:
Screenshot of the map in progress
Screenshot of the map in progress
screenshot1.png (48.75 KiB) Viewed 7626 times
Palette Menu to show I chose the correct palette... or not.
Palette Menu
Palette Menu
screenshot2.png (51.83 KiB) Viewed 7626 times
and finally the Tile Editor (notice the palette on the far right)
Tile Editor
Tile Editor
screenshot3.png (22.95 KiB) Viewed 7625 times
Here is what I get when I dont set VIDEO_MODE=2 in the project settings:
Image

And here is what I get when I do set VIDEO_MODE=2 in the project settings:
Image

Thank you in advance for any help you can provide.
soshimo
Posts: 51
Joined: Thu Jan 08, 2009 10:10 pm

Re: DrawMap and TileStudio Help

Post by soshimo »

Okay, so they only allow 3 attachments. Here is the code.
Attachments
tiletest.zip
(2.81 KiB) Downloaded 374 times
User avatar
Jhysaun
Posts: 214
Joined: Tue Nov 04, 2008 12:32 am

Re: DrawMap and TileStudio Help

Post by Jhysaun »

Well first off you can set your color depth to 8. I don't know if it makes a different for the code but if it does you'll get more color.

The difference between 6-bit and 8-bit is simple... 2- bits.
Since a bit can be either 0 or one the max 6 bit color is: 111111 or 63
The max with 8bit is 11111111 or 255 colors. You get more colors with 8 bit.

Im looking at your code now....

EDIT: Use DrawMap2 instead of draw map, does that help?
EDIT2: I also think you can set the x and y coordinates for drawmap(2) to 0,0 instead of 1,1...Uze can you confirm this?
Lerc wrote:I intend to use my powerful skills of procrastination to ensure that when I get to making things, the chips will be available.
soshimo
Posts: 51
Joined: Thu Jan 08, 2009 10:10 pm

Re: DrawMap and TileStudio Help

Post by soshimo »

Well, I tried DrawMap2, here is the result:
CIMG1812.JPG
CIMG1812.JPG (161.16 KiB) Viewed 7618 times
A change, but still nothing matching what I created in TS.
User avatar
Jhysaun
Posts: 214
Joined: Tue Nov 04, 2008 12:32 am

Re: DrawMap and TileStudio Help

Post by Jhysaun »

I looked at your include file and you have 32x32 px tiles, that might cause problems
Lerc wrote:I intend to use my powerful skills of procrastination to ensure that when I get to making things, the chips will be available.
soshimo
Posts: 51
Joined: Thu Jan 08, 2009 10:10 pm

Re: DrawMap and TileStudio Help

Post by soshimo »

I also tried with 16x16, what is the tile size needed? This is very frustrating - a very simple part of the tool chain and I should be able to get it right. I can't find any documentation and I really don't feel like weeding through assembler code to figure out wth is going on. :?
User avatar
Jhysaun
Posts: 214
Joined: Tue Nov 04, 2008 12:32 am

Re: DrawMap and TileStudio Help

Post by Jhysaun »

FIxed it !!

In Mode 2 you need to use screen sections to display stuff.

This is what your code should look like:

Code: Select all

#include <stdbool.h>
#include <avr/io.h>
#include <stdlib.h>
#include <avr/pgmspace.h>
#include "kernel/uzebox.h"
#include "data/tiletest.pic.inc"


int main(){

  // SetTileTable(Tiles1); // sets the sprite graphics to our
	screenSections[0].tileTableAdress=Tiles1;
		screenSections[0].height=208;	
		
                                       // TileStudio graphics
	DrawMap2(1, 1,Tiles1_Map1);
  	while(1) {
   		// after updating the screen, just wait forever
	}
} 

Second:

The start of your map should look like this


const char Tiles1_Map1[16 * 16 + 2] PROGMEM=

Note the Red "char" not the "int" you had.

Third:
Add all these settings to your compile options.

-DVRAM_TILES_V=26
-DSCREEN_SECTIONS_COUNT=1
-DVIDEO_MODE=2

Then it should work
Lerc wrote:I intend to use my powerful skills of procrastination to ensure that when I get to making things, the chips will be available.
soshimo
Posts: 51
Joined: Thu Jan 08, 2009 10:10 pm

Re: DrawMap and TileStudio Help

Post by soshimo »

That didn't work :cry:, and it looked so promising too. I appreciate all your hard work on this but I think I'm about to call it a night. It's unfortunate because I only had a small window of opportunity this weekend to work on it and I was hoping I would get farther than this. I'm just a little frustrated and my head hurts from banging it on my desk. I just need a single "ah ha!" moment to make me feel satisfied :D, oh well. Thanks again.
User avatar
Jhysaun
Posts: 214
Joined: Tue Nov 04, 2008 12:32 am

Re: DrawMap and TileStudio Help

Post by Jhysaun »

Did you see my last minute edit?


I changed screenSections[0].tileTableAdress=Tiles1_Map1; or something to

screenSections[0].tileTableAdress=Tiles1;
I uploaded the working file.
Attachments
Test.hex
(71.84 KiB) Downloaded 403 times
Lerc wrote:I intend to use my powerful skills of procrastination to ensure that when I get to making things, the chips will be available.
soshimo
Posts: 51
Joined: Thu Jan 08, 2009 10:10 pm

Re: DrawMap and TileStudio Help

Post by soshimo »

Yes, I did catch that. Did you happen to try it out on your side to see what kind of output you got? Here is what I'm getting with both your hex file and the one I create when I the code with the changes:
After latest changes
After latest changes
CIMG1813.JPG (172.63 KiB) Viewed 7581 times
Maybe I have something hooked up wrong or maybe I'm using an older version of the kernel?
Post Reply