Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 05-25-2003, 05:53 AM
jbb
Hill Giant
 
Join Date: Mar 2003
Location: UK
Posts: 242
Default Pathing questions

First of all I had a few improvements to the output prints. I'd tidied up a few and made some a bit more useful. Didn't do much. But then had big problems doing a cvs update last week (I think the repository changed a lot!) and managed to delete all my changes while trying to fix my local copy. No big deal. I didn't lose anything very useful.

Anyway, instead I decided to look how pathing worked. It looked like when you attack something it always heads directly to you regardless of geography. So I looked at the code and it's clear that there is only code to do that.

So I was wondering why? Is it simply that nobody has had time to write anything better yet? Is someone working on improving it?


My thought was that it should be fairly simple to define a list of xyz coordinates for path points for a zone, and then a list of pairs of path points that a mob is allowed to travel between.

And then when a mob is attacked and wants to get from A to B and and the closest path points to A and B are two different points to get the mob to travel along the lines between path points as defined in the 2nd table.

That would seen to result in movement similar to EQlive now and would be fairly quick and easy to get working. So I was wondering why nobody has done this? Is it harder than it looks? Is anyone working on this kind of thing? Or have I missed something major?
Reply With Quote
  #2  
Old 05-25-2003, 10:28 PM
Bigpull
Discordant
 
Join Date: Feb 2003
Posts: 305
Default

It's good practice to keep a pristine cvsdir and a working copy, as you just saw.

Anyways.. Pathing is all there, whats missing is either manual grid entrys or a system to fully parse the .map files and attach Mobs to a grid "region" based on on the area of the zone they're in. The latter is prefered as it's needed for fear pathing aswell
Reply With Quote
  #3  
Old 05-25-2003, 10:30 PM
jbb
Hill Giant
 
Join Date: Mar 2003
Location: UK
Posts: 242
Default

Ok, thanks for advice.

I see code to implement pathing for mobs walking around but it doesn't look like there is any to pick the best route to get to a thing they want to attack?

Have I missed that?
Reply With Quote
  #4  
Old 05-26-2003, 07:37 PM
jbb
Hill Giant
 
Join Date: Mar 2003
Location: UK
Posts: 242
Default

When you say ".map files" do you mean the maps that come with the game? If you do I think that would be really really hard to come up with proper paths for mobs from this.

As an experiment I wrote some code so that when you attacked a mob in west freeport it would attempt to find a route to the player using a hard coded network of pathing points including going up onto the walkways around the entrance and back into a few of the buildings actually using the doors. It seemed to work quite well and feel similar to the offical servers. Of course you'd need a few hundred pathing points to cover all of west freeport. I just did about 50 close to the entrance, but it seems to work well.
Reply With Quote
  #5  
Old 05-27-2003, 01:49 AM
Edgar1898
Senior Member
Former EQEmu Developer
Current EQ2Emu Lead Developer
 
Join Date: Dec 2002
Posts: 1,065
Default

Thats interesting, I was going to attempt to do the same thing, although I was also going to add blanket areas (large areas in open zones with no obstables in between, where a mob can roam freely). Post what you have so far, I would like to get this done but I dont want to code something thats already done, that would be a waste of time :/
__________________
Lethal Encounter
Reply With Quote
  #6  
Old 05-27-2003, 02:20 AM
jbb
Hill Giant
 
Join Date: Mar 2003
Location: UK
Posts: 242
Default

My code is very simple - and has hand coded coordinates for the gate area of freeportw hard coded into the MobAI.cpp file rather than a database. And it does a big recursive search through the links between the path points so wouldn't scale very well but I know how to improve that but haven't had any time, but I'll post what I've got anyway (but it won't be until later on today when I get home)

If you want to have a try you should be able to make a character on my server (It's called Jbb Test Server) or something. Start in freportw zone. Stand in the middle of the bridge over the gate and annoy one of the guards below. They should run round and up towards where you are. I've only put in any paths as far as the nfreeport zone and a little way into the city.

And the mob is supposed to detect when it's already at the closest pathing point to it's target and revert back to heading directly for it - But I seem to have broken that in the latest code.
Reply With Quote
  #7  
Old 05-27-2003, 05:06 AM
Edgar1898
Senior Member
Former EQEmu Developer
Current EQ2Emu Lead Developer
 
Join Date: Dec 2002
Posts: 1,065
Default

I'm going to make a table to contain the paths so far I have:

Table Pathing
+-------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+----------------+
| type | bigint(20) | | PRI | NULL | auto_increment |
| zone | varchar(20) | | | NULL | |
| p1x | float | | | 0 | |
| p1y | float | | | 0 | |
| p1z | float | | | 0 | |
| p2x | float | | | 0 | |
| p2y | float | | | 0 | |
| p2z | float | | | 0 | |
| p3x | float | | | 0 | |
| p3y | float | | | 0 | |
| p3z | float | | | 0 | |
| p4x | float | | | 0 | |
| p4y | float | | | 0 | |
| p4z | float | | | 0 | |
+-------+-------------+------+-----+---------+----------------+

Where type is the type of the path (1 being a point, 2 being a wide open grid) and p2-p4 are only used if type is 2. (4 points of the square) This will be loaded at spawn time and all spawns will use it. Then, adding wander mobs will be trivial, you can just tell the mob how far to wander. Let me know what you think, if any db fields need to be added/changed.
__________________
Lethal Encounter
Reply With Quote
  #8  
Old 05-27-2003, 06:45 AM
jbb
Hill Giant
 
Join Date: Mar 2003
Location: UK
Posts: 242
Default

Well I stored two "tables". The first one was
(id, zone, x, y, z)

and the 2nd contained connections between pathing points that a mob can move between.

(zone, first_id, second_id)

As I said, I'd only done a quick hack and the tables were just arrays in the source code but I'll upload what I've got later.
Reply With Quote
  #9  
Old 05-27-2003, 06:51 AM
Edgar1898
Senior Member
Former EQEmu Developer
Current EQ2Emu Lead Developer
 
Join Date: Dec 2002
Posts: 1,065
Default

hmm mobs that fly will have to be flagged as such so they will ignore the pathing, otherwise we will have a bat that runs up the stairs :P
__________________
Lethal Encounter
Reply With Quote
  #10  
Old 05-27-2003, 06:54 AM
jbb
Hill Giant
 
Join Date: Mar 2003
Location: UK
Posts: 242
Default

Hmm, but bats *do* fly up the stairs in normal eq. They just seem to have a hight offset
Reply With Quote
  #11  
Old 05-27-2003, 06:57 AM
Edgar1898
Senior Member
Former EQEmu Developer
Current EQ2Emu Lead Developer
 
Join Date: Dec 2002
Posts: 1,065
Default

they do? so if a player cast a spell on a bat on live, the bat would fly to the stairs, go up the stairs, down the ledge and then attack the player?
__________________
Lethal Encounter
Reply With Quote
  #12  
Old 05-27-2003, 07:04 AM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

I believe they do, I think they follow the same pathing... If I remember correctly (and it's been a long time), it worked this way when I would kite flying mobs... They'll still path exactly the same way as a ground mob...
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
  #13  
Old 05-27-2003, 07:09 AM
Edgar1898
Senior Member
Former EQEmu Developer
Current EQ2Emu Lead Developer
 
Join Date: Dec 2002
Posts: 1,065
Default

Hmm I never seemed to notice that :P seems wierd that a flying mob couldnt just fly over the small ledge and attack
__________________
Lethal Encounter
Reply With Quote
  #14  
Old 05-27-2003, 11:53 AM
DeletedUser
Fire Beetle
 
Join Date: Sep 2002
Posts: 0
Default

Well.. they don't actually fly. They just look like their flying, because the only visibility of a mob is the top part of it. If you change your model to your bat, you still have your legs, you just can't seem them.

And the past week I was fighting sol b bats on live, they'll even "jump" into the lava which is where the kobolds and things go to run when they are low on health
Reply With Quote
  #15  
Old 05-27-2003, 10:57 PM
jbb
Hill Giant
 
Join Date: Mar 2003
Location: UK
Posts: 242
Default

I tried to post a copy of my modified MobAI.cpp here but it won't let me add an attachment and it's too big to put in the message.

So I've linked to a copy of MobAi.cpp here

Please note that this is just code I was playing about with to see if I could get anything working and certainly not of a quality for using for anything real. I only posted it in case it's useful to anyone. It probably won't compile without the changes to some other files too which I'll try to sort out and do properly soon.


Most of the new code (there isn't much) and the hacked freeport entrance path point table is at the top. I modified AI_process() to call DoMovement() instead of just heading towards the target directly.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:22 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3