Benvenuto Visitatore(Log In|Registrati)

8 Pagine V  « < 6 7 8  
Reply to this topicStart new topic
> Elvira Mistress Of The Dark:, a qualcuno interessa tradurlo?
TheRuler
messaggio4 Sep 2017, 18:55
Messaggio #176



Gruppo icone

Gruppo: SMod
Messaggi: 10.637
Iscritto il: 20 January 06
Da: Bologna
Utente Nr.: 2.653
Entropologo part-time

BGE AG: Indy3
Arcade: Silpheed
Free Roaming: Shadow of the Colossus
RTS: Praetorians

Playing Magari...
SO Windows7

OGI Supporter




I know, it's a mess.
The headers are stored in vga.h, for the records:

CODICE
// Elvira 1/2 and Waxworks
struct ImageHeader_WW {
    uint16 id;
    uint16 color;
    uint16 x_2;
    uint16 scriptOffs;
} PACKED_STRUCT;

struct AnimationHeader_WW {
    uint16 id;
    uint16 x_1;
    uint16 x_2;
    uint16 scriptOffs;
} PACKED_STRUCT;

// Common
struct VgaFile1Header_Common {
    uint16 x_1;
    uint16 imageCount;
    uint16 x_2;
    uint16 animationCount;
    uint16 x_3;
    uint16 imageTable;
    uint16 x_4;
    uint16 animationTable;
    uint16 x_5;
} PACKED_STRUCT;

#include "common/pack-end.h"    // END STRUCT PACKING



--------------------
 
TheRuler
messaggio4 Sep 2017, 19:07
Messaggio #177



Gruppo icone

Gruppo: SMod
Messaggi: 10.637
Iscritto il: 20 January 06
Da: Bologna
Utente Nr.: 2.653
Entropologo part-time

BGE AG: Indy3
Arcade: Silpheed
Free Roaming: Shadow of the Colossus
RTS: Praetorians

Playing Magari...
SO Windows7

OGI Supporter




Check out agos\gfx.cpp

kDFCompressed, maybe?


--------------------
 
Nyerguds
messaggio6 Sep 2017, 06:57
Messaggio #178



Gruppo icone

Gruppo: OldGamer
Messaggi: 190
Iscritto il: 27 June 14
Utente Nr.: 20.463
BGE Command & Conquer: Tiberian Dawn
SO Windows7




Yeah, but that makes it call "convertImage(...)", and the only function called that that I've found so far seems to be in "res_ami.cpp", a class claiming to be for the Amiga versions, so that's kind of... weird.

Well, it looks fairly easy to implement. Might give it a try.

Messaggio modificato da Nyerguds il 6 Sep 2017, 06:59


--------------------

Command & Conquer Gold v1.06 - Upgrading C&C95, byte by byte...
 
Nyerguds
messaggio6 Sep 2017, 19:25
Messaggio #179



Gruppo icone

Gruppo: OldGamer
Messaggi: 190
Iscritto il: 27 June 14
Utente Nr.: 20.463
BGE Command & Conquer: Tiberian Dawn
SO Windows7




Yeah, okay, I don't think this is it. I just implemented the decompression algorithm (a kind of RLE compression that first splits the data into sub-arrays depending on the bits per pixel... really weird) and it just started off with trying to read index 3626 in a 53-byte array n7.gif

Something to make my life slightly easier: the combined and identified information of the PC Elvira 1 "game mode". Now at least I'll be able to follow those spaghetti-code paths a bit more easily...

CODICE
// Elvira 1 - English DOS Floppy
AGOSGameDescription Elvira1DOSFloppy =
{
    ADGameDescription desc =
    {
        const char *gameId = "elvira1";
        const char *extra = "Floppy";
        ADGameFileDescription filesDescriptions[] =
        {
            // const char *fileName, uint16 fileType, const char *md5, int32 fileSize
            { "gamepc",   GAME_BASEFILE, "a49e132a1f18306dd5d1ec2fe435e178", 135332},
            { "icon.dat", GAME_ICONFILE, "fda48c9da7f3e72d0313e2f5f760fc45", 56448},
            { "tbllist",  GAME_TBLFILE,  "319f6b227c7822a551f57d24e70f8149", 368},
            { NULL,       0,             NULL,                               0}
        },
        Common::Language language = Common::EN_ANY;
        Common::Platform platform = Common::kPlatformDOS;
        uint32 flags = ADGF_NO_FLAGS;
        const char *guiOptions = GUIO1(GUIO_NOSPEECH);
    },
    int gameType = GType_ELVIRA1;
    int gameId = GID_ELVIRA1;
    uint32 features = GF_OLD_BUNDLE; // Old bundle games (ScummEngine_v3old and subclasses).
};

Still a giant mess, though.

Messaggio modificato da Nyerguds il 6 Sep 2017, 19:33


--------------------

Command & Conquer Gold v1.06 - Upgrading C&C95, byte by byte...
 
Nyerguds
messaggio7 Sep 2017, 11:20
Messaggio #180



Gruppo icone

Gruppo: OldGamer
Messaggi: 190
Iscritto il: 27 June 14
Utente Nr.: 20.463
BGE Command & Conquer: Tiberian Dawn
SO Windows7




I did it! toothy_037.gif



It's amazing what you can accomplish if you just kick out all the ScummVM code and just try to decompress an image manually in your hex editor purely on the principles used in that code biggrin.gif

No writing code yet, but really, the principle is pretty simple. It's RLE encoding, where the "repeat" command is always one more than the given value (because a repeat of 1 is useless and would be a "copy" command), and the resulting bytes are painted into the image column by column, no matter what bpp they have (meaning that for 4bpp, each such column is actually 2 pixels wide).

The problem with the ScummVM code was that it immediately converted that to one-byte-per-pixel format to paint it onto the screen, which made things ridiculously complicated, and which I don't need at all. I can perfectly keep it as 4bpp; the .Net framework knows and supports image data formatted like that.

Messaggio modificato da Nyerguds il 7 Sep 2017, 15:20


--------------------

Command & Conquer Gold v1.06 - Upgrading C&C95, byte by byte...
 
Nyerguds
messaggio7 Sep 2017, 14:10
Messaggio #181



Gruppo icone

Gruppo: OldGamer
Messaggi: 190
Iscritto il: 27 June 14
Utente Nr.: 20.463
BGE Command & Conquer: Tiberian Dawn
SO Windows7




Save code implemented.

To edit a file, open the .vga and then select "Save as frames" in the menu.

To convert the frames back, drag one of the frames that is actually a valid image file into the program and it'll ask to load it as frames. Elvira .vga files can contain empty frames, and those are saved as 0-byte files; in fact the vga files seem to consistently start with such an empty frame.

Types with frames can be saved by going to frame "-1" at the start and then saving the file as a frames-capable format. If you are viewing an actual frame, however, then you are saving only that one frame.


Note that for the compression I put a really simple check in there right now; it tries the compression, and if the compressed data is smaller than the raw data, it uses compression. Though right now, that seems to mean it saves all frames with compression.

I sincerely hope that actual frame-specified compression will not be needed, but just as side note, if you open the "File" menu and then hold the [SHIFT] key while clicking the "save" option, all optional compressions in the target file type you select will be disabled.

New version:
http://nyerguds.arsaneus-design.com/projec...verter/release/

Messaggio modificato da Nyerguds il 11 Sep 2017, 16:23


--------------------

Command & Conquer Gold v1.06 - Upgrading C&C95, byte by byte...
 
Nyerguds
messaggio7 Sep 2017, 14:58
Messaggio #182



Gruppo icone

Gruppo: OldGamer
Messaggi: 190
Iscritto il: 27 June 14
Utente Nr.: 20.463
BGE Command & Conquer: Tiberian Dawn
SO Windows7




Files with text in them:

012.vga:
007: "UP"/"DOWN"
025: Menu and action stuff

032.vga:
017-018-019: Attack commands
053-054-055: Attack commands

072.vga:
041-042-043: Attack commands

092.vga:
045-046-047: Attack commands

172.vga:
040: Runes on a wall. I guess those can be ignored, unless deciphering them is some kind of puzzle in the game. Didn't see any runes in the rest of the graphics though, so I doubt it. Still wondering what it says, though tongue.gif

192.vga: Contains Latin. Probably doesn't need translation biggrin.gif

252.vga:
029-030-031: Attack commands
053-054-055: Attack commands

272.vga: game title art and intro credits
012: "PRESENTS"

292.vga:
014: Sign with the word "MAZE".

332.vga:
002: "All Visitors Report To Gatehouse"
004: General UI layout
006-007: Game credits

342.vga:
137: "MIX" - Seems to be something related to brewing potions.
138-139-140: Potion ingredients

502.vga:
016-017-018-019: Attack commands
054-055: Attack commands

512.vga:
016-017-018-019: Attack commands
054-055: Attack commands

522.vga:
040-041-042: Attack commands

532.vga:
040-041-042: Attack commands

662.vga:
025: A screen of text. Looks like the end of the game.


Anyone know what's up with the "R" frames, btw? That seems to pop up again and again.

The ScummVM code mentioned something about a "palette offset" to translate the data on these frames to the actual palette colours. I wonder if I could read the odd .vga files to get those... because that'd be nice to add.

Messaggio modificato da Nyerguds il 7 Sep 2017, 15:30


--------------------

Command & Conquer Gold v1.06 - Upgrading C&C95, byte by byte...
 
TheRuler
messaggio7 Sep 2017, 15:24
Messaggio #183



Gruppo icone

Gruppo: SMod
Messaggi: 10.637
Iscritto il: 20 January 06
Da: Bologna
Utente Nr.: 2.653
Entropologo part-time

BGE AG: Indy3
Arcade: Silpheed
Free Roaming: Shadow of the Colossus
RTS: Praetorians

Playing Magari...
SO Windows7

OGI Supporter




CITAZIONE (Nyerguds @ 7 Sep 2017, 12:20) *
I did it! toothy_037.gif





--------------------
 
Nyerguds
messaggio7 Sep 2017, 15:34
Messaggio #184



Gruppo icone

Gruppo: OldGamer
Messaggi: 190
Iscritto il: 27 June 14
Utente Nr.: 20.463
BGE Command & Conquer: Tiberian Dawn
SO Windows7




Thanks!

The result of the conversion opens fine in the converter, but nothing has been tested in the actual game yet. I guess that's your job tongue.gif

[edit]

Hah, I just found out I can improve the saving code. Basic RLE replaces repeating bytes by a byte telling how many times to repeat, and then the byte value to repeat, and prefixes ranges of non-repeating bytes by a byte saying how long the range is to just copy over as it is. The difference between these 2 is made by enabling the highest bit in that count-byte, which identifies it as either the "repeat" or "copy" command (depending on the implementation); meaning a command has a maximum "count" value of 127.

Now, it seems the original Elvira VGA files already use a "repeat" command for 2 identical bytes in a row. While it may seem like replacing 2 bytes with first a repeat-command byte with value "2" and then the byte value itself is just "replacing 2 bytes with 2 bytes", that's not actually true: if it is followed by non-repeating data, then there needs to be an extra "copy" command byte behind it, which wouldn't be there if the whole range was seen as one longer "copy" range.

Changing the code to only start compressing when finding three identical bytes in a row actually makes the compressed versions of some of the images quite a bit smaller. A funny side effect is that this actually also optimises decompression, since there are less commands to process. biggrin2a.gif


Messaggio modificato da Nyerguds il 7 Sep 2017, 16:56


--------------------

Command & Conquer Gold v1.06 - Upgrading C&C95, byte by byte...
 
TheRuler
messaggio7 Sep 2017, 16:34
Messaggio #185



Gruppo icone

Gruppo: SMod
Messaggi: 10.637
Iscritto il: 20 January 06
Da: Bologna
Utente Nr.: 2.653
Entropologo part-time

BGE AG: Indy3
Arcade: Silpheed
Free Roaming: Shadow of the Colossus
RTS: Praetorians

Playing Magari...
SO Windows7

OGI Supporter




CITAZIONE (Nyerguds @ 7 Sep 2017, 16:34) *
The result of the conversion opens fine in the converter, but nothing has been tested in the actual game yet. I guess that's your job tongue.gif
You bet.



--------------------
 
Nyerguds
messaggio7 Sep 2017, 17:32
Messaggio #186



Gruppo icone

Gruppo: OldGamer
Messaggi: 190
Iscritto il: 27 June 14
Utente Nr.: 20.463
BGE Command & Conquer: Tiberian Dawn
SO Windows7




Oh, another fun thing I noticed. You remember the icons I took from the exe a while ago? I always thought they looked very strange, with the black lines through them.



Well, here's what happens if you take those black lines, split them off, and use them as transparency mask (and flip the image)

File Allegato  RUNVGA_icons_trans_lg.png ( 384byte ) Numero di download: 0


Interesting, huh? I bet that's more or less how they look ingame biggrin2a.gif

Messaggio modificato da Nyerguds il 7 Sep 2017, 17:41


--------------------

Command & Conquer Gold v1.06 - Upgrading C&C95, byte by byte...
 
TheRuler
messaggio7 Sep 2017, 17:47
Messaggio #187



Gruppo icone

Gruppo: SMod
Messaggi: 10.637
Iscritto il: 20 January 06
Da: Bologna
Utente Nr.: 2.653
Entropologo part-time

BGE AG: Indy3
Arcade: Silpheed
Free Roaming: Shadow of the Colossus
RTS: Praetorians

Playing Magari...
SO Windows7

OGI Supporter




Exactly te same, only B/W inverted.





Your're a Beech Maarten! ghgh.gif


--------------------
 
Nyerguds
messaggio7 Sep 2017, 18:00
Messaggio #188



Gruppo icone

Gruppo: OldGamer
Messaggi: 190
Iscritto il: 27 June 14
Utente Nr.: 20.463
BGE Command & Conquer: Tiberian Dawn
SO Windows7




I just realized when looking at the inventory on that screenshot... the icons in ICON.DAT do stuff like this too. The multiple almost-identical frames in there are actually colour channels, and one of them is probably also transparency blush.gif


--------------------

Command & Conquer Gold v1.06 - Upgrading C&C95, byte by byte...
 
TheRuler
messaggio7 Sep 2017, 18:54
Messaggio #189



Gruppo icone

Gruppo: SMod
Messaggi: 10.637
Iscritto il: 20 January 06
Da: Bologna
Utente Nr.: 2.653
Entropologo part-time

BGE AG: Indy3
Arcade: Silpheed
Free Roaming: Shadow of the Colossus
RTS: Praetorians

Playing Magari...
SO Windows7

OGI Supporter




CITAZIONE (Nyerguds @ 7 Sep 2017, 19:00) *
I just realized when looking at the inventory on that screenshot... the icons in ICON.DAT do stuff like this too. The multiple almost-identical frames in there are actually colour channels, and one of them is probably also transparency blush.gif

Clever but a bit weird. So the multiple frames are not animation but color layers. What's the point? Wouldn't it be simpler and smaller a real 4bpp image?

I think it could be an inherited code from the original amiga version due to programming architecture.


--------------------
 
Nyerguds
messaggio8 Sep 2017, 16:14
Messaggio #190



Gruppo icone

Gruppo: OldGamer
Messaggi: 190
Iscritto il: 27 June 14
Utente Nr.: 20.463
BGE Command & Conquer: Tiberian Dawn
SO Windows7




Yeah, it's a weird way of doing it, especially since the file is completely raw data without any headers indicating which images belong together, and how to layer them. Ah well.

I'm working on improved frames support in the tool now; it no longer complains when you dump in a frame that is 0 bytes if it can detect a frame range out of it, and 8-bit Dynamix SCR images which use the "4-bit upgraded to 8-bit" two-chunk storage method can now show their 4-bit image as second frame (rather useless, but still freaking cool in my opinion) blush.gif

As for Elvira, though, if you can confirm the engine has no problems with having all frames in there as compressed data, then I guess this chapter is closed now, from my side. I mean, unless someone can dig up any way to get to the colours for the VGA files, of course.

Messaggio modificato da Nyerguds il 8 Sep 2017, 16:20


--------------------

Command & Conquer Gold v1.06 - Upgrading C&C95, byte by byte...
 
Nyerguds
messaggio10 Sep 2017, 22:34
Messaggio #191



Gruppo icone

Gruppo: OldGamer
Messaggi: 190
Iscritto il: 27 June 14
Utente Nr.: 20.463
BGE Command & Conquer: Tiberian Dawn
SO Windows7




Well, I was going to release a new version of the tool this weekend, but then I went ahead and started on the custom save options per type, and it got delayed a bit.

but this should be nice, nonetheless:
File Allegato  elvira_palettes.zip ( 586byte ) Numero di download: 1


Not complete at all, but it has a bunch of them anyway, including the basic UI palette. I just kind of copied them from screenshots blush.gif

Messaggio modificato da Nyerguds il 10 Sep 2017, 22:35


--------------------

Command & Conquer Gold v1.06 - Upgrading C&C95, byte by byte...
 
TheRuler
messaggio10 Sep 2017, 23:02
Messaggio #192



Gruppo icone

Gruppo: SMod
Messaggi: 10.637
Iscritto il: 20 January 06
Da: Bologna
Utente Nr.: 2.653
Entropologo part-time

BGE AG: Indy3
Arcade: Silpheed
Free Roaming: Shadow of the Colossus
RTS: Praetorians

Playing Magari...
SO Windows7

OGI Supporter




Great addition, Maarten. Even with B/W palette we are able export a frame, edit and save it back, right?
The tool does not perform any palette changes, right?

CITAZIONE (Nyerguds @ 8 Sep 2017, 17:14) *
can now show their 4-bit image as second frame (rather useless, but still freaking cool in my opinion) blush.gif

I dare you to not implement this! Utility is relative when you're a nerd that loves geeky things! ;-)


--------------------
 
Nyerguds
messaggio11 Sep 2017, 10:38
Messaggio #193



Gruppo icone

Gruppo: OldGamer
Messaggi: 190
Iscritto il: 27 June 14
Utente Nr.: 20.463
BGE Command & Conquer: Tiberian Dawn
SO Windows7




No, the actual saved format of Elvira doesn't contain palettes, so indeed, editing is still the same. But the UI palette does make the text more clear to edit.

As for the 4-bit frame in Dynamix SRC, I mostly added it because it offers a way to extract that 4-bit image, which was something that wasn't possible before, except through my debug data dump functions (which are of course disabled in the release versions; it'd be a bit of a mess if it dumped a file of the raw data for all files you open tongue.gif).

Oddly enough I found another Dynamix game (F-14 Tomcat) where the VGA files are saved in the same way, and yet they added separate EGA files for the 16-colour versions. And the VGA sub-frames are not really usable either; the palette starts with a range of 16 generally-usable colours, and the images use those a lot, but in the 4-bit frame that means all those colours get saved as "0" of course, since for all colours it contains the palette index / 16. In fact, the first 16 colours of the palette were exactly the palette used for the EGA versions. So the actually-used EGA files just take the first row, not a vertical slice of the palette like the embedded ones do (in the adventure games we've seen anyway).

Messaggio modificato da Nyerguds il 11 Sep 2017, 14:42


--------------------

Command & Conquer Gold v1.06 - Upgrading C&C95, byte by byte...
 
TheRuler
messaggio11 Sep 2017, 15:29
Messaggio #194



Gruppo icone

Gruppo: SMod
Messaggi: 10.637
Iscritto il: 20 January 06
Da: Bologna
Utente Nr.: 2.653
Entropologo part-time

BGE AG: Indy3
Arcade: Silpheed
Free Roaming: Shadow of the Colossus
RTS: Praetorians

Playing Magari...
SO Windows7

OGI Supporter




UP DOWN, come li traduciamo?
SU e GIU'
o SALI e SCENDI?

Non si possono usare verbi troppo lunghi come ad esempio SCENDERE. Già SCENDI forse è troppo lungo.


--------------------
 
Micartu
messaggio11 Sep 2017, 17:07
Messaggio #195



Gruppo icone

Gruppo: SMod
Messaggi: 9.151
Iscritto il: 7 May 04
Da: Regione dell'Albero d'Oro
Utente Nr.: 1.400
BGE Elvira 1
SO WinXP




Sali e scendi se ci stanno sennò su e giù.

Grandissimi!!!!!


--------------------
 
Nyerguds
messaggio13 Sep 2017, 09:13
Messaggio #196



Gruppo icone

Gruppo: OldGamer
Messaggi: 190
Iscritto il: 27 June 14
Utente Nr.: 20.463
BGE Command & Conquer: Tiberian Dawn
SO Windows7




Ugh, I just realized you actually explained the vertical compression system of the VGA frames to me in a PM in the beginning of August, but I didn't have time then because I was on holiday, so I never really looked into that and forgot it n7.gif


--------------------

Command & Conquer Gold v1.06 - Upgrading C&C95, byte by byte...
 
Nyerguds
messaggioIeri, 15:04
Messaggio #197



Gruppo icone

Gruppo: OldGamer
Messaggi: 190
Iscritto il: 27 June 14
Utente Nr.: 20.463
BGE Command & Conquer: Tiberian Dawn
SO Windows7




Look what I just figured out!



Thanks to the strange structure of the files I discussed with TheRuler in PM, I realized each icon in the Elvira icons set was actually a set of 4 images... in other words, they're bit masks, forming a 4-bit image together. What confused me before was the fact there sometimes seemed to be much longer ranges of similar images, but they turned out to be the same object in different states, like a full bottle and the same bottle after it's been emptied.

And they all seem to use the same palette, so I reconstructed it from screenshots blush.gif

This also confirms that the edit we did actually turned out okay.

Messaggio modificato da Nyerguds il Ieri, 15:11


--------------------

Command & Conquer Gold v1.06 - Upgrading C&C95, byte by byte...
 
TheRuler
messaggioIeri, 17:01
Messaggio #198



Gruppo icone

Gruppo: SMod
Messaggi: 10.637
Iscritto il: 20 January 06
Da: Bologna
Utente Nr.: 2.653
Entropologo part-time

BGE AG: Indy3
Arcade: Silpheed
Free Roaming: Shadow of the Colossus
RTS: Praetorians

Playing Magari...
SO Windows7

OGI Supporter




Good catch Maarten!


--------------------
 

8 Pagine V  « < 6 7 8
Reply to this topicStart new topic
1 utenti stanno leggendo questa discussione (1 visitatori e 0 utenti anonimi)
0 utenti:

 

Modalità di visualizzazione: Normale · Passa a: Lineare · Passa a: Outline


Versione Lo-Fi Oggi è il: 20th September 2017 - 21:13