Opened 18 years ago

Closed 18 years ago

#2907 closed defect (fixed)

ALL: Current directory as default path

Reported by: SF/mcmartin Owned by: eriktorbjorn
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Full Throttle

Description

To reproduce:

1) Have a vorbis sound file named "credits.ogg" in your home directory.

2) Install Full Throttle.

3) Vorbis-encode FT's monster.sou.

4) Start Full Throttle from your home directory.

Result: ~/credits.ogg will play instead of "Legacy", and all subsequent speech/SFX will be silenced.

Ticket imported from: #1597208. Ticket imported from: bugs/2907.

Change History (14)

comment:1 by eriktorbjorn, 18 years ago

Assigning to aquadran. He should know if it's a bug or a feature. (The normal sound/voices resume later. Presumably when the game thinks it's done playing the credits sound and continues with the next part.)

comment:2 by eriktorbjorn, 18 years ago

Owner: set to aquadran

comment:3 by fingolfin, 18 years ago

I am not sure I properly understand the report...

Do you mean to say there is a bug in the encoding tools, that causes an invalid monster.sog file to be generated (containing data from that credits.ogg file, instead of the correct file) ?

Or do you mean to say that the presence of credits.ogg confuses ScummVM itself, leading it to play invalid data?

comment:4 by fingolfin, 18 years ago

Summary: monster.sog can be overridden by files in local directoriesTOOLS: monster.sog handling (?) / creation (?) incorrect

comment:5 by eriktorbjorn, 18 years ago

Owner: changed from aquadran to eriktorbjorn
Resolution: invalid
Status: newclosed
Summary: TOOLS: monster.sog handling (?) / creation (?) incorrectFT: monster.sog handling (?)

comment:6 by eriktorbjorn, 18 years ago

I think he means that putting a credits.ogg in your Full Throttle directory causes ScummVM to play it during the Full Throttle intro. But come to think of it, this doesn't have anything to do with monster.sog. It's playing the credits.ogg file, because it's playing the credits.san SMUSH movie. If you compress a SMUSH movie, you get the sound for it as a separate Ogg Vorbis or MP3 file, so this is the correct behaviour.

The Full Throttle intro is made up from ten different SMUSH movies and, I believe, some standard animations. The "credits" one begins where Malcolm says "Aw, your ears are fine."

comment:7 by SF/mcmartin, 18 years ago

No, they're in different directories. In this case, credits.ogg was in /home/mcmartin, and monster.sog was in /home/mcmartin/scumm/ft.

The misplay occurs when invoking scummvm from from /home/mcmartin, but not from /home/mcmartin/tmp.

comment:8 by eriktorbjorn, 18 years ago

Ah. That's seems to be because runGame() always calls Common::File::addDefaultDirectory(".") "as a last resort", but actually that probably means it gets picked up *before* the "video" sub-directory that the SCUMM engine adds. I wonder why we do that...

comment:9 by eriktorbjorn, 18 years ago

Resolution: invalid
Status: closednew
Summary: FT: monster.sog handling (?)ALL: Current directory as default path

comment:10 by sev-, 18 years ago

We do that on purpose, so it would be possible to override game files locally. So that's in fact an intentional behavior. This opens possibility to run scummvm with game data in current directory. However, I think we could make that turned off by default and make switchable by some command line key.

comment:11 by eriktorbjorn, 18 years ago

But that overriding doesn't seem to work all that well to me. I can override the real credits.ogg as long as it's in the "video" sub-directory, but if I move it to the main game data directory, I can't. Maybe it has to do with the order in which the directories to search are added?

comment:12 by fingolfin, 18 years ago

Well in the end this amounts to the question: Do we want to search files in the current directory (="PWD) by default, or not. There are pros and cons for each. If they that we want this feature, we should close this item as "Won't fix", as it's an intentional (mis?)feature.

However, I am not convinced that searching the PWD by default is such a good idea. IMO, it should be sufficient to *either* search path (and extrapath), *or* if no path has been specified, to search the PWD. Can somebody name some *realistic* scenarios where always searching the PWD is useful for our users? Something they can't also achieve by simply specificy --path=. ? Why would one want to merge two dirs like that? And if one really really wants to do that, wouldn't it be much better to allow the user to actually specify two paths, instead of forcing them to first chang to the proper dir before launching ScummVM?

comment:13 by fingolfin, 18 years ago

Since nobody objected when I brought this up on scummvm-devel, I have now removed the offending call, i.e. the lines // As a last resort add current directory Common::File::addDefaultDirectory("."); from base/main.cpp.

It is still possible to play the game in the current directory, as we have code which adds "." to the list of default dirs if no "path" has been set a few lines above.

comment:14 by fingolfin, 18 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.