Page 1 of 2

Moving the window on a frame-by-frame basis - good idea?

Posted: Wed Mar 25, 2015 7:41 am
by Kingdaro
A small question for an idea I wanted to do, akin to how some games have screen shake to simulate staggering effects, I'd like to apply that shake to not only the game, but to the entire window itself. I've done some demoing on Windows and it doesn't seem to have any adverse effects outside of not being able to drag the window to a new position (an implementation fault on my part, probably). As window functions tend to be unfriendly when it comes to overhead and other factors, as I've heard, is this a fine thing to do?

Re: Moving the window on a frame-by-frame basis - good idea?

Posted: Sat Mar 28, 2015 12:20 am
by rmcode
Make it optional, so people can deactivate it when it causes issues on their system :)

If you add a .love I'll gladly test it on OSX.

Re: Moving the window on a frame-by-frame basis - good idea?

Posted: Sat Mar 28, 2015 3:04 am
by undef
It sounds like a cool idea.
The only problem I see is that it might not be that portable...
My windowmanager would probably just ignore the request.

Also, make sure the window has the same position after the shake than before!
Otherwise it might just move off screen after a couple of times, which would be annoying.

Whether this is expensive performance-wise I don't know, but you should probably test it.

Re: Moving the window on a frame-by-frame basis - good idea?

Posted: Sat Mar 28, 2015 9:29 am
by Kingdaro
Glad to see there's interest in the idea! For testing, here's a love of the game with the WindowShake module I threw together, dropboxed because it's too large to be attached. Arrow keys to move and jump, and pretty much everything else is irrelevant, but you're still free to poke around if you desire.
undef wrote:It sounds like a cool idea.
The only problem I see is that it might not be that portable...
My windowmanager would probably just ignore the request.

Also, make sure the window has the same position after the shake than before!
Otherwise it might just move off screen after a couple of times, which would be annoying.

Whether this is expensive performance-wise I don't know, but you should probably test it.
The way I made it work, it takes into account the window's previous position before and after the shake is applied. It should, anyway.

Re: Moving the window on a frame-by-frame basis - good idea?

Posted: Sat Mar 28, 2015 10:17 am
by s-ol
There's no lag or performance impact noticeable on (arch) linux. The window is almost as large as my screen so the effect isn't very noticeable though, I'm going to make it smaller for testing.

Edit: it looks and feels great, adds a lot more feel and intensity to the actually rather small screenshake.

Re: Moving the window on a frame-by-frame basis - good idea?

Posted: Sat Mar 28, 2015 12:11 pm
by zorg
Works flawlessly on my Win7 (64bit, though with 32bit löve) as well; no lag whatsoever.

Interesting little game, though for some reason, i expected the world to be toroidal :3

Edit: One little issue; it always resets to the first monitor id when shaking; i'd suggest checking which screen its on _currently_, otherwise it will always snap back to that monitor on a multi screen setup.

Re: Moving the window on a frame-by-frame basis - good idea?

Posted: Sat Mar 28, 2015 3:24 pm
by undef
The main menu works, but when I start the game this happens:
error.jpg
error.jpg (39.72 KiB) Viewed 3110 times

P.S.: You really make some nice music!

Re: Moving the window on a frame-by-frame basis - good idea?

Posted: Sat Mar 28, 2015 4:02 pm
by Kingdaro
S0lll0s wrote:Edit: it looks and feels great, adds a lot more feel and intensity to the actually rather small screenshake.
That's the goal! :)
undef wrote:The main menu works, but when I start the game this happens:

P.S.: You really make some nice music!
There's a really, really high chance you're not using the latest version of love.

Also, it's not mine, it's by a guy named No Mana. https://soundbutt.com/ihavenomanas
zorg wrote:Edit: One little issue; it always resets to the first monitor id when shaking; i'd suggest checking which screen its on _currently_, otherwise it will always snap back to that monitor on a multi screen setup.
Good catch, forgot to account for multiple displays. Thanks for that.

Re: Moving the window on a frame-by-frame basis - good idea?

Posted: Sat Mar 28, 2015 5:43 pm
by zorg
Kingdaro wrote:Good catch, forgot to account for multiple displays. Thanks for that.
No problem ^^
undef wrote:The main menu works, but when I start the game this happens
As Kingdaro said (and i experienced as well), you're running an older than 0.9.2 version of love (or at least, have it in your path, if you're on windows)

[REMOVED]

Posted: Sat Mar 28, 2015 6:05 pm
by RaptrStudios
[MESSAGE REMOVED BY OWNER]