Jump to content

faramir118

Members
  • Posts

    541
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by faramir118

  1. Basically, there are 4 parts:

    1. Framework which represents conditions.
      These come in the form of methods like HasAura, HasItem, etc
    2. An expression tree representation that we can store in the database.
      In our case, we probably want SQL insert statements
    3. Conversion from the former to the latter
    4. Mangos Core implementation to rebuild and execute the expression tree

    [h]Database Structure[/h]

    Conditions will go in a table, similar to Schmoo's design but with a small difference (my approach sacrifices space for simplicity):

    (id, Type, Val1, Val2)

    eg:

    (0, 1, 1234, 1)

    (1, 6, 67, 0)

    (2, -2, 0, 1)

    (3, 1, 1235, 1)

    (4, 6, 469, 0)

    (5, -2, 3, 4)

    (6, -1, 2, 5)

    Where

    Type = -2 := AND

    Type = -1 := OR

    From the rows above, we can build condition 6 by repeated expansion of each expression:

    6

    2 OR 5

    (0 AND 1) OR (3 AND 5)

    ((Aura 1234 idx 1) AND (Team Horde)) OR ((Aura 1235 idx 1) AND (Team Alliance))

    [h]Code Format[/h]

    A very expressive, extendible way to represent the above condition expression in C#:

    (c.HasAura(1234, 1) && c.IsHorde()) || (c.HasAura(1235, 1) && c.IsAlliance())

    [h]Conversion[/h]

    Basically, the database developer will just need to write some C# code, and the framework will convert it into a suitable format.

    I have pushed the code to http://github.com/faramir118/MangosUtil/ - it works with MonoDevelop and Visual Studio 2010. It demonstrates that complex logic is easily parsed and formatted (currently not the format we need)

    For an example, just look at https://github.com/faramir118/MangosUtil/blob/master/MangosUtil/Runner.cs. You can step through with the debugger if you wish to learn how it works.

  2. If you have tile unload enabled, and only 1-2 players, you don't even need 1gb to run mangos, regardless of what other options you enable.

    If you have tile unload disabled, mmaps will add well over a 1gb to your peak memory requirement. I think it's somewhere around 1.5gb on disk of just data, which doesn't include runtime allocations for navmesh and pathfinding.

    If you have a small server, just leave tile unload enabled.

  3. use this:

    telnet address port

    replace address with your server's IP or hostname

    replace port with the port you have configured for RA

    follow the prompts to login (push enter to send)

    after you are logged in, just use it like you would the mangos console

  4. During development, only MovementGenerators needed access to the path. Now things are different, with MoveSplineInit using path also and other development trying to take advantage of pathfinding (and also trying to reduce performance impact with caching or reuse of existing path).

    Maybe it makes more sense now to have the path as a member of Unit, and let all of these other things access it?

  5. No fel reavers in outland :(

    Fel Reavers are there, just that they are static, don't have waypoints implemented.

    Also, visibility distance doesn't work on mangos like it should. On official servers, fel reavers are visible from half way across a zone. This is not a simple issue.

  6. Something like this:

    bool Creature::CanReach(Unit* pVictim)
    {
       PathFinder path(this);
    
       float x, y, z;
       pVictim->GetPosition(x, y, z);
       path.calculate(x, y, z, false);
    
       return path.getPathType() & PATHFIND_NORMAL;
    }
    

    Should probably first check a few other conditions (on same map?, in same instance?, is pathfinding enabled?, etc)

    Also, since pathfinding is expensive, you may want to attempt to use the existing path from movement generator, if possible

    • check if current movement generator is chase or follow
    • cast it to targeted movement generator, check if its target is pVictim
    • if both previous checks succeed, use GetMotionMaster()->operator->()->IsReachable()
  7. Sorry for being slow to respond, lots of work stuff recently...

    contrib/mmap with -DACE_USE_EXTERNAL works for me after some copy paste (untested with 'internal' ace):

    https://gist.github.com/1721754

    When compiling contrib/mmap, MoveMapSharedDefines.h seems to have a bad include for DetourNavMesh:

    In file included from /Users/a/Projects/mangos/mangos/contrib/mmap/src/TerrainBuilder.h:24,
                    from /Users/a/Projects/mangos/mangos/contrib/mmap/src/MapBuilder.h:26,
                    from /Users/a/Projects/mangos/mangos/contrib/mmap/src/generator.cpp:20:
    /Users/a/Projects/mangos/mangos/contrib/mmap/../../src/shared/../../src/game/MoveMapSharedDefines.h:23:62: error: ../recastnavigation/Detour/Include/DetourNavMesh.h: No such file or directory
    

    All other files under src/game include "../../dep/recastnavigation/Detour/Include/DetourNavMesh.h", so MoveMapSharedDefines.h is probably wrong in general.

  8. MoveMapGen.exe 562 --tile 31,20 --debugOutput true --offMeshInput offmesh.txt

    mapid (562 is that arena's map id)

    tile (31,20 is the tile that has the ropes on it)

    debug output for RecastDemo, which can be found under dep/recastnavigation. Use it to view the navmesh. (this command is not mandatory for adding offmesh connections, just useful for debugging)

    offmesh file when used, it will rebuild map tiles (from scratch) with offmesh connections. it creates tiles just like a regular build, so they will be placed in the same spot (and overwrite existing files, if present)

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use