First, thanks for reading my request! I'm very interested in voxel rendering. Recently, I found Ken Silverman's old work CAVE engine(http://advsys.net/ken/voxlap/cave.zip). I know voxlap but it is too complicated for me, this little CAVE engine is a really good start for me and I like it so much that I want to port it into flash using actionscript and Alchemy.
As you may know, Adobe Alchemy can compile c/c++ into a swc which works with actionscript like a dll with C. Both Doom(www.newgrounds.com/portal/view/470460) and Quake(www.silvergames.com/game/quake-flash/) have already been ported into flash, which enable us to play them online. If there are no asm code, I think someone will try to port Duke Nukem 3D, too.
Now I want make this cave experiment an online application using flash.
The problem is I'm not a professional programmer... and I can't read assembly language, too. There are some functions written in OpenWatcom inline assembly, I need someone to translate them into C code. Is it possible? Can anyone help me?
Thank you very much in advance! :)
If I succeed, I will release the full source code and you will be one of the authors of this project, I promise. P.S. function showscreen4pix320200() maybe not very important for me, all I need is "scrbuf"(SreenBuffer), the array will be passed to flash. I mean, you don't need to worry about how to put SreenBuffer on screen, all I need is the SreenBuffer array - "scrbuf" as a return value.
Re: Could anybody help me on Ken Silverman's CAVE engine source
Here you go:
setvmode(0x13): change to 320x200, 256 colors setvmode(0x3): change back to text mode before quitting void drawpixel (long ptr, long val) { *(long *)ptr = val; } //silly function; not used anyway long scale (long a, long b, long c) { return (long)(((__int64)a * b) / c); } long mulscale (long a, long b, long c) { return (long)(((__int64)a * b) >>c); } long divscale (long a, long b, long c) { return (long)(((__int64)a <<c) / b); } long groudiv (long a, long b) { return(divscale((a<<12)-posz,b,24)); } long drawtopslab (long p, long c, long v) { for(;c>0;c--,p+=80) *(char *)p = (char)v; return(p); } long drawbotslab (long p, long c, long v) { for(;c>0;c--,p-=80) *(char *)p = (char)v; return(p); } showscreen*pix*(): blits scrbuf; some variants duplicating rows/columns to increase fps
Bruce_Jawn at
Awesoken said at
Here you go:
setvmode(0x13): change to 320x200, 256 colors setvmode(0x3): change back to text mode before quitting void drawpixel (long ptr, long val) { *(long *)ptr = val; } //silly function; not used anyway long scale (long a, long b, long c) { return (long)(((__int64)a * b) / c); } long mulscale (long a, long b, long c) { return (long)(((__int64)a * b) >>c); } long divscale (long a, long b, long c) { return (long)(((__int64)a <<c) / b); } long groudiv (long a, long b) { return(divscale((a<<12)-posz,b,24)); } long drawtopslab (long p, long c, long v) { for(;c>0;c--,p+=80) *(char *)p = (char)v; return(p); } long drawbotslab (long p, long c, long v) { for(;c>0;c--,p-=80) *(char *)p = (char)v; return(p); } showscreen*pix*(): blits scrbuf; some variants duplicating rows/columns to increase fps
:D THANK YOU SO MUCH, Ken Silverman! I will try my best to do the port now, wish I can bring good news back soon!
CaimX86 at
Awesoken said at
Here you go:
setvmode(0x13): change to 320x200, 256 colors void drawpixel (long ptr, long val) { *(long *)ptr = val; } //silly function; not used anyway [/quote]
Hi Ken,
Why you said it's a silly function? What you use instead of this function?
I'm asking that, because I'm using a similar function in my engine.
Edited by CaimX86 at
Awesoken at
In 1994, I was more comfortable with assembly language than pointers in C. It's silly because the C equivalent should run just as fast, if not faster.
CaimX86 at
Now I'm understand what you mean!
Schraubendreher at
Hi!
I wrote an Evaldraw script recently, which Ken says uses something very much like his CAVE algorithm. Since you are trying to port it, I think it would help to have a working example in a more general language, without asm-specific things.
You use W/S/A/D for movement, mouse to look, space for jumping, and Q for flying (release Q to fall). If the frame rate appears too low, lower the resolution of Evaldraw. It has a very simple renderer that draws vertically, so it will have major cache issues for large resolutions. Optimizing it will not help the porting effort, so I'm leaving it as it is.
Let me know if you find it useful. :)
Bruce_Jawn at
Thanks! What I want to do (port the cave engine) seems harder than I had expected... :( some unknown runtime bugs crashed my programme hundreds of times!
Now I'm also trying to write a simple raycasting voxel engine based on this voxel terrain experiment: http://bruce-lab.blogspot.com/2008/10/open-source-as30-voxel-terrain-engine.html First AS3, then I will try to use alchemy(C/C++) to speed it up. I think the source will help. :)
And, some good resources(Flash+voxel):
flash render a 320k+ CT voxels head(Flash AS3): http://www.mrdoob.com/blog/post/571 http://www.romancortes.com/blog/voxel-head-in-flash/
Mikko Haapoja's AS3 Voxel Engine -Fancy Engine(Pixel Bender + Flash AS3) http://www.mikkoh.com/blog/2009/07/voxels-in-flash-continued/ this engine can render Ken Silverman's .vox file, if I'm right?...