C2 Performance, let's be honest...

Discussion and feedback on Construct 2

Post » Wed Feb 19, 2014 1:34 am

@whiteclaws Sounds like you know your stuff, thanks for the info, I will check out the Vid...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,270

Post » Wed Feb 19, 2014 1:43 am

Uh, as far as I'm aware C++ is compiled to native code (unless you use an interpreter for some reason) which is processor instructions, and is no different from C in that regard, as opposed to being the language the operating system was coded in, which I don't think is relevant. Those languages become compiled to the instruction set of the processor on the system. Javascript is interpreted by some other program at run-time and is far slower as a result. I think with modern engines there's some sort of just-in-time compilation for javascript which means that when you run the program it is compiled to machine code at the time you run it, or part of the program is anyway.
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Wed Feb 19, 2014 1:47 am

[QUOTE=Whiteclaws]

HTML5 is javascript , and it gets interpreted (converted) into native code ( I think , correct me if I'm wrong ) in the browser , WHILE running the application , that's called an JIT compiler (Just In Time) , and that's why it's slower than native C , aka NodeWebkit ...
I hope this shed a bit of light on Javascript manners
Moreso , if you want to go more into details , this video is a must (Javascript is interpreted by the way)

[/QUOTE]
Almost correct, interpreting it would mean running the JS without compiling it into native code this is the more traditional slower "web" method of running JS.

The V8 engine (Chrome) actually compiles the JS to native machine code X86-64, ARM etc which has a number of advantages eg it can be further optimised at runtime, be cached etc etc It's almost as fast as native because it is ultimately native there's a loss of time in the initial conversion one must assume. Thing is although its been out in the wild a few years now the V8 engine is imo very much a work in progress I expect to see further significant improvements in time.
There are 10 types of people in the World, those that understand binary and those who don't.
B
7
S
2
Posts: 93
Reputation: 797

Post » Wed Feb 19, 2014 2:05 am

@Pixel perfick :

C2 has it's quirks, but on desktop platforms at least, it can generally hold it's own. I'm working on a bullet hell shooter now that can have 1000-2000 moving sprites on screen at times, checking cols against a few hundred enemies, all per tick(yes, cols too).

Plus particles effects, rotating enemies, multiple layer, parallax, etc.

I'm getting 60fps solid, with only occasional dips in debugger. Cpu usage maxes around 75, averages about 20-40, and that's also in the debugger, which adds a good bit of overhead, especially when you have a lot of moving objects. Now, I have a pretty fast processor (i5, 3570k), but I'm using it's integrated graphics.

This has been said before, but javascript has improved dramatically, and continues to improve in speed and performance. As other's have said, 90 percent of modern games don't code to the metal to begin with, because: a. too slow and difficult, b. OS in the way, and c. no way of knowing what metal is going to be there.

The key is this: javascript has a way to go to compete with C/C++...but there are no set-in-stone barriers to getting there.

@TGeorgeMihai, @lennaert :

I kind of reject the idea that Visual/WYSIWYG editors will never be able to compete favorably with hand coded games. Obviously, hand coded will always be faster (IF they are coded well...and that's a big if). But, in most cases, it's not going to be the massive difference that it was in the past.

If you doubt this, take a look at the original Construct Classic. It's easily as fast as many custom coded pc games...and in many cases faster. And keep in mind that it would probably be even faster by now had the Scirra Bro's kept on developing it.

Of course, you still have to understand the basic logic that goes into making things work, still have to refine your approach, but at this point in time, most of the lower level muckity-muck is best left to the computer itself.

I wish I had the skill, dedication, time, and talent to build my games from scratch, to work exactly how I want them to.

But...I'd rather actually make them...with C2.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Wed Feb 19, 2014 2:21 am

The technical performance differences between compiled JavaScript and languages like c is even more complicated. It's not a matter of 'JavaScript is x amount slower across the board.' Certain specific operations are different speeds depending on the language and the compiler.

Also, how the JavaScript is written makes a big difference - as an example, physics uses either the normal box2d web or asm.js. Asm.js is still JavaScript, but written differently. But even that isn't the whole story. A recent improvement was made to asm.js that speeds it up by about 50% when using that optimization.

Regardless, currently, even when compiled, javascript generally is not as fast as other languages, but it's not all that far behind and there is continual work being done that is improving it.Arima2014-02-19 02:23:06
Moderator
B
95
S
34
G
33
Posts: 3,007
Reputation: 27,876

Post » Wed Feb 19, 2014 2:25 am

@TiAm

This is what I want to see ,a game that pushes the C2 envelope, would like to see that running sometime...You need testers?   

Thanks for your refreshing post...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,270

Post » Wed Feb 19, 2014 4:46 am

@Pixel perfick
@TiAm

For 120$ you get an easy to use (almost no programming skills needed) game maker that export HTML5 (even without the "exporters", the index.html file can still can be tweaked to run on any device that supports HTML5). Of course that it has some issues like the TileMap scaling that makes it unusable on variable resolutions or the overall performance could be better... etc

The performance is not that great compared to native games, but it comes really close. We are talking about average casual gamer, the one that plays Angry Birds, not the one that plays Battlefield 4 at Ultra-Quality and expects no less then 60 fps... Any constant fps higher than 30 would do fine for average casual gamer.

Also HTML5 is not complete, still evoluates as we speak and Scirra team upgrades Construct 2 very often, for example:
- WebGL increased significantly the performance/speed
- asm.js powered physics
- bug fixes

Just to make a quick comparison with another few engines I tested until I decided to go with Construct:

Unity
Great engine, free for Indie Devs until they reach 100.000$ , great tools and support, and also exports native games on different platforms (including consoles) and decently easy to use.
The bad: You need to know programming, spend more time, need 3D models if you decide to make a 3D game and does not export HTML5. You can skip some programming if you buy a 100$ plugin named PlayMaker that gives a Construct-like interface, but also buy other plugins like IAP, Social (even PlayMaker have different plugins depending on platform, each variate from 10$ to 25$)... or you can code them yourself.

Game Maker: Studio
Costs 200$ to get the HTML5 exporter and the performance is not that good even if makes native games (Try Street Fighter X Mega Man to see the minimum requirements for a 8bit-like game)... For "better" performance you can buy the Yoyo-Compiler for just another 300$ or the whole package and exporters for 800$. On top of that you get to work with a very outdated layout editor and need to learn a proprietary programming language. Quite the deal.
Also has a great community and the support team answers to all questions you have about bugs and features. /sarcasm
The good part is that exports directly to other platforms without the need of 3rd party wrapper.

... and a few others engines

Long story -> Short:
You get what you pay for. But yes, I dislike the fact that I need to relay on 3rd party wrappers in order to export my game on different platforms. Also, from here on, HTML5 is just getting better and better.
B
49
S
15
G
6
Posts: 535
Reputation: 7,197

Post » Wed Feb 19, 2014 10:25 am

@TGeorgeMihai

Thanks,

That's a good rundown of comparable game engines pro's and cons, as I have said more than once, I think C2 is great and would recommend it to anyone...

All I am asking is for us as developers to be honest about the performance of the games we are creating on C2, it's really easy to be consumed by the creative bubble, making us biased and zealously defensive of criticisms...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,270

Post » Thu Feb 20, 2014 3:58 am

@Pixel perfick :

Will hopefully be done within the week. Kind of just a quicky experiment, mod of built in shooter. A lot of stuff I ripped from a more ambitious game I'm working on. Here's a screen though...(60fps, and 0.214 is cpu usage, so, about 21 percent)

Image
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Thu Feb 20, 2014 6:10 am

@TiAm
Good job. I like it. I found C2 weakness really isn't it's graphical render. it's the fact that it's really easy to make poor and slow event coding.
B
92
S
18
G
9
Posts: 2,455
Reputation: 15,113

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 1 guest