The International Simutrans Forum

Community => Simutrans Gaming Discussion => Topic started by: Tomas on August 28, 2008, 12:36:14 PM

Title: Image and .dat form pak?
Post by: Tomas on August 28, 2008, 12:36:14 PM
Hi!
Is there a (simply) way to obtain the original image and data (content of .dat file) from .pak file?
For example, through makeobj?

T.
Title: Re: Image and .dat form pak?
Post by: Frank on August 28, 2008, 01:33:20 PM
Quote from: Tomas on August 28, 2008, 12:36:14 PM
...
For example, through makeobj?
...

see german wiki

http://de.wiki.simutrans-forum.de/wiki/tiki-list_file_gallery.php?galleryId=4 (http://de.wiki.simutrans-forum.de/wiki/tiki-list_file_gallery.php?galleryId=4)

http://de.wiki.simutrans-forum.de/wiki/tiki-index.php?page=de_dat-Dateien&bl=y (http://de.wiki.simutrans-forum.de/wiki/tiki-index.php?page=de_dat-Dateien&bl=y)

or SVN from pak64

http://simutrans.svn.sourceforge.net/viewvc/simutrans/pak64/ (http://simutrans.svn.sourceforge.net/viewvc/simutrans/pak64/)
Title: Re: Image and .dat form pak?
Post by: DirrrtyDirk on August 28, 2008, 02:42:59 PM
No, you cannot extract sources from a pak file (which is exactly the reason for using pak files at all, actually).

But there many sources (but by far not all!) openly available - see the links Frank provided.
Title: Re: Image and .dat form pak?
Post by: Tomas on August 28, 2008, 03:45:25 PM
Thanks for answers. But my problem si different:
I found several objects for the old version Simutrans. In new version doesn't work and addons autor doesn't respond :(
There is nothing important, but I would like, if it had...
Title: Re: Image and .dat form pak?
Post by: DirrrtyDirk on August 28, 2008, 03:59:30 PM
There's not much you can do then. - Except (as I have done) recreate the whole object yourself (a lot of work).

But there is no way to extract things from the pak file, so you could change them.
Title: Re: Image and .dat form pak?
Post by: Frank on August 28, 2008, 04:13:41 PM
Quote from: Tomas on August 28, 2008, 03:45:25 PM
...
I found several objects for the old version Simutrans. In new version doesn't work and addons autor doesn't respond :( ...

What addons?
Title: Re: Image and .dat form pak?
Post by: Ashley on August 28, 2008, 06:36:08 PM
You could almost certainly reverse engineer a backwards makeobj from the source, Simutrans itself decodes the pak files afterall. Failing that you could just take screenshots from within the game and use those to reassemble the object (though there are some small colour key issues with that approach).
Title: Re: Image and .dat form pak?
Post by: Tomas on August 28, 2008, 07:01:02 PM
Quote from: Frank on August 28, 2008, 04:13:41 PMWhat addons?
Several local (czech) attractions, nothing important.

Quote from: Timothy on August 28, 2008, 06:36:08 PMYou could almost certainly reverse engineer a backwards makeobj from the source,
Good joke! ;)
No, seriously: I'm PHP coder - not reverse engineer :)

Thanks for answers, I curse pak files :D and discard this idea.

T.

PS: add the idea "No, you cannot extract sources from a pak file" to Wiki  ;D
Title: Re: Image and .dat form pak?
Post by: DirrrtyDirk on August 28, 2008, 07:06:02 PM
@Timothy: Yes, technically it should be possible to create a reverse-makeobj - but that's one of the big no-nos as far as I understood. It kinda defeats the idea of pak files altogether, doesn't it? Weren't they meant to protect the work of people who decided not to publish their sources?

The screenshot-method is the "a lot of work"-way I mentioned earlier. I was forced (oh well, not with a gun or so ;D ) to go that route already... this approach is in one word: tedious.  ;)
Title: Re: Image and .dat form pak?
Post by: prissi on August 28, 2008, 07:16:20 PM
Well, for very old, there is a program, if you search enough. It will retrieve an image (whichout special colors, those will be all balck) and you will not be able the get the statistics. However, waht kind of pak would not work? The only one fundamental different a caternary, tunnel and crossings, and there were never many of those anyway (resp. all old ones were converted to new ones anyway).
Title: Re: Image and .dat form pak?
Post by: Ashley on August 28, 2008, 08:39:40 PM
Quote from: DirrrtyDirk on August 28, 2008, 07:06:02 PM
@Timothy: Yes, technically it should be possible to create a reverse-makeobj - but that's one of the big no-nos as far as I understood. It kinda defeats the idea of pak files altogether, doesn't it? Weren't they meant to protect the work of people who decided not to publish their sources?

The screenshot-method is the "a lot of work"-way I mentioned earlier. I was forced (oh well, not with a gun or so ;D ) to go that route already... this approach is in one word: tedious.  ;)

Yes, it's very tedious (I did the same thing for some road/track graphics back in the day). I've never really considered the pak format to be about protecting graphics (since they are displayed in the game, and can easily be screenshotted). Ever since Simutrans became opensource the potential has been there for someone to make a reverse-makeobj (and TBH, in some ways, such a tool would be quite useful if for no other reason than the documentation for the pak file format it would provide...)

Of course, the main problem in such an endeavour is that pak files throw quite a lot of information away, which may be hard to reconstruct.
Title: Re: Image and .dat form pak?
Post by: Spike on August 28, 2008, 09:06:21 PM
Quote from: Timothy on August 28, 2008, 08:39:40 PM
Of course, the main problem in such an endeavour is that pak files throw quite a lot of information away, which may be hard to reconstruct.

Comments and the order of the values is lost, but all the values given in a dat file end up in the pak as well.

With the Simutrans sources open a pak-disassembler is fairly easy to write. Easy as in "not much coding skill required", but still it will take some time to write the "dat export" from the internal data.