Network Npc help needed.

Started by
9 comments, last by purri 10 years, 11 months ago

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?

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.

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

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

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

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

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

I didn't find anything usefull but i have some ideas in my mind.

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)

[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

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?

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.

[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

This topic is closed to new replies.

Advertisement