Devlog #7 — Physics and Cameras

Shaun Wall
Crayta
Published in
4 min readMay 10, 2019

⚠ This content is old and may no longer be correct or relevant!

Welcome to Alpha 833! Features include things obeying some form of physics and a bunch of editor and camera improvements to make game development easier for everyone!

You can find the full changelog below, but here are some exciting highlights!:

Physics ⚛️

This has been on the roadmap for a while, and we’re extremely excited to get the first pass at physics out. All entities can now have physics, mass and gravity effects toggled, allowing for some exciting new game possibilities.

This updates also adds a few new physics-based Lua APIs for you to use, such as adding general and angular velocity, impulse and angular impulse and constant forces to any entities. These also give you access to the physics properties on entities, allowing you to toggle an entity’s physics, gravity and mass properties on the fly via Lua. You can access the Lua API in-game by opening a code window and pressing F1 (or Help -> Lua Documentation).

The physics is still very much a work-in-progress, so expect weird and unexpected behaviours from this first pass as we work to solidify and improve!

Swimming 🏊‍♀

Enjoy the wonders of blocky liquids by adding a body of water voxels and jumping in. We’ve added some swimming mechanics and animations for surface and sub-surface swimming, finally allowing for everyone’s favourite feature of games: underwater levels.

Packages 📦

Packages are the new way of sharing what you’ve made with other players: you can put anything you want into a package (templates, scripts, widgets, voxel meshes etc.) and publish it to the store for anyone else to use. Packages detect which other packages they’re dependent on, and include those as “dependencies”. This allows for reusing other assets and packages in your own games, and easy sharing of things you’ve built.

New game settings 🛠

World Settings has been renamed to Game Settings in preparation for additional settings and tweaks we plan on adding. For now, there are a few new skydome related options for you to fiddle with, including curvature colouring, optional meshes and layer assets.

Camera presets 🎥

One of our more noticeable changes is that the Player template now has a selection of configurable in-built camera types to help creators make a wider variety of games without needing to dive into Lua scripting. These include:

  • Action — The standard Crayta camera, move the mouse to move your view like any third-person action game. Good for shooters.
  • Fixed — The camera is fixed at a specific angle and distance, moving the mouse does not have any effect. Good for top-down strategy games, or fixed-camera arena games.
  • Orbit — Similar to Action, except the Player’s movement is independent of the camera. E.g. moving backwards will cause the player to turn around and run towards the camera instead of running backwards.
  • MMO — Moving the player’s rotation requires clicking and dragging the right mouse button, or dragging the left mouse button to move the camera only.

This is the biggest update of 2019 so far, and not only contains a lot of exciting things, but is also laying the groundwork for even more fun things to come. We’re really excited to see what the community can make with these new tools, and look forward to playing your games!

Happy creating!

Full A833 change log:

  • Added Physics system (work in progress) — Entities now have physicsEnabled, overrideMass and gravityEnabled flags. Entity now have a massScale input to modify their mass.
  • Added Physics Lua API — Lua API now contains the following Entity physics functions: GetVelocity, SetVelocity, GetAngularVelocity, SetAngularVelocity. And the following Mesh physics functions: CreateThruster, CreateRelativeThruster, DestroyThruster, AddImpulse, AddAngularImpulse.
  • Added Swimming animations — The Player now has both surface and underwater swimming animations which are triggered when they enter a volume of water voxels.
  • Added new voxels — Forest Floor, Mosaic Tile, Sandstone Brick, Terracotta Tile and Wood Log Vertical voxels added.
  • Added Package system — This replaces the Template publishing system, and allows anyone to bundle assets (templates, scripts, meshes etc) into a Package, which can be published to the store. Other users can then download these packages and use them in their games.
  • Additional sky dome Game Settings — World Settings has been renamed to Game Settings, and a few new configurable options are available: skydomeCurveSkyUpperColor, skydomeCurveSkyLowerColor, skydomeColorHue, skyMesh and skyLayer.
  • Added Player camera presets — This are selectable and configurable from the Player template, and include Action, Fixed, Orbit and MMO.

--

--

Shaun Wall
Crayta
Editor for

UI / UX Designer working on Crayta - Spends more money on games than food.