Plans for the next version of czPlayer

November 29th, 2009
Been in Scotland for near 2 years already, working at RealtimeWorlds, more specifically in a game called APB.
Times does fly when we’re having fun!
Meanwhile, I did work a bit in czPlayer, but nothing really new. Mostly bugfixes or small features for a client.
So despite not having any updates here in the blog, the following things happened to czPlayer
- Some games using czPlayer were release
- A client added iPhone support. Was as simple as creating a single class with about 160 lines of code.
- Implemented volume ramping, which helps a great deal in removing clicks, especially for chiptunes
- Added some other small features, again with minor effort. :)
- Fixed some bugs, especially related to Symbian.
Also, apart from czPlayer, I managed to squeeze in some other small freelance work.
The last few months I’ve been thinking where to go next with czPlayer, and I’ve decided to go with a new design.
Personally, I think the current design is really good performance-wise, minimizing copying memory around unnecessary or other unnecessary overhead.
For example, internally a Mixer object contains MixerInputGroup objects, and each MixerInputGroup contains individual MixerInput objects. Each of those classes have a SetVolume method, which allows me to have several levels of volume (aka as Global volume and channel volume) which get multiplied to calculate a final volume to apply in a single mixing pass, avoiding the need to mix at the MixerInputGroup level, and then again at the Mixer level.
Although the current design has proven successful, it does have severe limitations in flexibility, has for example not being able to apply an hypothetically effect to a single sound or sound group. It’s only possible to apply an effect to the final mix.
So I decided to go with a new design which should be more flexible, but I’ll still use the old codebase as reference, especially because of the small fixes/features I’ve implemented meanwhile.
Some of the new features I’m planning:
- DSP plugins. Will probably provide just 1 or two as an example.
- Configurable DSP network. This will make it possible to create a custom DSP network and play sounds in specific point in the network.
- Streaming support. Only Ogg Vorgis planned so far, but should pave the way for other formats
- Maybe virtual voices (ala FMOD style), if I get the time.
Again, those features shouldn’t add significant overhead until used, of course.
If the user  sticks with the default settings, performance should hopefully be comparable to the current version.
I’ll be dropping support for old Symbian editions (< 3rd edition), which should make some things easier.
I wish I could drop Palm OS, which is a real pain to develop for, but a particular client still requires it.

czPlayer 0.2.1 Released

March 1st, 2008

Here I am again.
Almost 2 months and here it is a new version.
No new fancy features or big changes. Basically, I’ve just added support for loading WAV files encoded with ADPCM (IMA and Microsoft ADPCM supported).

I’ve been so quiet for a reason…
Last 2 months I’ve been looking for a new position in the games industry, and finally got one in Scotland-Dundee.

You can download the new version here :
Download lastest czPlayer demo

Highly customizable C++ template String class

January 30th, 2008

In my last contract, we used CEGUI for the User Interface. The String class provided and used by CEGUI uses an internal array as quick buffer for small strings, and reverts to the heap when the data doesn’t fit that quick buffer.
That approach increases performance if the quick buffer is big enough to hold most of your string operations.

However it lacks some features:

  • The quick buffer size is hard-coded in the class, instead of template-based.
  • When reverting to heap based, it doesn’t use any mechanisms to minimize allocations/ deallocations, like for example (Reference counting and Copy-On-Write)

Since I’m starting a new hobby project (my own small game engine), to test ideas and learn some new things, the first thing I’m coding is my own String class, which I’m also using as an exercise to test some more advanced templates stuff, instead of the classical “container of values of type T”.

So… about my String class.

Features:

  • Completely template based, using policies like described in the book Modern C++. This allows for a great deal of customization.
  • Using policies, it supports multiple types of string storage. Currently it support 2 storage types:
    • Heap based with reference counting and Copy-On-Write, to delay memory allocations/deallocations as much as possible.
    • Quick buffer based (like CEGUI), but with fallback to Heap based like described above when the data doesn’t fit the quick buffer. Also, the quick buffer size itself is a template parameter, so we set the size based on the use we have in mind.
  • We can mix strings declared with different policies (the ones provided), and internally it will still try to minimize memory allocations/deallocations, by using reference counting and Copy-On-Write when possible.
  • We can specify our own Allocator for heap based strings
  • Basic methods for manipulations. I need to implement a lot more.

Missing/Todo:

  • More methods for manipulations (make it more compatible with the std::string)
  • Unicode support. I’ve laid down the bases for that, but currently only works with char type

When coding it, I’ve used CppUnite2 for the tests. See this link for more information (Games from Within: CppUnitLite2 1.1).

I haven’t used this String class in a complex product yet, only in the tests during development, so I can’t talk about performance or bugs yet.

If you want to check it out, download it below:

NOTE: I’ve only tested it with Visual Studio 2005 (with sp1), so the provided project files are for that same compiler.

czString Download