VDrones

35 views
Skip to first unread message

David Bernard

unread,
Feb 27, 2013, 4:21:38 PM2/27/13
to dartga...@googlegroups.com
Hi,

This is an email, to introduce my ( wip ) game VDrones.

VDrones has :

* a 2D gameplay : you drive a vdrone across area (currently one)
* a 3D display

# Links

* play at http://vdrones.appspot.com/ (dart2js version)
The code is crappy, I port my js code +/- AS IS to Dart. I'm new to Dart but I'm a java/scala/javascript developer.

# History (someone can be interested, else you can skip)

* The project was started few month ago in haxe, then I migrate to javascript/coffeescript.
* The project in js version used Three.js (rendering), chipmunk.js (physics), knockout (html binding), jsfx + soundmanager2 (sound), ...
* I also tried (1 week) 2 frameworks : playcanvas and turbulenz sdk.

* Since 2 weeks I migrate to dart
* I failed to port chipmunk.js (some strange bugs), so after 3 days, I switch to box2d (I previouly used box2dweb.js for the project in js).
* I removed sound
* I import Three.dart, but I had to fork it to fix some issues with material (Lambert, Phong, Shader) + some missing function I used in a more recent Three.js. The code run well under dartium, but I've got some difference in dart2js version :
  * NormalMeshMaterial doesn't display with same colors
  * WebGL error in my ShaderMaterial used to display explosions
* I experiment successfully an other approach, using Three.js + js-interop (introduce lot of boilerplate code). the dart2js performance are similar (may be better) than Three.dart (but lesser than the original full js version).


# About using Spectre

I would prefer to use a dart solution for the display (type check, api and code originaly targeted for dart, main team on dart). So I give a quick try to Spectre, but :

* from the sample and article I read, I thinks it need lot of more code to setup scene, renderer, ...
* I'm not sur I can do what I need to replace Three.js (+ future needs, like AO, shadows), if you're ok I can send one email (on the ml) per need / question / how to.
* I'm not sur about the performance under Chrome and Firefox, the sample run "slowly" (~ 7 fps) under chrome and failed under Firefox, under Dartium  (~12 fps)
* younger than three.js, so there is a lot of less code, sample, article.

I'm ok to try more with the help of John, Don, anyone (My main goal is to create a game not to create a game-engine, assets pipelines, ...).
My current asset are pretty basic, I made the vdrone under Blender (to test the asset pipeline) but it can be created programmaticaly with 4 trianges, other 3d objects are box and planes.

Thanks for reading this long introduction.

Don Olmstead

unread,
Feb 27, 2013, 4:28:33 PM2/27/13
to dartga...@googlegroups.com
Thanks for posting David. So with the performance of the skinning demo this is because of the Dart VM. John actually works at Google and has been the one pushing through the SIMD stuff. As he mentioned on GitHub this issue will go away. Currently there's some work that needs to be done to get scalarlist stuff into WebGL. John can of course elaborate more if you're interested in the performance.

Can you be a bit more specific on what exactly you need out of Spectre to make your game? Are you loading models? Do you need some standard mesh support?



--
You received this message because you are subscribed to the Google Groups "DartGameDevs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dartgamedevs...@googlegroups.com.
To post to this group, send email to dartga...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/dartgamedevs/-/Y_mA0E1KbKQJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

John McCutchan

unread,
Feb 27, 2013, 4:33:35 PM2/27/13
to dartga...@googlegroups.com
On Wed, Feb 27, 2013 at 1:21 PM, David Bernard <david.be...@gmail.com> wrote:

* from the sample and article I read, I thinks it need lot of more code to setup scene, renderer, ...

This is true today. The core spectre library is a "better" WebGL it's not a high level rendering engine like Three.js is. I'm in the process of writing spectre_renderer which will introduce abstractions that greatly reduce the number of lines of code to get something on the screen. This is coming.
 
* I'm not sur I can do what I need to replace Three.js (+ future needs, like AO, shadows), if you're ok I can send one email (on the ml) per need / question / how to.

As mentioned above, The core spectre library is a light abstraction over WebGL. spectre_renderer will have materials and scenes, making assembling a scene really simple. Patience here.
 
* I'm not sur about the performance under Chrome and Firefox, the sample run "slowly" (~ 7 fps) under chrome and failed under Firefox, under Dartium  (~12 fps)

Did you gather any profile data to help pinpoint why it's running slowly?
 
* younger than three.js, so there is a lot of less code, sample, article.

True, but we're working on that. I'd be happy to have you contribute some basic examples.
 
--
John McCutchan <jo...@johnmccutchan.com>

David Bernard

unread,
Feb 27, 2013, 4:50:02 PM2/27/13
to dartga...@googlegroups.com
Thanks for quick reply.

I thinks what can help me (a lot) to start and may be to switch would be a sample code with :
* an ambient light, a spotlight
* (box + sphere ) x (NormalMeshMaterial, Lambert or Phong Mesh Material)
* bonus : particules + shader to made some explosion or animated material.

If you can give me some pointer, I could try to make the sample (I've few hours tomorrow, next week I'll be +/- offline and off desktop).

David Bernard

unread,
Feb 27, 2013, 4:55:49 PM2/27/13
to dartga...@googlegroups.com
On Wed, Feb 27, 2013 at 10:33 PM, John McCutchan <jo...@johnmccutchan.com> wrote:
On Wed, Feb 27, 2013 at 1:21 PM, David Bernard <david.be...@gmail.com> wrote:

* from the sample and article I read, I thinks it need lot of more code to setup scene, renderer, ...

This is true today. The core spectre library is a "better" WebGL it's not a high level rendering engine like Three.js is. I'm in the process of writing spectre_renderer which will introduce abstractions that greatly reduce the number of lines of code to get something on the screen. This is coming.
 
* I'm not sur I can do what I need to replace Three.js (+ future needs, like AO, shadows), if you're ok I can send one email (on the ml) per need / question / how to.

As mentioned above, The core spectre library is a light abstraction over WebGL. spectre_renderer will have materials and scenes, making assembling a scene really simple. Patience here.

Nice. Do you suggest me to continue with Three.js + js-interop until you release spectre_renderer ?
 
 
* I'm not sur about the performance under Chrome and Firefox, the sample run "slowly" (~ 7 fps) under chrome and failed under Firefox, under Dartium  (~12 fps)

Did you gather any profile data to help pinpoint why it's running slowly?

No, how to capture profile data ?
 
 
* younger than three.js, so there is a lot of less code, sample, article.

True, but we're working on that. I'd be happy to have you contribute some basic examples.

chicken and egg problem ;-)

I'll try to made a sample tomorrow, (I'm not a OpenGL dev, I read few article only)
 
 

Don Olmstead

unread,
Feb 27, 2013, 4:58:22 PM2/27/13
to dartga...@googlegroups.com
John I think David is referring to the skeleton skinning example which does run slow because of the VM performance. It taxes my MacBook Air quite a bit at home when running the Hellknight. Not so much with Bob but that's a simpler model.


John McCutchan

unread,
Feb 27, 2013, 5:14:28 PM2/27/13
to dartga...@googlegroups.com


On Wed, Feb 27, 2013 at 1:58 PM, Don Olmstead <don.j.o...@gmail.com> wrote:
John I think David is referring to the skeleton skinning example which does run slow because of the VM performance. It taxes my MacBook Air quite a bit at home when running the Hellknight. Not so much with Bob but that's a simpler model.

He is referring to the performance when compiled to JavaScript. This is likely different than the current issue with VM.

--
John McCutchan <jo...@johnmccutchan.com>

David Bernard

unread,
Feb 27, 2013, 5:38:30 PM2/27/13
to dartga...@googlegroups.com
I thought you ask profiling dartium (12 fps with scalarlist)
about chrome ( 6fps without scalarlist) I did a screenshot (I don't know how to export)

Inline image 1


2013-02-27-233649_1093x566_scrot.png

Don Olmstead

unread,
Feb 27, 2013, 7:27:16 PM2/27/13
to dartga...@googlegroups.com
Well if you aren't using the skinned meshes you won't have that issue ;)


2013-02-27-233649_1093x566_scrot.png

David Bernard

unread,
Feb 27, 2013, 7:30:05 PM2/27/13
to dartga...@googlegroups.com
The issue come from the dart2js. it doesn't take care of Float32Array as "javascript native" and introduce lot of overhead via call to $index,... like for dynamic.
I tried to add missing Float32Array in method signature of Float32ArrayHelpers but it doesn't change fps.
I replace in the generated js the code of $.Float32ArrayHelpers_* by same code as dart (copy/paste + one replace of Float32Array by var) : result I up from 6 fps to 19 fps.

I hope it help you.

(In FF the error is :
TypeError: this.noSuchMethod$1 is not a function

in

get$depth: function() {
return this.noSuchMethod$1($.createInvocationMirror("depth", "get$depth", 1, [], []));
},
)
2013-02-27-233649_1093x566_scrot.png

John McCutchan

unread,
Feb 27, 2013, 7:37:13 PM2/27/13
to dartga...@googlegroups.com
Hi David,

Thanks for looking into this. The team is hard at work improving the dart2js dart:scalarlist support and removing the typed arrays from dart:html. When the dust settles, performance will be better. Please be patient or start sending pull requests to the dart2js team.

John


--
You received this message because you are subscribed to the Google Groups "DartGameDevs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dartgamedevs...@googlegroups.com.
To post to this group, send email to dartga...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
John McCutchan <jo...@johnmccutchan.com>
2013-02-27-233649_1093x566_scrot.png

David Bernard

unread,
Mar 14, 2013, 8:43:26 AM3/14/13
to dartga...@googlegroups.com
I open a ticket for the dart2js team :

  http://code.google.com/p/dart/issues/detail?id=9139
Reply all
Reply to author
Forward
0 new messages