강의

멘토링

커뮤니티

Cộng đồng Hỏi & Đáp của Inflearn

Hình ảnh hồ sơ của nieskalany
nieskalany

câu hỏi đã được viết

[Series Phát triển Game MMORPG bằng C++ và Unreal] Phần 5: Kết nối Server UE5 & IOCP

sự chuyển động

Snapshot base vs packet oriented

Đã giải quyết

Viết

·

117

0

Hello Master 🙂

I would like to ask wich method is prefered in wich case. Most mmo code i seen either go packet way like in this course or

  1. Client send commands wich contains input + mouse postion + fields that allow you to for example specify operation type like interact, consume etc.

  2. Server respond each tick with snapshot of zone you are around your aoi with all possible data with delta comporession so you get only new information.

     

     

    Wich approach is prefered, on wich it depends? Does they have some serious perfomance gains when you stick to one of them? Or its just matter of architecture your team prefer?

     

c++unreal-enginewindows-server

Câu trả lời 1

1

Rookiss님의 프로필 이미지
Rookiss
Người chia sẻ kiến thức

Your question is a bit confusing,
but if you're asking whether you should synchronize by input or by delta position
it depends on the game genre you're developing. For instance,

[1] Starcraft
If you're making a strategy game like starcraft,
you can't just delta serialize every single position data,
because you can have up to 1000+ units.
It would be smarter to synchronize using clients' input commands (mouse/keyboard inputs)


[2] MMO (with keyboard based movement, like WOW)
In this case you have no choice but to synchronize movement regularly.
Usually you do this by setting a temporary destination every 0.25s,
and you can try sending this destination to the client,
and the client will interpolate the movement smoothly.
This is known as dead reckoning.

[3] MMO (with mouse based movement, like Lineage)
The first attempt is to synchronize by mouse inputs, because it seems pretty cheap.
However you have to be consider whether your game needs player collision.
If it does, then it's probably using a grid based system.
In this case you can't just send mouse input,
the server has to judge which user successfully moved.

Hình ảnh hồ sơ của nieskalany
nieskalany

câu hỏi đã được viết

Đặt câu hỏi