4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.81k stars 848 forks source link

Physics behaviour hangs the game #434

Closed noz1ng closed 6 years ago

noz1ng commented 6 years ago

Created the project at version 5 b13 , then updated GDevelop to current 5 b22, and just wanted to add physics to one of my existings objects - but app hangs at scene preview after that. Same if i create a new one and add physics to him. So, i opened project json and manually add string with physic behaviour into the project extensions list. Then restarted GDevelop, load project... and nothing changes, still hangs at preview

P.S Running at Windows 7 SP1 x64, with all latest KBs and runtimes

zatsme commented 6 years ago

I started to use v5 last night after waiting for the physics to be added, thanks 4ian!

I had same issue when playing with it. Looking at the code in browser debug it reported null values in the size of my objects.

I didn't go any further as I needed sleep ☺️

4ian commented 6 years ago

Can you send me (by email: florian.rival@gmail.com) your game folder (project file + images)?

I can then debug and issue a new beta version :)

On Wed, Jan 24, 2018 at 12:04 PM Zat notifications@github.com wrote:

I started to use v5 last night after waiting for the physics to be added, thanks 4ian!

I had same issue when playing with it. Looking at the code in browser debug it reported null values in the size of my objects.

I didn't go any further as I needed sleep ☺️

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/4ian/GD/issues/434#issuecomment-360096797, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOIgnpNA5TX2FsuyPaSBNRILeJm_Nteks5tNw4_gaJpZM4RrDiZ .

noz1ng commented 6 years ago

Looks like i digged out, why. Just look at project .json, and scroll down to "layers" section. Compare to physics tutorial, user created projects are deprived of this code:

      "behaviorsSharedData": [
        {
          "gravityX": 0,
          "gravityY": 9,
          "name": "Physics",
          "scaleX": 100,
          "scaleY": 100,
          "type": "PhysicsBehavior::PhysicsBehavior"
        }
      ]

So, i just copy-pasted this section from physics tutorial, and it's worked for me

zatsme commented 6 years ago

Yes so scalex and scaley is null and therefore exception....

Last night i created a new project with b22 and it worked fine, so must be old projects causing issue. When adding physics behaviour it's not creating the section for some reason?

noz1ng commented 6 years ago

Nope, it crashing with new as well. Until i manually added these strings in json

4ian commented 6 years ago

There is indeed something missing here. I'll try to fix that asap for the next beta! Thanks for digging in this issue, really useful 👍

4ian commented 6 years ago

This should be fixed in GD 5 beta 23! You are also able to edit the gravity and internal options of the physics engine (when at least one object on the scene have the Physics behavior):

screenshot 2018-01-27 19 39 22
zatsme commented 6 years ago

Yes, works as far as I can see :)

But I think the Gravity should default to Y=9 rather than 0 which it does now!

Also, there are some small things which would help the GUI...and I know this needs to go somewhere else?!

There should be a List of last opened projects at startup The tabs.... ( Start Page / Scene / Events ) should shift right when you open project manager Project Manager, layers, instances should open below icon bar, so you can always see icon bar The icons that open windows should be toggles, so a second click closes the window

Zat.

4ian commented 6 years ago

But I think the Gravity should default to Y=9 rather than 0 which it does now!

Better indeed, I've changed this for next beta!

Also, there are some small things which would help the GUI...and I know this needs to go somewhere else?!

For now, you can discuss about this in the forum on this thread: http://forum.compilgames.net/viewtopic.php?f=18&p=64849#p64849

I've noted your ideas anyway :) For project manager I'd like to see if I can add a button/preference to have it pinned on the left.

noz1ng commented 6 years ago

Cool! But what about to allow input floating values here? For now, if i wish 0.x gravity, i can't do this using GUI

4ian commented 6 years ago

If think you can but the "." is removed directly while you're typing. I'll change this, for now you can try to copy paste a floating point value in it.