Happy New Year!
It has been a while since the last update, I know. As I may have mentioned prior, aside from the holidays, I have been just trying to get something interesting to show, which is hard when the majority of my work the past few weeks has been on relatively boring back-end stuff.
Here is a video - sorry I was tired when I made it!
Since the last video update, we have:
- Walking around, with collision and auto-climbing/descent of stairs/hills (the power of technology!!!)
- Camera that follows the character, orients itself in your travel direction, and more
- Saving and loading of character poses
- Rendered (fully voxel-based / procedural) character has replaced the placeholder box object.
- Ability to assign materials to each character limb, or other objects
- Material editor has been migrated from the web client. For those who have not seen it, the web client looked like this. The web client had many problems, including performance (slowing down the main client), inability to effectively manage data over a websocket, requiring a web server to run (i.e. a localhost), being generally unwieldy, and more.
- Much more advanced GUI features, data binding, and data serialization. The GUI now supports multiple features to keep everything DRY (Don't Repeat Yourself), keep data and presentation separate, and more. This is important because many times it is not a 1:1 mapping of data to UI - for example the color picker has 6+ components which map to only 3 data values.
- Several more optimizations, in particular some UI optimizations that make it load faster and make it more responsive.
- Many more small fixes and improvements.
In the coming week I am going to work on inventory management, picking up items and dropping them, and rendering additional NPCs and making them walk around.
As usual feel free to ask me anything.
This week I did a pretty huge cleanup on the code (I deleted thousands of lines while retaining the same functionality and more). I also added in collision detection, a context menu (right click menu), and some functions for spawning/removing/editing entities - mostly for the purposes of quickly testing stuff but also useful for the eventual sandbox.
Making the collision work was not exactly trivial but it is a lot easier now that voxels are passed to the CPU and meshed. It looks at all the voxels within a given cell and determines (based on a given threshold) whether or not that cell is mostly solid, air, water, etc. More granular collisions can be done in screenspace, but this is necessary for offscreen or hidden collision testing. This coming week I will be working on camera movement (following an NPC or trackballing around it), in addition to registering collision and behaving accordingly (i.e. climbing stairs automatically if you collide with a step, etc). I will also try to work on managing movement and collision when other NPCs are present.
Also, if you enjoyed the classic Master of Magic, you might want to check out my friend Aaron's game Worlds of Magic. He is running for Indie Game of the Year (in the top 100 now), so throw him a vote if you are feeling generous:
Also, David Sahlin, who I have known for almost a decade (since I worked on Genesis) sent me his ideas for a mod for VQ, drawing inspiration from the likes of Pokemon, Spore, etc - I think it is a pretty interesting idea and I would love to see someone make a mod like this:
It has taken some time to get to updating this as I mostly update in the forums and on the KS page, but I am happy to let everyone know that Voxel Quest has been successfully funded! Also, in the last week of the KS campaign, I added in a perspective camera - this is an early video of it but I am demoing a much improved version this coming Friday.
It has been about 6 months since my last major update. In that time I got married and had my first child (it's a girl!). But aside from real life I've been neck-deep in voxels.
So what has changed? A lot - a huge amount. There are plenty of visual changes but also tons of things under the hood - not so much (premature) optimization, but really a restructuring of a good portion of the engine to make it easier to work with.
One small, but major change is the support for voxel super-sampling. Everything you are viewing has been rendered to bitmaps that are 1/4 to 1/8th as large as the bitmaps used for chunks in the previous video. This reduction in buffers for the chunks has led to a massive decrease in the memory needed to store chunks - since chunks are stored volumetrically, every reduction of 2 decreases memory by a factor of about 8 (2*2*2). So a reduction of 4 leads to 4*4*4 or 64 times less memory for chunks.
In the image above, I am using 1/8 chunk buffer resolution (8*8*8 or 512 voxels per pixel!). You would think such super sampling to be excessive, but it makes all the difference visually and ensures that no voxels get dropped (as you may remember in the last video, lowering the voxel resolution led to holes in the plaster and defects in other thin areas). It is also using 1/2 screen buffer resolution (1/2 1080p, stretched to 1080p). Lowering by a factor of 8 also reduces the number of ray casts and normal calculations needed by a factor of 64. Total memory usage is only 472 megabytes and it has rendered about 46 billion voxels without unloading anything (you may have notice how quickly chunks unloaded in the old video). I have a 3 GB video card but I've capped mem usage at 2560 MB to reserve space for the operating system (Windows seems to use usually only a few hundred MB unless a browser is open).
The TL;DR here is that it can now store massive areas in memory without needing to unload anything, without any major drop in visuals. There is still tons of room for "low-hanging" or trivial optimizations like better front-to back loading.
Another thing that has changed is the way the world is represented. The old terrain system was based on a heightmap. The new one is based on macroscopic chunks (you can see each cliff or bluff here is sort of cubic, but rounded off to look more natural. All this data is pulled from a volumetric buffer and makes it incredibly easy to calculate things like dynamic water. Right now each unit in this volumetric set is 8x8x8 meters large, but it can be adjusted. This is big enough to carve out sections of cave or dungeon and ensure that any type of monster will fit in there without hitting the ceiling or walls, making pathfinding more trivial. Speaking of which, I have added in pathfinding support as well (you can see this at 5:13 to 5:22 in the Kickstarter video). Chunks do not need to be rendered to perform pathfinding, as shown (first image below).Ensuring that the world is constructed properly and all roads are reachable when you have multiple levels, and ensuring that stairs are spaced enough to not be too steep, and dealing with a million other factors, was a big challenge (see second image below). :) I even tried to implement winding staircases to address the issue of small space within towers, but I pulled that feature for now (third image below).
I've also added in camera tilt - this was mostly to be able to easily see around walls, seen at 7:44 in the KS video.
The UI is another major change. The UI is tightly bound to the data storage, although the presentation layer and the data storage layer are completely different structures - its not MVC though, a paradigm I hate. I have built so many UI's I'm sick of it, but I must say I've gotten the hang of it. The VQ UI system (let's just call it VQUI for now) is built to address many of the headaches I've had in the past with UIs, namely:
Writing your own UI would seem like a bad idea in most circumstances, but I really evaluated every solution and most of them honestly suck. I would have loved to use browser-based tech like in the old VQ editor, but that turned out to be a really, really bad idea for multiple reasons I won't delve into (hey, I make mistakes like anyone else :) ). On the bright side, it was a good practice run for what not to do.
One really powerful thing in the UI is that you can autobind shader variables to sliders, as seen in the video (the part where the hue is adjusted). This works by using a shader preprocessor that I wrote, which already was in there for automating other tasks. You only have to surround a variable name with "@" symbols, and this will autobind it to a slider after you refresh the shaders in the program. You don't even need to declare the variable, it will do that for you, so if you quickly want to fiddle with a value, you just throw in one of these special variables.
This also has an important performance side effect - you can bake these values into the shader after you have changed them, so that you don't need to pass in a uniform (the preprocessor just declares a constant value and sticks it in the generated program). None of this effects the code while you are writing (it modifies the shader in memory, not the file you are working on). The impact has been huge - I can now tweak values without having to constantly save and refresh the shader.
So, you can see that I've faced many challenges - the devil is in the details as they say. There were a million other improvements and fixes to the engine, but I can't cover everything - too much other work to do now! I do have most of the pieces in place to actually start building a real, genuine game though - enough of this engine nonsense. :)
The Kickstarter campaign is live, give it a look (and some money :D).
Hi everyone - I know things have been silent for a while but I have been very busy working on VQ and preparing for the coming Kickstarter campaign. Just want to give everyone a heads up that the campaign will be out soon! Updates will definitely be more regular after this, but I have to carefully use my time at this point and each major update costs me a lot of time and effort.
Had an interview with Jonathan (Ithica), Branislav (Atomontage), and Miguel (Everquest Landmark), and myself on TSG.tv. If you have never heard of them, The Speed Gamers (TSG) raise money for charity by streaming games live. This week they raised over $500,000!