Does anyone have a clue what is the best way for all users in a online rpg to monitor npc movement and make it all sync correctly...
any help is appreciated.
Printable View
Does anyone have a clue what is the best way for all users in a online rpg to monitor npc movement and make it all sync correctly...
any help is appreciated.
Simple, I have in my MMORPG even system that makes NPC chase players, all controls server side.
You need to have map in the memory of server (grid is almost must). For example, every 2 secs run a loop which calculates new positions and then send the result to the session.
Thats the main point, forget about client controlled things.
how is it possible to have then smooth animation, so you can see npcs walk to their new position, and they only chase you if you are in a battle with them.
If the server sends the destination (and speed, if needed) of a npc, then the client has enough information to make it move
but then i need to create a another object that leads the main npc through cordinites? if im using for example bouncing ball movement on the npc's...
You dont need anoher object.
Say the old coordinates are X1 and Y1, new X2 and Y2.
When recieved data to specific NPC, it set new positions to some values. Then you can use simple extension or code to move the object to new position smoothly.
Like:
Alt X>X pos = X pos +1
etc.
Its the simplest method and could look quite good.
Move safely 2 object extension, does that work?
awwwwwww...this is killing me here, every npc is moving so damn stupid, no idea how to figure out how to make them move with the correct animation and dir, and without sending flooding messages to the client from the server...
* biting fingernails*
you do it something like this: send a message with information of where it started from, and where it should end up, that's it really
yeh, but is it best to send to all npcs at once or just one at a time, depending where the player is standing, if so how in the hell.