Hello everyone, recently i met some guys developing a game in C2 for desktop platforms and we had a conversation, in which we discussed if CC would be a viable option instead of C2 and how the performance of the two compares.
Now, i looked around the forum and the blog in hopes of finding a benchmark of the two, and while i did find one that did compare them (link), the blog post was made in 2011. Now, you'll probably agree that this is a long time and much could have changed in it, so i set out to make a new benchmark.
<img src="https://dl.dropboxusercontent.com/u/80437109/cc%20and%20c2%20benchmarks/images/divider.png" border="0">
The idea.
The idea i had is to create benchmarks for both CC and C2, which could provide us with some information which is more performant and how the older implementation of different things (e.g. physics, collision detection) has aged, as well as to see how well different machines perform in general. Of course, you can't always make a 1:1 copy of the implementation of something, but i guess that is part of the challenge!
<img src="https://dl.dropboxusercontent.com/u/80437109/cc%20and%20c2%20benchmarks/images/divider.png" border="0">
What i came up with so far.
For the initial testing i decided to try comparing something simple - the performance of drawing, rotating and resizing sprites. I made 3 benchmarks, testing each of the features in that order, both for CC and C2. Below you can compare the event sheet views as well as download an archive of both the .cap and .capx files.
Download of the editor files:
LINK ("every 5 ticks" version)
LINK ("every tick" version)
bench1 - drawing test
The simplest of all tests, this benchmark draws a new 256x256 32bit .png file with transparent areas on screen every 5 ticks.
C2: <img src="https://dl.dropboxusercontent.com/u/80437109/cc%20and%20c2%20benchmarks/images/c1.png" border="0">
CC: <img src="https://dl.dropboxusercontent.com/u/80437109/cc%20and%20c2%20benchmarks/images/cc1.png" border="0">
bench2 - rotation test
A bit more intensive benchmark, this one does the same as above, as well as rotates the sprites by 5 degrees clocwise every tick.
C2: <img src="https://dl.dropboxusercontent.com/u/80437109/cc%20and%20c2%20benchmarks/images/c2.png" border="0">
CC: <img src="https://dl.dropboxusercontent.com/u/80437109/cc%20and%20c2%20benchmarks/images/cc2.png" border="0">
bench3 - scaling test
The last benchmark i made for this thread, it changes sprite sizes every tick, until they either reach a width of 256 or 128, then the process is inverted.
C2: <img src="https://dl.dropboxusercontent.com/u/80437109/cc%20and%20c2%20benchmarks/images/c3.png" border="0">
CC: <img src="https://dl.dropboxusercontent.com/u/80437109/cc%20and%20c2%20benchmarks/images/cc3.png" border="0">
<img src="https://dl.dropboxusercontent.com/u/80437109/cc%20and%20c2%20benchmarks/images/divider.png" border="0">
Differences between the benchmarks.
There's a couple of things that you'll instantly notice, that are different. First, i used the spritefont object in C2 as opposed to the default font one, as there have been plenty of complaints on the forums about the performance issues with it. Secondly, there is no tick counter built-in inside of C2, therefore i just opted for using a global variable, which should perform almost as good, if not better. Lastly, in CC, there is no fps counter (unless you use the one in the caption, but it is lost on export), therefore i made one of my own, however the accuracy is rough at best (+/- 5 fps).
Furthermore, i adjusted the settings for the best possible performance at the expense of graphical quality, because this is a benchmark for exactly that, not a comparison between the eye-candy options available or roundness of the pixels.
CC (r2) settings: 800x600 window size, point sampling, fixed framerate, 60fps, aliased text, no multisampling
C2 (r156) settings: 800x600 window size, pixel rounding off, point sampling, low quality scaling, no high dpi display, do not clear background, webgl enabled
<img src="https://dl.dropboxusercontent.com/u/80437109/cc%20and%20c2%20benchmarks/images/divider.png" border="0">
How to participate.
Of course, none of this is important, unless you participate!
The goal i'd like to reach is to have as many people as possible download the samples and run them, write down the results and post them here, so more people know what to expect performance-wise on different desktop configurations.
Because of this, i tried to make the process as simple as possible, all you have to do is:
1.) download the archive and extract the executables (you can build them yourself, but then you need to select webkit as the export platform in c2, to test the executable exporter).
--LINK(~75MB, .zip archive, "every 5 ticks" version)--
--LINK(75MB, .zip archive, "every tick" version)--
2.) download the spreadsheet i made for easily comparing the results, depending on which office software suite you have.
--LINK(.xls for Microsoft Excel, converted from .ods)--
--LINK(.ods for OpenOffice / LibreOffice etc.)--
3.) run the executables, keep a close eye on the fps values and write down the object counts at which fps reaches the values in the tables, also, if you can write down some basic information about your hardware in the indicated cells, that would be nice. furthermore, you really should check what renderer is being used by c2 and put it in the table (webgl or canvas2d)
4.) take a screenshot of the resulting charts / spreadsheet, host it somewhere (imgur is usually good for this) and post it here!
<img src="https://dl.dropboxusercontent.com/u/80437109/cc%20and%20c2%20benchmarks/images/divider.png" border="0">
My results.
Here are the results i got on my outdated laptop i made the benchmark on, but please keep in mind that WebGL is off because my hardware doesn't support it (yay, legacy, right?), therefore the performance is pretty bad there. Another thing, you'll notice that there are "x" in a couple of cells - this means that C2 didn't achieve the indicated framerate at all (shouldn't be a problem on most modern machines, though).
<img src="https://dl.dropboxusercontent.com/u/80437109/cc%20and%20c2%20benchmarks/images/results.png" border="0">
Also, if you'd rather view this in .pdf format, here are the results: LINK.
<img src="https://dl.dropboxusercontent.com/u/80437109/cc%20and%20c2%20benchmarks/images/divider.png" border="0">
Also, i should probably mention that higher means better in the charts... :/
This is pretty much just a test post to see what kind of feedback i get, if there is demand for stuff like this, i could compare things like the efficiency of physics, sounds, particle effects etc.
Good luck, everyone!