News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

Image and .dat form pak?

Started by Tomas, August 28, 2008, 12:36:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tomas

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.


DirrrtyDirk

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.
  
***** PAK128 Dev Team - semi-retired*****

Tomas

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...

DirrrtyDirk

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.
  
***** PAK128 Dev Team - semi-retired*****

Frank

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?

Ashley

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).
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

Tomas

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

DirrrtyDirk

@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.  ;)
  
***** PAK128 Dev Team - semi-retired*****

prissi

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).

Ashley

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.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

Spike

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.