IT界討論區(58) 唔講上一份人工
青花瓷 2019-3-7 16:34:06 係咪講緊
client 收到msg {x=1, velocity=1 ,time=10}
但係client local time係10.1 所以client個x 應該set做 x=1.1

Ads

實驗羊 2019-3-7 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-3-7 16:37:38 client禁制signal遲左一秒先send到server,
要補番果一秒比client
:^(
實驗羊 2019-3-7 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.
手一黏便緊(UTC+9 2019-3-7 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
手一黏便緊(UTC+9 2019-3-7 16:45:11 如果你用單一server去出clock 咁就local time is irrelevant
不過電話網絡會好多lag感 或者要係game logic層面做好複雜既extrapolation
實驗羊 2019-3-7 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.
手一黏便緊(UTC+9 2019-3-7 16:53:09 其實又唔係好大effort
group埋一齊咁講出黎咪好似要寫幾日咁
但係其實當時係逐件逐件上 一開始只係對錶搞左clock skew
之後見兩分鐘後啲UX有啲奇怪 咪加埋clock drift入去
成件事其實分佈落黎個workload好light
連登臭飛 2019-3-7 17:20:32
:^(
實驗羊 2019-3-7 17:38:19 You do PR I see see learn from 60k boi
:^(
手一黏便緊(UTC+9 2019-3-7 17:41:27 不了 成三四年前既code 唔通merge返去兩三版之前條branch
:^(

Ads

青花瓷 2019-3-7 17:52:50 咁其實隔一段時間reset clock skew咪得,唔使理clock drift
電波宅 2019-3-7 17:57:44
:^(
i-vtec找J/屎眼數 2019-3-7 18:23:15 FG?
可以試下嘅
實驗羊 2019-3-7 18:37:06 Depends on what game la
實驗羊 2019-3-7 18:38:13 I think OW is P2P game
世界唯一打怪物 2019-3-7 18:58:14
:^(
(。•ˇ‸ˇ•。) 2019-3-7 19:03:54 programmer既話多唔多英文in
:^(
狼王托迪10 2019-3-7 19:05:20 自我介紹有既
手一黏便緊(UTC+9 2019-3-7 19:10:39 都係一個常用方法 我唔用係因為唔想處理跳clock 兩者workload應該差唔多 純睇個人偏好
青雞面 2019-3-7 19:11:22 托迪巴兩登都見到你
:^(

Ads

狼王托迪10 2019-3-7 19:13:40
:^(
:^(
裸辭幾日 無call 心荒荒
:^(
i-vtec找J/屎眼數 2019-3-7 19:15:45 唔少大公司英文in
手一黏便緊(UTC+9 2019-3-7 19:17:15 同us video interview用英文
:^(
青雞面 2019-3-7 19:21:34 我打算去埋旅行先搵
全部都係agent 西工
:^(