9 ms·
Show HN: My Isometric GPU-Powered Voxel Engine
- josephagoss 13y agoI 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 13y agoYeah, 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.
- chrisfarms 13y agoYeah would make a pretty cool openstreetmap tile generator
- josephagoss 13y agoSounds really cool! :)
- TuringTest 13y agoForget maps, this would be the ultimate Dwarf Fortress visualization engine!
- tankbot 13y agoThis was my first thought too, except for rogue/nethack/other ascii-based roguelikes.
- simcop2387 13y agoI'm actually working on something like that, where instead of using a map, I'm making a small DSL that's a bit prolog like for creating the rules about how things should be placed. It will be open sourced but I do have to write it first. I'm basing a lot of my work on things like this: http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/ http://www-cs-students.stanford.edu/~amitp/game-programming/...
- samsaga2 13y agoIt seems that he is using marching cubes [http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html]
- gavanwoolery 13y agoNope - 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.
- sspiff 13y ago> and at that time, was patented Is it no longer patented today? Who held the patent and was it released or did it just expire?
- deleted 13y ago[deleted]
- JMiao 13y agoI'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 13y agoThanks! 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.
- moconnor 13y agoGenesis3D? I contributed a little to that back in '98! There were big plans at the time, though they didn't come to anything of course. I remember working on the collision code late at night. Those were the days :-)
- gavanwoolery 13y agoMaybe that was a different Genesis Project? I released the Genesis Engine in 2006. :)
- mr_luc 13y agoOh wow, let me add to the group and say thanks. Teenaged mr_luc turned into a programmer mostly because of late-90's game engines, and I'm probably not alone. Everyone who wanted to be a programmer and was interested in game development probably remembers Genesis3d. There's something magical, as a young programmer, about compiling an open-source 3d engine and walking around in the demo. Although in my case I never did more than compile Genesis and tweak a few variables in the physics code before recompiling. (I ended up learning from the Torque Game Engine and its forebears, because they had a scripting language and sprawling outdoor terrains with multiplayer).
- gavanwoolery 13y ago
- brokenparser 13y agoPlease change the seizure-inducing flickering background, thanks.
- gavanwoolery 13y agonoted :)
- lutusp 13y agoThere was once a Japanese cartoon show that was said to have actually induced seizures among susceptible viewers: http://www.cnn.com/WORLD/9712/17/video.seizures.update/ http://www.cnn.com/WORLD/9712/17/video.seizures.update/ So it's not mere hyperbole to say "seizure-inducing."
- brokenparser 13y agoAnd more recently the unveiling of the 2012 Summer Olympics logo: http://news.bbc.co.uk/2/hi/6724245.stm http://news.bbc.co.uk/2/hi/6724245.stm
- onkar 13y agoGreat
- pjgomez 13y agoGreat work, kudos!
- kunil 13y agoI was expecting another minecraft clone but it looks awesome.
- forgottenpaswrd 13y agoYou made an amazing job here. It would be great if you find a way to sustain your development using this system.
- chii 13y agoIs 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 13y agoHi - 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).
- Yoms 13y agoGreat work, wonderful to see voxel engines becoming more popular and feasible. Also check out http://procworld.blogspot.ca/ http://procworld.blogspot.ca/ great technical write-ups on the engine chosen by Sony for EQ2.
- donpdonp 13y agoEverquest 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 13y agoYes - I have been following Miguel's work for some time (and apparently he checks out my work sometimes too) :)
- Ellipsis753 13y agoLooks 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 13y agoThanks! My host is Weebly (I believe a YCominator graduate, IIRC). I am not a huge fan of their image gallery either. :(
- tgb 13y agoDoes having a fixed isometric perspective give any benefits to performance or code quality?
- corysama 13y agoMy 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 13y agoThat's pretty much exactly whats going on. It renders it to a frame and then uses deferred rendering for the lighting. Static objects (i.e. terrain) are not re-rendered until the camera moves, but dynamic objects (like the grass) are rendered in realtime (unless the grass animation is turned off, which I have included for weaker machines).
- gavanwoolery 13y agoYes! 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.
- aktau 13y agoThis 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 13y agoThanks! Everyone has to start somewhere (if you saw my earliest work, you'd probably laugh). :) Good polygon rasterization can be a project in itself.
- j_m_b 13y agoMmmmmmmm.... Voxely!
- kingmanaz 13y agoI 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 http://i.imgur.com/MGDSXYP.jp . Voxels would seem to be a great fit for such an engine.
- donpdonp 13y agofixed url http://i.imgur.com/MGDSXYP.jpg http://i.imgur.com/MGDSXYP.jpg using game data from older games sounds like a great idea (if any of those licenses allowed it)
- kingmanaz 13y agoThe exult project (http://exult.sourceforge.net/ http://exult.sourceforge.net/) has done much of the hard work in terms of making game data available. It would be neat to see a voxel engine transplanted into the old game.
- gavanwoolery 13y agoI 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.
- kingmanaz 13y agoSame here. I was hoping Origin would redeem itself after U8. Hopefully in the afterlife I'll be able to play U7 again for the first time. What a great game and a hard act to follow.
- shadowmint 13y agoThis 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 13y agoHi - 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. :)
- shadowmint 13y agoSounds interesting, definitely be interested in a blog post with some details, for example, how it compares to the normal way of doing this sort of stuff (eg. http://www.seas.upenn.edu/~pcozzi/OpenGLInsights/OpenGLInsights-SparseVoxelization.pdf http://www.seas.upenn.edu/~pcozzi/OpenGLInsights/OpenGLInsig...)
- GuiA 13y agoThanks 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").
- nollidge 13y agoCan you increase the contrast of the font? I can barely read gray-on-slightly-darker-gray, particularly at that size.
- gavanwoolery 13y agoGood suggestion, I'll do that (its a prefab theme). I have noticed that issue myself.