manuel.gysin Posted April 22, 2011 Share Posted April 22, 2011 Hello I build up some code onto the Unigine::character class, but had some strange problems to sync it over the network. Since some months there is a the new class Pawn which replaces the CharacterSmart class. I switched to this class and made some simple synchronizations. While multiple clients are connected to the server, pawns are moving right in all directions and turning is too synchronized well. But I can't get animations working. In the samples is no sample with the pawn class and the code is on some parts not clear to me. I used a PawnAnimated for the local player and for remote players I used PawnDummy. PawnSynchronizer: // Create state "pawn position". SharedState state_pawn_position = network.createSharedState(shared_object_id,STATE_PAWN_POSITION); state_pawn_position.setUpdateInterval(50); state_pawn_position.setMaxHistorySize(20); state_pawn_position.setArray(( pawn.getPosition(), pawn.getYaw(), pawn.getPitch(), pawn.getLinearVelocity(), pawn.getAngularVelocity())); shared_object.addSharedState(state_pawn_position); // Create state "pawn actions" SharedState state_pawn_actions = network.createSharedState(shared_object_id,STATE_PAWN_ACTIONS); state_pawn_actions.setUpdateInterval(50); state_pawn_actions.setMaxHistorySize(10); state_pawn_actions.setArray(( pawn.isFiring(), pawn.isCrouching(), pawn.getMoveDirection())); If I'm right everything needed to play a animation is sent over the network. But only the "crouch" effect is appearing randomly while moving. Is there something I'm missing? Maybe is there an sample for this class? Thanks a lot and for any hint I'm very thankfully! Link to comment
Guest anet Posted April 25, 2011 Share Posted April 25, 2011 Hello Manuel, To be able to play animation for remote characters you should use PawnAnimated too. This code is still in a prototype stage. So there is no released sample yet in our SDK. I have attached some code samples to this message. local_player.h remote_player.h npc.h Link to comment
Guest anet Posted April 25, 2011 Share Posted April 25, 2011 Here is one more file. network/common/synchronizers/pawn_synchronizer.h is included in our SDK. game_world.h Link to comment
manuel.gysin Posted April 25, 2011 Author Share Posted April 25, 2011 Hello Anet Thanks a lot! :) I have a look at the files. Link to comment
Recommended Posts