Tileset Builder 2

Information and discussion for custom maps and mods.
User avatar
katzsmile
Posts: 39
Joined: Mon Sep 06, 2010 7:03 am
Location: Arkhangelsk
Contact:

Tileset Builder 2

Post by katzsmile »

New Tileset builder

Features:
- You can specify palette for image
- You can create new tileset in any moment
- Preloading terrain type defaults
- Editable tileset properties
- Fixed XCC Mixer compatibility (only for 24x24px tiles)
- Fixed magic typo

Sources included
Attachments
Tileset Builder 2
Tileset Builder 2
tilesetbuilder2.jpg (370.89 KiB) Viewed 17156 times
TilesetBuilder2.zip
Tileset Builder 2
(311.39 KiB) Downloaded 883 times

User avatar
zypres1
Posts: 276
Joined: Mon Oct 24, 2011 8:22 pm

thank you.

Post by zypres1 »

Thank you.

I do not understand this, but thank you, this wil open for new maps...

What kind of tiles do we need or want?

*dune (like yours)
*next x-mas maps?
*jungle
*frozen (ice over lakes, but cannot pass)
*city
*Metro33
*offshore and pirate sea
*area 51
*mordor
*what more can we wish for?

User avatar
Petrenko
Posts: 156
Joined: Fri Apr 08, 2011 5:36 pm

Post by Petrenko »

Heyho.

I tried making a tileset for cnc but i have a problem:

I doesn't shop up in the editor.
I got no idea where to put the .pal

There is a .png of my try attached.
Attachments
try.png
try.png (433.86 KiB) Viewed 17047 times
Hail to the soviets!

User avatar
Petrenko
Posts: 156
Joined: Fri Apr 08, 2011 5:36 pm

Post by Petrenko »

If anyone else wants to try i edited a z-terrain to fit in the 24pixel tilesize and adjusted the colours a bit.
Attachments
jungle.rar
(596.37 KiB) Downloaded 771 times
Hail to the soviets!

User avatar
katzsmile
Posts: 39
Joined: Mon Sep 06, 2010 7:03 am
Location: Arkhangelsk
Contact:

Post by katzsmile »

.pal must go to bits folder
tileset yaml must be listed in mod.yaml

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

I think this should replace Tileset Builder 1 which I can't even start because it requires two undocumented command line options.

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

Rough and Rock have the same color which makes them indistinguishable.

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

Export crashed with 32x32 d2k_BLOXBASE.BMP

Code: Select all

System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter]
  at System.Drawing.GDIPlus.CheckStatus (Status status) [0x0009d] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs:220 
  at System.Drawing.Bitmap.LockBits (Rectangle rect, ImageLockMode flags, PixelFormat format, System.Drawing.Imaging.BitmapData bitmapData) [0x00012] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/System.Drawing/System.Drawing/Bitmap.cs:280 
  at System.Drawing.Bitmap.LockBits (Rectangle rect, ImageLockMode flags, PixelFormat format) [0x00006] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/System.Drawing/System.Drawing/Bitmap.cs:270 
  at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:LockBits (System.Drawing.Rectangle,System.Drawing.Imaging.ImageLockMode,System.Drawing.Imaging.PixelFormat)
  at OpenRA.TilesetBuilder2.frmBuilder.ExportTemplate &#40;OpenRA.TilesetBuilder2.Template t, Int32 n, System.String suffix, System.String dir&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
  at OpenRA.TilesetBuilder2.frmBuilder.ExportClicked &#40;System.Object sender, System.EventArgs e&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
  at System.Windows.Forms.ToolStripItem.OnClick &#40;System.EventArgs e&#41; &#91;0x0001c&#93; in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs&#58;1002 
  at System.Windows.Forms.ToolStripButton.OnClick &#40;System.EventArgs e&#41; &#91;0x0001a&#93; in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripButton.cs&#58;186 
  at System.Windows.Forms.ToolStripItem.HandleClick &#40;Int32 mouse_clicks, System.EventArgs e&#41; &#91;0x0002a&#93; in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs&#58;1812 
  at System.Windows.Forms.ToolStripItem.FireEvent &#40;System.EventArgs e, ToolStripItemEventType met&#41; &#91;0x00042&#93; in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs&#58;1779 
  at &#40;wrapper remoting-invoke-with-check&#41; System.Windows.Forms.ToolStripItem&#58;FireEvent &#40;System.EventArgs,System.Windows.Forms.ToolStripItemEventType&#41;
  at System.Windows.Forms.ToolStrip.OnMouseUp &#40;System.Windows.Forms.MouseEventArgs mea&#41; &#91;0x00047&#93; in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs&#58;965 
  at System.Windows.Forms.Control.WmLButtonUp &#40;System.Windows.Forms.Message& m&#41; &#91;0x0007e&#93; in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs&#58;5278 
  at System.Windows.Forms.Control.WndProc &#40;System.Windows.Forms.Message& m&#41; &#91;0x0017b&#93; in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs&#58;5019 
  at System.Windows.Forms.ScrollableControl.WndProc &#40;System.Windows.Forms.Message& m&#41; &#91;0x00000&#93; in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs&#58;813 
  at System.Windows.Forms.ToolStrip.WndProc &#40;System.Windows.Forms.Message& m&#41; &#91;0x00000&#93; in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs&#58;1221 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage &#40;System.Windows.Forms.Message& m&#41; &#91;0x00000&#93; in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs&#58;228 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc &#40;System.Windows.Forms.Message& m&#41; &#91;0x00000&#93; in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs&#58;209 
  at System.Windows.Forms.NativeWindow.WndProc &#40;IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam&#41; &#91;0x00085&#93; in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs&#58;242
I am using the precompiled sources with Mono.

PS: Compiling it myself won't help.

User avatar
katzsmile
Posts: 39
Joined: Mon Sep 06, 2010 7:03 am
Location: Arkhangelsk
Contact:

Post by katzsmile »

My tools - SHPViewer and TileSetBuilder 2 is not designed for Linux and Mono. Never ever try using it underr Mono. Or grab the sources and fix the bugs yourself

User avatar
Harisson
Posts: 149
Joined: Sun Jan 13, 2008 10:03 pm

Post by Harisson »

katzsmile, can you allow tileset with less size ? Maybe 16x16....

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

Crashes on Windows XP, too. Sorry for German error messages.

Code: Select all

************** Ausnahmetext **************
System.ArgumentException&#58; Ungültiger Parameter.
   bei System.Drawing.Bitmap.LockBits&#40;Rectangle rect, ImageLockMode flags, PixelFormat format, BitmapData bitmapData&#41;
   bei System.Drawing.Bitmap.LockBits&#40;Rectangle rect, ImageLockMode flags, PixelFormat format&#41;
   bei OpenRA.TilesetBuilder2.frmBuilder.ExportTemplate&#40;Template t, Int32 n, String suffix, String dir&#41;
   bei OpenRA.TilesetBuilder2.frmBuilder.ExportClicked&#40;Object sender, EventArgs e&#41;
   bei System.Windows.Forms.ToolStripItem.RaiseEvent&#40;Object key, EventArgs e&#41;
   bei System.Windows.Forms.ToolStripButton.OnClick&#40;EventArgs e&#41;
   bei System.Windows.Forms.ToolStripItem.HandleClick&#40;EventArgs e&#41;
   bei System.Windows.Forms.ToolStripItem.HandleMouseUp&#40;MouseEventArgs e&#41;
   bei System.Windows.Forms.ToolStripItem.FireEventInteractive&#40;EventArgs e, ToolStripItemEventType met&#41;
   bei System.Windows.Forms.ToolStripItem.FireEvent&#40;EventArgs e, ToolStripItemEventType met&#41;
   bei System.Windows.Forms.ToolStrip.OnMouseUp&#40;MouseEventArgs mea&#41;
   bei System.Windows.Forms.Control.WmMouseUp&#40;Message& m, MouseButtons button, Int32 clicks&#41;
   bei System.Windows.Forms.Control.WndProc&#40;Message& m&#41;
   bei System.Windows.Forms.ScrollableControl.WndProc&#40;Message& m&#41;
   bei System.Windows.Forms.ToolStrip.WndProc&#40;Message& m&#41;
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage&#40;Message& m&#41;
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc&#40;Message& m&#41;
   bei System.Windows.Forms.NativeWindow.Callback&#40;IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam&#41;


************** Geladene Assemblys **************
mscorlib
    Assembly-Version&#58; 2.0.0.0.
    Win32-Version&#58; 2.0.50727.3634 &#40;GDR.050727-3600&#41;.
    CodeBase&#58; file&#58;///C&#58;/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll.
----------------------------------------
OpenRA.TilesetBuilder2
    Assembly-Version&#58; 1.0.0.0.
    Win32-Version&#58; 1.0.0.0.
    CodeBase&#58; file&#58;///E&#58;/TilesetBuilder2/OpenRA.TilesetBuilder2.exe.
----------------------------------------
System.Windows.Forms
    Assembly-Version&#58; 2.0.0.0.
    Win32-Version&#58; 2.0.50727.3634 &#40;GDR.050727-3600&#41;.
    CodeBase&#58; file&#58;///C&#58;/windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll.
----------------------------------------
System
    Assembly-Version&#58; 2.0.0.0.
    Win32-Version&#58; 2.0.50727.3634 &#40;GDR.050727-3600&#41;.
    CodeBase&#58; file&#58;///C&#58;/windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll.
----------------------------------------
System.Drawing
    Assembly-Version&#58; 2.0.0.0.
    Win32-Version&#58; 2.0.50727.3636 &#40;GDR.050727-3600&#41;.
    CodeBase&#58; file&#58;///C&#58;/windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.
----------------------------------------
OpenRA.FileFormats
    Assembly-Version&#58; 1.0.0.0.
    Win32-Version&#58; 1.0.0.0.
    CodeBase&#58; file&#58;///E&#58;/TilesetBuilder2/OpenRA.FileFormats.DLL.
----------------------------------------
System.Core
    Assembly-Version&#58; 3.5.0.0.
    Win32-Version&#58; 3.5.30729.1 built by&#58; SP.
    CodeBase&#58; file&#58;///C&#58;/windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll.
----------------------------------------
mscorlib.resources
    Assembly-Version&#58; 2.0.0.0.
    Win32-Version&#58; 2.0.50727.3634 &#40;GDR.050727-3600&#41;.
    CodeBase&#58; file&#58;///C&#58;/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll.
----------------------------------------
System.Xml
    Assembly-Version&#58; 2.0.0.0.
    Win32-Version&#58; 2.0.50727.3053 &#40;netfxsp.050727-3000&#41;.
    CodeBase&#58; file&#58;///C&#58;/windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll.
----------------------------------------
System.Drawing.resources
    Assembly-Version&#58; 2.0.0.0.
    Win32-Version&#58; 2.0.50727.3053 &#40;netfxsp.050727-3000&#41;.
    CodeBase&#58; file&#58;///C&#58;/windows/assembly/GAC_MSIL/System.Drawing.resources/2.0.0.0_de_b03f5f7f11d50a3a/System.Drawing.resources.dll.
----------------------------------------
System.Windows.Forms.resources
    Assembly-Version&#58; 2.0.0.0.
    Win32-Version&#58; 2.0.50727.3053 &#40;netfxsp.050727-3000&#41;.
    CodeBase&#58; file&#58;///C&#58;/windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_de_b77a5c561934e089/System.Windows.Forms.resources.dll.
----------------------------------------
I don't understand the code so I doubt I can fix this myself :/

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

researching the problems

Post by Matt »

I started trying to fix it:

Code: Select all

				var data = src.LockBits&#40;new Rectangle&#40;0, 0, src.Width, src.Height&#41;,
					ImageLockMode.ReadOnly, PixelFormat.Format8bppIndexed&#41;;
seems to fail because the surface1.Image is not Format8bppIndexed as System.Drawing won't work with indexed images. I have not found a solution to this.

I changed DPI from 96x96 to 72x72 because this is what GIMP tells me when I open BLOXBASE.bmp

Code: Select all

surface1.Image.SetResolution&#40;72, 72&#41;;
I also had to remove setting TerrainType to anything other then "Clear":

Code: Select all

string ttype = "Clear";
//ttype = TerrainType&#91;surface1.TerrainTypes&#91;t.Key.X, t.Key.Y&#93;&#93;.Type;
because I get ArrayIndex out of range otherwise.

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

I fixed the crash https://github.com/Mailaender/OpenRA/co ... ef59a91ddf and cleaned up the whole code and added it to the MakeFile.

Bitmap src was not properly initialized and SetPixel on Bitmap rbitmap screwed the palette (it does not work with 8bpp) so I replaced it with clone. Took me some time to fix this.

Fixing the broken TerrainType array is next on my TODO list.

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

Petrenko wrote: If anyone else wants to try i edited a z-terrain to fit in the 24pixel tilesize and adjusted the colours a bit.
Everything in OpenRA is indexed to a 8bit color palette. Your PNG is a regular RGB file. I think you just need to convert it.

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

Everything is fixed now (except MIX file writing) and merged into OpenRA.

Post Reply