Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Looking for some answers

Author
Message
Sharky
18
Years of Service
User Offline
Joined: 29th Dec 2005
Location:
Posted: 7th Feb 2006 11:37
I am pretty new to DB. I have programmed in Basic before and am pretty old school since I wrote programs on the commodore vic 20's and 64's. What I am looking for an answer to simply is this. How would one go about programming the pathing for an NPC. Like I have seen in Everquest or WoW how some mobs will walk a particular path and others roam in one specific area. I am pretty much trying to get into game programming and want to create a small RPG to get my feet wet, but I have no clue as how to program for the pathing of the mobs. If anyone could shed some light on this subject it would be much appreciated.
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 7th Feb 2006 13:28
One technique that can be used for 'wandering' is to find a spheric area around an object, then position a hidden object somewhere in that sphere, then have the monster point towards that object and move to it, the hidden object repositions itself whenever it is met.


Join Our Forums and get game updates faster!
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 7th Feb 2006 16:23 Edited at: 7th Feb 2006 16:24
or you could do something like:

have your npc move to different points that you've selected.

if npcstate=10
`move to pt 1 here
endif

remstart
then set some kind of condition here for if the npc gets to
pt 1 or how long u want them to wander toward that pt like:
remend

if npc gets to xyz
npcstate=20`they either go to a different pt or are idle for
a while
endif

endif

WarGoat
20
Years of Service
User Offline
Joined: 19th Sep 2004
Location: Montreal
Posted: 8th Feb 2006 03:02
it's not so hard. What I've done myself is, I've putted a function that make an invisible square(MinX, MinZ, MaxX, MaxZ) If the object is in the square, putt a rnd to see if it is turning, or moving. If turning, then decide, left or right. if moveing, move the object. if the object is trying to go out of the invisible square, then move him back and make him turn around so he can take another move. Maybe be a little confusing, but it work.


Windows XP,pentium IV, 3.0 MGZ, 1024 mb memory, 256 mb video card ATI Radeon XPRESS 200 'sett squadron back on the assault'

Login to post a reply

Server time is: 2024-11-27 05:39:27
Your offset time is: 2024-11-27 05:39:27