Skip to main content
GameDev.net gamedev.net
🔒 Locked

Mem problems

Started by UgaBuga Jul 18, 2003 at 10:49 AM 4 replies 400+ views
Original Post
UgaBuga
UgaBuga
Hello! Imagine a world of tiles wich is really huge and puting it all on mem wouldnt work out. Now lets say this world is populated with npc wich can move randomly into any direction, as long its not ocupied. It would only load the area where the player would be. The problem is, how one would implement the npc moving without loading all the map into memory. It would be possible by accessing the 9 ajacent squares around each npc, but if we had for example 10.000 npc''s, it would need to do 10.000 HD access, wich would kill the game. Does anyone have a solution? I know Ultima online handles this (I think), "how" is the question :D, any ideas? thx
Dak Lozar
Dak Lozar
If I understand what you are asking... I think the solution is to ''limit'' the movement of an NPC. In UO, for example, most NPC''s do not move too far from there origin (origin being the spot on the map where they spawned from) unless they are following another player. The NPC Mobs stop following a player once they leave a bounding area...

HTH,

Dave "Dak Lozar" Loeser
Dave Dak Lozar Loeser
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."--anonymous
UgaBuga
UgaBuga
"most NPC's do not move too far from there origin"
Ya, ive noticed it, but still, every npc would need to know if where he "wants" to walk is walkable.
"The NPC Mobs stop following a player once they leave a bounding area..."
I guess I could load an area for each npc/group of npc in the same area but it might still take to much mem..

btw, does UO server load the entire map?

[edited by - UgaBuga on July 18, 2003 12:34:44 PM]
UgaBuga
UgaBuga
Im not sure if got it right...
How would I know if the player would be getting to the actual position of the npc without doing all the calculations and hd access. I think it would be even worse!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.