Voxel Engine Project: AIBlocks
AIBlocks
This is the first in a series of posts describing my current development project, AIBlocks. It is a voxel game engine (similar to Minecraft) that I am developing to study various techniques for procedural world generation, networked game systems, video game artificial intelligence, and Java optimization. I’m also brushing up on my OpenGL knowledge and getting some valuable practice using modern software design techniques and patterns.
AIBlocks grew out of a project for an Artificial Intelligence course (CSc 215) at CSU Sacramento. It was initially a study in A* pathfinding, but quickly grew over the course of a week into a small OpenGL-powered game engine that looks (coincidentally, of course) like a certain very popular video game. These blog posts document my progress and interesting problems I’ve encountered, as well as related research.
Project Status, February 2016
Here’s what the project looks like currently:
Current Features
- Infinitely-generated terrain (a-la Minecraft) using OpenSimplex noise.
- Brute-force meshing algorithm to remove unseen faces.
- AI pathfinding using A*.
- Entities that can jump to navigate terrain.
- Passable terrain physics for players and entities.
Technical Details
The engine is implemented using OpenGL 2.1 (plus VAO extension) via the Lightweight Java Game Library, version 2. I targeted OpenGL 2.1 so the engine would run on my laptop, which has a 1st gen Intel HD Graphics integrated GPU. However, after seeing the abysmal performance of that GPU, I will probably drop support for older versions of OpenGL and move up to OpenGL 3.x. The engine is very performant on an Intel Atom + 4th gen Intel HD Graphics tablet, getting 60FPS even on battery, at least until you explore enough terrain to make it bog down.
Terrain is generated using a public-domain OpenSimplex Noise implementation that generates a heightmap on the fly from a seed. (No caves yet!)
Roadmap
AIBlocks started as a “what-if” project, and I didn’t plan it out very well; my goal was essentially “see what I can make in a day”, which grew to two days, then three…
While this was a great way to impart impetus on an exploration-style project like AIBlocks, random flailing and “chasing the shiny” wasn’t going to see the project through to completion. At the very least, I needed goals that I could break down into smaller tasks to focus on one at a time. Even better would be an end goal so I could declare the project done (or as close to done as possible) at some point in the future. So I sat down and laid out some constraints for the project.
Major “must-have” features:
- Terrain generation: done!
- NPC Pathfinding (A*): done!
- NPC behavior (Behavior Trees, Boids)
- Block placement/removal
- Very simple combat system
“Nice-to-have” features:
- Improved engine architecture (I’m eying Entity-Component systems)
- Biomes
- Cave generation
- Generated world structures (houses, etc): partially done if you consider trees.
- Networked support for multiple players
- World saving/loading
“Definitely not doing unless I get lots of free time” features:
- Mining mechanics
- Crafting recipes
- XP
- Enchanting
- Basically anything else from Minecraft
The project covered a lot of ground (no pun intended) since I started it a few weeks ago. The next few blog posts will be retroactively analyzing various parts of the engine before I move on to new features.