This is the Voxlap library, plus full engine source code. Also, I added GAME.EXE to the archive so now non-programmers can try the demo.
Discuss.
TX at
I don't really have anything particularly interesting to say on the matter as I know very little about voxels (and Voxlap, for that matter), but I'm always pleased when source to cool stuff like this is released.
Thanks for your continued support and for giving back to the community, Ken. I hope somebody does something cool with this.
Saucjedi at
Thanks a lot, Ken. Do you see any problems in porting it to Game Boy Advance? I'm not familiar with the requirements of the engine, but it will be a sweet thing to do. I have been thinking on doing it myself.
What do you think?
Anonymous at
Ken
thanks for the code, I just had a quick look at it and the first impression was that it looks like the quake code when comparing the style. Lots of unreadable passages and weird hacks :D
Unfortunately I dont have any time to work on that topic anymore cause im working full time but I hope someday voxel will rule the world as you say. a 3d shooter could be a blockbuster like the orignal doom. I'm sure on that!
Sebastian
Awesoken at
Do you see any problems in porting it to Game Boy Advance?
Voxlap requires 128MB RAM. I can't imagine how you would squeeze that into the GBA's 256KB RAM without castrating nearly every feature of the engine. If you want a voxel engine for GBA, I would start with a basic floor-mapper like in GROUFST2.BAS and extend the map size using a grid of tiles.
masterlee at
You can have 256 MB Ram in GBA by using flash card with additional memory. But you must use some sort of paging. Also memory can saved by reducing map size and using fewer colors only 8bit or less palette. "EZ-III Flashlinker, 2Gbit + 256Mbit (2,25Gbit Set)" have 256 Mbit of Battery Saved Ram, i didn't knew if that is fast enough. If size ist halfed in X-,Y- and Z-direction it could fit?
Tomkh at
Great release, I'm glad game.exe is finally included :)
As Ken would probably say most functions written in Assembler also have equivalent C code, disabled by default using "#if 0" statements and "#define USEV5ASM 1" for v5.asm. Obviously for porting to non-intel platforms using just C code instead of asm is a must.
Anyway, I think the best option for GBA is to figure out / learn how the basic algorithm works and rewrite many parts (or everything) from scratch (using simplified algo). But if you are really good at tweaking someone else C code, prove me wrong :)
Also I can say that Voxlap API was very easy to use for me (as a Voxlap game developer) so I strongly encourage to keep new ports/adaptations compatible (I'm mostly talking about set* functions, cansee, hitscan and matrix/camera operations).
And as you can see Ken's code is quite dense / smart / uncommon, but you can get used to it. In fact it's very clean / carefully written code, just few weird conventions, like all vector operations are always expanded (and optimized a bit), also if a "function" would be called only once Ken just inline it by hand, so at the end there are really not many functions, just few big ones. Oh and yes.. whole code is usually written in a single big file (feel free to divide it if you found it uncomfortable, some logic parts are usually seperated by "-----" line). It's just Ken is using his own tools even for editing code (KC text editor, available at his homepage).
masterlee: I've seen your animated plasma for evaldraw, very nice :)
Maximus at
WOW!!!
IM SO EXCITED!!! I've been playing with the VOXAP lib for ages now. And now you've released the FULL CODE!!! Oh MAN!!!
The plans i've had are now even huger. With direct access to the full routines I can see some C++ wrappers getting thrown in.
Any how... I'm getting over excited!
Nice one Ken! :D
You DA MAN!!!
-Rik
p.s. Has anyone uploaded their own code anywhere? Id love to see others efforts... Personally I havent cos 1:I have no where to put it. 2:All my stuff is small ODD ideas |I have... If I ever pull my finger out and setup some webspace Ill keep this place posted ;)
Frobozz at
So any chance we are going to see that "prototype game" with what looks like a pair of apes and "HI :)" written to the screen?
Also - is anybody actually doing anything with this library? Somebody needs to do something - I suck at modelling - although the polygon to voxel thing sounds interesting. Will have to check that out. :wink:
plugwash at
didn't ken write a polygon to voxel converter for use with the build games ages ago? or is thier something different about this one?
Frobozz at
plugwash said
didn't ken write a polygon to voxel converter for use with the build games ages ago? or is thier something different about this one?
Not sure - maybe it's the same thing. At any rate it does a good job! Tried it on one of 3dsmax's tutorial scenes and it got it exactly. Maybe once I figure out how to compile again I might try my hand at something.
Main thing I've got to figure out now is how to animate various things. Like maybe water surfaces. Don't need anything fancy. 8)
Anonymous at
Saucjedi said
Thanks a lot, Ken. Do you see any problems in porting it to Game Boy Advance? I'm not familiar with the requirements of the engine, but it will be a sweet thing to do. I have been thinking on doing it myself.
What do you think?
Why would you make a 3D game on a platform that was built for 2D?
Saucjedi at
Anonymous said
Saucjedi said
Thanks a lot, Ken. Do you see any problems in porting it to Game Boy Advance? I'm not familiar with the requirements of the engine, but it will be a sweet thing to do. I have been thinking on doing it myself.
What do you think?
Why would you make a 3D game on a platform that was built for 2D?
Well, in the first place, I had no idea about the requirements of Voxlap and well, Doom I & II, along with Wolf3D have nice renditions on the GBA. Granted, they're not 3D... but sort of...
It depends on your point of view. The PC wasn't designed to make games AT all... but in time... you see. Remember that BUILD predates any 3D card
Anonymous at
Bit of a tangent from the current topic...
Ken, can you tell me a bit about the vx5sprite struct, the point3d values s, h and f?
The reason I ask is cos I thought they were to do with scaling the sprites. However each value has 3 dimensions. So unless you are doing something incredibly funky maths wise (which isn't impossible to imaging :wink: ) they are for something else.
Looking at the monster shooting code you copy the monsters values to these then scale them down...
Ta
Rik
Awesoken at
The s, h, and f vectors form a transformation matrix allowing you to scale, rotate, or shear the sprite in any way you want. I've gotten into the habit of using 's' for strafe, 'h' for height, and 'f' for forward. For you, it may be easier to use x, y, z instead - that's what those unions are for. The reason I did not list those 3 vectors consecutively in the vx5sprite structure is for alignment purposes - so each 12-byte vector starts on a 16-byte boundary.
Maximus at
Ok. Cool.
I uess I was kind of half right... Like the union, makes code easier.
One more Q.
You say that you can scale, rotate and shear. Would this be the x,y,z of each point3d then?
So 'sprite.s.x' would be to scale in the 'strafe' dimension(relative to the sprite)?
If I remember this isnt how you do those cool curvy/twisting sprites is it... They were done using global variables. However a similar effect code be achieved using these values.
Sorry, don't have code in front of me so can't check! :oops:
And thanks again for the help!!!
-Rik :D
Anonymous at
Saucjedi said
Anonymous said
Saucjedi said
Thanks a lot, Ken. Do you see any problems in porting it to Game Boy Advance? I'm not familiar with the requirements of the engine, but it will be a sweet thing to do. I have been thinking on doing it myself.
What do you think?
Why would you make a 3D game on a platform that was built for 2D?
Well, in the first place, I had no idea about the requirements of Voxlap and well, Doom I & II, along with Wolf3D have nice renditions on the GBA. Granted, they're not 3D... but sort of...
It depends on your point of view. The PC wasn't designed to make games AT all... but in time... you see. Remember that BUILD predates any 3D card
Very True.
But I left out something :oops: Wouldn't it be better on the New Nintendo DS?
JoshW at
Hey Ken, nice work being released and all.
I was compiling it and came across something which caused a plethora of errors. What it was is the structure kv6data in voxlap5.h
It seems that in the structure has a reference to itself kv6data *lowermip;, and wont compile because of it.
So i did some insane thing and pretended it was a pointer of another type and modified all references of it, but it has decided it would not run because of it.
So, what have i done wrong? :(
Hazard at
JoshW said
Hey Ken, nice work being released and all.
I was compiling it and came across something which caused a plethora of errors. What it was is the structure kv6data in voxlap5.h
It seems that in the structure has a reference to itself kv6data *lowermip;, and wont compile because of it.
So i did some insane thing and pretended it was a pointer of another type and modified all references of it, but it has decided it would not run because of it.
So, what have i done wrong? :(
I had the same problem when using MSVC. You'll have to force MSVC to compile all the C files as C++ Code to get it to compile.
Raedwulf at
Easier still just rename the .c to .cpp
Ken says somewhee in readme or something liek that - the source files are all c++ (except kplib(but compile it as c++ too for linking convenience))
He was just lazy to type cpp :P
Hazard at
I compiled a first test version of my VoxlapDotNet class. To achieve this i made a Voxlap C++ DLL and the VoxlapDotNet Class that handles the main loop and calls all functions exportet by the DLL. This way you're able to make cool Voxlap Games with an absolutely easy to use .Net Class.
The following code of VB.Net is everything you'll have to code to create a project like simple.c (just without the Desklamp sprite):
Friend Module modVoxlap
Friend WithEvents Voxlap As New CVoxlapDotNet
Public Sub Main()
If Voxlap.CreateWindow(1024, 768, , False) Then
Voxlap.StartLoop()
End If
End Sub
Private Sub Voxlap_Initializing() Handles Voxlap.Initializing
Voxlap.AddDataFile("voxdata.zip")
Voxlap.LoadVXLMap("vxl/untitled.vxl")
End Sub
Private Sub Voxlap_DrawFrame() Handles Voxlap.DrawFrame
End Sub
End Module
It's only a test for now, but i hope to get a first really useful version done in (relatively) short time. My next attempt will be to create a game.c like game using VoxlapDotNet.
But i don't think that the early versions will support VoxelSprites cause i don't like them. :) I hope to find a way to implement my own drawing functions to achieve combined Voxel and Polygon rendering using a shared Z-Buffer.
I sadly won't be able to work on it on this weekend because i'm on a weekend trip to Denmark, but next week i'll definitely spend a lot of time to it.