Talk:The 7th Guest

From XentaxWiki
Jump to: navigation, search

Algorithm and such ...

OK, I have added some information about the VDX format, but I'm not sure whether the pseudo code is appropriate here: LZSS is a fairly well known compression routine which has been used quite in bit especially in older games, but unfortunately it has been implemented in many different variantions. You need at least the parameters N, F, Threshold, Start Position and Void Byte as well as the information on how the offset is calculated (relative or absolute) to properly decompress LZSS-compressed data.

So ... should we instead write something about this algorithm in a centralized place and just point there with the right parameters or keep it to each game entry?

Someone might want to take a look at the code -- I think it's not very readable yet ...
--Deniz Oezmen 07:57, 31 May 2005 (EDT)

Good question

Let me try to understand. If I'm reading this correctly, your question has two parts:

  • How to improve readability of the pseudo code?
    I've looked at it and I agree the pseudo code isn't very readable at this point. I think the kind of visitor we get is pretty capable of reading proper, 'real' code, like for instance java or C snippets. I would like the other guys imput on this though.
  • If there are more games using a similar technique, should a separate page be created?
    The team has pretty much agreed that in such cases, a separate page should be created, that the game pages can link to. This prevents certain maintenance problems down the road.

-Captain 08:30, 31 May 2005 (EDT)

Yes ... =

... you got that correct so far. ;-)

  • I'd agree that real code snippets are usually better readable than pseudo code (as long as the snippets are not comprised of "compressed C style" that seasoned C programmers are often prone to produce). On the other hand, this special algorithm looks much more frightening in a fully implemented variant (due to the buffer management overhead). For example, a fully-fledged Object Pascal implementation of said algorithm might take around 50 lines (not counting comments, declarations and empty lines), which is a bit too much to show the idea behind it.
    C or Java code would of course be a bit shorter, but nonetheless ...
    Maybe there's something "in between"?
  • Creating a single page sounds good. Where should it belong?

Just as a thought ... what about something along these lines:

while InputPos < InputSize do

FlagByte := Input[InputPos++]
for i := 1 to 8 do
if FlagByte and 1 then
OfsLen := Input[InputPos] + Input[InputPos + 1] shl 8
InputPos += 2
if OfsLen = 0 then
Length := OfsLen and LengthMask + Threshold
Offset := (BufPos - (OfsLen shr LengthBits)) and (N - 1)
copy Length bytes from Buffer[Offset] onwards
while increasing BufPos
copy 1 byte from Input[InputPos]
InputPos += 1
FlagByte := FlagByte shr 1


--Deniz Oezmen 08:56, 31 May 2005 (EDT)

I think that looks a lot easier to read than the pseudocode. -Captain 09:21, 31 May 2005 (EDT)

  • Hm. I agree 50 lines would be too much, but I don't have any ideas on how to solve it. Maybe just leave the pseudocode as is right now I think the pascal code is better, and add some links (if available) to external websites that explain it in detail.
  • You can create new pages as follows (if it doesn't work just ask me and I'll do it for you):
    • Create a link on the page you want to link from (in this case, the page where the pseudocode is). You can create links to new pages by using double brackets (as seen elsewhere on the page), if the name you put between the brackets is unique for this Wiki, a new page will automatically be created. I would suggest a name like 'LZSS'.
    • Save the page and click the new link you've made. It will take you to the new blank page and you can edit that. If you want to link to the new page from other places, just use double brackets again and use the exact same name you did earlier.

Hope this was helpful. -Captain 09:19, 31 May 2005 (EDT)

Yes, it surely was, thanks! I think I've managed to do that ... I have now simply copied over the above snippet and wrote some general information. There's always room for improvement, of course. ;-) --Deniz Oezmen 11:10, 31 May 2005 (EDT)

Separate section

Well, I agree actually that we might have a separate section for compression types/encryption types.

You could then say something like "The files are compressed using the standard RLE method" and link to the page where people can find details about the RLE compression method. --Mr.Mouse 11:06, 31 May 2005 (EDT)