织梦CMS - 轻松建站从此开始!

欧博ABG官网-欧博官方网址-会员登入

Ogr皇冠e Forums

时间:2024-09-30 22:41来源: 作者:admin 点击: 26 次
Edited to be nicer Calsmurf I very much disagree with your assertions. Games do NOT model physics on the client, they model some simple movement code

Edited to be nicer

:P

Calsmurf I very much disagree with your assertions. Games do NOT model physics on the client, they model some simple movement code is all. The "real" physics happens on server.

The following applies to multiplayer games only obviously.

All "decision making" _MUST_ be done on the server, no matter what. You _CANNOT_ trust a client to perform any sensitive decision (since clients can be easily hacked no matter what crypto/security you use). Also, synch issues will cause clients to have slightly different copies of world data, thus leading to different outcomes from physics simulation.

Imagine the scenario: player A and player B both try to pick up an item. Both think they succeed, since they model physics locally. Which is correct? This is why you must have a centralised authority. Think back to Diablo with it's peer to peer multiplayer, players could become invulnerable just by hacking their client to ignore "take damage" messages.

It is true though that players will experience "local lag" when they try to move though. To get around this we implement some simple "client side prediction". I.e when the player presses "move forward", on the client we just move them forward straight away, without waiting for a confirmation from the server. This gives the player the illusion of lagfree movement. Then we can apply some interpolation between the "real" position the server sends, and the clients "lookahead" position.

Maybe the client will have some rudimentary collision code to stop them moving through walls etc, but really very little physics is needed on the client. Indeed it simplifies the project a lot to completely move all simulation to the server, and focus on rendering and input for client.

From the article linked above on Source network model: "Usually a server is a dedicated host that runs the game and is authoritative about world simulation, game rules, and player input processing." (my emphasis)

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-02-22 16:02 最后登录:2025-02-22 16:02
栏目列表
推荐内容