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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Kingdaro
Party member
Posts: 395
Joined: Sun Jul 18, 2010 3:08 am

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

Post 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?
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

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

Post 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.
User avatar
undef
Party member
Posts: 438
Joined: Mon Jun 10, 2013 3:09 pm
Location: Berlin
Contact:

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

Post 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.
twitter | steam | indieDB

Check out quadrant on Steam!
User avatar
Kingdaro
Party member
Posts: 395
Joined: Sun Jul 18, 2010 3:08 am

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

Post 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.
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

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

Post 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.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
zorg
Party member
Posts: 3441
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post 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.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
undef
Party member
Posts: 438
Joined: Mon Jun 10, 2013 3:09 pm
Location: Berlin
Contact:

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

Post by undef »

The main menu works, but when I start the game this happens:
error.jpg
error.jpg (39.72 KiB) Viewed 2854 times

P.S.: You really make some nice music!
twitter | steam | indieDB

Check out quadrant on Steam!
User avatar
Kingdaro
Party member
Posts: 395
Joined: Sun Jul 18, 2010 3:08 am

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

Post 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.
User avatar
zorg
Party member
Posts: 3441
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post 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)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
RaptrStudios
Prole
Posts: 39
Joined: Thu Jan 22, 2015 5:46 am

[REMOVED]

Post by RaptrStudios »

[MESSAGE REMOVED BY OWNER]
Last edited by RaptrStudios on Sun Mar 29, 2015 12:35 am, edited 2 times in total.
Raptr Studios
http://raptrstudios.weebly.com/

Please consider donating to us!

New Game I'm Working On - Cerradon
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], MrFariator and 139 guests