• 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
Farkon

Processing inputs right away

5 posts in this topic

Hello,

 

I was reading some Carmack updates about the QuakeWorld development here : http://fabiensanglard.net/quakeSource/johnc-log.aug.htm

 

And that part made me think about how to process inputs :

 

Instead of expecting everyone's messages to be dealt with at once, I now
deal with each packet as it comes in. That player alone is moved forward
in time, and a custom response is sent out in very short order. The rest
of the objects in the world are spread out between the incoming packets.
There are a lot of issues that that brings up. Time is no longer advancing
uniformly for all objects in the world, which can cause a lot of problems.

It works, though! The average time from a packet ariving at the system to
the time a response is sent back is down to under 4ms, as opposed to over
50 with the old dedicated servers. 

 

In my projects I usually have a big server loop, processing all the received messages and sending back "independently" the server updates to all the players.

 

It works but indeed, as he said, it adds some latency if you process the messages at 30 or 60fps but I always just dealed with it; now i'm wondering how you handle cheat with this kind of architecture.

 

The issue being cheaters trying to speedhack by just sending packets at a different expected rate. Do you average the number of packets received from the client and try to consume them at an arbitrary rate ?

 

Is it a good route to take ? Any drawback ?

0

Share this post


Link to post
Share on other sites
Personally, I don't like the "everyone moves when their packets come in" mechanism. It may move for certain fast-paced games with little physical interaction between entities, but it is inherently nondeterministic and doesn't work well at all for multi-entity interactions (e g two rolling balls colliding or whatever.)
0

Share this post


Link to post
Share on other sites
I'm with hplus.

This is a technique that can be useful for certain types of simulation, but for anything with nontrivial physics, it's a bloody nightmare.
0

Share this post


Link to post
Share on other sites

Thanks for the help.

 

I thought more about how to process MY inputs and i need a few enlightments :

 

The client is sending ~2 frames per packet.

 

What i used to do in my other projects is checking on the server if there are datas to dispatch, if so, call movePlayer() or throwArrow() and since i'm having 2 frames i was sometimes calling throwArrow() twice in a row.

 

But right now i'm using an entity/component architecture, the same as T=Machine where an entity can only have one component type. So when i'm receiving a client packet about throwing arrows the networkSystem would attach a CThrowArrowEvent component to my client entity and then the event would propagate through all my systems.

 

That's my server loop :

 

timerSystem.processOneGameTick();
networkSystem.processOneGameTick();

roomSystem.processOneGameTick();
inputSystem.processOneGameTick();
actionSystem.processOneGameTick();
repairSystem.processOneGameTick();
towerDetectorSystem.processOneGameTick();
towerActionSystem.processOneGameTick();
lineSystem.processOneGameTick();
energySystem.processOneGameTick();
healthSystem.processOneGameTick();

characterMovementSystem.processOneGameTick();
characterPositionSystem.processOneGameTick();

networkOutSystem.processOneGameTick();
 

So if i'm having two events in the same packet about throwing arrows, i can't just attach 2 events to my player entity as soon as i'm processing the packet since my entityManager structure doesn't allow it.

 

I would like to avoid changing my entityManager but i'm not sure what method would fit the best my architecture.

 

I could make one server loop per packet frame for all the players which mean that i would make two loops in a row independently of my server fps. I would still send back datas at regular interval. How does that sound ?

 

 

0

Share this post


Link to post
Share on other sites
Typically, events are time stamped, which means that you will only dispatch/attach events for a particular time stamp during a particular loop through your simulation loop. The other event would wait in a queue until its time stamp comes up, and be handled at that time.
0

Share this post


Link to post
Share on other sites

I have no idea why i thought it would be different from what i was doing, i actually had a bug when spamming an action key would cumulate latency, so i started from that and made wrong premises. Thanks putting me on the right track :3

 

(I actually have more questions but i'll make another thread);

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