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.

DarkBASIC Professional Discussion / Server side A*...what have I got myself into...

Author
Message
Qqite
16
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Florida, U.S.
Posted: 17th Mar 2011 02:00
Ok so I'm working on my largest project yet: an MMOFPS. It's basically zone-based organized grouping with server side control of just about everything the player does, except for movement.
I'm taking this to the next level...an f'ing huge level.

I am attempting to script in A* that is server side. I'm looking for a CHEAP way of processing pathfinding serverside. My first prototype of the idea is to have every zone have a bumpmap of the zone to have where the NPC can and can't go, then process, via the bumpmap, a path for the NPC. Every so often it will send an update, to the clients near by, the waypoints (the jagged pathfind to the target) to where the NPC will walk. The server will determine where the NPC is via timer and said processed path.

Here is where I'm stuck. I'm stuck with 2D pathfinding (walking to a player 5x 0y away and walkign to a player 5X 1000y away will be the the same time. Ha! That's why, in WoW mobs do tat on terrain.).

Is there a way of making pathfinding over same y-height levels? An example that most people can relate to is like how CoD Zombies will chase you up stairs to anotehr level overtop another room, or in WoW how you can pull mobs over bridges.

Thanks in advance. Sorry for my English.

Ventures of the worlds around us are only limited by imagination.
Wyldhunt
16
Years of Service
User Offline
Joined: 27th Sep 2009
Location: The Dark Side
Posted: 18th Mar 2011 05:01 Edited at: 18th Mar 2011 05:19
http://forum.thegamecreators.com/?m=forum_view&t=114240&b=5
A* dll. Those who have used it said that it worked well.

http://forum.thegamecreators.com/?m=forum_view&t=107374&b=1
A thread discussing A* with some good external links.

http://www.thegamecreators.com/?m=view_product&id=2024
Personally, I use DarkAI. It allows for chasing across bridges and such. It also uses A*.

http://forum.thegamecreators.com/?m=forum_view&t=165271&b=1
Also, you may want to review Omens website. It's a giant tutorial on how to code and set up a pro server/client and MMO. He covers a lot of stuff that people tend to miss the first time they try to make an MMO.
revenant chaos
DBPro Master
19
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 18th Mar 2011 05:33
If you are looking for that kind of complexity, the only way I can think of would be to use a node-based pathfinding system. The idea is the same as standard A*, but instead of "Tiles" you define imaginary points (I call them "Nodes") which are linked together to define a walkable path.

Reasons Node-based Pathfinding is better for 3D-AI:
--------------------------------------------------------
1) No "Unwalkable" tiles to deal with.

2) The total NodeQT represents the complexity of the scene rather than the system's search resolution (typically a speed-optimization, but can be taken to far with poor node/link usage).

3) Links can be created to go directly through the center of doorways

4) The Open list will usually be smaller, so there will be less nodes to consider each cycle.

5) Easily handle multi-floor environments.

6) By linking distant nodes together you can get the algorithm to bypass areas entirely.

7) Can automatically handle multiple, non-connected search areas.

8) To speed it up, you can pre-calculate the costs to travel from one node to another (in the same place you are storing the node links themselves).

9) No jagged paths (but it does produce robot-like paths).

I am sure there are more reasons, but those are off the top of my head.
Wyldhunt
16
Years of Service
User Offline
Joined: 27th Sep 2009
Location: The Dark Side
Posted: 18th Mar 2011 06:23 Edited at: 18th Mar 2011 06:26
Oh, and to answer your question a bit better in case you want to code it all yourself without DLL's, they use multiple maps. Each floor of a building may have its own map. Height is then estimated based upon which map they are using. In outdoor areas, each 20' of elevation may have its own map if you need to keep track of height.
The only time this gets a bit annoying is when you have small ledges, such as a staicase landing that NPC's can walk under. You'd have to make an entire map just for the stair case landing, which may be only a few feet across.
As long as the level designer doesn't make any stairs that they can walk under, there is no issue.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 18th Mar 2011 17:48
If you already have the 2D AI worked out, which it sounds like you have a few options, the server doesn't need to figure out the height. Just send the X and Z to the clients and let the clients figure out the Y based on your ground collision system. They'll have to follow the same rules as your players, so they wont be walking up vertical cliffs, and they'll take damage if they walk over the edge of one..

Just a thought..

Login to post a reply

Server time is: 2026-07-17 17:23:56
Your offset time is: 2026-07-17 17:23:56