Forum archive
How do I convert .BMP/.ART to .VOX/.KVX?
- I want to play around with voxel objects in Shadow Warrior, with the ultimate goal being to replace all sprites with voxel objects for use in JFSW/SWP.EXE
I have tried to do the following:
Extract the tiles*.art with XGroup
Using bastART, export all the pictures from TILES004.ART of the Sumo boss as sumo####.bmp
Create a new file called sumo.walk1.art and import the five rotations of the Sumo's first walking frame, in anti-clockwise sequence (that's the order they were in the original TILES004.ART).
Now supposedly I should be able to convert sumo.walk1.art to a voxel file incorporating these 5 frames with the following command:
slabspri.exe sumo.walk1 1 5 -5
But I just get a black full-screen, and when I alt-enter to have a look with explorer, nothing happens and no files were created.
Any idea? Re: How do I convert .BMP/.ART to .VOX/.KVX?
A few comments:
1. You must extract the PALETTE.DAT file from SW.GRP and use the same name as the ART.
2. SLABSPRI is a DOS program, so you must use short (8.3) filenames.
3. The first tile index of an ART file is 0, not 1. Unless you left a blank tile at the beginning of your ART file, the 2nd parameter should be 0, not 1.
I would suggest using the following filenames:
SUMO.ART
SUMO.PAL
Then write:
slabspri sumo 0 5 -5slabspri outputs garbage
Thanks for your reply, it got me a step further.
Since slabspri.exe doesn't run in XP, I booted into 98 for the first time in 2 years! :)
I went with the walk1.art/.pal filename, so my command was
slabspri walk1 0 5 -5
I end up in the editor (shouldn't it just write the .kvx to disk and terminate?)
and see that I have a horrible flesh colored mess, instead of the vaguely sumo-shaped blob I expected.
I guess when you wrote[SLABSPRI has] the facility to let you generate 3D objects from a series of carefully crafted 2D images
you meant 'carefully crafted' in a way I don't yet understand. When you created the .kvx for the pickups in SW, did you use a bunch of pre-rendered BMPs, or create them from scratch in the editor?
I have linked to the .art I used here and here, perhaps you can point out to me what I did wrong. Perhaps I misunderstood the scope of the program.
Is there any support for this format in another editor, such as Blender?Re: How do I convert .BMP/.ART to .VOX/.KVX?
Since slabspri.exe doesn't run in XP
It should run in XP if you run NOLFB.COM at the command prompt first. Get NOLFB here. It's near the top of the page.shouldn't it just write the .kvx to disk and terminate?
Sorry, I didn't implement it that way. You'll have to save manually inside the editor using Left Alt+S. If you don't like this, you are free to modify the source code : )and see that I have a horrible flesh colored mess
Slabspri cuts the cube using orthographic perspective. Unfortunately, this is rarely the case in sprite art, but with some alignment, usually it's not too bad. Alignment is critical for BMP->KVX conversion. Make sure the head and feet are at the same levels for all tiles. It helps to make all tiles in the .ART file the same size by padding them with transparency. Also make sure your vertical rotation axis is centered and correct for all tiles (Press ~ in EDITART and use left/right arrows). Pad on the left and right sides if necessary.When you created the .kvx for the pickups in SW..
The KVX pickups were made by other people at 3D Realms. I believe they started by converting from pre-rendered ART tiles, and then did some touch-ups in the SLABSPRI editor. They used the merge tool ('U' key) for some of the objects. I don't recommend this way anymore.Is there any support for this format in another editor, such as Blender?
Not that I know of. I only know of my own tools. Check out SLAB6 and POLY2VOX: http://advsys.net/ken/download.htm#slab6. SLAB6 is much better than SLABSPRI - except it doesn't have BMP to KVX conversion. POLY2VOX converts polygonal models to voxel models. If you're good at Blender, this would be a much better way to generate your voxel sprites.- Using macromedia fireworks, I resized sumo0001,5,9,13,17.bmp to uniform size of 256 x 256.
I then brought up the rulers and defined guidelines at x,y = 130,50. (green)
http://marco75.no-ip.info/images/art-to-kvx.editing_session.png
I then filled out the images with color 255 (purple)
http://marco75.no-ip.info/images/art-to-kvx.editing_session_2.png
when you look at them one after the other, they look like the character is spinning anticlockwise around his left leg as the pivot.
zip containing aligned BMPs
However, when I try to import them to a .ART file with bastART, the palette is all messed up:
http://marco75.no-ip.info/images/art-to-kvx.editing_session_3.png
I can for the life of me not figure out how the palettes of sumo0001.bmp and sumo0001.bmp differ.
I tried using editart.exe after running NOLFB.COM, but it's no good, I still get the black screen of death.
Thanks for your continued advice.
As for converting models to voxels, if I had created a model of a monster, the job would be done, since the SW source ports support models already. The idea of using voxels is to recycle existing sprite art which is potentially quicker than creating all-new 3D models.
Marco
P.S.: Sorry about the large images, but at least they are hosted on my own server, eh? - Okay I fixed up the palette thing.
Now I try to convert the .art file to .kvx as described earlier, but slabspri.exe crashes after CHOP 0.
I use the commands
NOLFB.COM
SLABSPRI.EXE walk1 0 5 -5
Can you try to convert the .art? - * I can't help with bastART. It's not mine.
* Editart does not use VESA graphics, and therefore does not require NOLFB. Slabspri does require NOLFB though.
* If Editart gives a black screen, you are probably missing one the necessary data files: TILES000.ART, PALETTE.DAT, or TABLES.DAT.
* SLABSPRI is currently compiled for models of maximum size: 128x128x200. That means no Editart tile can be bigger than 128x200 - or else crash. To increase the supported resolution, you can change the following lines in SLABSPRI.C and recompile:
#define MAXXSIZ 256 //formerly 128
#define MAXYSIZ 256 //formerly 128
#define MAXZSIZ 256 //formerly 200
I am putting a copy of a recompiled SLABSPRI.EXE here with the new limits, but only for a limited time!
* Your WALK1.PAL is only 768 bytes. Slabspri requires a full palette file - with shade table and 64K transparency table. You can either run "transpal.exe" on your palette file, or if it's the same palette as an existing Build game, it is easier to extract the PALETTE.DAT file from the GRP (and rename it).
* The correct command line syntax for your object is "slabspri walk1 0 5 -8". The 8 is important. That's how it knows to divide 360 degrees by 8, giving 45 degree increments. A 5 in the last parameter would give 72 degree increments, which is incorrect. I am putting a copy of a recompiled SLABSPRI.EXE here with the new limits, but only for a limited time!
In that case, I'll download it too, not that I'll ever use it but hey, you said "limited time" and to me that makes it a limited edition ;D- I should probably mention that classic Build only supports voxel sprites up to 128x128x200, while JonoF's port has supported 256x256x255 for a while.
- You know, that actually kind of worked. It is recognizable, and the back leg is at the correct angle... I'd still have to do a lot of editing on it, perhaps with different alignments I can get improved results.
- Man, I would LOVE to see this project of yours in completion. I would like to see what a character would look like as animated voxel-sprites.
Um, I have no way to actually help you create anything though, sorry, it's just not my field of talent. Good luck though! - I am currently going through a Blender tutorial on-line.
Since the .VOX/.KVX data formats are documented, I would like to investigate how the .BMP -> .VOX algorithm works.
It should be possible to implement the algorithm in Python for use in blender, so that you can convert and work on the results straight away. I'm not sure the editor in blender can be used for editing voxel graphics.
Conversely, I could just learn how to edit .KVX manually in Ken's editor.
I thought you could start with the frontal view, extend it, turn the view 45, place pixels from the 45 degree bitmap onto the surface displayed, turn it another 45 degrees and so on.
I will draw pictures to illustrate the idea.
The point is, this conversion has to be done in an environment that allows automation and scripting to accelerate the process as much as possible. If I merely find yet another laborious process I will have gained nothing.
Where can I find the sourcecode for SLABSPRI.EXE, Ken? SLAB6 comes with source, but I don't know about SLABSPRI.EXE. - Look for SLABSRC.ZIP near the top of this page: http://advsys.net/ken/buildsrc/
If you have 3D models of your object, you really ought to use POLY2VOX instead of SLABSPRI for conversion.
I briefly describe SLABSPRI's BMP->VOX algorithm in the Build faq, located on this page.