Jump to content
  • Advertisement
Sign in to follow this  
purri

Network Npc help needed.

This topic is 1848 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im programming ARPG game similiar like Diablo 2 and i cant understand how are npc controlled over network.

 

I know how to move and give commands to NPC players but how server "knows" where are obstacles etc. I have some idea in my head, i try to write it here , i was thinking this :

When player comes view of monster, player send's packet to server and server gives order to npc unit to act, am i right?

Share this post


Link to post
Share on other sites
Advertisement
The server has a model of the game world - all player and monster positions, items on the ground, obstacles etc. The server usually doesn't need to load or draw graphics.

Each player also has a model of the game world, although perhaps only of the area surrounding the player. Player machines send the server information about the actions each player is taking. The server sends each player information about any nearby enemies, dropped items etc.

Share this post


Link to post
Share on other sites

Sounds logical, can you point me any website or article to read more on this? 

Share this post


Link to post
Share on other sites

This FAQ is a good starting point. The Multiplayer and Networking forum is a good resource in general if you have specific questions.

Share this post


Link to post
Share on other sites

Thanks for link, im blind or stupid but i really didn't find anything NPC related on that topic. I even read all ! :D

Share this post


Link to post
Share on other sites

Im still missing logic behind this, i can't really find anything on google. 

Share this post


Link to post
Share on other sites

Thanks for link, im blind or stupid but i really didn't find anything NPC related on that topic. I even read all ! biggrin.png

 

an NPC is just another entity, its not special in any way. (The only difference between an NPC and a rocket is their behaviour, which is game logic and not really related to networking)

Share this post


Link to post
Share on other sites

That AI im talking about. I can load thousands npc to server no problem but how i ... command they attack to player? Do i need to acces those NPC entitys via client? or what?

Share this post


Link to post
Share on other sites

That AI im talking about. I can load thousands npc to server no problem but how i ... command they attack to player? Do i need to acces those NPC entitys via client? or what?

 

No, your server should run the simulation including behaviours(not just AI, anything that moves and isn't a player should be controlled by the server) for any non player entities and send information about their state and actions to any player who needs that information, if you're asking how to write an NPC AI this probably belongs in the AI forum.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!