ID:152186
 
I'm making a game set in space and one of the 'features' of the game is the ability to fly a ship through space. Currently, I have the ship move a certain number of pixels every 2/10 of a second. However, this can get a bit jerky when the ship gets up to higher speeds. Is there a better way to do this so that it can look more smooth?

Also, since you can't move Client.eye by pixels, the screen moves when the ship enters a new tile. From what I've heard, this can't be fixed, but if anyone has any ideas, I'm open to anything.
Jhon wrote:
I'm making a game set in space and one of the 'features' of the game is the ability to fly a ship through space. Currently, I have the ship move a certain number of pixels every 2/10 of a second. However, this can get a bit jerky when the ship gets up to higher speeds. Is there a better way to do this so that it can look more smooth?
I don't think BYOND can go faster than a tenth of a second...

Also, since you can't move Client.eye by pixels, the screen moves when the ship enters a new tile. From what I've heard, this can't be fixed, but if anyone has any ideas, I'm open to anything.

Nope, can't be fixed.
What you see in Theodis' RacingGame is about as good as you're going to get out of BYOND.
In response to Kaiochao2536
Kaiochao2536 wrote:
I don't think BYOND can go faster than a tenth of a second...

BYOND has a 10 FPS limit, but it can execute bytecode at an OK speed.

Also, since you can't move Client.eye by pixels, the screen moves when the ship enters a new tile. From what I've heard, this can't be fixed, but if anyone has any ideas, I'm open to anything.

Nope, can't be fixed.

I'm hoping for this one, too. It's been requested many times and I think they are still working it out. There have been a lot of graphical problems with the release of 4.0.
In response to CaptFalcon33035
actually, you might be able to get a good enough override on this, moving the whole map over at a time, till the screen decides to jump, moving it back over... you can try and get the code, it would be of course completely smooth, but it would also take a lot of time to code something like this.
In response to FallingLegend
Not a lot of time to code, just a long-ass time to execute. It's too slow to be a solution, and what if his game is multiplayer?
Now that I think about it, if you handle screen-drawing functions yourself, you can control your own view and control how the view appears to you. This will allow for smooth pixel scrolling. However, I imagine it'd be fairly slow, but you wanted a doable solution...
In response to CaptFalcon33035
both can be done, all we can do, is allow him to choose a way, and see if it will be good enough for his project.
There's a third method, that hasn't been discussed or mentioned.

Even though you can't make client.eye scroll per pixel, you can still make it scroll to new coordinates smoothly. Whenever client.eye is relocated to a location that is adjacent to its previous location, the screen will scroll smoothly (I believe it's 4 pixels per tick?). Pretty easy to implement this in any pixel-based movement system.

What's the difference between what I've suggested and the default behavior? client.eye will not scroll smoothly if the mob associated to the client has a null value for animate_movement. Instead, it will "jump" to the new location.
In response to D4RK3 54B3R
D4RK3 54B3R wrote:
Even though you can't make client.eye scroll per pixel, you can still make it scroll to new coordinates smoothly. Whenever client.eye is relocated to a location that is adjacent to its previous location, the screen will scroll smoothly (I believe it's 4 pixels per tick?). Pretty easy to implement this in any pixel-based movement system.

The client also has a pixel_step_size variable which allows you even finer scrolling per tick, down to 1 pixel per tick. So if your game moves slower than 1 tile per 3.2 seconds, you can get away with a very smooth scrolling system by setting client.pixel_step_size = 1.
In response to FallingLegend
FallingLegend wrote:
actually, you might be able to get a good enough override on this, moving the whole map over at a time, till the screen decides to jump, moving it back over... you can try and get the code, it would be of course completely smooth, but it would also take a lot of time to code something like this.

Yeah, I tried doing that once, but it made the game extremely slow. It's a good idea, but BYOND just can't handle it.
Thanks for all of your tips! I've boosted it up to 10 FPS and it's looking pretty smooth. I'm now one step closer to getting a decent game out there.