Leadwerks Engine module planned for BlitzMax

BlitzMax Forums/BlitzMax Programming/Leadwerks Engine module planned for BlitzMax

JoshK(Posted 2007) [#1]
For BlitzMax users, the gist of this is that my engine is now going to be more BlitzMax-friendly, and offer a low-level API similar to Blitz3D. I borrowed some of the matrix math from MiniB3D (thanks to Simon and Mark), but this is mostly just me thinking more in Blitz3D terms.


============================================

First, a demo for you
http://www.leadwerks.com/post/culltest.zip

Both frustum and antiportal culling are visible. Press "w" to view in wireframe. You'll see that when you go behind some buildings, the objects behind them get hidden. No pre-compiling was necessary. This will work in real-time, even as you edit the world. Portals are more complicated, but I think I can add them in while maintaining a totally dynamic system. The culling routine is somewhat inefficient at the moment, but I am adding an octree now to optimize it. If you press space, the culling gets frozen, and the framerate will be more reflective of what my final goal is.

Last Sunday I was having a lot of problems compiling a dll, and getting really frustrated, because there is pretty much no way to debug dlls. I started looking at the Blitz forum and reading a discussion about Max3D, or rather, the lack of it. I started thinking about Blitz3D's API, and how easy to use it was. I created a new folder, and started writing a Blitz3D-like API, with my own advanced rendering routines added. It turned out really well, and I have been quietly working on it all week. Obviously, I have re-written and simplified much of my original engine code.

The results are self-evident in the above demo. I originally envisioned Leadwerks Engine to be a complete game engine, where the user only modifies the end result. I now have a really nice core API that can be used for all kinds of applications, from editors to lightmappers to new game engines.

For users that only want to modify an existing engine, there is the script interpreter, which will remain the same as my original plan. For advanced users, I am going to offer a BlitzMax module that could be considered "Max3D" (or at least my own interpretation), since Mark himself has indicated he might want to let third-party mods fill the Max3D void. The module will be more low-level than the scripted engine. If you want a finished game engine, I recommend programming in script. If however you want to write an application, or want to design your own engine, the module will serve your needs well. The dll is no longer going to be supported, due to debugging difficulties. If you were dead-set on using the DLL version, please contact me privately.

What does this change? First, mesh loaders and savers are a hell of a lot easier to write. I can just take existing Blitz3D code and plug it right in, using commands like CreateSurface() and AddVertex(). So right away, I can support .obj, .3ds, .x, .b3d, .md3, .smd, .etc, and new importers are really easy to write. I'm not going to screw around with these dll importers any more.

Secondly, because I am using BlitzMax's cross-platform command set, it is possible that Leadwerks Engine and 3D World Studio 6 may run on Macintosh and Linux. I can't promise this for certain because it depends on a few third parties, but it appears it will work.

So to summarize:
-DLL version discontinued
-Low-level BlitzMax module; like Blitz3D on steroids
-Final engine controlled by script, just as before
-Likely support on Mac and Linux
-Plus, all the world geometry can be rendered on a per-face basis, with no pre-complilation necessary.


JoshK(Posted 2007) [#2]
I just implemented an octree. It was easier than I thought it would be:
http://www.leadwerks.com/post/octree.zip


Knotz(Posted 2007) [#3]
Excellent Josh, sounds like a good plan.


Tachyon(Posted 2007) [#4]
Sounds good. The demo produces no textures for me. Just black polygons on a gray world.

Windows XP 32bit (patched to the max)
GeForce 7900GTX (latest drivers)
DirectX 9.0c (latest version)
4gb RAM
AMD64 FX-60 cpu


tonyg(Posted 2007) [#5]
Same here and, for me, the culltest/textures then become that annoying 'read-only' type that can't be got rid of easily.


bradford6(Posted 2007) [#6]
black/grey ploys--no textures

pretty cool though.


Wayne(Posted 2007) [#7]
same here


H&K(Posted 2007) [#8]
Most of the texture work for me, except about 6 Big white cubes, and a several white collums.

What looks like its not working, is the "Join" between floor (when you have those ground slopeups), and walls, I get what looks like a "wave" effect.

(Ps. the camera needs to start at a higher level)


DJWoodgate(Posted 2007) [#9]
As above. I had assumed they were just not textured, but maybe there is a problem there.

I guess the acid test will be how it compares to Blitz3d in terms of performance and features. Apart from the texturing issues though the demo is pretty impressive.


JoshK(Posted 2007) [#10]
I can tell you already it is much, much faster than Blitz3D. As for the texturing issue, I can't test it until I load it on another computer. Must be some little thing I left out, no big deal to fix once I load it on another card.


Matty(Posted 2007) [#11]
Hi Leadwerks - (I also got the black objects) - when you say it is much faster than blitz3d, is it much faster than blitz3d running on more modern hardware or would it run better than blitz3d on older hardware as well (ie non shader capable hardware)?


CodeGit(Posted 2007) [#12]
This definitely sounds like it's moving in the right direction.

Just one question, does your API still have issues with ATI graphic cards?


Rozek(Posted 2007) [#13]
Hello!

Is there any fix which gets rid of the black textures? It seems as if there are quite a few people out there facing that problem...

BTW: *is* the module already cross-platform (the example is definitely not ;-) ) If not, do you have any time schedule when it will be?


JoshK(Posted 2007) [#14]
Don't worry about the black textures. I will test on an ATI card before releasing anything. Until I switch my cards out, there is no sense trying to fix it, since I can't even get the problem to occur on my NVidia card.

The engine will run much, much faster than Blitz3D, on the same hardware. I have put a lot of effort into my batched rendering system, so that all objects are automatically grouped and rendered in batches. It's the same way Unreal static meshes work, except that you can use the easy Blitz3D mesh commands, and you don't have to worry about what the engine is doing under the hood.

I'm also introducing a totally new type of geometry, the BSP Brush. This is used to create you scenes, and the whole scene is always rendered as a single surface, even as you create and delete bsp brushes. It tooks quite a bit of work to set this up, but the end result is you can build a world out of these building blocks, and the whole scene will always render as a collapsed single surface. This is very good for 3D World Studio, since it means the scene can render very fast, even as it is being edited. What it's doing is uploading data to the graphics card memory, and then editing the memory as you create and destroy objects, but don't worry your pretty little head about that.

I just tested for mem leaks, and I was able to load up some very complex scenes and dump them with no memory leakage, so things are looking good.


Who was John Galt?(Posted 2007) [#15]
"....but don't worry your pretty little head about that"
Haha! Looking forward to the release, Leadwerks.


CodeGit(Posted 2007) [#16]
I'm interested.

I have been waiting for Max3D. If your engine does what you say it can (and I believe it will), then there wont be any need to wait any longer.


Rozek(Posted 2007) [#17]
Josh,

you don't have any hot-pluggable graphics cards yet ;-)

But indeed, I'm looking forward to try your engine with BlitzMAX on every platform (WinXP, MacOSX, Linux) - so be warned ;-)