Direct comparison of medium sized game Flash/AS3 vs. OpenFL/Haxe + Issues

Hmm, I’m not sure exactly what render case you are hitting (perhaps something about alpha plus colorTransform or vector graphic rendering?)

…but alpha should apply to children, say you have a big parent sprite and you set it’s alpha to 0, it should make the sprite (and all its contents) invisible at once

OK. I will check more precisely whats going on. Thank you.

Hi,

it was a name clashing, there was a class that inherited from display object and implemented a alpha variable plus setters and getters that was actually only meant to be used for drawing a alpha-ed rectangle. But OpenFL used this alpha for rendering too.

Many thanx, best regards
Andreas

Hi,

I have a very important question, does anyone have any hints how to debug memory usage in browser? The game starts with 400-500MB and after playing a while it can gain 2GB or even more.

Any hints? What is important to know for memory management with OpenFL in browser?

Best regards
Andreas

Have you tried a heap snapshot or an allocation profile (in your HTML debugger) and seen if it gives some idea about which objects are largest?

1 Like

Hi,

@singmajesty Will try to debug memory usage later.

The game seems to be pretty much completely ported now. The only problems I see now are memory usage and those textfield input bugs, which means that some of them do not accept input. :frowning:

Any hint regarding those textfields? Can we somehow collaborate on that?

Best regards
Andreas

Awesome, that’s great to hear! :grin:

Was the input issue you are mentioned isolated to a simple test case?

1 Like

Thank you.

Well there are some minor things that I still have to do. But the biggest parts are done.

  1. E.g. what I found out a hour before is that I have to convert chat server to use WebSocket protocol or is there any support of having sockets using TCP without WebSocket protocol?

  2. Initiate client from dynamic data. We used flash vars for that with flash version. Is there any equivalent in OpenFL?

Well this week I will set up a test server and then the bug hunting and fixing can begin :smiley:

Best regards
Andreas

Hi,

I have a simple test case! If you want it, then tell me.

Best regards
Andreas

1.) You will need to use WebSockets, unless you use a hidden Flash Player plugin, but that is increasingly not possible to do, and eliminates the purpose of porting for HTML5 to begin with :wink:

I believe the big differences with WebSockets is handling the handshake (to confirm that web sockets are available) and you do not have full control over data frame sizes, you may also need CORS headers, depending on how it is accessed.

2.) We should support Flash variables, if you add them to your embed script. That’s what the parameters: {} object is in our default embed, it should populate loaderInfo.parameters similar to Flash :slight_smile:

A test case would be great, please publish it, or send privately if you need it to be private, or prefer :slight_smile:

1 Like

Hi,

I just send you a test case for those textfield issues.
I will try the flash vars equivalent tomorrow. Thank you for the tip.
Yes. I will have rewrite the chat server a bit to be WebSocket compliant.

Best regards
Andreas

Hi,

Is there a way to tell OpenFL/HTML5 from where to load its assets stuff?
I am setting up the game start up process. For some reason I have not 100% the same folder structure like the default.

JS is loaded but assets can not be loaded.

Many thanx.

Best regards
Andreas

You can specify { rootPath: "path/to/assets/root" } in your HTML embed script, if this is a runtime issue. Otherwise you can customize the project.xml if it’s a compile-time issue :slight_smile:

1 Like

Nice, rootPath, loaderInfo.parameter is working!!! Thanx!

1 Like

Hi,

I updated to OpenFL 7.0 and now my project cannot be compiled anymore, whereas I have no idea why.

Andreass-Air:pirates_code_hx andreas$ openfl build project_tutorial.xml html5 -v -debug 2>&1

OpenFL Command-Line Tools (null-LGL85z)

Initializing project…
Using project file: project_tutorial.xml
Reading Lime config: /Users/andreas/.lime/config.xml
Using target platform: HTML5

Running command: UPDATE
Warning: Could not find template file: default/icon.svg
Warning: Could not find icon path: null
Warning: Could not find template file: html5/template
Warning: Could not find template file: haxe
Warning: Could not find template file: html5/hxml

Running command: BUILD

Running command: haxe Export/html5/haxe/debug.hxml
Error: Could not process argument Export/html5/haxe/debug.hxml (file not found)
Package name must start with a lower case character
Andreass-Air:pirates_code_hx andreas$

There is no package with unusual char or something.

Any help is highly appreciated.

Did you try Cleaning with running Lime build/test project with -clean

1 Like

Could you run these commands, and see if they look correct?

haxelib path lime
haxelib path openfl

Also, make sure that your haxelib is up-to-date. haxelib path openfl should return “path/to/openfl/src”, not “path/to/openfl”

1 Like

Hi,

another question. There is no support for Linux-ARM right? I installed Haxe/OpenFL on a pretty capable ARM computer but compiling the project fails due to:

Uncaught exception - Could not find NekoAPI interface.

Uncaught exception - load.c(237) : Failed to load library : lime.ndll (lime.ndll: cannot open shared object file: No such file or directory)

Best regards
Andreas

We assume right now that we’re using Linux x86 or x64, unless you use A.) a source version of Lime and B.) run lime rebuild linux -rpi, but that also tries to link the Raspberry Pi graphics libraries instead of using X windows.

I’m sure it would be possible to improve our Linux platform code, though, to add support for ARM. It looks like we properly choose the correct default architecture, based on your host architecture, but there are some assumptions in our tooling that would have to be tidied a little:

Changes to this file are possible if you lime rebuild tools, then run again. Happy to help, but I don’t have a Linux ARM OS to test on at the moment :slight_smile:

1 Like

I already tried to build lime with "lime rebuild linux -DnoM32 -Drpi"
This did not work. ARM support would need some love I guess.

Another stupid question. The last one for today. :smiley:
Is JS obfuscation/min somehow build in into OpenFL?