Cabbage Logo
Back to Cabbage Site

Managing build sizes and resource management of Csound in Game Engines

okay, another question i’ve been thinking about as relevant to how Csound can work for games is build sizes. i’ve noticed that the Csound opcodes in the CsoundUnity integration are roughly 200MB. that’s a pretty hefty amount of space to take up, although i believe it may be all the different platform support weighing things down. does that pack down decently during a build for Android? a sort of ancillary question relative to size is the ability to exclude unused opcodes if not needed by the system. is this possible, or would that require a custom build of the platform library?

the other thing that a game company would want to know if deciding to use Csound is resource management in terms of CPU or memory usage. any ballpark ideas of how much overhead the runtime adds to the existing system? it’d be interesting to see how many waveguide opcodes vs synths like Ian’s GEN02 TB303 synth could be supported. if i can get this sequencer thing running in Csound i’ll certainly be doing some benchmarking myself, but answers to those kinds of questions would definitely be important to any game developer considering using Csound in their project.

These are all valid questions. Csound for Android is relatively small in size. The OSX Csound package is quite large because it ships with universal binaries for both 32 and 64bit. One can create an entire Csound build on Windows in under 8Mbs. Keep in mind too that many of the plugin opcodes can be dropped when shipping. But I do understand the concern. For what it’s worth Csound has only one dependency and that’s libsndfile. If you only build Csound with this single dep then the footprint should be quite small. But as you add support for other things it does grow in size.

I have benchmarked Csound in VST plugins, and the performance is quite good. It has been mentioned on the Csound list that Csound code runs on average about 2-3 times slower than native C code. That’s not at all bad for such a high level processing language. But it would take some implementation.

I would be most interested to see your findings. It would be great to provide this information for anyone thinking of using Csound in their games. Whats more, if we find CPU bottlenecks we can look at fixing them.