Codea Craft - Official Thread

JohnJohn Admin Mod
edited September 2016 in Codea Craft Posts: 487

Codea Craft

We are proud to officially announce the development of Codea Craft. There have already been several unofficial threads, twitter posts and videos based on pre-alpha versions of the update. We are now ready to release more information and answer questions related to this update. Codea Craft will be added to the official roadmap soon.

What is it?

Codea Craft is a new addition that simplifies and extends the 3D capabilities of Codea via an entirely new API and set of subsystems.

What Features will be included?

3D Physics!

Feature Breakdown

  • World() - The Codea Craft world, containing all the objects within it
  • Entities - Flexible objects in the world that can have a number of components
  • Components - Special modular components that can simulate physics, render graphics and more
  • Cameras - Physical representation of camera with support for changing FOV, orthographic rendering, raycasting and more
  • Mesh - Supercharged replacement for the mesh class
  • Model Loading - Support for loading .obj models (with future support coming for FBX and skinned meshes)
  • Materials - A completely new system for controlling the appearance of objects with support for lighting, textures and more
  • Rigidbody - Simulates 3D rigid body physics
  • Physics Shapes - Various 3D shapes for simulation including boxes, spheres, cylinders, cones, convex hulls, meshes and compound shapes
  • Physics Joints - Various 3D constraints for simulation including hinges, welds, ball-socket and more
  • Voxels - An entire sub-system dedicated to voxel rendering, customisation and interaction
  • Math Improvements - support for quaternions and associated helper functions, such as slerp, angle axis constructor and more
  • Comprehensive Noise Library - Tree-based 3D smooth noise including perlin, rigid multifractal and many others
  • New Example Projects - example projects showing how the new features work with step-by-step guides

When is it Coming Out?

There is a tentative release date for the end of the year but nothing solid just yet. Closed-beta will begin soon.

Will it be Free?

While we love giving out free updates wherever possible, Codea Craft represents an extraordinary amount of work on our part. We aren't sure how monetisation will work at this stage but we want to make this fair and reasonable for both new and existing users. We are open to suggestions at this early stage.



  • IgnatzIgnatz Mod
    Posts: 5,396

    I don't see why adult Codea users can't pay full price, it's not a huge amount of money, I assume. however, I would suggest a discount coupon for students, if that's possible, as they are very important in driving the success of the app.

  • Can't wait - please add me to the beta list 8-)

    And yes I agree with @Ignatz - I have no problem paying the going rate for this app, Codea is still the single most used app on my iPad (not including iBooks 8-))

    I'd be interested to see how this will integrate with / complement the existing Codea app and how exporting apps to run natively will work.

    If Codea Craft is being integrated with Codea then it might make sense to add it as an extra IAP, which could open up a whole new direction for Codea with extra downloadable modules / asset packs etc etc

  • Posts: 776

    Is this a Codea Update?

  • Posts: 776

    If I be in the Beta list? Will my projects be in examples? Just asking...

  • JohnJohn Admin Mod
    Posts: 487

    @Ignatz Yeah this is more about how to charge for a new feature in a way that's fair to us and our existing user base.

    @TechDojo, your suggestion to add the feature as IAP isn't a bad idea, the only drawback is that user's wont be able to test-drive the new features or load up forum projects that use it. I was thinking that the new examples would be read-only but still functional if Codea Craft isn't unlocked. That way the examples can still show you what features you will get.

    @TokOut, yes this is an update to Codea specifically (not a standalone product). If you are part of the beta then you are free to submit example projects to us although there's no guarantee they will be added (or we may ask you to fix or comment them as necessary).

    Thank you for the feedback so far.

  • Posts: 776

    It cost money :( I wished it, but I will not be allowed to install it. My father won't pay. Well grates to anyone who receives it!

    Also will Bluetooth and server writing be possible there?

  • Posts: 776

    Is World() a class? Wait it is reserved?

  • @John - Thanks for clarifying that, I thought it would be a standalone product (a bit like Codea scratchpad), the fact that it's a Codea update is great news.

    And I don't mind a reasonable IAP to purchase the extra functionality - god know's I've more than my fair share of use of Codea over the years :)

  • Beta list? IM IN

  • Posts: 478

    I do like that its build in into Codea! But I kinda dislike the idea of an API (pack) inside of another API. I also dislike that it has its own Mesh() function and a different syntax (funtions beginning with capital letters)

    I think Codea Craft should be added as an IAP (but free viewer). This would be the best compromise I think.

  • dave1707dave1707 Mod
    Posts: 6,874

    There's currently 22 names listed as beta testers. I'm not sure how many of those names are still current users/beta testers. I'm just posting what I saw listed on the Codea home page. I have no control over who's selected as beta testers, so don't ask me to include you.

  • Posts: 478

    I am! ... I think. Codea disappeared from my TestFlight, so .. not sure if I still am an "active" beta tester

  • I believe this game will be a huge success across multiple communities:
    Young kids will have interactions with unique shapes
    Older kids can enjoy coding their own Minecraft type game, thus making this more popular
    However, most people tend to go for the origional idea. Try adding custom a
    schematics into the game to make it unique to itself. Minecraft was an entirely new idea, how will this be similar and different? Make this stand out from other games, maybe add a coding tutorial in the game to help better understand.

  • JohnJohn Admin Mod
    Posts: 487

    @TokOut, @se24vad - I'm not 100% sure on the final syntax but at the moment you have to use the Lua require function to load the Codea Craft libraries, so none of the new features will clash with existing projects.

    Currently it looks like this:

    function setup()
      -- load Codea Craft table and export into global namespace
      require 'codeacraft':export()
      world = World()

    Alternatively you could do this:

    function setup()
      -- store reference to Codea Craft table to avoid crowding global namespace
      cc = require 'codeacraft'
      world = cc.World()

    @se24vad The use of capital letters for classes is supposed to mimic the naming convention used for user classes. This does look a bit strange compared to the standard syntax codea uses. All function names are still lower case, only classes (such as World, Entity and Components) are named this way. I may consider changing it for the sake of consistency but then you can't really name things as variables of the same name (i.e. world, mesh, material), which encourages uglier shorthand names (i.e. wrld, msh, m, mat, etc...)

    The World class itself may end up being automatically created and executed when using Codea Craft. Right now you have to create it and update / draw it manually each frame.

    function setup()
      -- load Codea Craft table and export into global namespace
      require 'codeacraft':export()
      world = World()
    function draw()
      -- Do your updates here
  • Posts: 776

    How to make your own requires?

  • Posts: 776

    Will be Codea Craft - The World() - be multiplayer avaibel?

  • IgnatzIgnatz Mod
    Posts: 5,396

    @Tokout - please stop cluttering this thread.

    Have a little patience and let John finish his work.

  • This game already looks great. So lets take some time to let John and his crew do the work, we will in the meantime use this wonderful app to create our own Codea Crafts :smile:

  • just add a in app purchase menu for people that straight out want to purchase it and add a button to access a list of surveys or ads basically that a user can select, do them, and gain enough points to purchase the app with that, after purchase make the app update to remove both buttons. Either way you would get paid, but people that can't afford it can still have the opportunity to get it.

  • Posts: 2,015

    This looks absolutely fantastic. An absolutely phenomenal feature set which really plays to Codea's strengths I feel. It's as if Unity has arrived on the iPad!

    I think an IAP upgrade would be very fair.

    Glancing through the feature list, I have a quick question, does it come with support for working out which 3D object has been touched? Is this what is meant by "raycasting" in the "camera" section (similar to Camera.ScreenPointToRay in Unity or SCNView.hitTest in SceneKit)? Although @Ignatz and @UberGoober managed to implement mapping of 2d touches onto the 3d scene, it was something of a marathon effort from them to get this working.

  • JohnJohn Admin Mod
    Posts: 487

    @featherfx Unfortunately ad and survey grinding (earning points by watching them) might be against most ad providers' terms of service.

    @yojimbo2000 Yes, Codea Craft is inspired by Unity, just as the original Codea feature set is inspired by Processing. At the moment you can use the physics system to do picking (on physics shapes rather than polygons directly). If you use a MeshShape with your rigid bodies then it will allow for picking polygons directly.

    Here's an example:

    function setup()
      require 'codeacraft':export()
      world = World()
      physics = world.physics
    function draw()
      camera =
      local origin, direction = camera:screenToRay(CurrentTouch.x, CurrentTouch.y)
      hit = physics:raycast(origin, direction, 100)
      if hit then
        -- hit contains: entity, rigidbody, point, normal and fraction

    I currently have this working as well as physics:sphereCast(), which I've used to implement a capsule shaped character controller (which works with the voxel system as well).

  • Posts: 2,015

    @John that's fantastic, I can't wait.

    I've had a blast working with 3D in Codea so far, but an awful lot of dev time gets taken up with implementing features like these. Although I've learned a tremendous amount getting stuff like this working, Codea Craft's C++ implementations will presumably be much more performant than the Lua-based ones we've been using. Most importantly though, Codea Craft will free us up to focus on what really matters, creating awesome experiences and games.

    I have another question while we're on the topic of taking inspiration from Unity: what level of 3D assets are you planning on bundling with it? My suggestion would be to hire a 3D artist (or license their work) to create genre-themed asset packs, which you could offer as additional IAP. E.g. A dungeon set would have dungeon fittings, treasure chests, skinned orc/ goblin/ dragon fbx models etc all the assets you'd need to create a great dungeon-crawler. It'd be similar to the Unity asset store.

    I think this is one of the most attractive parts in the Unity ecosystem, as it's a point where lots of indie devs struggle, in not having the time/ 3D skills to create and animate 3D assets. Even if you do buy assets online (or download free ones), getting them into your program and displaying correctly can still be really tough (especially if there are complex materials or skinned animations involved. Getting skinned animations out of a 3D authoring tool to display correctly in Apple's SceneKit is a major, major headache).

    I'd definitely drop $8 for a set of themed assets, if I knew I could drop an animated elf/ skeleton and have him/ her/ it run around in my code at the push of a button.

    In fact, that'd be my recommendation for the pricing model. Make Codea itself and Codea Craft cheap, or free even, but offer themed asset packs at $3-10 / pop. Space-themed assets, dungeon- themed, cute-platformer themed etc.

    You could do this for 2D assets too.

    The 2D assets that ship with Codea are rather lacklustre (and are the same as the ones in Pythonista, and other IDEs. In fact, the Pythonista ones are better, because the Codea ones seem to have frames of the animation missing, so we can't even make the dude with the bubble helmet walk properly in Codea).

    I think the really big pay off for this approach would be that it would make Codea sample code look way better than it often does currently. People would look at the App Store description of Codea or come to the forum and see incredible animated graphics, instead of the same dude with the bubble helmet that's in every other IDE, not even doing a walk cycle.

  • edited September 2016 Posts: 776

    Suggestion for Codea Craft:

    Project Uploading

    As in GitHub allow from Codea itself uploading games to ex. ** ** , were Packages Project Meshes will be automatically uploaded with, and from another device for example give the random ID "qidNe", so people can install codes with packages already built in

    Codea Server
    To make multiplayer games, Codea Users will receive a part of the Server running, something like

    function register(n)
            name = n,
            registeredTime = os.time()

    If Codea get Servers the popularity will definitely grow by 10,000 people (maybe)

    Json encode can currently save only pairs (tables and classes).

    -> Add JSON for images. Cause I am Sure that you want to save image() global

  • JohnJohn Admin Mod
    Posts: 487

    Character Controller Example progress:

    @yojimbo2000 Paid asset packs is an intriguing concept. I've been looking at the new assets released by since we included his assets and we could potentially include a significantly larger catalogue (especially since mobile download limits have been increased by Apple).

    Currently I'm looking at including these 3D asset packs for free at a bare minimum for the first release:
    Nature Pack (as seen in roller demo)
    Blocky Characters Pack
    Watercraft Pack
    Modular Buildings Pack
    Weapons Pack
    Minigolf Pack
    A 3D primitives and prototyping pack (generic useful shapes).

    @simeon Is actually a very talented 3D artist so he might be able to chip in some cool models. We are already considering including the assets from Wheeler's Treasure (our first iOS game).

    For both 2D and 3D I've already aquired a license for this:

    Which will be used for particle effects in both 2D and 3D.

  • Posts: 2,015

    Wow, looks like you're pulling out all the stops! Particle effects too.

  • Posts: 478

    I think it would be amazing to have an actual asset store! Just like gamemaker or unity3d. Would this be against apple's rules?

  • I would LOVE to be in the BETA TEST. Also great work so far on Codea craft, i think a IAP would be the best.

  • Posts: 2,015

    Another question, if I may. Will you be supporting cubic textures? I find these to be the easiest way to implement skyboxes (as well as reflective surfaces). If so, will it be possible to load cubic textures into GLES shaders via Codea's shader API?

  • JohnJohn Admin Mod
    Posts: 487

    @yojimbo2000 Yes cubemaps will be supported by the new rendering engine. I may also back-port those to the existing shader API.

    @TokOut - The first 2 will most likely be added. I'm not sure I like the look of the 3rd one however.

  • edited September 2016 Posts: 776

    Ok, do not import the 3rd one, why don't you want to use all 3D Assets?
    And also question:

    So as said these are 3D .obj models. Can you load your own objects? And how to create them? Will be meshes avaibel for these objects?

    Edit: (Merged posts - @John)
    P.S. You have maybe overseen this package:

    And these would be cool, too: (Just showing you, no need to add)




    WTF Lol:

  • JohnJohn Admin Mod
    edited September 2016 Posts: 487

    Hi @TokOut I'm not sure I understand what you mean by all 3D assets? I'm planning on including any that I find suitable (quality and usefulness). Unfortunately not all packs can be added due to bloating Codea's app package size, so I prefer to be a bit picky.

    Please do not make multiple posts in a row, but instead just edit your original and add the new ones after typing Edit: so we know that you changed your comment. I've merged your comments for you to give you an example.

    Edit: To answer your other question, you can make your own objects in a 3D package such as Blender, Maya or 3DS Max, or you can use code to make a mesh as well.

  • edited September 2016 Posts: 776



    Can I be in beta list with a question mark?

  • @John - just shut up and take my money already :)

    +1 for @YoJimbo2000's idea of an asset store. If Apple do get a little finicky about it you could always implement it as part of the Codea website and then have people log-in via the app to get the latest assets - although I'm sure downloadable asset packs for graphics / sound would be ok (code examples probably not).

    As for the new Kenny assets +1 for the 3D road tiles pack - that'll make it easy(er) to re-create the old Bull Frog classic "Populus" or EA's Racing Destruction Set in Codea :)

  • Posts: 103

    I'm curious about the materials and lighting. Will object materials have settings like reflectivity and transparency? And will there be different light sources, such as point, area, and spotlights?

  • JohnJohn Admin Mod
    Posts: 487

    @Dwins This is something I'm currently working on. The plan is to fully support multiple lights (spot, point and directional) along with various material properties (ambient, diffuse, opacity, specular, environment, normal maps, emissive, etc...).

  • @John

    How is one given access to a closed beta? I am a student at a university and codea has been the best tool I have ever used to learn programming. The community members included.

    If I could help give back by testing out the new features I would love to do that. However, I'm still wouldn't call myself a seasoned programmer, but I feel very comfortable in Lua.

  • Posts: 478

    @John @Dwins super cool! Can't wait to play with Codea Craft :)

  • This is the first time I have ever posted a comment, so forgive in advance me if I make a mistake. I am a pretty good programmer, but the thing that sort of bugged me is how Codea can only post it on the App Store (at least, with ease), and since you said you got the inspiration from Unity, will you make it compatible with more platforms?

  • Posts: 478

    The devs are working on a macOS port. They have planned a LOT of good things for us and are working hard on them, but their team is small, so you have to be patient...

  • Posts: 776

    Can Voxels be used 3D only, or can they be used 2D?

  • JohnJohn Admin Mod
    Posts: 487

    Progress Update - Lighting and Physically Based Materials

    Codea Craft will now support a Standard material that uses a Physically Based Lighting model. This means that a single shader can reproduce a large number of realistic surfaces with very little effort. This material is more expensive (i.e. slower) and so regular specular and unlit shaders are still available too.

    Standard Material Options:
    * diffuse (surface color)
    * opacity (how opaque the surface is, i.e. 0 = fully transparent, 1 = fully opaque)
    * offsetRepeat (modify texture scale and offset for shifting and tiling effects)
    * emissive (surface emission color)
    * emissiveMap (emissive texture - combines with emissive)
    * roughness (how rough the surface is)
    * roughnessMap (roughness texture - combines with roughness)
    * metalness (how metallic the surface is)
    * metalnessMap (metalness texture - combines with metalness)
    * map (diffuse texture - combines with diffuse color)
    * normalMap (surface normal details)
    * normalScale (how strong the normal map is)
    * displacementMap (modifies vertices based on grayscale texture)
    * displacementBias (offset for displacement map)
    * displacementScale (scale for displacement map)
    * aoMap (ambient occlusion map for self-occlusion details)
    * aoMapIntensity
    * envMap (environment map, used for reflecting environment based on surface settings)
    * envMapIntensity

    Details on Beta access coming soon!

  • JohnJohn Admin Mod
    Posts: 487

    @TokOut You can set the camera to be ortho and lock physics object axes to 2D so yes technically voxels can be used in 2D although it seems a bit of a waste to do that when the 2D tools would work fine.

    For a 2.5D game this approach would make sense though.

  • edited October 2016 Posts: 776

    Do Voxels have light/physics support?

  • JohnJohn Admin Mod
    Posts: 487

    @TokOut Yes

  • @John I was just wondering about the new update, will it only add codea craft or will it change other things about codea in general?

  • JohnJohn Admin Mod
    Posts: 487

    @CamelCoder We have other features and updates in the pipeline (i.e. Universal support, bug fixes).

    We don't plan to change the existing feature set - Codea Craft will be adding a separate set of features which enhance things that Codea lacks (i.e. 3D support, materials, lighting).

  • edited October 2016 Posts: 776

    It would be great if text files had support for styling, marking, etc.

    Will something new be added to shaders, e. G. Sading 3D Objects, etc.

  • Posts: 776

    I don't know if you have that feeling, but what if you already have tags in your project which will be added new? I mean, then you have to change your entire code. And I also have that feeling merged with "I can not wait for Codea Craft!! Let God develop it faster!" - Not negatively, I am always nervously waiting for cool stuff, I LOVE Codea!! John, Ignore Ignatz, I AM YOUR BIGGEST FAN!!

  • IgnatzIgnatz Mod
    Posts: 5,396

    @TokOut - please just leave John alone to finish his work.

Sign In or Register to comment.