Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一些疑问 #4

Open
homike opened this issue Dec 25, 2020 · 1 comment
Open

一些疑问 #4

homike opened this issue Dec 25, 2020 · 1 comment

Comments

@homike
Copy link

homike commented Dec 25, 2020

为什么要限制玩家在一帧中只能输入一次操作,看其他帧同步项目,基本没有这个限制。
func (l *lockstep) pushCmd(cmd *pb.InputData) bool { ... //检查是否同一帧发来两次操作 for _, v := range f.cmds { if v.Id == cmd.Id { return false } } ...

空帧为什么不马上广播,客户端是需要空帧来驱动前进的。
我看你提供的客户端在没有输入的逻辑帧时,自动currentFrameIdx++了,是不是不够严谨了,正式项目肯定是不能丢帧的。
if !g.dirty && framesCount-g.clientFrameCount < BroadcastOffsetFrames { return }

@byebyebruce
Copy link
Owner

byebyebruce commented Dec 29, 2020

我们游戏技能是带CD的,玩家不可能一帧释放多个技能
这个可根据策划需求

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants