LinkerMod icon indicating copy to clipboard operation
LinkerMod copied to clipboard

Raising the Max curvenn/terrain collision verts

Open ghost opened this issue 8 years ago • 33 comments

Current limit is 65536, was wondering if these could be increased.

ghost avatar Jun 08 '16 20:06 ghost

But why

how tf are you getting all these issues when in reality you're not even supposed to be getting them or even be near

iAmThatMichael avatar Jun 08 '16 20:06 iAmThatMichael

If we ever do decide to increase limits (and if possible), it will be similar to the threading remap code I wrote.

Which executable needs to have this raised? What is the error message(s)? Can't do anything without some more info.

Nukem9 avatar Jun 08 '16 21:06 Nukem9

The full output is "max curvenn/terrain collision vertices (65536) exceeded" it occurs in cod2map, this is the waw limit that was coded in cod2map. @Nukem9 I can private message you some info and test data for you to use if needed. @DidUknowiPwn we are aiming above and beyond anything you've seen before in a custom map :P, Again not sure if this is possible or not. Another reason why I report them is that its likely that these values are greater with the original tools that treyarch uses, these limits are there because they haven't specifically been overridden by the mod's. If the game can load a map with more collision verts then the compilation tools should too.

ghost avatar Jun 08 '16 23:06 ghost

It SHOULD be as simple as changing a short to an int, but the ramifications from doing that might be a bit iffy.

Arefu avatar Jun 09 '16 00:06 Arefu

    cod2map
    dword_1697FA40 = (int)operator new(13631488u);
    dword_1697FA48 = 65536;

13631488 bytes is 65536 elements, each being 208 bytes. It might be as simple as editing these two values. I don't know how BO's engine deals with the limit.

Nukem9 avatar Jun 09 '16 00:06 Nukem9

I'll whip up a quick patch for this and give it a go @Nukem9

ghost avatar Jun 09 '16 00:06 ghost

@Nukem9 Edit: I patched both to double their values, now I get an exception here:

0x004B3771

http://prntscr.com/be4d6u

ghost avatar Jun 09 '16 02:06 ghost

Crashes on qh_maxabsval returning null. I think you might have found a bug in some very old library, but I'll need the map source files to reproduce it (or somehow see your computer). I'll try fixing the bug first and let you test it yourself.

Nukem9 avatar Jun 09 '16 03:06 Nukem9

Sounds good, if you have skype I can always share my screen, (Would rather not use teamviewer right now lol) But whatever approach you want to take works fine.

ghost avatar Jun 09 '16 03:06 ghost

https://github.com/Nukem9/LinkerMod/commit/cb731bf7244f7a6f062e9bb8605ffcc3e13c7415 Untested.

Nukem9 avatar Jun 11 '16 01:06 Nukem9

We're getting there I think @Nukem9, new crash http://prntscr.com/beyei1 http://prntscr.com/beyfnk

ghost avatar Jun 11 '16 03:06 ghost

These infinite numbers may be the problem http://prntscr.com/beyh84

Might be that you didn't increase dword_1697FA40 too? Not sure though.

Notes this value is 13631488, but it is represented as 0x2000 x 0x68 (131072 x 104)

ghost avatar Jun 11 '16 03:06 ghost

What's the value of dim in that variable box? Also make sure you compile the dll in debug mode, release mode values will not be completely accurate.

Nukem9 avatar Jun 11 '16 04:06 Nukem9

https://github.com/Nukem9/LinkerMod/commit/63210789315d8477a999f4a6b564fa5d982d1ace

I can't debug it so I'm just guessing random fixes at this point.

Nukem9 avatar Jun 11 '16 04:06 Nukem9

Dim is 3, don't worry, I always run debug :) and if you want to skype you can, also sucks because it takes 3 minutes to get to the error, normal 0x482dc7e8 {-1.#IND000000000000 When the deref happens

ghost avatar Jun 11 '16 04:06 ghost

With your hack fix we now get this: While executing: | qhull QJ Pp Options selected for Qhull 2002.1 2002/8/20: Pprecision-ignore _run 1 QJoggle 2.6e-010 _joggle-seed 16807 _max-width 1.1 Error-roundoff 8.7e-015 Visible-distance 8.7e-015 U-coplanar-distance 8.7e-015 Width-outside 1.7e-014 _wide-facet 5.2e-014 qhull internal error (qh_maxsimplex): not enough points available

While executing: | qhull QJ Pp Options selected for Qhull 2002.1 2002/8/20: Pprecision-ignore _run 1 QJoggle 3.3e-010 _joggle-seed 16807 _max-width 1.7 Error-roundoff 1.1e-014 Visible-distance 1.1e-014 U-coplanar-distance 1.1e-014 Width-outside 2.2e-014 _wide-facet 6.5e-014 qhull internal error (qh_maxsimplex): not enough points available

This happens a bunch of times Then building curve/terrain collision... _max-width 0.43 Error-roundoff 1e-014 Visible-distance 1e-014 MAX_MAP_COLLISIONVERTS (65536) exceeded

Maybe another variable needs to change? Also that first output is displayed a lot again.

ghost avatar Jun 11 '16 05:06 ghost

I can also confirm that void qh_normalize2(coordT *normal, int dim, boolT toporient, realT *minnorm, boolT *ismin) is being passed this -1.#IND normal, as the var is set that way.

ghost avatar Jun 11 '16 05:06 ghost

The qh_normalize2/qh_maxsimplex is now less of a priority. Unless if those NAN/INF vector values screw up something in your map, it will not matter.

MAX_MAP_COLLISIONVERTS is hardcoded to 65536 in cod2map's BSP lump writer:

    if ( 12 * dword_116F0C78 )
    {
      if ( (unsigned int)v65 > 786432 )
      {
        printf("Adding Lump %s wont fit %d into %d bytes\n", off_51D35C[0], 12 * dword_116F0C78, 786432);
        exit(0);
      }

LUMP_COLLISIONVERTS = 0x1F

WAW's cod2map does have a limit, but I don't know if BO1's engine limit is higher than 65536....If BO1 also has the 65536 limit, there's literally nothing I can do. Will need to check tomorrow.

Nukem9 avatar Jun 11 '16 05:06 Nukem9

Sounds good to me, I'll be awaiting the answer

ghost avatar Jun 11 '16 15:06 ghost

https://github.com/Nukem9/LinkerMod/commit/0e29ea704f6185508453910673ddb364454e4074

Again, untested.

Nukem9 avatar Jun 11 '16 23:06 Nukem9

@Nukem9 A bunch of the qhull errors still but it wrote the d3dbsp! checking the rest of the compile chain now then running! :)

Edit: cod2rad problem: LoadBspFile: buffer for lump 31 is too small (786432 < 891096)

ghost avatar Jun 12 '16 00:06 ghost

Want me to try that commit or are you still adding on to it?

ghost avatar Jun 12 '16 01:06 ghost

Try it

Nukem9 avatar Jun 12 '16 01:06 Nukem9

Quantizing light grid colors... Encoding light grid...

EXCEPTION DETECTED: EIP: 0x00442484 EX0: 0x00000001 EX1: 0x00000019

Just incase: http://prntscr.com/bfahrj

ghost avatar Jun 12 '16 01:06 ghost

@Nukem9 Two things, paths don't seem to work, just hangs and window stays open, tries to capture pointer. If I skip paths, linker complains


UNRECOVERABLE ERROR: CMod_LoadLeafs: firstCollAabbIndex exceeded

Linker will now terminate.


Linker summary:

There was 1 warning and 7 errors.

Warnings: missing stringTable sp/configstrings/configstrings_pc_zombie_modme_zom.csv

Errors:

Com_LoadBsp(maps/zombie_modme.d3dbsp) Size: 97813172 CRC32: 64253249 Com_LoadBsp: End

(!) UNRECOVERABLE ERROR: CMod_LoadLeafs: firstCollAabbIndex exceeded Arguments passed to linker: -nopause -language english -moddir zombie_modme zombie_modme

ghost avatar Jun 12 '16 01:06 ghost

I'll need the source files for the map then, or a map source which reproduces the error. It's not possible to know what is going wrong without checking each stage of compilation. Same with qhull.

I know that you can share screens on skype or whatever, but this might take hours of debugging now. (Files can also be sent somewhere more private if needed)

Nukem9 avatar Jun 12 '16 02:06 Nukem9

I'll send you the source, just would rather do it privately :) I'm all for helping, we just don't want the map out / leaked / revealed

ghost avatar Jun 12 '16 02:06 ghost

Edit: I'll remove all models and make sure error is still there, then I just need some way to message you.

ghost avatar Jun 12 '16 02:06 ghost

Just email me an upload link (justbeamit or something): --removed--. You can remove any files, just as long as the error still happens.

Nukem9 avatar Jun 12 '16 03:06 Nukem9

Sent.

ghost avatar Jun 12 '16 03:06 ghost