The International Simutrans Forum

 

Author Topic: New pakset help  (Read 9430 times)

0 Members and 1 Guest are viewing this topic.

Offline balloonhead66

  • *
  • Posts: 20
New pakset help
« on: February 20, 2011, 09:58:42 PM »
ok, i want to make a pakset, but what is needed to make a playable game and how do the .dat files work?

Offline rfg123

  • *
  • Posts: 101
Re: New pakset help
« Reply #1 on: February 20, 2011, 10:46:53 PM »
A dat file is a text file that defines the image file and properties of in-game objects, such as speed for road vehicles, or the intro date for a city building. When using makobj/pakhelper, the image defined in the dat is combined with the parameters you specified to create a pak file. If you want more detail on which parameters are used for each object, use this page.

As for creating a new pakset, I believe the basic objects you need are grounds, fences, a GUI, and a couple others to function. However, I would suggest starting with an existing pakset and replace the objects as needed. For example, if I wanted to create a pak128.USA, I would copy and paste the existing pak128 folder and rename it. Doing so adds it to the list when you start Simutrans. This way I can slowly replace different parts - grounds, trees, roads, trains, tracks, etc. - while maintaining the stability of the pakset. In my experience, this method is much easier than starting from scratch.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17636
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: New pakset help
« Reply #2 on: February 20, 2011, 10:50:17 PM »
As rfg123 suggested, using an existing pakset as a base and changing objects one by one is a good way to start. Some paksets are open-source, so are good for this sort of thing: here are the sources for Pak128.Britain, for example. Have a look at the documentation and resources section of the forum for links to the reference for .dat files.

Take note, though: creating a new pakset from scratch is a project of gargantuan proportions.

Offline VictorKoehler

  • *
  • Posts: 157
  • Ahh... Os Transportes de hoje em dia...
    • VK Simutrans - Absolutamente Tudo sobre Simutrans!
Re: New pakset help
« Reply #3 on: February 21, 2011, 01:15:38 PM »
Design of large, creating a pakset is no easy task,  rfg123 do as suggested, still join a team for this,
I saw little that you participate in the forum.
Invite people for building alone will have to have experience and end in 2012 to actually do all the functions!

Offline wlindley

  • Devotee
  • *
  • Posts: 939
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: New pakset help
« Reply #4 on: February 21, 2011, 01:49:41 PM »
Can we get a few "old hands" to co-operate on a Pak64.Template and Pak128.Template?

I have tried several times to start a Pak128.USA but the size of the task has overwhelmed me.  Ideally I would like to start with Pak128.Britain and remove most everything, to build up again.

It's frustrating that some .dat's call for images in an images/ subdirectory, and some don't. Some paksets use standard command line tools like 'make', and some don't.  Some use tools only available on Windows which precludes my development, whereas linux tools all work on Windows under Cygwin. Some use subversion repositories or github, some don't. None of them seem to permit mere mortal users to have version-control branches to actively participate in development which is exceedingly frustrating.

The requirement to manually re-run TileCutter has to go; makeobj needs to have all that logic in it, so the .dat designer can write it all in once, and the process can be entirely automated.

There needs to be a standardized directory structure for our sanity when we work on multiple paksets.

So... What is the best way to create a couple Template paks, from which I can start pak128.USA and we can all proceed together?

Offline paco_m

  • *
  • Posts: 170
Re: New pakset help
« Reply #5 on: February 21, 2011, 02:47:19 PM »
I have tried several times to start a Pak128.USA but the size of the task has overwhelmed me.  Ideally I would like to start with Pak128.Britain and remove most everything, to build up again.

Maybe pak128 would be a better basis as they have already a couple of US diesel rail engines, just in spanish Renfe painting, from around 1950-1960 and 2000 Amtrak bought some spanish waggons that are also in the pak. As the pak128 is open it would just mean changing the painting to get a several trains.
However at the end it is more a personal question of painting styles as pak128.britain and pak128 are very different in this way.

Offline wlindley

  • Devotee
  • *
  • Posts: 939
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: New pakset help
« Reply #6 on: February 21, 2011, 03:01:47 PM »
I agree, pak128 has a better basis for a USA graphic style, and yes there was even an Amtrak set once that I still hope to salvage (needing a de-compiler for .pak to do so, since the sources were lost).

The question is:  Can we make a single template system, so that the only difference between pak128, pak128.Britain, and pak128.USA will be the actual graphic and dat files, and they will have the same structure and use the same tools?

As for TileCutter -- the various pakset "sources" have png's that are already cut -- which are intermediate files.  These are not the real source files, and would have to be "un-tile-cut" to edit them.  Indeed many of the pngs come from Blender files, for which none of the paksets give the real source.  This makes editing the actual pakset just about impossible.  The proper way to create a pakset would be to have the Blender sources automatically compiled to the pakfile, eliminating all manual intervention.  Otherwise we have the impossibilites of handcrafting that make pakset maintenance just about impossible today.

Offline vilvoh

  • One of the good guys
  • Administrator (Inactive)
  • *
  • Posts: 4504
  • I'm the constructor, the architect
    • Escala real
Re: New pakset help
« Reply #7 on: February 21, 2011, 03:04:11 PM »
There's a pakset template called pak64.minimal, if I remember correctly, that shows which is the minimal set of objects to make a functional pakset. You might use it as template for new paksets.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2831
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: New pakset help
« Reply #8 on: February 21, 2011, 05:00:42 PM »
Lucky day man, just added a new page on wiki: Needed files for a playable pakset

Offline balloonhead66

  • *
  • Posts: 20
Re: New pakset help
« Reply #9 on: February 21, 2011, 05:30:38 PM »
OK, TileCutter has been mentioned a few times, what is it?

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: New pakset help
« Reply #10 on: February 21, 2011, 06:10:26 PM »
OK, TileCutter has been mentioned a few times, what is it?

In Simutrans everything on the game world occupies one or more tiles. A tile is the smallest unit of distance and area. Buildings which occupy more than one tile need to be cut up into tile-size blocks. This is how Simutrans's graphics engine works.

TileCutter is a utility which assists with the process of cutting an image into these tile-size blocks.

For example it would take this input image (in pak64 scale):



And cut it into tiles that look like this:



And also output a .dat file containing the array of information that Makeobj (the utility which compiles objects in Simutrans' .pak format) requires to index the individual tile images. E.g.:

Code: [Select]
Obj=building
Name=test_1
Type=cur
Passengers=100
intro_year=1900
chance=100
dims=3,3,1
BackImage[0][0][0][0][0][0]=images/output.0.0
BackImage[0][0][1][0][0][0]=images/output.0.1
BackImage[0][0][2][0][0][0]=images/output.0.2
BackImage[0][1][0][0][0][0]=images/output.1.0
BackImage[0][1][1][0][0][0]=images/output.1.1
BackImage[0][1][2][0][0][0]=images/output.1.2
BackImage[0][2][0][0][0][0]=images/output.2.0
BackImage[0][2][1][0][0][0]=images/output.2.1
BackImage[0][2][2][0][0][0]=images/output.2.2

The requirement to manually re-run TileCutter has to go; makeobj needs to have all that logic in it, so the .dat designer can write it all in once, and the process can be entirely automated.

You need only to run TileCutter in GUI mode once for any individual object. You can save a TileCutter project (.tcp) file which can then be used with TileCutter from the command line to repeat the actions you previously took. You don't even need to store the intermediate "cut" image as this is created every time you run TileCutter and there is a command line flag that permits creation of the intermediate "cut" image in a temporary directory. This command-line functionality is detailed in the TileCutter documentation here:

http://entropy.me.uk/tilecutter/docs/#CommandLineUsage

As for TileCutter -- the various pakset "sources" have png's that are already cut -- which are intermediate files.  These are not the real source files, and would have to be "un-tile-cut" to edit them.  Indeed many of the pngs come from Blender files, for which none of the paksets give the real source.  This makes editing the actual pakset just about impossible.  The proper way to create a pakset would be to have the Blender sources automatically compiled to the pakfile, eliminating all manual intervention.  Otherwise we have the impossibilites of handcrafting that make pakset maintenance just about impossible today.

I don't know about scripting Blender (I assume it can be fairly easily) but as I have already said TileCutter is fully capable of being automated (indeed I added this functionality at the behest of pakset maintainers who wanted to do exactly what you describe).

Offline The Hood

  • Devotee
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: New pakset help
« Reply #11 on: February 21, 2011, 06:44:56 PM »
Scripting blender is possible I gather, but there is a significant problem in going straight from blender to pak file fully automated in that many of the images need cleaning up and tweaking by hand.  I'm not at all a fan of pixel-pushing, but unfortunately blender doesn't have a "please read my mind and do this" module which therefore necessitates some processing by hand.

Offline balloonhead66

  • *
  • Posts: 20
Re: New pakset help
« Reply #12 on: February 21, 2011, 06:52:31 PM »
OK, now I understand what TileCutter is, but what is open pak128, pak128 gone open source? what is it?

Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: New pakset help
« Reply #13 on: February 21, 2011, 07:20:52 PM »
Well, that's it. Pak128 was not open source (sources were not available), but as all the other paks were open source or were moving to open source status (sources are available for everyone to download and modify) and the game itself is open source, the Pak128 staff decided also to move to open source status. As you can guess, that's still in process ;)

Offline balloonhead66

  • *
  • Posts: 20
Re: New pakset help
« Reply #14 on: February 21, 2011, 11:10:35 PM »
so why can't they just upload the entire thing, why is it taking so long?

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2831
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: New pakset help
« Reply #15 on: February 21, 2011, 11:24:18 PM »
Cause to be opensource you need the pak file creator permission to share its work.

Offline paco_m

  • *
  • Posts: 170
Re: New pakset help
« Reply #16 on: February 21, 2011, 11:30:27 PM »
so why can't they just upload the entire thing, why is it taking so long?

Good question :D
Actually the openpak nightlies you can download from the nightly builds contains only graphics of authors that agreed to make them opensource and they already offered the complete sources for it in the pak128 forum for download - search for it or ask VS; as far as I know it is just a question of not automated uploads of the sources that it isn't as accessible as pak64 sources at the moment ;)

Offline balloonhead66

  • *
  • Posts: 20
Re: New pakset help
« Reply #17 on: February 22, 2011, 12:01:48 AM »
Good question :D
Actually the openpak nightlies you can download from the nightly builds contains only graphics of authors that agreed to make them opensource and they already offered the complete sources for it in the pak128 forum for download - search for it or ask VS; as far as I know it is just a question of not automated uploads of the sources that it isn't as accessible as pak64 sources at the moment ;)
so you mean like simupakopen128-1150.zip from the nightly page?  How long would it take for the entire thing to go open?

== EDIT ==
I want to know because I am planing on making pak128.HD, but I need the images.  The original point of this thread was to see what I would need to draw off of screenshots, but now that it is open, it seems eaisier.

If you hake looked at my old thread from a year ago, that was when pak128 was closed source.

Offline paco_m

  • *
  • Posts: 170
Re: New pakset help
« Reply #18 on: February 22, 2011, 12:16:23 AM »
so you mean like simupakopen128-1150.zip from the nightly page?  How long would it take for the entire thing to go open?
The not open graphics are already removed from this snapshots so the current target is to draw new (open) ones for those that had been removed for legal questions, however this work seems to be almost completed - actually there is much more stuff in here as in the last official release. The balancing work for all that (revenues, running costs, ...) is still going on so it won't be in just a few days and consider that the contributors and maintainers are doing all this in their freetime. When they consider it ready it will be released, I guess that nobody can confirm you a day for it ;)