Bug 4699 - [patch] FS_CheckPak0 requires baseq3/pak0.pk3 even if com_standalone is 1
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: GIT MASTER
Hardware: All All
: P3 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2010-08-13 13:21 EDT by Simon McVittie
Modified: 2011-02-04 08:29:24 EST
2 users (show)

See Also:


Attachments
FS_CheckPak0: don't require BASEGAME/pak0.pk3 if fs_basegame is not BASEGAME (1.21 KB, patch)
2010-08-13 13:22 EDT, Simon McVittie

Description Simon McVittie 2010-08-13 13:21:04 EDT
STANDALONE builds of ioquake3 don't look for baseq3/pak0.pk3, but non-STANDALONE builds with com_standalone 1 still do (so com_standalone 1 isn't entirely standalone yet).

However, if fs_basegame is set to another game (like baseoa for OpenArena), *and* we're running with com_standalone 1, then we won't be reading baseq3/pak0.pk3 at all, so we don't need to check that it exists.

Patch to follow once I get a bug number.
Comment 1 Simon McVittie 2010-08-13 13:22:11 EDT
Created attachment 2396 [details]
FS_CheckPak0: don't require BASEGAME/pak0.pk3 if fs_basegame is not BASEGAME
Comment 2 Thilo Schulz 2010-08-25 16:22:26 EDT
No, this behaviour is deliberate. If it finds the original id pak file somewhere it will automatically disable com_standalone, as the game really isn't standalone anymore then.
The com_standalone cvar was introduced in case game developers release their independent games with an unchanged quake3 engine (read: as delivered by us) and do not depend on id's assets. It also forces game developers to name their fs_game directory differently.
Comment 3 Simon McVittie 2010-08-26 06:03:52 EDT
> If it finds the original id pak file
> somewhere it will automatically disable com_standalone, as the game really
> isn't standalone anymore then.

I didn't intend to change this behaviour, and I don't think the patch affects it; if I'm wrong, I'd welcome corrections.

FS_CheckPak0 contains two opposite checks:

* the one you mention: if baseq3 assets exist, forbid standalone mode
* the one I filed this bug about: if not in standalone mode, forbid running *without* baseq3 assets

What I aimed to change with this patch is that the check for whether we need the baseq3 assets is too strict: if I set com_standalone to 1, fs_basegame to baseoa, and fs_basepath to a location that contains baseoa but not baseq3, the engine still checks "do I have baseq3/pak0.pk3?", discovers that it does not, and refuses to run.

> The com_standalone cvar was introduced in case game developers release their
> independent games with an unchanged quake3 engine (read: as delivered by us)
> and do not depend on id's assets.

Right, I wrote this patch because we want to do something very similar in Debian. If ioquake3 can only play the proprietary Quake III Arena then we can't include it in Debian, but if it can also be used for GPL'd assets (i.e. OpenArena), we can. I'd prefer to ship the genuine ioquake3 (with minimal changes to play OpenArena) rather than OpenArena's branch.
Comment 4 Tim Angus 2010-08-26 06:14:22 EDT
(In reply to comment #3)
> What I aimed to change with this patch is that the check for whether we need
> the baseq3 assets is too strict: if I set com_standalone to 1, fs_basegame to
> baseoa, and fs_basepath to a location that contains baseoa but not baseq3, the
> engine still checks "do I have baseq3/pak0.pk3?", discovers that it does not,
> and refuses to run.

I think perhaps you're misinterpreting the purpose of fs_basegame. It came about in response to the Team Arena expansion being released, so that people could make Team Arena mods. i.e. setting fs_basegame doesn't and shouldn't break the dependence on baseq3, what's it's saying is fs_game inherits fs_basegame inherits baseq3. I hope that makes sense.
Comment 5 Simon McVittie 2010-08-26 06:59:34 EDT
(In reply to comment #4)
> I think perhaps you're misinterpreting the purpose of fs_basegame. It came
> about in response to the Team Arena expansion being released, so that people
> could make Team Arena mods. i.e. setting fs_basegame doesn't and shouldn't
> break the dependence on baseq3, what's it's saying is fs_game inherits
> fs_basegame inherits baseq3. I hope that makes sense.

I see. I'd been using fs_basegame can also be used to get a 2-level hierarchy (e.g. OpenArena -> Excessive Plus) with an unmodified engine binary, if the fs_basegame happens to be one like OpenArena or Urban Terror that doesn't reference the baseq3 assets anyway; as a side-effect, the BASEGAME (i.e. baseq3) directory will still be on the search path, but as a result of the check Thilo mentioned, we won't actually allow ourselves to use any of the baseq3 assets without disabling com_standalone.

Would you prefer a patch that added a fs_rootgame or fs_basebasegame or something, which is a CVAR_INIT version of the hard-coded BASEGAME? The default for fs_basegame could then change to be the value of fs_rootgame (I'd have to be careful to initialize fs_rootgame first :-), but FS_CheckPak0 would still be interested in BASEGAME.

Relatedly, it might make more sense to check for a hard-coded "baseq3" in FS_CheckPak0.

One complicating factor is that OpenArena also has an unfinished pseudo-mod called "missionpack" (which has the GPL'd game logic from Team Arena, but otherwise has nothing to do with it), so when running a non-baseq3 "root game", "missionpack" shouldn't be rejected.
Comment 6 Ludwig Nussel 2010-08-26 07:59:35 EDT
FS_CheckPak0 works if you use fs_game. The idea was that a total
conversion like westernq3 or urban terror could be started the same
way, no matter if baseq3 is installed or not. I've simply overlooked
the fs_basegame case. I think we can and should modify the code to
make that method work too in standalone mode.

> One complicating factor is that OpenArena also has an unfinished pseudo-mod
> called "missionpack" (which has the GPL'd game logic from Team Arena, but
> otherwise has nothing to do with it)

That's quite stupid. Can't they simply rename their mod?
Comment 7 Thilo Schulz 2011-02-04 07:10:04 EST
check out r1840
I think it's doing what you want.
Comment 8 Thilo Schulz 2011-02-04 08:29:24 EST
Oh and yeah, there have been changes to how com_standalone works. Please read the section in the README again, it explains everything.