Manageing NPCs out of the screen
if( pChar->Visible() )
{
UpdatePath();
SmoothPath();
CheckCollision();
}
else
{
UpdatePath();
CheckSimpleCollision();
MoveChar();
}
AI Game Programming Wisdom has a nice article about this subject. It describes different Level of detail to use on the ai.
----------------------------------------------
Petter Nordlander
"There are only 10 kinds of people in the world. The who understand binary and those who don''t"

I''ll post here leater if I find a well-working tecnique.
bye
Dave Mark - President and Lead Designer
Intrinsic Algorithm - "Reducing the world to mathematical equations!"
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
I included also "ability" to here sounds and be allerted and also the "ability" to be hitten by ranged weapons that strike also out of the screen.
I switch to first Ai class when the NPCs enter the screen, and I switch to the second one (that does not manage apparence and other things) when they leave the screen.
It seems to work correctly for my game engine.
I''ve to improve it a lot, because is not fast enaught to manage a lot of NPCs, but it''s OK.
In a multiplayer game, NPCs-status changeing must be managed by the server??
Must the server tell to the clients changes in NPCs status, so, if someone is in the area where and NPC appears, the client can manage correctly what it is doing?
bye
quote:
Original post by darkbard
Ok, I tried, and it seems to work.
Good to hear!
quote:
Original post by darkbard
I included also "ability" to here sounds and be allerted and also the "ability" to be hitten by ranged weapons that strike also out of the screen.
You can think of it like this... there is actually a large world out there with all of the interactions going on that are handled by your game engine. There is also a small part of that world that you have a window into. As InnocuousFox pointed out, you generally need to adjust the level of computational detail based on whether an activity is within your view window of the world or not... and whether, if the event is outside, it is necessary to handle it.
quote:
Original post by darkbard
In a multiplayer game, NPCs-status changeing must be managed by the server??
If you leave it up to the client, it leaves your game open to be hacked by false clients.
quote:
Original post by darkbard
Must the server tell to the clients changes in NPCs status, so, if someone is in the area where and NPC appears, the client can manage correctly what it is doing?
Typically the game client for a Client-Server game handles just three things
1: collection of user inputs
2: transmission of inputs to server and collection of game state from server
3: display of current game state
This minimises the ability for players to hack the game state using a modified client, since all physics and AI is done on the game server.
Cheers,
Timkin
quote:
Original post by Timkin
Typically the game client for a Client-Server game handles just three things
1: collection of user inputs
2: transmission of inputs to server and collection of game state from server
3: display of current game state
This minimises the ability for players to hack the game state using a modified client, since all physics and AI is done on the game server.
it seems obvious

I''l try to implementa small server that "thinks" for the NPCs ... if I''ll have some problem, I''ll ask you ...
bye
Dave Mark - President and Lead Designer
Intrinsic Algorithm - "Reducing the world to mathematical equations!"
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
Do you think it could work?
I''d like to write this small program to do something like SETI: if someone doesn''t want to play the game, he can only run this very small program to improve realism in my World.
I an NPC isn''t controlled by HIS program, it behaves like the NPC on the other MMORPG ... for example: it only sells things, without creating new one, and so on ...
quote:
Original post by darkbard
I planned to create small client programs that manage AI of NPCs that are importants in my World. These programs should be ran when someone is on the net, and thay manage NPCs making them able to create items, build things, and so on.
Do you think it could work?
I''d like to write this small program to do something like SETI: if someone doesn''t want to play the game, he can only run this very small program to improve realism in my World.
You''re asking for a world of torment and heartache here... it would be far too easy for someone to write a hacked AI NPC that destroyed the gameplay experience for your players. You might think that this wouldn''t happen, but trust me, there are people out there whose only happiness comes from the misery of others.
SETI is different in that it works in isolation from the main server, except to update it with the results of its work. It doesn''t need to communicate back to the server in real time and the results don''t affect the data sent out to other clients. Your game, on the other hand, would be different. Your AI clients would perform actions that would affect the game world and thus the data sent to other AI and players. This is very open to corruption.
Timkin