top | item 6358394

Show HN: My Isometric GPU-Powered Voxel Engine

203 points| gavanwoolery | 12 years ago |voxelquest.com | reply

76 comments

order
[+] shadowmint|12 years ago|reply
This is a cool project, but something here sounds familiar a) doesn't use a known algorithm like sparse tress or b) a million GB of memory.

...wait a second. I swear I've heard this before.

Why does everyone who works with voxels act so secretive about how their rendering works?

No one cares.

No one cares.

No one. Cares.

Really. No one is going to steal your clever memory optimizations. They don't care.

If you've done something clever, explain it. Maybe you'll get a hi-5 from someone. Being all, coy about it is just irritating.

[+] gavanwoolery|12 years ago|reply
Hi - I kind of have explained it a little bit in previous comments here - I was going to go more in depth on my website but last night I was running on very little sleep. Sorry! :) The tricks are actually not that interesting but I guarantee I'm not like the Infinite Detail / Euclideon guys. :) It generates the voxels in GPU memory (About 128 MB of memory is used per chunk) - but once it renders the chunk it immediately dumps the non-critical data and reuses that rendering page. It can still access any visible voxel in the 2D rendering (even the various chunk layers), but to access the internal voxels it has to regenerate the chunk or use the procedural generation algorithm to determine what a given point would be like. Collision detection can still be handled pretty well via the larger chunk properties and the depth properties of the rendered chunk. So the real trick lies in procedural generation and the ability to rapidly recreate chunks as needed. It uses ray-casting on a hexagon shaped like an isometric cube, which is nothing very advanced or new. Let me know if I can answer in more detail - I may do a writeup on the techniques time willing. :)
[+] GuiA|12 years ago|reply
Thanks for posting this. I've had a few toes (ok maybe a foot) in the indie game development world for quite a few years now, and they're definitely amongst the group of developers who are the most averse to putting their shit on github and open sourcing their libraries etc.

The game dev community has a love/hate relationship with open source: on one hand a lot of widely used tools are under open source/free software licenses (box2d, SDL, etc.), but on the other hand you'd be hard pressed to find an indie willing to release his source code (Jason Rohrer I love you).

There's definitely a technical reason for it (game code is often hacky and not that reusable), but I've observed that it has to do more with the sense of pride of the developers ("my code is too ugly people are going to think I am a bad developer").

[+] josephagoss|12 years ago|reply
I have an idea, could you load a basic map into this, the map would contain a rough idea what the roads, trees, buildings look like. But then use algorithms to add generated details to those objects. So it would be a way to define the rough idea what a map would be like, except all the nitty gritty is generated.
[+] gavanwoolery|12 years ago|reply
Yeah, you will actually be able to do something like that fairly "easily" (at least, relative to how complex it might be in other engines) -- the engine is scriptable via a javascript client (demoed in another post), so you could pull data from Google Maps or something.
[+] JMiao|12 years ago|reply
I'm sorry you couldn't live in your parents' house forever. :)

I remember reading about the Genesis Engine in college. For what it's worth, I think it's awesome how you've worked your way to Voxel Quest. Good luck.

[+] gavanwoolery|12 years ago|reply
Thanks! I am amazed that people still remember it. It has been a decade long battle to fight my way back into doing game development full time, and even though I am working like a dog I couldn't be happier right now.
[+] aktau|12 years ago|reply
This is really awesome, considering my current (first ever) graphics engine which just uses standard polygon rasterization can't even render a few rotating cubes without starting to break a sweat. And you've got billions of everything! You say the grass is green-space. Do you mean that you just generate the grass as a texture and blit it to a framebuffer or something equivalent? (i.e.: it's never "real" geometry on the GPU).

Do you generate your visuals by rendering a fullscreen quad and having shaders do all the work is there actual polygon work involved?

Just curious, nice work!

EDIT: drat, it seems I missed a few comments, you already answered most of my questions. So feel free to disregard them. I'm leaving the comment to show that I really like the things you've done with the engine, it looks fantastic (and $deity knows how much fun it can be to work on something like that)

[+] gavanwoolery|12 years ago|reply
Thanks! Everyone has to start somewhere (if you saw my earliest work, you'd probably laugh). :) Good polygon rasterization can be a project in itself.
[+] samsaga2|12 years ago|reply
It seems that he is using marching cubes [http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html]
[+] gavanwoolery|12 years ago|reply
Nope - good guess though. :) Funny story about marching cubes: in 2004, when I was creating my first major game engine, I "invented" the marching cubes algorithm without knowing that it already existed (and at that time, was patented) - a testament to how stubborn I am about learning on my own.

I am actually using ray-cast volumes, rendered to a hexagon (6 tris). Each vertex in the hexagon contains two points, a front and back location of the equivalent cube. (If you look a a cube in isometric perspective, it looks just like a hexagon which is why I used this technique -- another thing I'm sure that has been done before me). :) Another optimization over a standard cube is that a cube contains 12 triangles, and would have double redundancy on fill time.

[+] chii|12 years ago|reply
Is there any way for a hobbyist game dev to try out the engine in a game? say, for the next ludum dare or some such competition.

I think real feed back comes from people using it, and can't be given by only viewing screenshots or video demos. I m assuming you are going to license the engine out of course.

[+] gavanwoolery|12 years ago|reply
Hi - I am going to avoid releases until I am in beta. The reasons being: I don't want to preemptively disappoint people with bugs/issues, and as a one man team I simply can't keep up with the support work (its hard enough doing a public release and trying to respond to many comments/emails). I would like to open source the engine in the future if it is possible (the decision is not entirely up to me).
[+] kunil|12 years ago|reply
I was expecting another minecraft clone but it looks awesome.
[+] Ellipsis753|12 years ago|reply
Looks good but the images on the page are actually larger images scaled down with css. This is a bit pointless as the images always show the same size regardless of how large my resolution is (They're shown in a small column in the middle anyway). This is just a pet peeve of mine as I dislike seeing the images loading slowly and knowing there's no real reason for them to do so. Also Firefox has a tendency to resize is a really ugly way when width/height is set on an image. Finally it's going to eat through all your bandwidth as you're featured on Hacker News. :P (You might even want to consider replacing them with small jpegs if you're worried about your bandwidth but this would be lower quality.)

Congratulations and the engine really does look great. :)

[+] gavanwoolery|12 years ago|reply
Thanks! My host is Weebly (I believe a YCominator graduate, IIRC). I am not a huge fan of their image gallery either. :(
[+] forgottenpaswrd|12 years ago|reply
You made an amazing job here.

It would be great if you find a way to sustain your development using this system.

[+] tgb|12 years ago|reply
Does having a fixed isometric perspective give any benefits to performance or code quality?
[+] corysama|12 years ago|reply
My guess: Because there is no perspective or camera rotation, changes in the appearance of the voxels are limited to screen-aligned translation, zooming and changes in lighting. Relighting is easy assuming he's using standard deferred rendering techniques. Zooming can be clamped to a certain range. If the voxels are rendered off-screen at maximum zoom, that just leaves panning the render around on the screen. In other words, he can render each tile once and cache them as 2D images to reuse in later frames. Each frame he only needs to render new tiles that have not been seen before. Unless you are panning really fast, that's a small amount of work compared to re-rendering the whole screen every frame like most 3D engines do.
[+] gavanwoolery|12 years ago|reply
Yes! With a dynamic (traditional) perspective, you must obviously render every time the camera moves. Since the camera never changes angle, I can render once and be done with it until something is changed or the memory pool cycles back to the start (i.e. a chunk falls out of rendering distance).

In terms of code quality, it is actually far more difficult (IMO) to do isometric projection with a 0.5 slope (not true isometric with 120 degrees between axes). You can build a projection matrix to handle it but I actually just worked out the math by hand to handle the projections and inverse projections. So, for a while this really put a dent in how clean my code was until I refactored everything several times.

[+] Yoms|12 years ago|reply
Great work, wonderful to see voxel engines becoming more popular and feasible. Also check out http://procworld.blogspot.ca/ great technical write-ups on the engine chosen by Sony for EQ2.
[+] donpdonp|12 years ago|reply
Everquest II was released in 2004, I believe you mean Everquest Next. The voxel engine in the game looks very exciting. Modifying individual blocks after they're placed blew my mind.
[+] gavanwoolery|12 years ago|reply
Yes - I have been following Miguel's work for some time (and apparently he checks out my work sometimes too) :)
[+] nollidge|12 years ago|reply
Can you increase the contrast of the font? I can barely read gray-on-slightly-darker-gray, particularly at that size.
[+] gavanwoolery|12 years ago|reply
Good suggestion, I'll do that (its a prefab theme). I have noticed that issue myself.
[+] j_m_b|12 years ago|reply
Mmmmmmmm.... Voxely!
[+] kingmanaz|12 years ago|reply
I haven't touched video games in years, but I did spend time playing Delta Force in the 90s. Voxels were a perfect fit for the 300+ meter military engagements DF1 was attempting to model. I tried one of the latter entries in the series after they "upgraded" to a standard 3D engine and the sense of space was lost.

I can recall when Ultima 9 was originally conceived it was anticipated to be isometric 3D RPG. Here is a screenshot http://i.imgur.com/MGDSXYP.jp . Voxels would seem to be a great fit for such an engine.

[+] gavanwoolery|12 years ago|reply
I remember as a teenager I had the first issue of PC Gamer that talked about Ultima 9 and Ultima Online - I must have read it 1000 times. It was a shame U9 never lived up to its plans (I blame EA! :), hopefully Garriott has better luck with his current venture.