Post-Apocalyptic RPG forums

Development => Programming => Topic started by: Gaspard on January 09, 2011, 10:01:29 PM



Title: Removing / Fixing the NPC wandering code
Post by: Gaspard on January 09, 2011, 10:01:29 PM
Hi guys, would it be a very big task to remove the code that makes all of the NPCs walk around randomly around the big map ?
It is very cumbersome to test talking to NPCs when you have to hunt for them over the big screen.

The good scenario would be to have only one NPC walk around on the "Farm" map (that is the smaller map where you teleport when you use the door) to showcase NPC movement and all the rest of the NPCs to be stationary for easy interaction with them.

If it is not too difficult and/or time-consuming it would be very much appreciated : )


Title: Re: Removing / Fixing the NPC wandering code
Post by: Q_x on January 09, 2011, 10:14:37 PM
Sorry for being totally unrealistic, but I'm not agains randomly walking PC's. Let them maybe stick to a place if this is important to fix eg. for writers, but let some of them still wander...
What I would say to fix the problem is implementing AI, at least simple one.


Title: Re: Removing / Fixing the NPC wandering code
Post by: Gaspard on January 09, 2011, 10:23:45 PM
As barra said, and I agree with him here - is that implementing an AI should not be the goal here.

I guess I stated my request unclearly - I'm asking for (hopefully) something far more simple than any (simple or complex) AI - I'm asking for most of the NPCs to be stationary, but one or two of them still walking and strictly on the farm map as that is a smaller one and finding the NPCs would not be such a difficult pain in the ass, if you pardon me my French


Title: Re: Removing / Fixing the NPC wandering code
Post by: zenbitz on January 10, 2011, 03:28:27 AM
Latest SVN has a tiny little patch that makes this easier.  I just slowed down how often they go from "stand still" to random walk.
It might be a little more realistic to randomize the delay for each object so that they are not totally synchronized.

Try it.

It would very easy to make it so that no NPCs ever move (just comment out one line), but it would take effort to set up some different interfaces so that some PCs were "wanderer" types and some were "static".   Might as well wait for the AI to get developed.


Title: Re: Removing / Fixing the NPC wandering code
Post by: Gaspard on January 10, 2011, 06:55:54 AM
Thanks, it already improves the chances of hitting their sprites with the mouse cursor .)


Title: Re: Removing / Fixing the NPC wandering code
Post by: dracre on January 11, 2011, 12:19:30 AM
How about you set a radius (number of tiles) for wandering, and when the npc reaches it, he will start walking towards its center.  :o


Title: Re: Removing / Fixing the NPC wandering code
Post by: zenbitz on January 11, 2011, 07:58:53 AM
DrAcre- well, this will presumably be replaced with a an actual scripting/AI mechanism.  So while you idea is at least as good as the others, it's not worth just bolting on.   We just wanted to make it a little bit easier to actually go through the quests for now.



Title: Re: Removing / Fixing the NPC wandering code
Post by: Technomage on January 12, 2011, 11:39:29 PM
Yup, once we get AI scripting up and running we'll need to think about various behavior algorithms. But dracre brings up a good point: we definitely don't want NPCs to wander off into the wilderness! Just something to keep in the back of our minds.