Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Screen Speed
#1
A fairly simple question, but we don't seem to have a General Q&A thread.
:p

Well anyways, here's my question:
How fast can the play-screen move?

The screen doesn't 'stick to' the player so much as follow them, and I'm
not asking that the screen's speed be changed (which would really dictate
I post this in the HEX section :D) I'd just like to know how fast the screen
can go before the player outruns it and vanishes off screen.

Doesn't have to be exact either, relative/vague terms are fine. ^^

Also, if no-one's actually checked this out I can always just figure it out
myself, when I've got the time ofc.
If you're curious as to why, I'm thinking about epic style moves, but it'll be
of no use if you can't see them. :D
Trust you're all well.
Reply
Thanks given by:
#2
(03-14-2010, 09:26 AM)Magnamancy Wrote:  How fast can the play-screen move?
The screen doesn't 'stick to' the player so much as follow them,

yeah it goes fast at first then starts going faster after a while and so on...
"I'm the president of the shadow government
The grand governor of the federal reserve
Public enemy of the society
The one you cannot see the thirty three degree"
Reply
Thanks given by: Magnamancy
#3
Yeh, as freeza said, it's not a continuously equal camera-movement-speed but it's accelerating/decelerating according to the distance of the player to the center (or approximately at least). Personally, I haven't tested out how fast you'll have to be to leave the screen (as fast as possible), but I suspect it to be around the running_speed of 30-40. Don't know how exactly it translates into dvx-values (as those movements accelerate at first, too), but yeah, that's the subject for you to try out :P
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by: Magnamancy
#4
exact position calculation:

take the average of all (players that are alive)'s x coordinates (on the same computer), store it in avgX

next variable, start with 0, and add 1 for every player facing right, and subtract 1 for every player facing left, store this in facing

let xLimit be where we want the camera to move to, screenW be 792 (lf2 window width), and halfW= 792/2 = 396.

also, let numPlayers be the number of alive players on the current computer

the calculation for xLimit is:
xLimit=
(facing × screenW) / (numPlayers × 6) - (halfW + avgX)

if xLimit < 0, then xLimit = 0
if xLimit > background's width - screenW then xLimit = background's width - screenW


kayz so that's where the camera will scroll to assuming the characters don't move from their current positions. but since we want to implement a smooth scroll (the dvx: of the camera), instead of making the camera's x position = xLimit, we would do:

x = currentX + (xLimit - currentX position) / 8

---

I'm 80% sure that that's the exact algorithm that lf2 uses (i know xLimit is exactly the same as lf2's, but not sure about the x scrolling speed. if any of you still have the java HQ running, then you could check by running them side by side



Azriel~
Reply
Thanks given by: Magnamancy




Users browsing this thread: 1 Guest(s)