[BEHAVIOR] Chipmunk Physics

From the Asset Store
Simple yet very life-like rag doll made with Physics!
  • R0J0hound, awesome, thank you! I converted most of my game to Chipmunk, which, so far on my laptop, runs with less hiccups than the current C2 physics engine(s). Next stop is to see how it performs on my phone!

  • R0J0hound

    The minifier still doesnt work for me. Just a black screen. I am also using Paster in the same project, could it be that ?

    Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Paster seems to work with the minifier.

    What does the browser console say? You can open it with ctrl+shift+j.

  • I am exporting to NW.js. its not an HTML project.

    Just tried it as a web export. the Chrome console says:

    Document was loaded from Application Cache with manifest http://www.mailtree.co.uk/temp/offline.appcache

    (index):1 Application Cache Checking event

    (index):118 Uncaught (in promise) DOMException: Only secure origins are allowed. http://goo.gl/lq4gCo {message: "Only secure origins are allowed. http://goo.gl/lq4gCo", name: "NotSupportedError", code: 9, INDEX_SIZE_ERR: 1, DOMSTRING_SIZE_ERR: 2…}(anonymous function) (index):118

    (index):1 Application Cache NoUpdate event

    c2runtime.js:94 Uncaught (in promise) DOMException: A call to lockOrientation() or unlockOrientation() canceled this call. {message: "A call to lockOrientation() or unlockOrientation() canceled this call.", name: "AbortError", code: 20, INDEX_SIZE_ERR: 1, DOMSTRING_SIZE_ERR: 2…}l.qr c2runtime.js:94l.xv c2runtime.js:89l.Uj c2runtime.js:103l.Cw.Cg.a.onload c2runtime.js:81

    www.mailtree.co.uk/:1 Uncaught (in promise) DOMException: lockOrientation() is not available on this device. {message: "lockOrientation() is not available on this device.", name: "NotSupportedError", code: 9, INDEX_SIZE_ERR: 1, DOMSTRING_SIZE_ERR: 2…}

    c2runtime.js:408 Uncaught ReferenceError: tri is not defined

    No idea what any of that means or if its relevent. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • Updated the web version without minify and it works ok there now.

    Just tried it with webGLoff and minify on. Still no joy

  • Can you run your nw.js exported exe from the command line with the --enable-logging switch? It will make a debug.log file that should have the error.

    A simple way to do that is to create a .bat file.

    Open notepad and type in:

    newproject --enable-logging[/code:2p88pw6b]
    where newproject is whatever the exe file is named.
    Next "save as" and call it debug.bat and save it to the same folder as the export.  Be sure to change the "save as type" to "all files" or it will save as a text file.
    Finally run the debug.bat file and the debug.log file will be created.
  • R0J0hound

    This is the debug.log contents.

    [7892:0426/090241:ERROR:nw_shell.cc(335)] ReferenceError: tri is not defined

    at c.Go (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:408:155)

    at c.ix (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:411:79)

    at c.fl (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:415:345)

    at c.tq (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:413:344)

    at l.Ae (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:125:460)

    at l.It (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:174:437)

    at m.an (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:158:259)

    at l.nv (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:108:181)

    at l.go (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:105:334)

    at file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:107:184

    [7892:0426/090241:INFO:CONSOLE(408)] "Uncaught ReferenceError: tri is not defined", source: file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js (408)

    [7892:0426/090243:INFO:CONSOLE(4)] ""[Construct 2] Suspending"", source: file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js (4)

  • spongehammer

    Hmm, best I can tell "tri" is some minified variable name, so I have no way of knowing where to look. I'm not getting an error on my machine when exporting as a minified nw.js.

  • R0J0hound

    I could pm you the capx if you think it might help ?

  • spongehammer

    It might. It could be there is some function that I need to tweak that isn't being used in my tests.

  • Upadated to 2.2d

    spongehammer

    I think I fixed it. It was caused by using polygon collision shape and there was an uninitialized variable named "tri". After that I found another bug by turning on "use strict". It should work now. Also I fixed a bug with paster when webgl isn't available that your capx exposed.

  • R0J0hound

    What a genius thanks. I had seen the problem with paster but not realized it was a bug.

  • I was about to write about minify blackscreen but new version fixed that!

  • R0J0hound not to keep bugging you about features, but I ran into something else unexpected. In porting from the Scirra physics engines to Chipmunk, I noticed that the center of mass is not longer set to... well... the object's center of mass, but rather the origin.

    Is there any way I could, say, set this as a global default? Or per object? It would be so much easier because right now my player is sorta hard-coded to explode into pieces, and unfortunately otherwise I would have to hand-change about 24 different object & frame origins.

    Not a huge deal, but so time consuming, especially when I have other oddities using Chipmunk that have not come up with Scirra's vanilla physics.

  • DatapawWolf

    It's not using the object's origin, it's just using the center of the object regardless of where the origin is. It was an oversight to not take into account the center of a polygon shape. I'll be taking a look into it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)