Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

WIP: Week 2 -- Meshing, Shapes, and Worlds!

Sign in to follow this  


This past week has been quite productive for the engine! I updated my RenderingEngine to support rendering buckets, which is basically a set of efficient priority queues to sort meshes every frame. I also started working on frustum culling, to help cull meshes using their bounds from going through the rendering pipeline. Currently the supported bounds are AABBs and spheres, but I hope to also add OBBs as a "originally" supported bounds. Anything else shouldn't apply to a basic voxel engine yet, anyways!

I then started working on meshing chunks for the engine. Though I've done this already on my Java version of the game, I needed to change some things in order to *mesh* well with my engine (pardon the pun). With that in mind, I rewrote my greedy mesher to be not only modular, but more efficient and data-driven. It seamlessly molded into the voxel corner of the engine, and I now can mesh chunks efficiently, with AO, as can be seen here:
Screen Shot 2014-12-27 at 12.10.56 PM.pngScreen Shot 2014-12-27 at 12.11.36 PM.png
Not only that, but I began creating methods that create circles, spheres, boxes, and other simple shapes in order to make modeling easier. Yay!

Next I wanted to tackle what puts me off these types of projects all the time: world management. For some reason, I can logically break apart that topic into a large group of manageable tasks, but I've never managed to do more than meshing management. Now that I have an engine structure I'm happy with and I've got a momentum carrying me along, I hope I can accomplish just that!

I haven't done much yet, so there's nothing to show, but the general layout of a world's "tick" looks a little like this:

[code=:0]//...In VoxelWorld.cppvoid tick(float dt) { // Update Chunk Management Logic // --> Chunks can move between different states: // a. Loading (Fire event with chunk pointer, // wait until loaded ) // b. Setup (generate, decorate, mesh, etc) // c. Physics/Water/Player/LOD/etc updates // d. Unloading (Fire event with chunk pointer, // wait until unloaded ) _chunkStateManager.updateChunkStates(dt, this); // Update visibility // --> Read front to back for solid rendering, // read back to front for transparent rendering :) // _chunkSorter is a modified std::priority_queue // (underlying vector for iterating ease). _chunkSorter.update(_camera.getPosition()); // Update player inputs and movement. _player.update(dt);}//...
Whoo!! The nice thing about this is all cross-thread communication is done through the EventManager, and each event is fired asynchronously, making everything easy on the developer. Having [font='courier new']_chunkStateManager[/font] be an object has allowed me to try different options for state management, like dumb systems that are step-based (run 'x' amount of chunk updates per frame), as well as smart systems that are AI based (extend chunk updates in a smart fashion that allows for more realistic results that should take into account how it's taxing the computer). All of this together creates a flexible system that I can use with ease.

This next week, I'll be continuing with the World Management in the game, and will focus on possibly scripting events following that. I also want to start thinking about


decorations and weather effects, in order to bring the world alive.

Until Next Time,


Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!