Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught exception when running with OpenFL Neko #77

Open
bartvanheukelom opened this issue Dec 30, 2013 · 14 comments
Open

Uncaught exception when running with OpenFL Neko #77

bartvanheukelom opened this issue Dec 30, 2013 · 14 comments

Comments

@bartvanheukelom
Copy link

It appears something in Nape causes an error when running an OpenFL game with Neko.

Demo code:

class Main extends flash.display.Sprite {

 public function new () { 
 super();

 var tf = new flash.text.TextField();
 tf.text = "Hi There";
 addChild(tf);


 //var space = new nape.space.Space();
 }

}

This works fine. However, if you uncomment the var space line, the output is as follows:

$ openfl test neko
Uncaught exception - std@module_read

Am I doing something wrong or is this a Nape thing. If the latter, is it a bug or is Neko deliberately unsupported? Will it be fixed/added in the future?
Thanks

@deltaluca
Copy link
Owner

I'd be tempted to log this to openfl instead... I cannot reproduce it in a non-openfl project with just neko + nape

class Main
{
    static function main() {
        var space = new nape.space.Space(nape.geom.Vec2.weak(0, 10));
        var b = new nape.phys.Body();
        b.shapes.add(new nape.shape.Circle(10));
        b.space = space;
        space.step(1/60);
        trace(b.position.y);
    }
}

haxe -x Main -lib nape

@bartvanheukelom
Copy link
Author

As you can see I've reported the issue with OpenFL. I'll soon test your code to see if the error is gone then on my machine as well.

@bartvanheukelom
Copy link
Author

Yes, your sample works here too.

@gamedevsam
Copy link

I get this error when trying to run with Neko target:

AL lib: (EE) alc_cleanup: 1 device not closed
Called from zpp_nape/callbacks/CbType.hx line 348
Called from nape/callbacks/CbType.hx line 179
Called from nape/callbacks/CbType.hx line 198
Called from zpp_nape/callbacks/CbType.hx line 174
Called from zpp_nape/callbacks/CbType.hx line 353
Called from zpp_nape/ID.hx line 186
Uncaught exception - Invalid operation (+)

I put these two defines in my project.xml:

<haxedef name="NAPE_RELEASE_BUILD" />
<haxedef name="NAPE_NO_INLINE" if="neko"/>

@deltaluca
Copy link
Owner

Could you reproduce that without using openfl and it's build tools? This seems to stem from the ID.hx file which is basicly just a bunch of 'static var X_ID = 0;' lines not ending up in the compiled code, and with the integers initialised to null (hence the invalid operationr + error).

@gamedevsam
Copy link

Well, here's a test project that initializes nape without openfl, it seems to work... but I need openfl and its build tools to make my games that use of Nape. So I'm still kinda sad, because Neko compiles much faster than cpp.

@mrcdk
Copy link

mrcdk commented Feb 14, 2014

It might be a neko issue HaxeFoundation/neko#14

@R32
Copy link

R32 commented Jun 1, 2014

It works. hehe..

<haxeflag name="-dce full" />

<!-- Optional -->
<haxedef name="NAPE_RELEASE_BUILD" />
haxe [3.1.3]
lime [0.9.7]
openfl-native [1.4.0]
nape [2.0.16]

@galundin
Copy link

galundin commented Jun 2, 2014

As I mentioned in openfl/openfl#158, that flag doesn't resolve the issue for me, using all the same versions.

@deltaluca do you know why the static variables in ID.hx are included in the compiled code for all other targets, but not Neko? Can you think of why OpenFL would cause this to happen?

@deltaluca
Copy link
Owner

There's no point investigating any further unless you build the latest neko with the lifted opcode limit as that is the reason for this problem. (OpenFL + Nape triggers it by being so damn huge paired together)

@MartinDelille
Copy link

It doesn't work for me:

haxe [3.1.0]
lime [2.0.0]
open-fl [2.1.6]
nape [2.0.16]

I'm in the middle of a coding jam so I will do it with flash and loose all the neko debugging facility...

@starburst997
Copy link

Just pointing out that I compile Neko from the GIT source and this does fix it for the example in the first post, however testing it on my game, the same error still occured.

Here my build of neko: http://test.failsafevault.com/files/neko-2.0.1-win.zip don't forget to replace the neko.dll in the bin folder

@deltaluca
Copy link
Owner

@starburst997, raise it with haxe/neko, if it's the exact same issue it may still be something on the lines of not having a large enough opcode size since presumably your game is more than a few lines of code ^^

@starburst997
Copy link

Thanks, I'll try tweaking the values to allow more size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants