News:

Simutrans Forum Archive
A complete record of the old Simutrans Forum.

Simutrans DAT File Editor

Started by Zeno, March 19, 2009, 03:48:09 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Zeno

I've been working on a tool to build/edit DAT files with a friendly and easy GUI. The bad think is it is only available for windows (and it needs .NET Framework 2.0). Anyway, the points I've taken as a must are:

  • Use dropdown lists where possible (easy use, avoid typing errors, etc)
  • Use drag and drop like behaviour to manage image/graphics (easy + intuitive)
  • Keep artists away from coding even these small easy DATs (they just don't like, do they?)

So, at the moment is still in a very early beta stage, but you all can take a look on what I want to do, and most important: how it works!

I would like to remark I still don't expect any bug report, as it's really early for that. I'd love instead some behaviour comments/opinions (that thing could be done that way, and things like that).
Any questions you have, of course will have their answer here :)

Current functionality:

  • Load/Save single vehicle DAT
  • Load/Save multiple vehicle DAT
  • Load and manage (not save yet) PNG info on single vehicle DAT
  • DAT Preview mode

Wishes list:

  • Create NEW DAT files (partially supported now)
  • Multi-Pakset compatibility (only pak128 now)
  • Save PNG info on single vehicle DAT
  • Full support on multiple object DAT files
  • New/Load/Save non-vehicle DAT files

Just need to unzip where you like and run. Be sure you have .NET Framework 2.0 installed.

Download BETA 0.1.1

I'm looking forward your comments!


Edit:
20/03: Fixed some vehicle editor issues, added version history. Version 0.1.1 uploaded.

VS

#1
I unzipped that and ran, but the computer wouldn't explode!

I can't load any dat file and can't find how to get to that image changing form, either :( So not much comments from me apart from that it looked good!

The one place where it assumes too much is goods selection. How do you know Kohle is coal in all paksets? That still needs some though...

EDIT: Maybe you could use some kind of calendar popup for dates? selecting year from a list seems overdone and not so easy.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Zeno

Ops! Redownload, there was a last-minute-stupidity :D
About freight types, of course it's supporting a set of prefixed-freight types only. At the moment is only tested in pak128. I'll make a new entry in the wishes list for non-pakset-dependant freight types...

Michael 'Cruzer'

At first, don't use this ugly standard Info box from Microsoft VS7/8! When you use that, the programm will look very unprofessional, and most of the people who know this box would close the progamm!
It's better do use no Info-Box as an ugly Info-Box!!!!!!

If I press F8 (menu: View -> PNG Setup) DATEditor crashed!

Here is theJIT-Debbug Report (Sorry that is in German, but the important thing (NOT NULL ERROR) you should can read):
Informationen über das Aufrufen von JIT-Debuggen
anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

************** Ausnahmetext ******** ******
System.ArgumentNullException: Der Wert darf nicht NULL sein.
Parametername: path1
   bei System.IO.Path.Combine(String path1, String path2)
   bei Simutrans.DatEditor.imageManager.comboBox1_SelectedIndexChanged(Object sender, EventArgs e)
   bei System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
   bei System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
   bei System.Windows.Forms.ComboBox.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Geladene Assemblys **************
mscorlib
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3521 (NetFXspW7.050727-3500).
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll.
----------------------------------------
Simutrans.DatEditor
    Assembly-Version: 0.1.0.0.
    Win32-Version: 0.1.0.0.
    CodeBase: file:///C:/Users/Hohl%20Michael/Downloads/Simutrans.DatEditor.exe.
----------------------------------------
System.Windows.Forms
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3521 (NetFXspW7.050727-3500).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll.
----------------------------------------
System
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3521 (NetFXspW7.050727-3500).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll.
----------------------------------------
System.Drawing
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3521 (NetFXspW7.050727-3500).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.
----------------------------------------
System.Windows.Forms.resources
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3519 (NetFXspW7.050727-3500).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_de_b77a5c561934e089/System.Windows.Forms.resources.dll.
----------------------------------------
mscorlib.resources
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3521 (NetFXspW7.050727-3500).
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll.
----------------------------------------
Simutrans.DATFramework
    Assembly-Version: 1.0.0.0.
    Win32-Version: 1.0.0.0.
    CodeBase: file:///C:/Users/Hohl%20Michael/Downloads/Simutrans.DATFramework.DLL.
----------------------------------------

************** JIT-Debuggen **************
Um das JIT-Debuggen (Just-In-Time) zu aktivieren, muss in der
Konfigurationsdatei der Anwendung oder des Computers
(machine.config) der jitDebugging-Wert im Abschnitt system.windows.forms festgelegt werden.
Die Anwendung muss mit aktiviertem Debuggen kompiliert werden.


Sorry for my worse english...
Founder and Ex-Maintainer of pak192.comic. Provider of Simutrans Hosting rental service.

Zeno

Quote from: Cruzer on March 19, 2009, 05:09:28 PM
At first, don't use this ugly standard Info box from Microsoft VS7/8!
Yeah, it's very ugly. But I don't have much freetime and I prefer to make other things work before making this look better.

Quote from: Cruzer on March 19, 2009, 05:09:28 PM
If I press F8 (menu: View -> PNG Setup) DATEditor crashed!
It's the part I'm developing now, so it will crash very often. You can try with a simplier vehicle (let's say a coal truck), and you will see how it looks like. Anyway there are lots of ugly icons and images in that page, so beware! :D

IgorEliezer

#5
Timothy had created a tool called TileCutter which has a, say, a dat file creator. I don't know if you know this tool too. Maybe you two could interchange some ideas.

Zeno

Quote from: IgorTekton on March 19, 2009, 05:20:40 PM
Timothy had created a tool called TileCutter which has a, say, a dat file creator. I don't know if you know this tool too.
Thanks Igor, I already talked with Timothy. He encouraged me to develop this application, as Tilecutter is not focused on DAT management, but image edition, cutting, clipping and so.

Quote from: IgorTekton on March 19, 2009, 05:20:40 PM
Maybe you two could interchange some ideas.
We will, sure. Maybe when this begins to work properly, at least with vehicle management. When I'm ready to board buildings and factories I'll surely need his advice :)

Ashley

As Zeno says, TileCutter is intended only for producing certain kinds of buildings (typically the ones which can span multiple tiles). I may add support for stations in the future, but that'll be it.

This tool looks promising though, it'll be interesting to see how it develops.
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.

Zeno

As VS said, it's a problem to deal with non-pak dependant stuff. How would you guys deal with freight types?
I've taken pak128 freights as a base, and I've coded them as a simple enumeration (they have an internal numeric id plus a name). The name is not a problem because I can easily build a translation table based in its internal identifier, which would have all different translations for each pakset. But are there the same freight types in all paksets? I assume is not, so there should be an additional flag indicating in which paksets is available... or a table per pakset. Am I right?
Have you any better/different idea on it?

z9999

IIRC, "freight_catg" is not saved in .pak file.
I don't know about future compatibility, but currently it is not used.

Frank

Quote from: Zeno on March 19, 2009, 07:34:43 PM
...
Have you any better/different idea on it?

Docu in wiki?

the sets in german wiki

see the links bottom - 'Liste der Waren' ( goods list )

jamespetts

A GUI for a .dat file editor is a good idea, as it will make some aspects of Pakset creation more accessible. I have just downloaded it, and will try it presently. Incidentally, do you intend to make it open source? It might be a good idea.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Zeno

#12
Quote from: Frank on March 19, 2009, 08:02:01 PM
Docu in wiki?
see the links bottom - 'Liste der Waren' ( goods list )
Thanks Frank, sure I'll have to take a look on it. I got the current list from the translator, so I guess it will be similar (if not the same). But I still doubt if a standard list can be done or I'll have to code a list for each different pakset.

Quote from: jamespetts on March 19, 2009, 09:05:52 PM
A GUI for a .dat file editor is a good idea, as it will make some aspects of Pakset creation more accessible. I have just downloaded it, and will try it presently. Incidentally, do you intend to make it open source? It might be a good idea.
Thanks James, that's the idea: to make it more accessible. It probably will be open source when there's someting to release... at least the vehicles edition module. I haven't take a thought on it, but I don't have any interest on keeping it under secret.

Quote from: z9999 on March 19, 2009, 07:56:18 PM
IIRC, "freight_catg" is not saved in .pak file.
I don't know about future compatibility, but currently it is not used.
Sure? Then how does it work, I can just set a vehicle to carry whatever I want without being restricted by freight category? I mean this:

freightimagetype[0]=Khole
freightimagetype[1]=Milk
freightimagetype[2]=Mail
freightimagetype[3]=Passagiere

jamespetts

I have just looked at it briefly. A few points: firstly, what language is it supposed to be in? The introduction dialogue has "Aceptar" where the "OK" button would normally be, and a number of the internal names (such as the engine type for the vehicles) use the untranslated, internal Simutrans names, rather than user-friendly names ("hydrogene" instead of "Hydrogen fuel cell", for example; also, all the "frieght" names are in German). Also, the waytypes seem to be out of date: "electrified track" is no longer a separate waytype, but narrow gauge, monorail and maglev are.

The introduction date cannot be set earlier than 1930 (many paksets allow for pre-1930 building), and the word "length" is mis-spelled as "lenght". It would help also to have tooltips for each of the individual types, so that creators can know what they all mean.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Zeno

Quote from: jamespetts on March 19, 2009, 09:58:16 PM
what language is it supposed to be in?
English. But my dev.environment is in spanish, so you'll find some words like that button in spanish. Then all internal names aren't translated yet, so most are in german, some in english.

Quote from: jamespetts on March 19, 2009, 09:58:16 PM
Also, the waytypes seem to be out of date: "electrified track" is no longer a separate waytype, but narrow gauge, monorail and maglev are.
Wow... thanks for that one. I have to admit I haven't put enough attention on that, simply took the values from that list that has always been there, you know  :-[

Quote from: jamespetts on March 19, 2009, 09:58:16 PM
The introduction date cannot be set earlier than 1930 (many paksets allow for pre-1930 building), and the word "length" is mis-spelled as "lenght".
Should I use 1800? Or you think it's better to let the user type it in? Maybe both, selectable from 1870-2040, but allow to input values?

Quote from: jamespetts on March 19, 2009, 09:58:16 PM
It would help also to have tooltips for each of the individual types, so that creators can know what they all mean.
You mean a description on each field about what it is and which values are allowed? I've got in mind, but I prefer to code first functionality, then details, help, translations, and so on. And I'm still in the first step! :o

jamespetts

Ahh, I understand about the development environment, etc. - no doubt those are issues that can be fixed in time :-) I agree with your third suggestion - selectable between 1870 and 2040, and allowing the user to type in anything else.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Zeno

I was thinking in making configuration files for each pakset, which would include: set of supported keys/instructions (obj,name,author,freight,etc), set of supported types (list of freight types, way types, engine types, ...). Then the application should work based on startup pak selection. Do you think it's a good idea? Any reason to believe this won't be possible?

VS

Good idea. I was afraid of suggesting exactly that :-\

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Zeno

Quote from: jamespetts on March 19, 2009, 09:58:16 PM
Also, the waytypes seem to be out of date: "electrified track" is no longer a separate waytype, but narrow gauge, monorail and maglev are.
Sorry but all my electric vehicles (as much as a couple) are codified using "electrified track", and they work nice... I knew about monorail, but never heard a word about narrow gauge and maglevs in pak128... ::)
I'll need to take a look at the vehicle codings in the repository. Btw, is there any "official" documentation on it? I didn't find anythink about these collections (engines, ways,...) in the wiki (neither the german one).

jamespetts

"Electrified track" works because makeobj and/or Simutrans has backwards compatibility code to deal with legacy .dat files. Pak128 does not have narrow gauge or Maglev, but they are in Simutrans. There is a Maglev addon for Pak128. I am not sure whether any Paksets presently use narrow gauge, although I have a recollection that the PakGerman and/or Pak64 might have had it at some stage.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Zeno

Yes, sure... I should have thought on that. Anyway, I can't find any documentation on this in the english wiki, and the german wiki seems not to be working. Anyone knows if there is any information on this types and its values?


Zeno

Wow! Danke! Thanks a lot Frank!  :o

PS: Japanese is not my strongest language (neither Deustch) but contents are clear enough!

Zeno

Ok, after drawing a million planes (maybe a billion) I'm back with this ;)

Quote from: Zeno on March 22, 2009, 01:20:06 PM
I was thinking in making configuration files for each pakset, which would include: set of supported keys/instructions (obj,name,author,freight,etc), set of supported types (list of freight types, way types, engine types, ...). Then the application should work based on startup pak selection.
Quote from: VS on March 22, 2009, 02:39:04 PM
Good idea. I was afraid of suggesting exactly that :-\
Ok, let's go with it then. Now type lists including engines, ways, categories and freights, are loaded from external csv files. I'll proceed to a ask for a pak (like simutrans) at very first launching the application, then load the values for that pakset. Any idea/complain on that?

I'll spend some of my time with the editor from now, after being away from it for a while, so I expect having some improvements soon. Btw, I've already included a small translation system (also based in external csv files), as well as corrected some dropdown selection issues in the editor form. Once it works a little, then I'll put my attention on the PNG managing window.
Stay tuned ;)

Zeno

There's a new version on the file server. There is no much change since last version though, at least if you do a quick look on it.
I've changed half of the code to keep the application just as it was before, but well, this kind of things happen ;)
File handling has been fully recoded, and now save and save_as functionalities are enabled, and even seem to work.
I have recoded most of type-lists stuff: that means all selectable options in engine, freight, category and way type dropdowns. They are now configurable by external files and pak dependant. You can take a look on the files in the config folder.
I've also added a trivial and manual translation system, which consists on lists of internal_name;translated_name items. Again in external csv files. They're in the translations folder.
All other options haven't been tested yed, and may (or not) be recoded as well. I've done a couple of tests: I've created a simple (very simple) vehicle, and I was able to save it, and loaded it back without any problem. Anyway, I didn't try to compile it with makeobj  ;D
Again, it seems to load any pak128 objects and save them back; but that hasn't been hardly tested yet.
So you can download it (same link) to take a look, mainly at the editor window, but don't expect to mess a lot with it, as it is still in pre-beta status.

PS: Pak64 files haven't been changed yet; they're just pak128 copies!