"Saving" while in physics view

General discussion about the R.U.B.E editor
Post Reply
mfagerlund
Posts: 20
Joined: Wed Jul 10, 2013 2:07 pm

"Saving" while in physics view

Post by mfagerlund »

Hi, I often hit Ctrl-S when in the physics view, in an attempt to save my changes - which doesn't do anything. What I really want is to save the editor.

It would be nice if the tool would warn you if you did that. Either that, or if it would do a save on the editor that spawned it.
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: "Saving" while in physics view

Post by iforce2d »

Very true. I am holding off on that for now because in future, saving from a player view could potentially have different meaning (eg. saving the current positions of things in the player back to the editor, say to let a pile of boxes settle or just to allow more intuitive dragging things around etc). But perhaps, that could be assigned to a different combo like Ctrl+Shift+S maybe... will think about it.
mitcki
Posts: 1
Joined: Wed Sep 18, 2013 8:17 pm

Re: "Saving" while in physics view

Post by mitcki »

Saving from the player view to the editor or to json would be a great feature!
nazgee
Posts: 7
Joined: Mon Sep 30, 2013 8:44 pm

Re: "Saving" while in physics view

Post by nazgee »

iforce2d wrote: saving the current positions of things in the player back to the editor, say to let a pile of boxes settle or just to allow more intuitive dragging things around etc
Ok, I do not like the word, but it fits perfectly here: this feature would be epic!
nazgee
Posts: 7
Joined: Mon Sep 30, 2013 8:44 pm

Re: "Saving" while in physics view

Post by nazgee »

Let me be more verbose :)

In inital phase, right after loading of the rube scene, all objects are awake, so simulation can get really chopy. If one would wait untill multiple piles of rocks or other stuff settle down, this inital lag would be gone.

During the gameplay quite ofthen only a fraction of objects is awake, but after loading the scene- all of them are awake. Won't it be great to have it fixed without having to change anything in our loaders?
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: "Saving" while in physics view

Post by iforce2d »

The idea of saving from the player view is to get piles of things into the position where they are already settled, rather than change their awake status.

Although there is an 'awake' property in the properties panel for bodies, and this works in the RUBE player view, this is perhaps a bit misleading in that it does not guarantee the bodies will be asleep when loaded from the scene file. There are many things that can wake bodies, for example creating a fixture nearby with an overlapping AABB. To be 100% sure that things which are supposed to be asleep are really asleep, your program will most likely need to do this after loading.

Even without being able to save from the player view, running a few world steps after loading will let piles of bodies sleep. The advantage of saving from the player view is that they will sleep quicker since their velocities start at zero and they have nowhere to move, and you will be able to preview in the editor exactly where they will be.
Post Reply