Assuming Codea Craft is a block world, I have a question. When I built a 3D scene with blocks, I put them in one mesh for speed, and still needed to cull hidden faces to avoid slowing down too much.
But if your blocks can be moved or destroyed, then do you keep them in separate meshes, and what do you do about hidden faces? How you optimize performance?
It would be great to have an option to smooth curve from cubes
( bezier curve in 3d ) and possibility to modify scale or cube’s width ( to build chair for example) . It was simple and realistic. I buy
Because it exist yet sculpt 3d apps and minecraft apps but never software between the two :)>-
It’s a project @john has been working on. Basically it’s a voxel world building environment where you can attach code to blocks. And you can also code the procedural world generator.
In the video above @john created a block with a script that causes it to grow outwards and upwards. Then placed it and watched the algorithm evaluate in the world.
The Voxel engine is C++ and it’s something I’d like to pull back into the main version of Codea and expose through an API. Codea Craft uses a custom voxel renderer instead of the regular runtime (to do things like ambient occlusion and voxel-specific occlusion culling).
@Ignatz I will try get @john to explain the optimisations. I think the most basic one is that all internal structures are removed (so only the visible surfaces of voxels are rendered).
The way the voxel renderer works is very similar to Minecraft. The world is divided into a 2D grid of chunks (each is 16x16x128 blocks). Whenever a block is modified (or removed) it’s chunk is marked as dirty and then gets re-meshed in the next frame. Any blocks faces that are occluded by other solid blocks aren’t generated. In some cases when a block is modified on the border between chunks, multiple chunks will need to be re-meshed.
Meshing starts from scratch each time a chunk is modified, there is currently no smart algorithm for reusing vertex buffers and I don’t have a greedy algorithm that merges planar surfaces based on materials and textures.
The flags are used to allow for multiple block edits per frame but only a single re-mesh operation. The bounds of each chunk are computed during meshing, which is then used with frustum culling so that non-visible chunks aren’t drawn.
In order to speed up the meshing algorithm, chunks store copies of adjacent blocks on their borders. When modifications are made these copies need to be updated to keep everything in sync (this is quite tricky and error prone).
There are quite a few other optimisations but these are the basics. Also much of the work is done is multiple threads, such as terrain generation, saving and loading.
@TokOut Codea Craft will be reaching closed beta soon (likely January) and I’ll be putting it on TestFlight for selected testers (we’ll have signups on the forums).
My plan is to release it with minimal features and provide updates every month or so. The focus is on letting users create and share content (block types, generation scripts, texture packs, monsters, items).
The first version will contain:
Voxel based world
Integrated editor tools
Lua scripting
First person player controllers (placing and destroying blocks)
This is an awesome and very original idea. It will go down really well with the modding community (who seem to do everything with Lua scripts, Lua is definitely the number one game-mod language).
More Infoseek please. How many will it cost and a SERVER game? First User controls removing and placing blocks. It IS AWESOME! Thank you very much @Simeon, but one question in the next codea version, will there be the game script codes y/n? Like CargoBot?
Very neatly done, guys. Coming up with a compelling development environment for those learning to code is always a challenge (I wrote the Logo-based Turbo Turtle for the original Mac in 1984 before the machine was officially released, but it didn’t exactly start a craze). This seems to do a good job of offering the sort of in-game mod system that’s actually quite rare.
I’ll be interested to see how you handle the controls. None of the iPad Minecraft clones I’ve tried (including Minecraft) have felt quite right.
Then I’ll be looking forward to the day when you can “train” and arm ranks of pigmen to man the top of your battlements as they fight off waves of incoming creepers.
@Mark The default controls will be similar to Minecraft PE, however I plan to make them moddable as well so you can come up with a totally new control scheme if you wish.