The International Simutrans Forum

 

Author Topic: Image and .dat form pak?  (Read 7038 times)

0 Members and 1 Guest are viewing this topic.

Offline Tomas

  • *
  • Posts: 251
Image and .dat form pak?
« 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.


Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: Image and .dat form pak?
« Reply #2 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.

Offline Tomas

  • *
  • Posts: 251
Re: Image and .dat form pak?
« Reply #3 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...

Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: Image and .dat form pak?
« Reply #4 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.

Offline Frank

  • Inactive/Retired
  • *
  • Posts: 1431
  • Languages: DE
Re: Image and .dat form pak?
« Reply #5 on: August 28, 2008, 04:13:41 PM »
...
I found several objects for the old version Simutrans. In new version doesn't work and addons autor doesn't respond :( ...

What addons?

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: Image and .dat form pak?
« Reply #6 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).

Offline Tomas

  • *
  • Posts: 251
Re: Image and .dat form pak?
« Reply #7 on: August 28, 2008, 07:01:02 PM »
What addons?
Several local (czech) attractions, nothing important.

You 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

Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: Image and .dat form pak?
« Reply #8 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.  ;)

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9559
  • Languages: De,EN,JP
Re: Image and .dat form pak?
« Reply #9 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).

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: Image and .dat form pak?
« Reply #10 on: August 28, 2008, 08:39:40 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.

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: Image and .dat form pak?
« Reply #11 on: August 28, 2008, 09:06:21 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.