• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Nanook

Acceptable input lag

3 posts in this topic

Whats acceptable input lag?

I'm implementing a threaded engine.. but thinking about how I would handle input when its networked.

At the moment its not networked and it goes like this(n is frame number):
n=0: Platform input is read at start of frame. Input system handles the input and sends the results off to the physics system
n=1: Physics system would calculate the new positions
n=2: Render system renders the new position.

Would this be acceptable?

I could make the render system dependent on the physics system and the render system dependent on the input system so the tasks of each system would all run on the same frame, but then if the other threads on my engine are really fast I would defeat the purpose of doing it multi threaded anyways. Whats more realistic would be to make the physics system dependent on the input system so I would reduce it to just one frame lag.

What I'm thinking for a networked game:
n=0: Platform input is read. Then its sent to the server. On the server its also checks if there's incoming input before it starts running any of the threaded tasks. Input system handles the input and sends the results off to the physics system
n=1: Physics system on the server would calculate the new positions.
n=2: Network system on server sends the new positions to clients. Network system on the clients receives the new positions
n=3: Render system renders the new position

There could also be network lag on frame 0 and 2 here so the input lag would be variable. Is this acceptable or do I need some kind of synchronization?

Now with this I could do some of the same dependency tricks to reduce it. I could get the physics update into n=0 and maybe even make the render system dependent on the network system so it is run before the rendering task can start. Reducing it to either;
n=0: input
n=2: render
or;
n0: input
n=1: render

+ the network lag of course..

I guess I want as little lag as possible, but since I will reduce concurrency with this whats acceptable?

Got a lot of answers just by writing this post, but still need some more opinions on this.. Hopefully its readable and clear enough :)
0

Share this post


Link to post
Share on other sites
Acceptable is very relative.

I've seen games that can go as high as 200ms before it even becomes noticeable. I've also played games that are only acceptable when played on a LAN.


[quote name='ApochPiQ' timestamp='1353738532' post='5003687']
Slowly dial up the delay until you can perceive it, and note how long you're buffering your input. Now cut that back by about 25% and you have your target :-)
[/quote]I like that.

You should be able to come up with some coarse numbers before that. For example, if your physics is running on 10 updates per second, that tells you you're looking in the 20-30ms range. If it updates 4x per second, you're looking in the 200-500ms range.
0

Share this post


Link to post
Share on other sites
[quote name='ApochPiQ' timestamp='1353738532' post='5003687']
Keep in mind that there can be up to several frames of lag between when you hand off your rendered scene to the video drivers and when the player actually "sees" the image.
[/quote]

Do you mean the time of swapping the buffers?

[quote name='ApochPiQ' timestamp='1353738532' post='5003687']
Also, bear in mind that you cannot escape network latency by hiding it. It is generally measured in dozens of milliseconds - the roundtrip time of even the speediest cross-internet trip is going to be very noticeable. (See also: why "streaming gaming" services have generally failed to catch on.) You need to anticipate network latency and deal with it in a totally different way than just hoping the player can't feel it.
[/quote]

I guess I should run the updates on both the clients and the server instead and then send out delta packages to controll the clients..

[quote name='ApochPiQ' timestamp='1353738532' post='5003687']
Now - with those caveats out of the way: in my experience, you can generally burn about 30-50ms (depending on the player) before input latency "feels" bad. At 30Hz, that means you can afford one frame of latency or maybe two if you're not expecting twitch reflexes from your gamers. At 60Hz of course you're in a different boat, and can afford a lot more.

Here's a great experiment you really should try: build a simple game like a Snake skeleton or something, just implement the controls and rudimentary rendering and that's it. Put in a configurable delay buffer between when your input is read and when it affects the game simulation. Slowly dial up the delay until you can perceive it, and note how long you're buffering your input. Now cut that back by about 25% and you have your target :-)
[/quote]

That's a interesting idea.. I'll see if I get time to do that..

I guess I could also run some of the update threads at a different hz..
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0