Navigation Tcp-Server for my WoW-Bot based on the TrinityCore MMAP's and Recast & Detour
- Clone this repository
git clone https://github.com/Jnnshschl/AmeisenNavigation.git
- Make sure you got the MMAP's somewhere (you just need the mmaps, no map or vmap shizzle)
- Open the .sln file in Visual Studio
- Compile & start it...
Now there should be a TCP server running on the port you specified (default: 47110).
To generate a path you need to send a serialized PathRequest to this server:
struct PathRequest
{
public Vector3 A { get; set; } // Starting position
public Vector3 B { get; set; } // Target position
public int MapId { get; set; } // your current MapId (Eastern Kingdoms = 0, Kalimdor = 1, ...)
public PathRequest(Vector3 a, Vector3 b, int mapId)
{
A = a;
B = b;
MapId = mapId;
}
}
public struct Vector3
{
public float X { get; set; }
public float Y { get; set; }
public float Z { get; set; }
public Vector3(float x, float y, float z)
{
X = x;
Y = y;
Z = z;
}
}
Serialize this struct with a serializer, for example Newtonsoft Json:
JsonConvert.SerializeObject(stringToSend);
Send it using the C# TcpClient Class as an ASCII string.
After you sent the request you will get the path as a serialized List of Vector3's.
Deserialize this Json with a deserializer, for example Newtonsoft Json:
JsonConvert.DeserializeObject<List<Vector3>>(receivedString);
Either generate them yourself using the generator from TrinityCore
https://github.com/TrinityCore/TrinityCore
or use the ones supplied in this repack, go check it out it's great
If you want to, you can preload specific mmaps on startup, to do that add the following line into the AmeisenNavigation.Wrapper.h
AmeisenNav(String^ mmap_dir)
{
ameisen_nav = new AmeisenNavigation(std::string(string_to_char_array(mmap_dir)));
ameisen_nav->LoadMmapsForContinent(0); // this will preload Eastern Kingdoms
}
❤️ TrinityCore for their MMAP format - https://github.com/TrinityCore/TrinityCore
❤️ Recast & Detour - https://github.com/recastnavigation/recastnavigation