IT界討論區(58) 唔講上一份人工

1001 回覆
6 Like 0 Dislike
2019-03-07 16:34:06
係咪講緊
client 收到msg {x=1, velocity=1 ,time=10}
但係client local time係10.1 所以client個x 應該set做 x=1.1
2019-03-07 16:35:15
Client local time I think is irrelevant to a game, can’t imagine any case.

Maybe I’m wrong, you got any examples?
2019-03-07 16:37:38
client禁制signal遲左一秒先send到server,
要補番果一秒比client
2019-03-07 16:43:11
That’s for anti lag system by determining the next second right?

I think it’s a bit 9 because my experience with League of Legend it’s useless.
2019-03-07 16:43:22
呢個係game logic上面點處理亂序同delay既package 睇你個game既性質係點
但係首先係開game之前 你要對到錶 例如A個clock係10000 B個clock係20000咁 呢個係clock skew
然後仲有A同B既clock speed唔一定一樣 例如A每秒100 B每秒102咁 呢個係clock drift (其實同一部device既clock都未必平穩 因為溫度變化之類
咁你就要開場之前measure晒 之後一路玩 每個package都有個sender time 接收個方就可以換算返做receiver time
有左呢個time之後 再睇你個game logic去判斷亂序既package既優先性 同埋啲motion點interpolate

例如我之前寫個隻 係有招捉人既 被捉隻角就無得出招
咁被捉個隻野既出招package可能後啲send 但係先啲到
咁就要係game logic層面諗點搞 個底層time library只係確保每個參加者都會收到正確統一timestamp既package
2019-03-07 16:45:11
如果你用單一server去出clock 咁就local time is irrelevant
不過電話網絡會好多lag感 或者要係game logic層面做好複雜既extrapolation
2019-03-07 16:49:39
I guess if you are very eager to solve the lag issue and fairness, but I think it’s an effort with not much output, I guess for a open source project if you make such PR it’s not gonna hurt to include it.
2019-03-07 16:53:09
其實又唔係好大effort
group埋一齊咁講出黎咪好似要寫幾日咁
但係其實當時係逐件逐件上 一開始只係對錶搞左clock skew
之後見兩分鐘後啲UX有啲奇怪 咪加埋clock drift入去
成件事其實分佈落黎個workload好light
2019-03-07 17:20:32
2019-03-07 17:38:19
You do PR I see see learn from 60k boi
2019-03-07 17:41:27
不了 成三四年前既code 唔通merge返去兩三版之前條branch
2019-03-07 17:52:50
咁其實隔一段時間reset clock skew咪得,唔使理clock drift
2019-03-07 17:57:44
2019-03-07 18:23:15
FG?
可以試下嘅
2019-03-07 18:37:06
Depends on what game la
2019-03-07 18:38:13
I think OW is P2P game
2019-03-07 18:58:14
2019-03-07 19:03:54
programmer既話多唔多英文in
2019-03-07 19:05:20
自我介紹有既
2019-03-07 19:10:39
都係一個常用方法 我唔用係因為唔想處理跳clock 兩者workload應該差唔多 純睇個人偏好
2019-03-07 19:11:22
托迪巴兩登都見到你
2019-03-07 19:13:40
裸辭幾日 無call 心荒荒
2019-03-07 19:15:45
唔少大公司英文in
2019-03-07 19:17:15
同us video interview用英文
2019-03-07 19:21:34
我打算去埋旅行先搵
全部都係agent 西工
吹水台自選台熱 門最 新手機台時事台政事台World體育台娛樂台動漫台Apps台遊戲台影視台講故台健康台感情台家庭台潮流台美容台上班台財經台房屋台飲食台旅遊台學術台校園台汽車台音樂台創意台硬件台電器台攝影台玩具台寵物台軟件台活動台電訊台直播台站務台黑 洞