Posted: Fri Aug 08, 2008 1:27 pm Post subject:
VXL File Format
I am writing a program to read the VXL file format. I have used several resources so far; The VXL documentation available here http://xhp.xwis.net/documents/VXL_Format.txt, the source code for the excellent OS Voxel Tools (the program this board is dedicated to) and the source code from the XCC Mixer and related tools (http://xhp.xwis.net/).
I can successfully read the headers & tailers, but the voxel data itself is causing me some trouble. I just keep ending up with scrambled data. The thing that is confusing me the most is the span_start and span_end arrays. I understand these to be byte offsets into the span_data, but if I take the first span in span_data, I end up with a voxel_count (from the top & tail of the span), the skip count, and the voxel data itself. But if I add up the 3 bytes for the skip count & voxel counts then add on 2 * the voxel count, the result does not equal span_end - span_start for that span. Am I misunderstanding some part of the format?
If I just ignore the start_span & end_span values then I appear to be able to read a set of packed spans (top & tail voxel counts match, skip count looks sane), but when I try to display them it's not right.
I noticed in this http://www.ppmsite.com/forum/viewtopic.php?t=14594 thread ViPr said that they had some more up-to-date documentation for the VXL format, so if someone round here has a copy of that I'd really appreciate a copy. QUICK_EDIT
Well, I've fixed it. I took a more detailed look at the pascal code in OS Voxel Tools. I just use the start_span offset to seek to the start of each span, then I read the voxels for the span from there. This works properly.
Thanks to Banshee & anyone else who's worked on the OS Voxel Tools - wouldn't have got very far without the loading code for reference.
I now have a C++ class for reading VXL files. I'm happy to post it if anyone wants it for anything (BSD licensed). QUICK_EDIT
Well, probably not a modding tool as that seems well covered when it comes to SHP/VXL/HVA. A couple of friends & I are reimplementing Red Alert 2 (and Yuri), using more up-to-date & portable libraries (SDL/OpenGL) and using TCP/IP or UDP/IP instead of god-awful IPX. Whether this will materialise is another question entirely, it's more something to keep me busy for now. RA2 was a fantastic LAN game, but now-a-days it's just such a pain to get it set up, especially as it refuses to run networked in WINE. QUICK_EDIT
Joined: 18 Jun 2005 Location: Dordrecht, the Netherlands
Posted: Fri Aug 08, 2008 8:19 pm Post subject:
shiny wrote:
Well, probably not a modding tool as that seems well covered when it comes to SHP/VXL/HVA. A couple of friends & I are reimplementing Red Alert 2 (and Yuri), using more up-to-date & portable libraries (SDL/OpenGL) and using TCP/IP or UDP/IP instead of god-awful IPX. Whether this will materialise is another question entirely, it's more something to keep me busy for now. RA2 was a fantastic LAN game, but now-a-days it's just such a pain to get it set up, especially as it refuses to run networked in WINE.
I suggest chatting with PaD or DCoder for that RA2/YR stuff... I dunno if they are doing the same thing as you guys do, but it seems you have a certain coding knowledge QUICK_EDIT
Well, probably not a modding tool as that seems well covered when it comes to SHP/VXL/HVA. A couple of friends & I are reimplementing Red Alert 2 (and Yuri), using more up-to-date & portable libraries (SDL/OpenGL) and using TCP/IP or UDP/IP instead of god-awful IPX. Whether this will materialise is another question entirely, it's more something to keep me busy for now. RA2 was a fantastic LAN game, but now-a-days it's just such a pain to get it set up, especially as it refuses to run networked in WINE.
very intresting info here, I hope you keep us updated with that OpgenGL stuff. QUICK_EDIT
In incorporates some code and algorithms from Voxel Selection Editor, and the GPL meets the requirements for crediting the authors. Also it was the license that I happened to have the header etc. lying around ;p, and I like to make sure the license on any code I release is clear. I can re-license to BSD if you like, after all it's mostly just ported from Voxel Selection Editor's pascal code. _________________ If at first you don't succeed, get a bigger hammer. QUICK_EDIT
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum