针对晶体硅车间仿真中多个客户端进行技能PK时,人物动画状态转换以及客户端动画同步的问题,提出了基于状态机的动画转换方法,极大地简化了动画状态转换,减小了实现难度。首先,提出的方法将一个完整的动画分割成若干个动画片段;然后,将每一个动画片段作为状态机的一个状态,从而通过改变状态机变换条件实现动画的转换。同时在授权服务器与非授权服务器基础上提出了一种更加灵活的网络构建方法,该方法直接由客户端接收信息输入,在结果转发给服务器的同时将状态同步到其他终端中。实验结果表明结合双服务器构建方案的方法很好地解决了网络中动画不连贯,用户体验差的问题。
To solve the problem of animation transition and client state synchronization in skills PK of crystalline silicon workshop simulation,this paper introduced an animation transition method based on the state machine,which greatly simplified the transition of animation states,and reduced the difficulty of system implementation. First,an entire animation was divided into several animation clips; then,each animation clip was set as one state of the state machine; and finally,the animation transition was completed by changing the conversion condition of the state machine. In addition,based on the authoritative server and the non-authoritative server,a more flexible network solution was presented in which the client received and processed the player's input directly,and synchronized the result to the server and other clients. The results indicate that the proposed method has a good performance in solving the problem of discontinuous animation and poor user experience in network environment.