This is a summary of new features and breaking changes in recent noa
versions.
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.29.0
- 0.28.0
- 0.27.0
- 0.26.0
- 0.25.0
- 0.24.0
- 0.23.0
- 0.22.0
- 0.21.0
- 0.20.0
- 0.16.0
- Signature of
noa.registry.registerMaterial
changed to take an options object - Terrain now supports texture atlases! Merge your textures into a vertical strip atlas, then call
noa.registry.registerMaterial
with that texture and specify anatlasIndex
options property. - When passing world data to
setChunkData
, client may now pass in afillVoxelID
to signify that entire chunk should be filled with that voxel (e.g.0
for air) - Babylon version updated
- Added options/properties to
noa.camera
for temprary changes to camera control sensitivity.sensitivityMult
(default1
)sensitivityMultOutsidePointerlock
(default0
)
- Added
noa.camera.inputsDisabled
for temporarily disabling camera controls - Modernization updates to
noa.inputs
. Breaking changes:- Key bindings should now use KeyboardEvent.code strings, like
KeyA
,Shift
, etc. - Mouse button bindings should use
Mouse1
,Mouse2
.. - Mouse move/scroll values (
dx,dy,scrollx,scrolly
) are moved fromnoa.inputs.state
tonoa.inputs.pointerState
- Key bindings should now use KeyboardEvent.code strings, like
- Changes default light to Directional, and updates related engine options:
- removes option
groundLightColor
, addslightVector
, and changesambientColor
- removes option
- Removes
noa.rendering.postMaterialCreationHook
- use mesh hooks instead - Adds
rendering.setMeshVisibility
for toggling the display of meshes that are added to the scene withaddMeshToScene
- Engine now emits events when adding/removing terrain meshes that it magnages (static chunk terrain, or custom block meshes). Clients can listen to these to implement shadows.
noa#addingTerrainMesh
noa#removingTerrainMesh
- Adds
playerShadowComponent
option, defaulting totrue
- Renames some internals to be public - e.g.
rendering._scene
toscene
- Fixes npm versioning issue - no code changes.
- Change the speed of the world with
noa.timeScale
- Now possible to control chunk processing order:
noa.world.chunkSortingDistFn
- Chunk processing will happen more reliably, particularly after switching worlds.
- Changed how the docs work, and how code comments are arranged for this purpose. See API docs.
- Moves to Babylonjs version 5 (alpha).
- Adds more exported types and code hints.
- Engine now a named export, use
import {Engine} from 'noa-engine'
- many performance and size optimizations
- now generates proper type declarations and API references!
- Adds separate horizontal/vertical add/remove chunk distances in
world
- Scene octree now can put multiple chunks in each octree block
- Adds option
noa.rendering.renderOnResize
- Changed game-shell dependency, which affects several properties:
- init option
tickRate
is now in ticks per second, not ms per tick - init option
maxRenderRate
added (leave at0
for no cap) - init option
stickyFullscreen
added - adds
noa.tickRate
. Read only; if you really need to change it usenoa.container._shell.tickRate
. - adds
noa.maxRenderRate
- this is safe to change dynamically. Set to0
for no limit.
- init option
- Removed the
id
property onChunk
objects. Shouldn't realistically affect any game clients, but if you were using it for some reason, usechunk.requestID
instead. - Made several of the core
babylon
imports more specific, which could cause errors if your client code is using Babylon modules without importing them. If you're using any mesh builders (e.g.Mesh.CreateBox()
), make sure to import the necessary module (import '@babylonjs/core/Meshes/Builders/boxBuilder'
).
- Maximum allowed voxel ID is now
65535
- New option
worldGenWhilePaused
added tonoa.world
. When true, the engine will keep doing world generation (requesting new chunks, disposing old ones, meshing, etc) even while paused. - New option
manuallyControlChunkLoading
added tonoa.world
. When set, the engine will not automatically add or remove chunks near the player. Instead, callnoa.world.manuallyLoadChunk
andmanuallyUnloadChunk
on the coordinates you need. - Voxel IDs are now stored internally as plain
Uint16Array
elements, rather packing IDs and bit flags together. Any clients that were accessing internal data arrays will probably need to be updated. - Fixed the
dt
parameter tonoa#render(dt)
events. Previously it could occasionally be wrong in such a way as to cause temporal aliasing when used for animations.
- Voxel data is no longer internally duplicated at chunk borders. This means:
- World generation no longer necessarily needs to be deterministic. Previously, voxels on chunk borders would get tracked in several chunks, and if the data didn't match up it would cause rendering artifacts. This is no longer the case, each voxel is stored in only one place.
- When each chunk gets meshed for the first time, it will have have some artifacts at edges where the neighboring chunk doesn't exist yet. Such chunks will later get re-meshed once all their neighbor chunks exist.
- Set
noa.world.minNeighborsToMesh
(default6
) to control how aggressively chunks first get meshed.
- Can now swap between world data sets
- Set
noa.worldName
to manage - Current worldName is now sent with
worldDataNeeded
events, so that game client knows which worldgen data to provide
- Set
- Removed leading
_
from several property names, since they're meant to be set by the client:noa.world.maxChunksPendingCreation
(max # of chunks to queue)noa.world.maxChunksPendingMeshing
(max # of chunks to queue)noa.world.maxProcessingPerTick
(time in ms)noa.world.maxProcessingPerRender
(time in ms)
- Mostly rewrites
noa.world
internals (chunk create/update/dispose flow)
- Engine now does world origin rebasing, to avoid precision bugs in large worlds
- Entity positions are now handled internally relative to a local coordinate system, which is periodically rebased around the player entity
- The following systems now internally use local coordinates:
- rendering
- physics
- entity/entity collisions
- raycasting
- Pre-existing position properties and related APIs still work, but may be imprecise. Each such API now has a
_local
alternate - Engine option
originRebaseDistance
controls how often rebasing occurs - See /doc/positions.md for more details
- Engine now imports Babylon as a peer dependency
- Noa games must now declare their own dependency on
@babylon/core
- See examples for sample code, weback config, etc.
- Noa games must now declare their own dependency on
- Noa now exports Engine as an ES6 module.
- Clients using
require
will need to dorequire('noa-engine').default
- Clients using
- Example worlds (
test
andhello-world
) moved to a separate repo - Internal modules all migrated to es6 import/export syntax
- Moves several camera-related APIs from rendering to
noa.camera
- Removes several redundant properties/APIs (they throw depreceation messages when accessed)
- Component systems now fire in a fixed order, see components.md
- Changes order of various render logic - fixes temporal aliasing bugs
noa#render
events now pass correctdt
argument - see issue #53
- Adds
debug
option: populateswindow
with useful references, bindsZ
to BJS inspector - Now current with Babylon.js 4.0
- Updates many dependencies, many small bug fixes.
- Terrain materials can specify a renderMaterial (see
registry.registerMaterial()
) - Targeting and
noa.pick
can take a function for which block IDs to target - #36 every
component is removed (client apps using this, please define it separately)
- Now uses octrees for scene selection for all meshes, even moving ones
- Option
useOctreesForDynamicMeshes
(defaulttrue
) to disable previous noa.rendering.addDynamicMesh
changed toaddMeshToScene(mesh, isStatic)
- Entities can now be cylindrical w.r.t.
collideEntities
component - Adds pairwise entity collision handler
noa.entities.onPairwiseEntityCollision
- Large/complicated scenes should mesh and render much faster
- Chunk terrain/object meshing now merges results. Block object meshes must be static!
- Removed redundant
player
component - usenoa.playerEntity
property - Added
showFPS
option - Many internal changes that hopefully don't break compatibility
- Support unloading/reloading new world data.
Sample implementation in thedocs/test
app (hit "O" to swap world data) - changes
noa.world#setChunkData
params:id, array, userData
- changes
noa.world#chunkBeingRemoved
event params:id, array, userData
- Near chunks get loaded and distant ones get unloaded faster and more sensibly
- Greatly speeds up chunk init, meshing, and disposal (and fixes some new Chrome deopts)
- Revise per-block callbacks:
onLoad
when a block is created as part of a newly-loaded chunkonUnload
- when the block goes away because its chunk was unloadedonSet
- when a block gets set to that particular idonUnset
- when a block that had that id gets set to something elseonCustomMeshCreate
- when that block's custom mesh is instantiated (either due to load or set)
- Simplifies block targeting. Instead of several accessor methods, now there's a persistent
noa.targetedBlock
with details on whatever block is currently targeted. noa
now emitstargetBlockChanged
- Built-in block highlighting can now be overridden or turned off with option
skipDefaultHighlighting
- Adds per-block callbacks:
onCreate
,onDestroy
,onCustomMeshCreate
- Simplifies block registration - now takes an options argument, and the same API is used for custom mesh blocks
- Removes the idea of registration for meshes