Bug 3312 - server-side mods block native code loading
Status: RESOLVED WONTFIX
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: unspecified
Hardware: All All
: P2 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2007-08-14 23:57 EDT by /dev/humancontroller
Modified: 2007-08-23 11:06:03 EDT
0 users

See Also:



Description /dev/humancontroller 2007-08-14 23:57:09 EDT
When looking for native code (.dll, .so), Sys_LoadDll searches the current game directories of basepath and cdpath for it, and if not found, it loads the QVM, searching in ALL paths. Consider what happens, when server-side mod doesn't have a new cgame.qvm.

The client connects to the server, and sets fs_game from 'baseq3' to what mod it has to, let's say 'myMod'. There are no pk3s to download, because myMod is a server-side mod. OK, time to load. Start with loading the DLL (sv_pure is off). Can a DLL be found for the mod called myMod? Searching cgamex86.dll in [ basepath | cdpath ]/myMod/ ... not found. Proceeding to load a QVM. Searching cgamex86.dll in [ basepath | cdpath ]/myMod/ ... not found, just as with the DLL. This is where the QVM search and the DLL search differs. The QVM search continues, this time not with myMod, but with baseq3 (homepath, basepath, cdpath). QVM found, loading.

In this scenario, the QVM for baseq3 that has been loaded should have been replaced by the DLL for the same baseq3 mod. So even when we have native code for a give mod, the interpreter will be loaded in the presence of a server side mod.

So to fix this I would search all paths for native code and the QVM, and if native code is found in a the same or higher precedence directory, go ahead and try to load it.
Comment 1 Tim Angus 2007-08-22 18:00:11 EDT
This is established Q3 FS behaviour and isn't going to change. Yes, it's a bit wacky, but it's an error case anyway that you wouldn't run in to unless you're doing something wrong. Futhermore, the effects are pretty innocuous.
Comment 2 /dev/humancontroller 2007-08-23 04:45:31 EDT
(In reply to comment #1)
> This is established Q3 FS behaviour and isn't going to change. Yes, it's a bit
> wacky, but it's an error case anyway that you wouldn't run in to unless you're
> doing something wrong. Futhermore, the effects are pretty innocuous.

I'm displeased. I'm a framerate geek, and always want to have the maximum performance. My processor is too slow for QVMs, so I compile native code to get a 20%-30% performance boost. (FreeBSD even builds Tremulous from the ports collection, building native code by default, while respecting the processor-specific optimizations in make.conf.) This way the game is playable. Then I join the server with the ZOMGMOD7 server side mod, and my client loads the QVMs instead of the native code. Everything is correct, I'm doing everything right, but performance is scarce because of this, and sometimes isn't so innocuous. To fix, either create a create directories for all server side mods you're going to play on, and copy the native files to each, OR FIX THE BUG.
Comment 3 Tim Angus 2007-08-23 07:24:43 EDT
(In reply to comment #2)
> I'm displeased. I'm a framerate geek, and always want to have the maximum
> performance. My processor is too slow for QVMs, so I compile native code to get
> a 20%-30% performance boost.

If you're seeing that much difference something else is broken for you.

> (FreeBSD even builds Tremulous from the ports
> collection, building native code by default, while respecting the
> processor-specific optimizations in make.conf.)

Trem (and ioq3) builds the native libraries by default, but these are not intended to be used for actually playing the game.

> This way the game is playable.
> Then I join the server with the ZOMGMOD7 server side mod, and my client loads
> the QVMs instead of the native code.

Native libraries are for debugging really. The server should not be letting you load native libraries if it is pure anyway. If you're circumventing these checks that technically a cheat.

If you want to argue more take it off Bugzilla.
Comment 4 /dev/humancontroller 2007-08-23 11:06:03 EDT
They are for debugging only? I think they are a good to reduce the CPU requirement (just make the integer rounding consistent!), for both servers and clients. sv_pure is for those that don't trust clients. There are servers that are graceful and allow "custom performance". And for example, LAN parties never use sv_pure.

If I make a fix someday, will you commit it?