Game developer questions

#1

Hello! I recently started learning haхе ​​+ openfl as a replacement for a deceased flаsh and a not-so-resilient adobe air for creating games. I am interested in a few questions regarding this platform so that I can finally be convinced of my choice.
Question # 1.
What type of rendering is used for html5 and android? And how to change it if necessary?
Question # 2.
What is the performance of displaying graphics and animations, relative to flash and air + starling?
Question # 3.
How can I use a soft texture packer to load my texture atlases and display them?
Question # 4.
Does it make sense to use the Starling-haxe library? Will this affect performance? As far as I know, this is just a render wrapper, but after all, openfl already uses its renders like opengl / webgl.
I would be very grateful)This is very important for my future.

0 Likes

#2

Welcome YoJa to the openfl community \o/

HTML5 : By default it’s WebGL but there is a fallback to Canvas if not supported. You can force compilation to Canvas and even Dom with -Dcanvas and -Ddom.
Android : It’s hardware accelerated by default using OpenGL. There is also a software fallback. You can change configuration at compilation by using some of the following parameters in your config.xml

<window hardware="true" allow-shaders="true" require-shaders="true" depth-buffer="false" stencil-buffer="false" />

What is the performance of displaying graphics and animations, relative to flash and air + starling?

For display it’s good enough in my use cases. It is also good enough for animations for some use cases but I know that performance of animated swf is less good than flash. If you want better performance than flash, especially if you make games, you need to drop swf and use Tilemap or graphics.drawTriangles or graphics.drawTiles instead because it allows batching. To create your animations, you can use Spriter or Spine. To read atlases you can use openfl-atlas.

How can I use a soft texture packer to load my texture atlases and display them?

You can use openfl.display.Tilemap for tile packed atlases. You can also use triangular/polygonal packed atlases thanks to AtlasTriangle.

Does it make sense to use the Starling-haxe library? Will this affect performance? As far as I know, this is just a render wrapper, but after all, openfl already uses its renders like opengl / webgl.
I would be very grateful)This is very important for my future.

I don’t use Starling so I’m not sure of what the best answer is. I think it’s a good idea if you target flash or Air. It depends of your habits of coding I guess. For apps, I use pure openfl with standard display list and swf assets. For games, I use pure openfl with Tilemap or dragTriangles and Spriter for the animations.

2 Likes

#3

I asked Joshua about this not too long ago.
Starling only gets performance boosts if you export to a flash target (swf or air). For everything else it is just a wrapper to make you feel more comfortable or for compatibility with old tools or code.

I develop games directly in OpenFL using the display list and relying heavily on spritesheets (and tilemaps) for animations. But maybe you might want to check HaxeFlixel? (A port of the old flash flixel, it runs on top of openfl)

1 Like

#4

Thank you very much for the answers! It turns out such a large selection of how to display graphics, it is very cool. Interested in another question. Does haxe and openfl atf support textures?

0 Likes

#5

Openfl supports ATF but not fully (no JPEG-XR). However there may be a bug in the current release of Openfl (I’ve created an issue few months ago, I don’t know if it has been fixed). Anyway I know how to fix it, so I’ll try a pull request in few weeks.

1 Like