Jump to content

MMaps Redux


Guest auntieMangos

Recommended Posts

  • Replies 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

The core should compile just like normal.

However, you can only compile the generator on windows. I need help from a linux coder to redo the makefile.

Ok you mean if you dont have a someone for create a good makefile for linux ,we can't use the mmaps? or i compile the generator on windowsand generate mmaps and i put them on the core ? But how the core recognize the mmaps?

Thanx again for reponse.

Link to comment
Share on other sites

Ok you mean if you dont have a someone for create a good makefile for linux ,we can't use the mmaps? or i compile the generator on windowsand generate mmaps and i put them on the core ? But how the core recognize the mmaps?

Thanx again for reponse.

when you pull the mmaps branch it adds some informations about them in the .cpp files ,it will detect mmaps automaticly after compile

Link to comment
Share on other sites

mmaps are static at the moment.

Some instances require dynamic mmaps though (like the bridge in gun'drak, or the floor in the coliseum).

There are five ways to make it work, but I haven't decided which is better.

  • * Generate two versions of these maps, one without the GO and one with the GO
    This is kind of a hacky way to do it.
    * Generate a map with all GOs spawned, but flag the GO polys in a special way.
    I haven't even begun to look at how to flag specific polys, but I like this way best so far.
    * Define off-mesh connections.
    There is no way to automate this.
    * Rebuild the navmesh tiles at runtime.
    Navmesh generation is extremely time consuming.
    However, time is dependant on tile size. If the tiles are small, and the GO doesn't span across a lot of tiles, it might be do-able as long as rebuilding didn't happen that often.
    * Disable mmaps on the maps that have dynamic GOs as walkable surfaces.
    Yes, it defeats the purpose. But it's the easy thing to do. :P

And if a GO exists in only one phase, it will either affect all of them or none of them. But, I'm having enough 'fun' getting the generator finished. Don't want to think too much about this at the moment.

FYI, just want to do a bit of housekeeping on my local repo, then I'll push new generator.

Next step is making core load/unload tiles into navmesh at the same time it loads/unloads grids.

Link to comment
Share on other sites

I had crashes with 0004932.mmap

mmap branch

Revision: * * 9856 *
Date 29:5:2010. Time 12:55 
//=====================================================
*** Hardware ***
Processor: AMD Athlon(tm) 64 Processor 3000+
Number Of Processors: 1
Physical Memory: 1048048 KB (Available: 34876 KB)
Commit Charge Limit: 3048368 KB

*** Operation System ***
Microsoft Windows XP Professional Service Pack 3 (Version 5.1, Build 2600)

//=====================================================
Exception code: C0000005 ACCESS_VIOLATION
Fault address:  00880510 01:0047F510 Y:\\mangos\\mangosd.exe

Registers:
EAX:00000000
EBX:7315E408
ECX:72FE7DC0
EDX:00000000
ESI:00000000
EDI:008E9B30
CS:EIP:001B:00880510
SS:ESP:0023:09286480  EBP:09286494
DS:0023  ES:0023  FS:003B  GS:0000
Flags:00010297

Call stack:
Address   Frame     Function      SourceFile
00880510  00000000  PathInfo::getPathPolyByPosition+40
008811CD  00000000  PathInfo::Update+28D
0070118F  00000000  TargetedMovementGeneratorMedium<Creature,ChaseMovementGenerator<Creature> >::_setTargetLocation+28F
00700D86  00000000  TargetedMovementGeneratorMedium<Creature,ChaseMovementGenerator<Creature> >::Update+4B6
0047CEE7  00000000  MovementGeneratorMedium<Creature,ChaseMovementGenerator<Creature> >::Update+17
00476CEE  00000000  MotionMaster::UpdateMotion+FE
00480206  00000000  Unit::Update+426
004BE355  00000000  Creature::Update+725
004FB4DF  00000000  MaNGOS::ObjectUpdater::Visit+6F
004FB462  00000000  VisitorHelper<MaNGOS::ObjectUpdater,Creature>+12
004FAC80  00000000  VisitorHelper<MaNGOS::ObjectUpdater,Creature,TypeList<DynamicObject,TypeList<Corpse,TypeNull> > >+10
004FA7F3  00000000  VisitorHelper<MaNGOS::ObjectUpdater,GameObject,TypeList<Creature,TypeList<DynamicObject,TypeList<Corpse,TypeNull> > > >+23
004FA170  00000000  VisitorHelper<MaNGOS::ObjectUpdater,TypeList<GameObject,TypeList<Creature,TypeList<DynamicObject,TypeList<Corpse,TypeNull> > > > >+10
004F6A9F  00000000  Map::Visit<MaNGOS::ObjectUpdater,TypeMapContainer<TypeList<GameObject,TypeList<Creature,TypeList<DynamicObject,TypeList<Corpse,TypeNull> > > > > >+CF
004F12A7  00000000  Cell::Visit<MaNGOS::ObjectUpdater,TypeMapContainer<TypeList<GameObject,TypeList<Creature,TypeList<DynamicObject,TypeList<Corpse,TypeNull> > > > > >+67
004D934B  00000000  Map::Update+33B
006A5E48  00000000  MapManager::Update+128
00640C36  00000000  World::Update+7A6
0045637E  00000000  WorldRunnable::run+8E
008E9B49  00000000  ACE_Based::Thread::ThreadTask+19
002A1B84  00000000  __WSAFDIsSet+FFFFFFFFFFFCCB4C
78543433  00000000  _endthreadex+44
785434C7  00000000  _endthreadex+D8
7C80B729  00000000  GetModuleFileNameA+1BA

Call stack:
Address   Frame     Function      SourceFile
7C90E514  00000000  KiFastSystemCallRet+0
7C802542  00000000  WaitForSingleObject+12
00259C04  00000000  __WSAFDIsSet+FFFFFFFFFFF84BCC
002C64AA  00000000  __WSAFDIsSet+FFFFFFFFFFFF1472
002C266F  00000000  __WSAFDIsSet+FFFFFFFFFFFED637
0065966A  00000000  WorldSocketMgr::Wait+4A
73456344  00000000  0000:00000000 
73456344  00000000  0000:00000000 
6C696146  00000000  

Link to comment
Share on other sites

I use some uggly hacks to fix some crash :

first (already posted)

@@ -160,11 +160,11 @@ bool TargetedMovementGeneratorMedium<T,D>::Update(T &owner, const uint32 & time_
        return true;
    }

    if (i_destinationHolder.UpdateTraveller(traveller, time_diff, false))
    {
-        if (!IsActive(owner))                               // force stop processing (movement can move out active zone with cleanup movegens list)
+        if (!IsActive(owner) || !i_path)                    // force stop processing (movement can move out active zone with cleanup movegens list)
            return true;                                    // not expire now, but already lost

        // put targeted movement generators on a higher priority
        if (owner.GetObjectSize())
            i_destinationHolder.ResetUpdate(50);

second :

@@ -17,7 +17,7 @@ PathInfo::PathInfo(WorldObject* from, const float x, const float y, const float

dtPolyRef PathInfo::getPathPolyByPosition(float x, float y, float z)
{
-    if(!m_navMesh)
+    if(!m_navMesh || !m_pathPolyRefs)
        return 0;   // navmesh isn't loaded

    float distance;     // not used
@@ -313,6 +313,9 @@ void PathInfo::Update(const float destX, const float destY, const float destZ)

    if(startOffPath)
    {
+        if(!m_pathPolyRefs)
+            return;
+
        bool adjacent = false;
        int i;
        for(i = 0; i < DT_VERTS_PER_POLYGON; ++i)
@@ -349,6 +352,9 @@ void PathInfo::Update(const float destX, const float destY, const float destZ)

    if(endOffPath)
    {
+        if(!m_pathPolyRefs)
+            return;
+
        bool adjacent = false;
        int i;
        for(i = 0; i < DT_VERTS_PER_POLYGON; ++i)

Also I commented all sLog.outError(XXX); related to mmaps to stop flood console...

Link to comment
Share on other sites

Ok, finally satisfied that its ready to be put to larger-scale testing and critique.

mmap generator re-written:

  • * using Lynx3d's vmap_rewrite
    * using tiled navMeshes

The generator is stable, but I haven't tested all of the maps. I know that some of them are imperfect, but I was generally happy with the results.

I generated 1271 map tiles, and it took about 13 hours at 2.4 ghz, one thread only.

Core updated

  • * also using Lynx3d's vmap_rewrite
    * dynamic navmesh tile loading/unloading
    * updated version of recastnavigation API
    * several bug fixes
    * no more console flood

added RecastDemo

Helped a lot with debugging my code, including it for those that are interested.

It will be more useful once I add a way to modify the generator settings at runtime.

Generator Todo:

  • * add runtime settings (config file or command line parameters)
    * use liquid info when building mmaps
    * prevent potential tile index inconsistencies
    * find a way to 'poke holes' in the heighmap mesh where there should be entrances (caves, stairs leading underground, etc)

Core Todo:

  • * load navmesh only into the parent map of instances
    * other stuff listed on my first post in this thread

Again, this is still a development thread. Please post only bug reports, feedback, and suggestions.

Please checkout the code from the mmaps_rewrite branch of git://github.com/faramir118/mangos.git or browse at github

You can look at the list of maps here, and download them all here.

These are little-endian binary data files.

They go in the mmaps directory in your mangos binary directory.

I can't test all of them on my own, so I offer no guarantees that they all work well.

I will update my initial post to reflect these changes.

Link to comment
Share on other sites

The new vmap extractor/assembler aren't very good at letting you know they're working. I would just give it some time, it should be done after a bit.

I'll ask Lynx to add a progress indicator of some sort.

As for the 'size 0' warnings, that's normal and not an error.

Link to comment
Share on other sites

faramir118, thank you for your dedicated efforts to make a new map extractor. The one currently supplied with MaNGOS has gotten a bit long in the tooth. Combined with vmap_rewrite, I'm greatly looking forward to the vastly improved terrain handling. mmap and vmap v3 (as it ought to be named when accepted into the core), are fundamental fixes that improve functionality of the entire play experience and it has been long overdue.

I take it you need testers to provide feedback from the numerous maps before any further progress can be made in developing or refining the code?

I'm completely lost in regards to generating the maps. I understand you must supply the map number and then the X and Y coordinates, but I have absolutely no idea how to obtain the proper values for X and Y. Will any X and Y coords from the specified map work or do you need the origin?

A simple text list of all maps and their X,Y coordinates would be most helpful. Then all anyone would need to do is plug that data into the generator or batch file.

Link to comment
Share on other sites

A simple text list of all maps and their X,Y coordinates would be most helpful. Then all anyone would need to do is plug that data into the generator or batch file.

I got the coordinates X and Y based on the name file maps

Example:

map   X    Y
000   23   32.map

created a bat file that runs the generator with the parameters.

static void Main(string[] args)
{
   Console.Write("Enter the file size (in bytes) that must pass: ");
   int size = int.Parse(Console.ReadLine());

   using (StreamWriter sw = new StreamWriter("mmaps_convert.bat", false, Encoding.ASCII))
   {
       foreach (var file in new DirectoryInfo("maps").GetFiles("*.map").Where(n => (n.Length > size)))
       {
           string str = String.Format("generator.exe {0} {1} {2}", file.Name.Substring(0, 3), file.Name.Substring(3, 2), file.Name.Substring(5, 2));
           sw.WriteLine(str);
           Console.WriteLine(str);
       }
   }

   Console.ReadLine();
}

Link to comment
Share on other sites

rev more make build files

i don't know if i done something wrong?

1) merged your branch and compiled without problems

2) placed Lynx3d vmaps and downloaded mmaps in appropriate folders

3) runed server and ported to naxxramas

4) targeted first NPC

5) typed .debug mmap path

it shown list of 3 points and split of seconds and got crash

Revision: * * 10027 59ecc6d1017e7c7411daa946f41f56b144be2944
Date 5:6:2010. Time 13:6 
//=====================================================
*** Hardware ***
Processor: Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz
Number Of Processors: 2
Physical Memory: 2095532 KB (Available: 715888 KB)
Commit Charge Limit: 2986876 KB

*** Operation System ***
Microsoft Windows XP Professional Dodatek Service Pack 3 (Version 5.1, Build 2600)

//=====================================================
Exception code: C0000005 ACCESS_VIOLATION
Fault address:  0094AF20 01:00549F20 D:\\Server 3.3.3a\\mangosd.exe

Registers:
EAX:00000000
EBX:74A6A7A0
ECX:709EC580
EDX:0A2521A8
ESI:0A25F820
EDI:0093FEA0
CS:EIP:001B:0094AF20
SS:ESP:0023:0A24CCDC  EBP:0A24CE20
DS:0023  ES:0023  FS:003B  GS:0000
Flags:00010202

Call stack:
Address   Frame     Function      SourceFile
0094AF20  00000000  dtNavMesh::findStraightPath+20
008833E1  00000000  ChatHandler::HandleDebugMoveMapCommand+3E1
0059CA5C  00000000  ChatHandler::ExecuteCommandInTable+2AC
0059C8C8  00000000  ChatHandler::ExecuteCommandInTable+118
0059D17B  00000000  ChatHandler::ParseCommands+18B
0090977F  00000000  WorldSession::HandleMessagechatOpcode+54F
00633B70  00000000  WorldSession::Update+120
006449F3  00000000  World::UpdateSessions+C3
00642F6E  00000000  World::Update+3DE
004568BE  00000000  WorldRunnable::run+8E
0093FEB9  00000000  ACE_Based::Thread::ThreadTask+19
002F1B84  00000000  __WSAFDIsSet+FFFFFFFFFFFCCB4C
78543433  00000000  _endthreadex+44
785434C7  00000000  _endthreadex+D8
7C80B713  00000000  GetModuleFileNameA+1B4

Call stack:
Address   Frame     Function      SourceFile
7C90E4F4  00000000  KiFastSystemCallRet+0
7C802542  00000000  WaitForSingleObject+12
002A9C04  00000000  __WSAFDIsSet+FFFFFFFFFFF84BCC
003164AA  00000000  __WSAFDIsSet+FFFFFFFFFFFF1472
0031266F  00000000  __WSAFDIsSet+FFFFFFFFFFFED637
0066CF3A  00000000  WorldSocketMgr::Wait+4A
747E3C44  00000000  0000:00000000 
747E3C44  00000000  0000:00000000 
6C696146  00000000  

Link to comment
Share on other sites

Does anyone else has problems compiling the new vmap extractor in VS90? Something about stdint.h missing.

EDIT: I found missing stdint.h in a different folder, but when I tried to copy it, I got a whole bunch of LNK2005 errors about recurrent function definitions.

EDIT2: Never mind all this crap above. I found the source of the problem and it was local.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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