Skip to content

Instantly share code, notes, and snippets.

@max-mapper
Last active December 14, 2015 01:58
Show Gist options
  • Save max-mapper/5009821 to your computer and use it in GitHub Desktop.
Save max-mapper/5009821 to your computer and use it in GitHub Desktop.
voxel-engine to-do list

major goal: "everything is just an object and voxel-engine just deals with keeping a list of objects for collisions" via voxel-chunks

pending:

  • voxels.createChunkRadiusStream().pipe(voxels.generateChunkStream()).pipe(game.voxels) for async chunk loading
  • switched to the culled mesher so that we can implement texture atlases, which will reduce draw calls by a ton
  • implement ambient occlusion after switching to the culled mesher

investigated/completed:

@chrisdickinson
Copy link

rip the octree out of spatial-events, make improvements, and use that to keep track of the locations of items (to build and update potential collision sets for those items)

@chrisdickinson
Copy link

ability to register bit masks and then add items with a bitmask, and additionally request a list of items using a bitmask

game.registerItemMask('terrain')
game.registerItemMask('player')

game.getItemsMatching(game.masks.terrain | game.masks.player) // == [list of items]

var into = []
game.getItemsMatching(game.masks.terrain, into, atIDX) // === into, into has been updated with the new items

Copy link

ghost commented Feb 22, 2013

SPACESHIPS

@chrisdickinson
Copy link

make aabb-3d not quite so horribly painful to work with, somehow

@chrisdickinson
Copy link

solve the horrible yaw / pitch / roll set of nested object3ds somehow -- use one object3d for all three, maybe?

@techwraith
Copy link

I have no idea what the API for this would look like, but it would be nice to have additional steps for terrain generation, we need to make it easy for people to hook into terrain generation to add features like:

  • ore stems
  • rivers
  • biomes
  • structures

This might look something like this:

  1. the chunk generation step emits a beforeGeneration and an afterGeneration event
  2. when these events get emitted, the engine passes the chunk to whatever is listening
  3. developers can do what they want with the chunks.

@chrisdickinson
Copy link

make voxel-control operate in world coordinates, again somehow

@techwraith
Copy link

Document the whole public API

@chrisdickinson
Copy link

being able to use the aforementioned octree to do:

game.getItemsNear(point, radius[, optionalMask])

@chrisdickinson
Copy link

emit a start event once all resources have been fetched

@shama
Copy link

shama commented Feb 22, 2013

  • loading api

    Push/pop onto loading stack, get status, maybe on a worker?
  • main menu

    Start game, options, key bindings, hip blurry and slow moving backgrounds
  • player/item attributes/stats api

    hp, str, stam, dex, etc, full on D&D
  • better fog

    Only show on XZ plane so the sky isn't hidden
  • watery bodies: ocean, riviers
  • lots of mobs

    A cool mob api with AI
  • inventory

    Hold all your things
  • crafting api
  • stream all the things
  • airships

@snagy
Copy link

snagy commented Feb 22, 2013

I think the question is "what should voxel-engine be?" What functionality should it hold?

It seems like it should have as little implementation as possible, and instead just be an API for different modules and the communication between those modules. Ideally everything could be entirely replaced individually without having to modify the core engine or interfaces between modules.

Some ideas for what modules should be the core engine, with their current implementations if they exist:

  • scene manager (THREE interface in engine)
  • renderer (THREE)
  • mesher (voxel-mesh)
  • chunk manager (voxel-chunk & some kind of spatial partitioner)
  • chunk generator (voxelGenerateChunk, do it need a pre/post like Techwraith suggests?)
  • cameras
  • game item/entity manager(s?)
  • physics (voxel-physical)
  • collision? (seems like it might fall under the chunk manager or physics manager)
  • controls (voxel-control)
  • resource manager?

SpatialEventEmitter is cool but yeah, it seems like something that should be separate from the actual spatial partitioning algorithm.

@max-mapper
Copy link
Author

@snagy very well said, thank you

@vogonistic
Copy link

Voxels needs to be more than a type if we want to record data like state (open/closed), rotation (steps, fences). If we assume most blocks will not a have a state, we could just have a hash for lookup in each chunk.

@shama
Copy link

shama commented Feb 22, 2013

Oh and an easy one, we should all start using peerDependencies to specify the version of voxel-engine each module is compatible with. http://blog.nodejs.org/2013/02/07/peer-dependencies/

@timoxley
Copy link

timoxley commented Mar 7, 2013

meshing and terrain generation is expensive. move heavy loads out to web workers. A streaming interface between webworker and main thread could be cool

@jeromeetienne
Copy link

q. is there already way to get the items ? http://www.minecraftwiki.net/wiki/Items

@max-mapper
Copy link
Author

here is what @vogonistic does to load async chunks:

1. inserts an empty chunk (I assumed this would stop additional requests for it to be made)
2. requests the chunk to be generated (socket.io connection)
3. replaces the chunk with the generated one when it is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment