Jump to content

[10167] vmap rewrite


Auntie Mangos

Recommended Posts

Maps without terrain (no ADT files) only consist of a single WMO (unless they are just dummy maps).

MaNGOS' map code doesn't seem to care if a map is tiled or not, it always creates grids and requests vmap loading for it, but the WMO is already loaded at StaticMapTree::InitMap().

So the actual tile coords are ignored, vmap code only keeps track of the grids that requested a vmap to know when it can be unloaded again.

Link to comment
Share on other sites

  • Replies 298
  • Created
  • Last Reply

Top Posters In This Topic

compile errors with latest Lynx3d repo

1>------ Build started: Project: shared, Configuration: Release Win32 ------
1>Extract revision
1>Compiling...
1>MapTree.cpp
1>BIH.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\\..\\..\\src\\shared\\vmap\\BIH.cpp': No such file or directory
1>c:\\mang\\dep\\ACE_wrappers\\ace/OS_NS_string.inl(222) : warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details.
1>        H:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\include\\string.h(207) : see declaration of 'strdup'
1>c:\\mang\\dep\\ACE_wrappers\\ace/OS_NS_stdlib.inl(310) : warning C4996: 'putenv': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _putenv. See online help for details.
1>        H:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\include\\stdlib.h(864) : see declaration of 'putenv'
1>c:\\mang\\dep\\ACE_wrappers\\ace/OS_NS_unistd.inl(59) : warning C4996: 'access': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _access. See online help for details.
1>        H:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\include\\io.h(303) : see declaration of 'access'
1>c:\\mang\\dep\\ACE_wrappers\\ace/OS_NS_unistd.inl(131) : warning C4996: 'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _chdir. See online help for details.
1>        H:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\include\\direct.h(127) : see declaration of 'chdir'
1>c:\\mang\\dep\\ACE_wrappers\\ace/OS_NS_unistd.inl(156) : warning C4996: 'rmdir': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _rmdir. See online help for details.
1>        H:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\include\\direct.h(129) : see declaration of 'rmdir'
1>c:\\mang\\dep\\ACE_wrappers\\ace/OS_NS_unistd.inl(377) : warning C4996: 'getcwd': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _getcwd. See online help for details.
1>        H:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\include\\direct.h(121) : see declaration of 'getcwd'
1>c:\\mang\\dep\\ACE_wrappers\\ace/OS_NS_unistd.inl(983) : warning C4996: 'swab': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _swab. See online help for details.
1>        H:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\include\\stdlib.h(865) : see declaration of 'swab'
1>c:\\mang\\dep\\ACE_wrappers\\ace/OS_NS_unistd.inl(1127) : warning C4996: 'unlink': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _unlink. See online help for details.
1>        H:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\include\\stdio.h(301) : see declaration of 'unlink'
1>..\\..\\src\\shared\\vmap\\MapTree.cpp(317) : warning C4018: '<' : signed/unsigned mismatch
1>c:\\mang\\src\\shared\\vmap\\maptree.cpp(322) : error C4716: 'VMAP::StaticMapTree::UnloadMap' : must return a value
1>Build log was saved at "file://c:\\mang\\win\\VC90\\shared__Win32_Release\\BuildLog.htm"
1>shared - 2 error(s), 9 warning(s)

Link to comment
Share on other sites

as i understand it's related to latest changes with BIH. I was reverted this in my repo to be able compile again...

also there is a typo with

bool StaticMapTree::UnloadMap(VMapManager2 *vm)

should be

void StaticMapTree::UnloadMap(VMapManager2 *vm)

Thanks, that prototype was indeed unintended...classy copy&paste mistake.

About BIH.cpp not found, i'm pretty sure i did not forget to commit it, but maybe i updated one of the VS project files incorrectly...need more info if it still happens.

Link to comment
Share on other sites

some variabletype mismatch warnings shown by VC90

diff --git a/src/shared/vmap/MapTree.cpp b/src/shared/vmap/MapTree.cpp
index 00923bd..8c77ee1 100644
--- a/src/shared/vmap/MapTree.cpp
+++ b/src/shared/vmap/MapTree.cpp
@@ -317,7 +317,7 @@ namespace VMAP
        for (loadedSpawnMap::iterator i = iLoadedSpawns.begin(); i != iLoadedSpawns.end(); ++i)
        {
            iTreeValues[i->first].setUnloaded();
-            for (int refCount = 0; refCount < i->second; ++refCount)
+            for (uint32 refCount = 0; refCount < i->second; ++refCount)
                vm->releaseModelInstance(iTreeValues[i->first].name);
        }
        iLoadedSpawns.clear();
diff --git a/src/shared/vmap/VMapManager2.cpp b/src/shared/vmap/VMapManager2.cpp
index c4c13fe..216caa4 100644
--- a/src/shared/vmap/VMapManager2.cpp
+++ b/src/shared/vmap/VMapManager2.cpp
@@ -56,7 +56,7 @@ namespace VMAP
    Vector3 VMapManager2::convertPositionToInternalRep(float x, float y, float z) const
    {
        Vector3 pos;
-        const float mid = 0.5 * 64.0 * 533.33333333;
+        const float mid = float(0.5 * 64.0 * 533.33333333);
        pos.x = mid - x;
        pos.y = mid - y;
        pos.z = z;
@@ -69,7 +69,7 @@ namespace VMAP
    Vector3 VMapManager2::convertPositionToMangosRep(float x, float y, float z) const
    {
        Vector3 pos;
-        const float mid = 0.5 * 64.0 * 533.33333333;
+        const float mid = float(0.5 * 64.0 * 533.33333333);
        pos.x = mid - x;
        pos.y = mid - y;
        pos.z = z;

and one more not solved by me

2>..\\..\\src\\shared\\vmap\\WorldModel.cpp(156) : warning C4554: '&' : check operator precedence for possible error; use parentheses to clarify precedence

Link to comment
Share on other sites

Well if that kind of nit-picking is your only concern, i consider this project finished for now...

There's nothing to make more efficient or correct about initializing a const float with a const expression, the MS compiler just wants to be a smart ass here IMHO...

The other warning was more useful ;)

Btw. if you didn't read the commit log, you need to update you mangosd.conf, indoor check is now a bool variable.

Looking forward to more feedback, now is the time to report any setup/usage problems.

Oh and i think you don't need to be afraid to enable VMaps everywhere.

I don't have scientifically precise numbers, but it became pretty much a moot question after the first comparison attempts, the engineer would say "it's about one order of magnitude faster"...

Link to comment
Share on other sites

Well if that kind of nit-picking is your only concern, i consider this project finished for now...

There's nothing to make more efficient or correct about initializing a const float with a const expression, the MS compiler just wants to be a smart ass here IMHO...

The other warning was more useful ;)

Btw. if you didn't read the commit log, you need to update you mangosd.conf, indoor check is now a bool variable.

Looking forward to more feedback, now is the time to report any setup/usage problems.

Oh and i think you don't need to be afraid to enable VMaps everywhere.

I don't have scientifically precise numbers, but it became pretty much a moot question after the first comparison attempts, the engineer would say "it's about one order of magnitude faster"...

And when we can see this on Master?

Link to comment
Share on other sites

Tested with rev 10021 and works great!

Dismounting tested in dalaran and orgrimmar and fishing works in dalaran too, awesome!

mangosd start up time without vmap_rewrite (rev 10021): ~35secs

mangosd start up time with vmap_rewrite (rev 10021): ~40secs

both with udb 391 and without sd2

Link to comment
Share on other sites

without mod or with disabled vmaps?

Without the vmap_rewrite (mod).

In both cases vmap.enableLOS = 1 and vmap.enableHeight = 1, in the second case with ~40secs startup, I simply add vmap_rewrite to the same core and enabled of course indoorcheck...

Link to comment
Share on other sites

looks funny, slime at Ruins of Lordaeron (arena) cause a damage, seems it works like lava xD

Lynx made a comment about this somewhere. In short, this isn't a problem with vmap_rewrite.

vmap_rewrite just made WMO slime data available, so now wmo slime is being handled in the generic way that mangos handles all slime. mangos core doesn't know that some slime is harmless.

Link to comment
Share on other sites

Tested with rev 10021 and works great!

Dismounting tested in dalaran and orgrimmar and fishing works in dalaran too, awesome!

mangosd start up time without vmap_rewrite (rev 10021): ~35secs

mangosd start up time with vmap_rewrite (rev 10021): ~40secs

both with udb 391 and without sd2

For me it's less then 10 second crash or restart recovery using CentOS 5, 8 x 2.24GHz process, and 24GB of RAM. This is with rewrite enabled, my own fixes, cherry-picked comments from repos like Insider and RSA along with a very thin SD2 using only guards_ai and my custom instance and NPC scripts,

Link to comment
Share on other sites

Little question lynx, are you in contact with mangos devs? Or is there silence on both sides, have they said something about your awesome work and when they want probably implement this?

I dont know exactly how mangos handles those projects today, I just remember w12x's Outdoor PvP patch which was totally awesome, but I never fully implemented?!

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