A few questions about NPC's in Tile games
Yah, say you have a RPG game and you have NPC''s which are in one part of a large map. Say you want them to be able to do things such as goto work, then go home, based on certain times. How would you make a NPC who isnt on the current screen, walk properly around obstacles and whatnot. Since the map isnt loaded in the area the NPC is in, is there some way to make it avoid the obstacles in an efficient manner.
I have designed a tile engine before, but the maps were small enough to be all loaded into memory at once, so this problem didnt occur.
Also what would be the best way to have obstacles which arent as least as big as a tile. Like is there a way to get pixelized collision, instead of tile collision, like more precision. i was thinking of having a COllision map which is loaded, and basically has lines which if the player comes in contact with, stops the player moving.
Thanks for any help you guys can give!
-Jason Starr-
Jason
I wouldn''t even bother with pathfinding, unless it''s absolutely necessary. The character isn''t on screen so, unless you''re using the path the NPC will take in conjunction with a time elapsed element, just have the NPC appear at the location and then back home at the required times. Only if you''re worried about the character interacting with the player somewhere along the route would you even need to worry about this. If you need to do this you would just have to load the tile data into memory and perform the pathfinding.
Breakaway Games
Breakaway Games
Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development
First things first..3 words for this thread: Artificial Intelligence Forumn(well, at least for the pathfinding stuff)
With that said..i have to disagree with a lot of what machaira says:
the problem is: if your npc is just gonna stay in a room somewhere THEN JUST LEAVE HIM IN THE ROOM and dont deal with AI and paths AND dont say just plop the npc in another area because if he''s offscreen on on right side of your screen and plops on the left side of the screen when u scroll left..your imagination is ruined because u just saw this npc on the other side of map...blah, bad suggestion!..you might as well not even bother with the mindless npc!
As for the main question: collisions, i sugget looking into A* pathfinding in the AI forumn for NPC''s and also search for collision detections..good luck. <br><br><p>aka John M.<br>Never give up. Never surrender!<br></p><br>
With that said..i have to disagree with a lot of what machaira says:
quote: ..just have the NPC appear at the location and then back home at the required times. Only if you''re worried about the character interacting with the player somewhere along the route would you even need to worry about this.
the problem is: if your npc is just gonna stay in a room somewhere THEN JUST LEAVE HIM IN THE ROOM and dont deal with AI and paths AND dont say just plop the npc in another area because if he''s offscreen on on right side of your screen and plops on the left side of the screen when u scroll left..your imagination is ruined because u just saw this npc on the other side of map...blah, bad suggestion!..you might as well not even bother with the mindless npc!
As for the main question: collisions, i sugget looking into A* pathfinding in the AI forumn for NPC''s and also search for collision detections..good luck. <br><br><p>aka John M.<br>Never give up. Never surrender!<br></p><br>
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement