vbGore Free Online RPG Engine

Revolutionizing Visual Basic ORPG Development
It is currently Sat May 18, 2013 10:59 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Coming soon - the brain of the NPC
PostPosted: Sat Sep 02, 2006 9:38 am 
Site Admin

Joined: Fri Jul 14, 2006 4:00 pm
Posts: 11230
Location: Washington
Thanks to Chase working on this algorithm for about a week, we have pathfinding for the NPCs! :D I'm still working on optimizing it to run faster and bug-free, but for the most part, a NPC will run after the player. :wink: Hopefully I'll have it ready to show you guys shortly. :D

I also want to make it so when a NPC spots a player for the first time, an exclimation (or maybe the food one, that'd be sexier) emoticon pops up above the NPC's head. Weeee, tiny insignificant details!! :D

So far, the algorithm takes about 2-4 miliseconds (that is 1/1000th of a second) to find the path from NPC to the player in a little maze when the player is about 20 tiles (walking distance, not absolute distance) away. A lot faster then you thought it was, aye Chase? 8) I think it was just those DoEvents and the way the NPC AI is handled at the time which made it seem so slow.

Edit: Also wanted to add that the time it took is while running the server in the IDE (not compiled) AND having the client on the same computer AND on a piece of crap (600mhz, 16mb gfx card) computer. On a decent dedicated host server, it would be soooooo much faster. 8)

Edit 2: Crap, compiled it takes 0~1 miliseconds. Looks like I will have to run the routine a few times just to make it take longer to get a more accurate result on how my improvements are doing. :lol:


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 10:34 am 
Site Admin

Joined: Sun Jul 30, 2006 4:00 pm
Posts: 1230
Muuuuch better ^^


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 10:37 am 
Source Code Swashbuckler

Joined: Wed Aug 30, 2006 4:00 pm
Posts: 45
Location: Scotland
No idea what most of that means but WOOT! >_>


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 10:38 am 
Site Admin

Joined: Sun Jul 30, 2006 4:00 pm
Posts: 1230
If theres something blocking the npc from getting to you, it can figure it out :)
<-- Edit: I am drinking one of those RIGHT NOW! YEAHY!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 10:42 am 
Source Code Swashbuckler

Joined: Wed Aug 30, 2006 4:00 pm
Posts: 45
Location: Scotland
What if I put a large wall infront of it? HUH??? Like to see it figure that one out....
Edit: ^ I want what he has :cry:


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 10:45 am 
Site Admin

Joined: Sun Jul 30, 2006 4:00 pm
Posts: 1230
As long as there is ONE space for it to get thru, IT WILL MUAHAHAHAHAHA
Or we could just have it lob a fireball over the wall :twisted:


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 10:46 am 
Source Code Swashbuckler

Joined: Wed Aug 30, 2006 4:00 pm
Posts: 45
Location: Scotland
Good thing I dont build my walls with holes then :D
Dam saw the fireball bit..... errr well Ill have a umbrella!! BWUHAHAHA


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 11:05 am 
Site Admin

Joined: Fri Jul 14, 2006 4:00 pm
Posts: 11230
Location: Washington
Basically, pathfinding lets NPCs go from point A to point B, if such a path exists. If no path exist, they dont go anywhere. :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 11:14 am 
Mister Mxyzptlk

Joined: Wed Aug 09, 2006 4:00 pm
Posts: 196
Location: Germany
show a vid plx :o


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 11:57 am 
Site Admin

Joined: Sun Jul 30, 2006 4:00 pm
Posts: 1230
Lol, I spoiled them... Sure, I'll post a newer one after work :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 12:25 pm 
Newbie

Joined: Mon Aug 21, 2006 4:00 pm
Posts: 4
Hmm.. Illutia I know made it so "Mystics" could not abuse the NPC wall trick too bad by teleporting the NPC near the player..


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 12:27 pm 
Site Admin

Joined: Fri Jul 14, 2006 4:00 pm
Posts: 11230
Location: Washington
I remember that - that was a good idea, too. That would probably be something I'd want in a "Custom Features" guide, though. :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 12:38 pm 
Site Admin

Joined: Sun Jul 30, 2006 4:00 pm
Posts: 1230
Yea, thats true, but thats all the npc's do now... :) The ai is tough on the server... imo but oh so worth it


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 2:00 pm 
Site Admin

Joined: Fri Jul 14, 2006 4:00 pm
Posts: 11230
Location: Washington
I am thinking of writing my own collection class to use instead of the VB collections. I have the feeling I could make something faster if I remove all the excess stuff that isn't used, such as keys. This is what makes collection good:

Put Info:
Code:
Collection.Add 1, "Awesome"
Collection.Add 5, "Uber"
Collection.Add 3, "^_^"


To get the info, you just have to call it by its key. Handy, but unused in the path finding, which is why I think a custom collection may work better. :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 2:08 pm 
Site Admin

Joined: Sun Jul 30, 2006 4:00 pm
Posts: 1230
Wha? Lol, you have some explaining to do when I get home tonight :oops:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group