No announcement yet.

replication problem with bots

  • Filter
  • Time
  • Show
Clear All
new posts

    replication problem with bots

    I created my own NPC's (non-aggressive bots derived off AIController, not Bot), and basically copied GameInfo.uc on how to spawn the controller, pawn, the whole deal. But in a multiplayer game, clients do not see these NPCs at all. Only the server player sees them.

    I don't see any example of NPC's in UT2003, so I had to follow their example of spawning normal bots. But it must have gotten messed up somewhere along the line. Or maybe I overlooked something, like setting one of those mysterious boolean variables that are all over Actor.uc?

    btw, I tried a quick fix by deriving the NPC class from Bot and it didn't work.

    Will post code if needed...

    Alright, I figured out that the problem was the pawns were there all along but there was NO MESH being set for them, so they were invisible. So I set jugg as the default mesh and lo and behold, I had Gorge floating around in his ref-pose.

    But now the problem is, I need the clients to change the mesh on their end as well, so it corresponds to what the server sees. I looked at how UT does this, and in PlayerController.uc state PlayerWalking, function BeginState, it calls Pawn.SetMesh() and this magically gets replicated to clients. I adapted this to my controller/pawn and the mesh is not set on clients. I tagged the relevant functions as 'simulated' like they do...


      One way MIGHT be to set the default pawn class for your new AIController class to be xPawn. This would make the physical representation = to the xPawn.

      Im not sure about replication, I havent messed with multiplayer. But since xPawn is all set up to do that, it might work out that way.

      But , this is not to say it would necessarily work now that I think about it. Are there functions in xBot that xPawn calls? If so, you would have to define those functions in your controller class too...

      What are you trying to make your NPCs do that the xBots dont do? Are they going to be just "drifters?"

      If thats the case, you can extend xBot instead, and just override all of the states to send it to your state, and then define the actions in your own state code. This would give you the support of xPawn and xBot in regards to replication...

      If you send an example of behavior that you want, I might be able to get some more information...

      Good Luck