Mesh scale like the vine grows up.
Do you mean the vine Spine example?
Yes, something like it.
We planned the 1.2.163 release today. Three items planned for the release in two weeks:
Those would be great especially sound completed callback! We will no longer have to guess based on counting time to know when music is probably done.
What I need more personally to switch back to using Defold audio directly:
- Audio on its own thread, not lockstep, to avoid audio glitches when the engine hiccups especially when loading assets (still happens even with improvements to loading that were done at some point)
- Ability to designate certain audio as to be streamed instead of being fully loaded into memory, designate how much buffer to keep loaded at once
Beyond those an audio profiles system (similar to texture profiles) would be useful. To modify the audio compression (especially selectively) when bundling would be super convenient. Being able to select platform specific audio types for bundling so that hardware playback can be used. Ability to have more lazy loading of audio so engine can load/unload as audio samples are used, and some samples can be marked to be loaded immediately/always loaded while others can be easily auto loaded as they are played and unloaded if not used for a while.
Audio on its own thread
Regarding threading, itâs not in our roadmap (yet). Itâs a good suggestion though, and given that itâs message based, that should make it easier to do.
âAbility to designate certain audio as to be streamed instead of being fully loaded into memory, designate how much buffer to keep loaded at onceâ
The sound is specifically memory mapped directly from the archive files, so it shouldnât have all the data in memory at once.
So when creating a sound resource, it should only get a raw pointer to the file on âdiscâ. Itâs not duplicated in memory (at least it shouldnât be)
Is this an issue you actually have and something you can reproduce?
Audio profiles
In what scenarios do you need to resample the audio upfront?
Also, I think prebundling scripts (aka editor extensions) should help with those things.
hardware playback can be used
Itâs not in our roadmap, and weâve always favoured one code path to make things small and platform independent. I can see the value for it, but Iâd rather add support for this through extensions, as opposed to adding this internally in the engine. (A good example is the hardware video player extension the Pet Rescue Puzzle team implemented)
This pretty cool! Btw. Iâve noticed that some profilers (I remember htop doing this) include memory mapped files in the appâs memory usage number, which is misleading, so be careful which metric youâre looking at.
I do not know for sure about the audio memory issue at the moment, I will test sometime soon to see if itâs a real issue. It is mostly an issue on mobile if it is. So this means we should not need to worry about unloading audio currently we can keep it all âloadedâ in a main collection and it would have similar memory impact as that collection not being loaded at all?
Audio profiles would be big ask, and less important than other things. It is the same benefit as using texture profiles. Being able to test out different compression quickly and modify multiple files at once without needing to use external editors. Of course external tools can be used, but the same could be said for textures. Texture profiles are a crucial feature of Defold. FMOD Studio has something similar for audio, but using it has catches and expensive.
I have not yet but I do plan to contribute to the OpenAL extension. Add more format support, and make some helper scripts (for direct bob bundling) to do the audio per target pre-processing with open source software available. Hardware playback can also be done with the extension I think. For Android it is most important.
it would have similar memory impact as that collection not being loaded at all
Thereâs ofc some overhead for a collection and its components, and you might still want the organisational help of using multiple collections.
I tested this now and it looks to not be the case, Defold loads all of the sound components into memory all at once. Am I misunderstanding something in how this should be setup? It seems like the only way to not keep everything in memory at once is to have a collection proxy per song, which sucks because changing songs makes the game hang and any other audio playing glitch still.
Before adding sound components for songs
After
Otherwise it is a blank project, not even playing the sounds.
What I want is a checkbox on some sound components to not load them at all and only stream data as they are played. Then in game.project be able to say how much buffer to keep loaded at any time.
Well, tbh, Iâm not sure why weâd reallocate the data again, since itâs already memory mapped, but Iâll look into it soon.
I assume what is currently happening is the compressed files are loaded into memory with the collection fully. Then each is streamed as needed. Wav files uncompressed, Ogg files streamed but the whole file is still kept in memory. Something like that makes sense when itâs one song at a time loaded compressed and streamed.
But current situation with built in audio means either canât have too many songs in a playlist (fully loading several songs at a time is still not ideal especially on mobile, and players notice the same songs repeating), accept that audio glitches and game hitches will happen as songs switch loading (really hurts feel of a gameâs quality).
Is the ability to create polygonal collision objects in the editor in any sprint?
No, Iâm afraid not. Itâs in the backlog. Youâll have to create the shape using an external tool.
Here is a little preview of a work in progressâŚ
The video demo both a new âbufferâ resource type and a new âmeshâ component. The buffer resource is essentially a resource version of a dmBuffer::HBuffer
, and the mesh component is a very simple component that uses buffers and renders them as vertex buffers. Combining these should open up a lot of new possibilities; custom meshes, implementing the official Spine runtime as a native extension, or why not write your own custom particle/sprite system?
Buffer resources, just as runtime dmBuffer
s , can include any combination of streams and types. This means that you can supply positions, multiple uv coords, normals, tangent vectors etc⌠Essentially whatever you like, as long as the material attached has attributes for them. For this demo I wrote a simple script that convert OBJ files into .buffer
files. Together with our plans for editor extensions, I think this can result in some really awesome Defold libraries.
Also, since .buffer
resources turns into dmBuffers
at runtime, we already have a runtime API to modify them (shown last in the video above where I modify the position stream for the buffer when dragging the mouse pointer).
As always, I want to point out this is an early WIP and things might change drastically. Itâs currently being prototyped together with the design for custom meshes and has already gone through a couple of different ideas, but I have a feeling we are on to something here.
Love it!
looks great. only problem I see at first glance is that then weâll have both a model and a mesh component that roughly do the same thing and might be confusing when to use either.
Model can be replaced with a mesh, but not the other way around.
Models will later be expanded upon (one model can have multiple meshes, support lod levels etc), whereas meshes are just that, a single mesh.
This is what happens in our project when switching screens while any audio such as music is playing when using built in sound components.
Most of those larger gaps are switching screens with âasyncâ loading enabled. Latest engine version.
You can hear / see that even small hitches in the game sim mess up the audio. This highlighted section isnât even a screen change. You can heart in the audio sample above.
This is with keeping all sound components loaded at the same time too. If I only keep a single sound component loaded (based on collection proxy loading/unloading) it makes the game sim hang while changing songs too (and any other audio which happens to be playing sound glitchy).