Engine Bugs - Quirks and Workarounds


(acQu) #1

This thread should be of great help for people trying to patch and fix the ET engine code, released under the GPL in 2010.

This thread is informational only. It tries to collect community feedback and therefore can be seen as a contribution on an informational basis.

The way it works is that people post issues here they think might fit. What results, in best case, is an entry in the first post’s overview table, which tries to collect everything important emerged out of this thread. But not only that, it contains a basic overview on issues discussed over the last year here at Splash Damage Forums. I at least tried to achieve that goal. (So far i have been through many threads over the last year which seemed to be important to me and remarked everything in the overview table. If you find something undocumented, report!)

If there are solutions to a specific issue, i would be glad to receive that kind of solution, so that i can link it in this thread.

This thread is also the place for general discussion and everything related to the topic.

Overview on collected issues:

  1. [li]Unpure client detected. Invalid .PK3 files referenced![/li]unsolved
    [li]The engine does not truncate oversize servercommands. trap_SendServerCommand() to a client of over 1022 bytes will crash the client.[/li]solved - see PBF B001
    [li]exiting limbo menu stops all sounds[/li]unsolved
    [li]level.time gets reset when a map goes into overtime[/li]unsolved
    [li]trap_R_DrawRotatedPic can’t stretch/skew the image according to it’s width/height parameters[/li]unsolved
    [li]typo in the engine RTCW and W:ET engine source at \win32\qgl.c[/li]solved
    [li]fix annoying console bug with ^[/li]unsolved

(see svn changelog for more)

Links worth watching:

[ol]
[li]http://games.chruker.dk/enemy_territory/modding_project_bugfix.php - The goal of this project is to provide modders in the ET community with a SDK code base that contains fixes for various bugs which are present in the stock etmain game (version 2.60).[/li][/ol]

Features which might fit:

  1. [li]improving sound support (make it possible to use full spectrum of .wav and .mp3)[/li]unsolved
    [li]improving file system[/li]unsolved
    [li]anti cheat support[/li]unsolved
    [li]global client authentication, similar to etkey to keep compatibility with old mods (e.g. xpsave)[/li]unsolved
    [li]Support for png textures[/li]unsolved for ET
    [li]Add a new and better zip technology[/li]unsolved
    [li]Increase HunkMegs by default[/li]unsolved
    [li]Increase MaxEntity limit[/li]unsolved

If you do not feel like beeing quoted above, just pm me and i will remove your quote.
Also i might have marked things unsolved which are already done.


(acQu) #2

I will start with one thing which bothered me now pretty long when playing ET. It is the unpure pk3. reference bug, for example =>

http://www.google.de/#sclient=psy&hl=de&source=hp&q=Unpure+client+detected.+Invalid+.PK3+files+referenced!&aq=f&aqi=&aql=&oq=&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=e56c8652f58720b

Happens to me mainly when i get dropped from the server (for some unkown reason) and then try to reconnect. This shouldn’t happen that way. I always have to close and restart ET in order to fix this issue.

Code leading into that specific issue can be found in sv_client.c by searching for “Unpure client detected. Invalid .PK3 files referenced!”.


(warren the ape) #3

http://games.chruker.dk/enemy_territory/modding_project_bugfix.php ?


(acQu) #4

Yes, this one should be merged in such a project as well. It is not engine stuff though :wink: but definetely a link worth fitting in such a project. Thanks for the reminder, i will put it near the overview table. :penguin:


(dutchmeat) #5

Unpure client detected. Invalid .PK3 files referenced!

I haven’t looked in the engine code for a long while, but my first tip is to compare the ‘dropclient’ code(the clientside code where the client automaticly drops after some event) with the actuall ‘disconnect’ code.

Also, be aware that this bug also sometimes occurs after a (failed)download, I believe these are seperate causes, but not sure at this time.

just a question, what’s the difference between this thread and the original pinned ‘Bugs, quirks, and other stuff’ thread ?


(daz2007) #6

Unpure client detected. Invalid .PK3 files referenced!



if ( bGood ) {
			cl->pureAuthentic = 1;
		} else {
			cl->pureAuthentic = 0;
			cl->nextSnapshotTime = -1;
			cl->state = CS_ACTIVE;
			SV_SendClientSnapshot( cl );
			SV_DropClient( cl, "Unpure client detected. Invalid .PK3 files referenced!" );
		}
	}
}

This is a Server Side Issue, usually caused by Autodownload


(acQu) #7

[QUOTE=dutchmeat;303374]I haven’t looked in the engine code for a long while, but my first tip is to compare the ‘dropclient’ code(the clientside code where the client automaticly drops after some event) with the actuall ‘disconnect’ code.

Also, be aware that this bug also sometimes occurs after a (failed)download, I believe these are seperate causes, but not sure at this time.

just a question, what’s the difference between this thread and the original pinned ‘Bugs, quirks, and other stuff’ thread ?[/QUOTE]

Yeah please solve this issue :stuck_out_tongue: You actually would be one of the very few persons i would trust when working on engine stuff.

The difference between this and the other thread is … uhm “overview” :smiley: It will be more organized and information can be gained from this thread more easily. It is also more up to date, and kinda should wake people up to work on the engine code. This thread here should be a great help for them, as i will collect all the things i find.

[QUOTE=daz2007;303390]



if ( bGood ) {
			cl->pureAuthentic = 1;
		} else {
			cl->pureAuthentic = 0;
			cl->nextSnapshotTime = -1;
			cl->state = CS_ACTIVE;
			SV_SendClientSnapshot( cl );
			SV_DropClient( cl, "Unpure client detected. Invalid .PK3 files referenced!" );
		}
	}
}

This is a Server Side Issue, usually caused by Autodownload [/QUOTE]

Yes, that’s the codesnipped leading into that thing.


(acQu) #8

[QUOTE=dutchmeat;303374]I haven’t looked in the engine code for a long while, but my first tip is to compare the ‘dropclient’ code(the clientside code where the client automaticly drops after some event) with the actuall ‘disconnect’ code.

Also, be aware that this bug also sometimes occurs after a (failed)download, I believe these are seperate causes, but not sure at this time.

just a question, what’s the difference between this thread and the original pinned ‘Bugs, quirks, and other stuff’ thread ?[/QUOTE]

Yeah please solve this issue :stuck_out_tongue: You actually would be one of the very few persons i would trust when working on engine stuff.

The difference between this and the other thread is … uhm “overview” :smiley: It will be more organized and information can be gained from this thread more easily. It is also more up to date, and kinda should wake people up to work on the engine code. This thread here should be a great help for them. Will start merging the other thread as soon as possible though.

[QUOTE=daz2007;303390]



if ( bGood ) {
			cl->pureAuthentic = 1;
		} else {
			cl->pureAuthentic = 0;
			cl->nextSnapshotTime = -1;
			cl->state = CS_ACTIVE;
			SV_SendClientSnapshot( cl );
			SV_DropClient( cl, "Unpure client detected. Invalid .PK3 files referenced!" );
		}
	}
}

This is a Server Side Issue, usually caused by Autodownload [/QUOTE]

Yes, that’s the codesnipped.


(acQu) #9

Another thing. I sometimes fail on downloading packages. The server will then leave me in an endless downloading loop, resulting in downloading packages like => nameofpk3adeadbafeb.pk3

The thing here is these temp pk3’s with “adeadbafeb”. Do you know what i mean ? It happens i think when i escape a download with the escape key, and then try to connect to the same server again. It then will create these packages. Because the actual checksum inside the package will be this of the escaped download package, which will differ from the checksum of the one you are attempting to download again.

For example i download random.pk3. If i escape it and then reconnect to the server, the server will create randomabcfeha.pk3. But i will have to recheck this issue, since i am not sure if it was some messed server setting or something. Therfore this will not yet be collected in the overview table in the first post, waiting for confirmation rather.


(acQu) #10

Another thing. I sometimes fail on downloading packages. The server will then leave me in an endless downloading loop, resulting in downloading packages like => nameofpk3adeadbafeb.pk3

The thing here is these temp pk3’s with “adeadbafeb”. Do you know what i mean ? It happens i think when i escape a download with the escape key, and then try to connect to the same server again. It then will create these packages. Because the actual checksum inside the package will be this of the escaped download package, which will differ from the checksum of the one you are attempting to download again.

For example i download random.pk3. If i escape it and then reconnect to the server, the server will create randomabcfeha.pk3. But i will have to recheck this issue, since i am not sure if it was some messed server setting or something. Therfore this will not yet be collected in the overview table in the first post, waiting for confirmation rather.


(acQu) #11

First post got updated.

http://www.splashdamage.com/forums/showthread.php?t=6709 merged.
Stripped out what should be stripped of => http://www.splashdamage.com/forums/showthread.php?t=23581

An interesting project to look at => https://bitbucket.org/tcmreastwood/raedwulf-et/overview


(acQu) #12

Stripped out what should be stripped of => http://www.splashdamage.com/forums/showthread.php?t=23581

First post updated.


(acQu) #13

Stripped out what should be stripped of => http://www.splashdamage.com/forums/showthread.php?t=23581

First post updated.


(acQu) #14

An interesting project to look at => https://bitbucket.org/tcmreastwood/raedwulf-et/overview


(acQu) #15

First post got updated.

http://www.splashdamage.com/forums/showthread.php?t=6709 merged.
Stripped out what should be stripped of => http://www.splashdamage.com/forums/showthread.php?t=23581


(Shanks) #16

[QUOTE=daz2007;303390]



if ( bGood ) {
			cl->pureAuthentic = 1;
		} else {
			cl->pureAuthentic = 0;
			cl->nextSnapshotTime = -1;
			cl->state = CS_ACTIVE;
			SV_SendClientSnapshot( cl );
			SV_DropClient( cl, "Unpure client detected. Invalid .PK3 files referenced!" );
		}
	}
}

This is a Server Side Issue, usually caused by Autodownload[/QUOTE]

Actually I think it’s triggered here:

// store number to compare against (minus one cause the last is the number of checksums)
			nClientPaks = i - 1;

			// make sure none of the client check sums are the same
			// so the client can't send 5 the same checksums
			for ( i = 0; i < nClientPaks; i++ ) {
				for ( j = 0; j < nClientPaks; j++ ) {
					if ( i == j ) {
						continue;
					}
					if ( nClientChkSum[i] == nClientChkSum[j] ) {
						bGood = qfalse;
						break;
					}
				}
				if ( bGood == qfalse ) {
					break;
				}
			}
			if ( bGood == qfalse ) {
				break;
			}

Basically it does a sanity check. It checks if the file it’s comparing is the same one, if it is then it skips to the next one. Then it checks to see if the checksum of the two different files are the same, if they are then it triggers the error.

IMO the entire function is incredibly sloppy and needs to be re-written. Hell most of the pk3 handling is less than stellar. It should be coded so that things like custom ui’s should not automatically overwrite every ui unless otherwise specified. I’ll look into fixing it up when I get a chance.

Error is triggered when…

  • cgame dll is not found.
  • ui dll is not found.
  • Less than 6 check-sums performed.
  • First check is not cgame.
  • Second check is not ui.
  • Same checksum for different files.
  • If the pk3 referenced is a higher number than the server’s loaded pk3’s (should never happen due to the weirdness of the code).
  • If the number of check-sums on the client is different.

EDIT: I’ve sorted the entire function above and included more detailed error messages based on the reason for the error.
Also I’ve added a client cvar that let’s the user control whether files that have already been loaded can be overwritten.


(acQu) #17

Merged http://www.splashdamage.com/forums/showthread.php?t=21759. Olol that was hard to read, so much unneccessary information and flame war :? But some cool things i stripped out there, see post 1 (e.g. new zip technology, png support). For png support i think the people at ioquake would know how to do it.

@unpure bug. Im so glad some people are working on that. Tell me when you seem to have grabbed a solution. I worked on it some time ago, but dropped it again because of no immediate solution. It take’s some serious “cleaning up” to fix this it seems.

Also for the console bug. This one occurs mainly because of characters beeing autorepeated as far as i see. If someone wants to work on it, take a look for the variable “consoleButtonWasPressed” and try to go from there. Was not able to solve this so far, because it is really weird, and i have not the neccessary time to go deeper into this. I’ll keep an eye on it though.

IS there actually a project taking advantage of this ? Let me know.


(Shanks) #18

It has to do with the ^ character still being counted but not visible. AFAIK you just need to prevent it from being counted and you should be fine. But of course you’d need an escape incase you delete a character and the carrot reappears.

Look in CL_ConsolePrint. That’s where the solution needs to be applied.


(acQu) #19

Added wwwdl overflow fix, as can be seen here => or here => http://www.gamersfiles.net/files/28-ET+Full+Download+and+Patches/1099-ET+wwwdl+overflow+fix

:penguin:


(acQu) #20

Added wwwdl overflow fix, as can be seen here => http://www.crossfire.nu/?x=forum&mode=item&id=33891 or here => http://www.gamersfiles.net/files/28-ET+Full+Download+and+Patches/1099-ET+wwwdl+overflow+fix

:penguin: