Tileset Maker
Displaying 1-19 of 19 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Wolf

I'd like to know if there's a general interest for some utility to make tilesets.

It's a little something I started on using V3 itself.
What it does now is load a given image. Then you can use the mouse to designate a 16x16 area.
Image Hosted by ImageShack.us
After that you can use the keyboard to hop over the image which is like a grid and pick out any tiles you like. The chosen tiles will be shown in the lower part of the screen.
Image Hosted by ImageShack.us
Then, when you're done, it will show your tile in a 640x480 resolution so you can easily display it fullscreen and printscreen it into your clipboard.
Image Hosted by ImageShack.us
After cropping the image to the right size it's ready for maped3 import.

It's a bit unwieldy as of yet. I`m not a native programmer, but this is simple enough for me to pull off and I hope it will be of help.

If there's enough animo, I want to try making a utility that I dare to upload out of it.

Posted on 2004-10-21 16:32:59

zaril

You'll have to add a feature or two for it to be less daunting than the normal way. When I've done it, I follow this procedure:

1. PrintScreen

2. Load AdobePhotoshop

3. Ctrl+N for new, Ctrl+P for Paste

4. Change the size of the working area

5. Cut out 16x16 with the info window as help for selected area and the fact that I cut out parts keeps me from cutting things out wrong, and I just put them in my empty work area, since they all need to have the same general grid, else you'll end up with tiles that won't go together.

It's such a simple task in Adobe Photoshop with Cut'n'Drag so any utility claiming to make it easier needs to have some sort of extra functionality.

Just my five cents, the initiative is great though. Don't let me stop you from anything.

Posted on 2004-10-21 18:25:47

vecna

I've been wanting a utility like that for a while, and I was almost going to make one myself but I never got around to it.

One suggestion, until I get around to adding a save image directly to disk in V3, use the V3 clipboard functions and make a hotkey to just copy the image itself directly to the clipboard so you don't have to crop it once you load it in photoshop.

Edit: Might also be nice to let it load images from the clipboard, so that you can copy them right from the emulator without having to save the image in photoshop first (well depending on the emulator, others have screenshot keys but not all do)

Posted on 2004-10-21 19:29:08 (last edited on 2004-10-21 19:31:16)

mcgrue

Most of the ones I use save to bmp or png but not clipboard.

Posted on 2004-10-21 22:34:21

vecna

..yeah, but the emulators that dont have direct screenshot support, you alt-prtscrn. walla, image in the clipboard.

Dork!

Posted on 2004-10-21 22:46:56

RageCage

V3 bmp output function:
Here.

Posted on 2004-10-21 23:43:42

Interference22

Quote:Originally posted by RageCage

V3 bmp output function:
Here.


Wow, didn't even notice that. Woohoo!

Posted on 2004-10-22 09:38:54

Wolf

Thanks for the reactions all.

The clipboard function was easy to implement and is indeed user-friendlier. I didn't even know it existed.

The BMP-output function works fine if I want a 320x240 bmp.
But I want 20 tiles per row (since maped3 shows it like that as well) with padding. So the width is 20*17+1=341.
When I change the image size to 341x240 in the bmpfunction it gets all screwy.
Code:

void SaveTileSet() //Save bmp -- Thanks to RageCage
{
string ScreenShot_Filename;
int file;
int row, col;
int something;

ScreenShot_Filename='screens\'+str(ScreenShot_Number)+'.bmp';
file=FileOpen(ScreenShot_Filename,FILE_WRITE);

FileWrite(file,'BM');
FileWriteQuad(file,0); // file size (ignore)
FileWriteQuad(file,0); // two reserved words
FileWriteQuad(file,54); // offset to image data

FileWriteQuad(file,40); // size of the bitmap info structure
FileWriteQuad(file,341); // image width
FileWriteQuad(file,240); // image height
FileWriteWord(file,1); // Number of planes? *shrug*
FileWriteWord(file,24); // bits per pixel
FileWriteQuad(file,0); // no compression
FileWriteQuad(file,0); // size of bitmap data (ignore)
FileWriteQuad(file,0); // whatever, man
FileWriteQuad(file,0); // whatever, man...
FileWriteQuad(file,0); // number of colors (ignore)
FileWriteQuad(file,0); // important colors (ignore)

for(row=239;row>=0;row--)
{
for(col=0;col<341;col++)
{
something=GetPixel(col,row,screen);
FileWriteByte(file,GetB(something));
FileWriteByte(file,GetG(something));
FileWriteByte(file,GetR(something));
}
}
FileClose(file);
while(!b1)
{
Render();
PrintString(50,100,screen,font,
'File saved as 'screens\'+str(ScreenShot_Number)+'.bmp');
Showpage();
}
ScreenShot_Number++;
}

Posted on 2004-10-22 19:49:49 (last edited on 2004-10-22 21:50:58)

Zip

Yeah, bitmap file format demands rows to be a quad multiple. There *should* be an elegant way of doing this to get the width right, but I've not bothered experimenting enough yet. Makmak currently pads the right edge as required:
if (di_x % 4) di_x += 4 - (di_x % 4); // Ack... must be better method...
ehehe... good comment by me there. (di_x being the x dimension of the bmp to save of course)

I may look at doing the proper method again later this evening.

Zip

[Edit: Pointless tab removal service.]

Posted on 2004-10-22 20:11:40 (last edited on 2004-10-22 20:12:21)

Zip

Right, got it happily working.
// Writes an image to file as a 24 bit bitmap

int WriteFileBitmap24(int out_image, string name)
// Pass: Image to save, filename (and path) to save as (without extension)
// Returns: 0 on fail, and the size on image data written on success
// Started life as code by geronimo
{
int xi, yi, out_file, out_pixel, img_size, img_xtra;
int img_x = ImageWidth(out_image);
int img_y = ImageHeight(out_image);
if (img_x * img_y == 0) return 0; // Return on bad image
if (img_x * 3 % 4) img_xtra = 4 - (img_x * 3 % 4); // Padding needed
else img_xtra = 0; // No padding needed
img_size = ((3 * img_x) + img_xtra) * img_y; // Size of image data in bytes
out_file = FileOpen(name + '.bmp', FILE_WRITE);
if (!out_file) return 0; // Return on bad path or unopenable file
FileWriteWord(out_file, 19778); // bfType - Header of 'BM'
FileWriteQuad(out_file, 54 + img_size); // bfSize - File size
FileWriteQuad(out_file, 0); // bfReserved1, bfReserved2 - Two reserved words
FileWriteQuad(out_file, 54); // bfOffBits - Offset to image data
FileWriteQuad(out_file, 40); // biSize - Size of (windows) bitmap info structure
FileWriteQuad(out_file, img_x); // biWidth - Image width
FileWriteQuad(out_file, img_y); // biHeight - Image height
FileWriteWord(out_file, 1); // biPlanes - Err... one
FileWriteWord(out_file, 24); // biBitCount - Bits per pixel
FileWriteQuad(out_file, 0); // biCompression - No compression
FileWriteQuad(out_file, img_size); // biSizeImage - Size of bitmap data
FileWriteQuad(out_file, 0); // biXPelsPerMeter
FileWriteQuad(out_file, 0); // biYPelsPerMeter
// X/YPelsPerMeter specifies the horizontal/vertical resolution,
// in pixels per meter, of the target device for the bitmap.
// An application can use this value to select a bitmap from a resource
// group that best matches the characteristics of the current device.
FileWriteQuad(out_file, 0); // biClrUsed - Not palletted data
FileWriteQuad(out_file, 0); // biClrImportant - All colours important

for(yi = img_y - 1; yi >= 0; yi--) // Move from bottom of image data up
{
for(xi = 0; xi < img_x; xi++) // Write row of pixels
{
out_pixel = GetPixel(xi, yi, out_image);
FileWriteByte(out_file, GetB(out_pixel));
FileWriteByte(out_file, GetG(out_pixel));
FileWriteByte(out_file, GetR(out_pixel));
}
for(xi = img_xtra; xi > 0; xi--) // Pad to quad width
{
FileWriteByte(out_file, 0);
}
}
FileClose(out_file);
return img_size;
}


Zip

[Edit: My fixor or my life]

Posted on 2004-10-22 23:15:44 (last edited on 2004-10-22 23:39:27)

Wolf

Well, I've continued work on the TilesetMaker.
It seems to work fine for simple importing purposes.
Thanks for the replies everyone, it was really useful.

Next up is the tileset editor. I've started on it, but you can't do anything with it yet.

I'd like to upload the program, so you can give me feedback and suggestions, but I don't have the webspace for it. If someone would be willing to host it, I'd be grateful. The file is 641 kB.
(It's just not ready to be uploaded in the files section yet).

Posted on 2004-10-25 23:40:15

Sungam

I'd like to upload the program, so you can give me feedback and suggestions, but I don't have the webspace for it. If someone would be willing to host it, I'd be grateful. The file is 641 kB.
(It's just not ready to be uploaded in the files section yet).


I'm sure one of the dev guys will come running offering space in a moment, but if not, you're welcome to e-mail it to magnus@kebun.net, and I'll upload it and post a link here.

Posted on 2004-10-25 23:45:39

TomT64

I'll host it. Email me at tomt64 At tomt64 DOT com and I'll set you up a space.

Posted on 2004-10-25 23:46:00

mcgrue

...Why not just upload it to the files section?

Posted on 2004-10-26 03:54:13

rpgking

Exactly what I was wondering...

Posted on 2004-10-26 04:53:38

Wolf

Because it's too sucky as of yet.
You can only use it for simple import.

I plan to add lots of useful features to it before I upload it into the files section, so you don't get a TilesetMaker v0.0001a beta release.

For now I just want some feedback and suggestions.

edit: BTW, thanks sungam and Tom64 for the offers. I've send the file to Tom64.

Posted on 2004-10-26 09:15:51 (last edited on 2004-10-26 09:17:07)

TomT64

File is downloadable at http://vopenchr.sf.net/tilesetmaker/TilesetMaker.zip.

Posted on 2004-10-26 11:58:08

Toen

Nothing is too sucky for the files section. Whenever you update it just go ahead and update it's listing.

Posted on 2004-10-28 04:09:21

Feyr

The update listing thing doesn't work for me, and apparently not for at least some others, either. A forum search for the error message I got (parent id not sent) turned up a few other people who mentioned it, with no resolution.

Posted on 2004-10-28 15:59:37 (last edited on 2004-10-28 16:01:33)


Displaying 1-19 of 19 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.