Page 1 of 2
Tileset Builder 2
Posted: Wed Jan 25, 2012 9:00 am
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
thank you.
Posted: Thu Jan 26, 2012 12:54 am
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?
Posted: Fri Feb 10, 2012 9:45 pm
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.
Posted: Fri Feb 10, 2012 9:50 pm
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.
Posted: Sat Feb 11, 2012 9:48 pm
by katzsmile
.pal must go to bits folder
tileset yaml must be listed in mod.yaml
Posted: Sat May 26, 2012 11:06 am
by Matt
I think this should replace Tileset Builder 1 which I can't even start because it requires two undocumented command line options.
Posted: Sat May 26, 2012 4:51 pm
by Matt
Rough and Rock have the same color which makes them indistinguishable.
Posted: Sat May 26, 2012 4:55 pm
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 (OpenRA.TilesetBuilder2.Template t, Int32 n, System.String suffix, System.String dir) [0x00000] in <filename unknown>:0
at OpenRA.TilesetBuilder2.frmBuilder.ExportClicked (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ToolStripItem.OnClick (System.EventArgs e) [0x0001c] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs:1002
at System.Windows.Forms.ToolStripButton.OnClick (System.EventArgs e) [0x0001a] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripButton.cs:186
at System.Windows.Forms.ToolStripItem.HandleClick (Int32 mouse_clicks, System.EventArgs e) [0x0002a] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs:1812
at System.Windows.Forms.ToolStripItem.FireEvent (System.EventArgs e, ToolStripItemEventType met) [0x00042] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs:1779
at (wrapper remoting-invoke-with-check) System.Windows.Forms.ToolStripItem:FireEvent (System.EventArgs,System.Windows.Forms.ToolStripItemEventType)
at System.Windows.Forms.ToolStrip.OnMouseUp (System.Windows.Forms.MouseEventArgs mea) [0x00047] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs:965
at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m) [0x0007e] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5278
at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x0017b] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5019
at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message& m) [0x00000] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs:813
at System.Windows.Forms.ToolStrip.WndProc (System.Windows.Forms.Message& m) [0x00000] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs:1221
at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:228
at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:209
at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00085] in /home/abuild/rpmbuild/BUILD/mono-2.10.6/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs:242
I am using the precompiled sources with Mono.
PS: Compiling it myself won't help.
Posted: Thu May 31, 2012 10:50 am
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
Posted: Thu May 31, 2012 11:11 am
by Harisson
katzsmile, can you allow tileset with less size ? Maybe 16x16....
Posted: Thu May 31, 2012 2:12 pm
by Matt
Crashes on Windows XP, too. Sorry for German error messages.
Code: Select all
************** Ausnahmetext **************
System.ArgumentException: Ungültiger Parameter.
bei System.Drawing.Bitmap.LockBits(Rectangle rect, ImageLockMode flags, PixelFormat format, BitmapData bitmapData)
bei System.Drawing.Bitmap.LockBits(Rectangle rect, ImageLockMode flags, PixelFormat format)
bei OpenRA.TilesetBuilder2.frmBuilder.ExportTemplate(Template t, Int32 n, String suffix, String dir)
bei OpenRA.TilesetBuilder2.frmBuilder.ExportClicked(Object sender, EventArgs e)
bei System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
bei System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
bei System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
bei System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
bei System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
bei System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
bei System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ToolStrip.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.3634 (GDR.050727-3600).
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll.
----------------------------------------
OpenRA.TilesetBuilder2
Assembly-Version: 1.0.0.0.
Win32-Version: 1.0.0.0.
CodeBase: file:///E:/TilesetBuilder2/OpenRA.TilesetBuilder2.exe.
----------------------------------------
System.Windows.Forms
Assembly-Version: 2.0.0.0.
Win32-Version: 2.0.50727.3634 (GDR.050727-3600).
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.3634 (GDR.050727-3600).
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.3636 (GDR.050727-3600).
CodeBase: file:///C:/windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.
----------------------------------------
OpenRA.FileFormats
Assembly-Version: 1.0.0.0.
Win32-Version: 1.0.0.0.
CodeBase: file:///E:/TilesetBuilder2/OpenRA.FileFormats.DLL.
----------------------------------------
System.Core
Assembly-Version: 3.5.0.0.
Win32-Version: 3.5.30729.1 built by: SP.
CodeBase: file:///C:/windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll.
----------------------------------------
mscorlib.resources
Assembly-Version: 2.0.0.0.
Win32-Version: 2.0.50727.3634 (GDR.050727-3600).
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll.
----------------------------------------
System.Xml
Assembly-Version: 2.0.0.0.
Win32-Version: 2.0.50727.3053 (netfxsp.050727-3000).
CodeBase: file:///C:/windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll.
----------------------------------------
System.Drawing.resources
Assembly-Version: 2.0.0.0.
Win32-Version: 2.0.50727.3053 (netfxsp.050727-3000).
CodeBase: file:///C:/windows/assembly/GAC_MSIL/System.Drawing.resources/2.0.0.0_de_b03f5f7f11d50a3a/System.Drawing.resources.dll.
----------------------------------------
System.Windows.Forms.resources
Assembly-Version: 2.0.0.0.
Win32-Version: 2.0.50727.3053 (netfxsp.050727-3000).
CodeBase: file:///C:/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

researching the problems
Posted: Wed Jun 06, 2012 2:28 pm
by Matt
I started trying to fix it:
Code: Select all
var data = src.LockBits(new Rectangle(0, 0, src.Width, src.Height),
ImageLockMode.ReadOnly, PixelFormat.Format8bppIndexed);
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(72, 72);
I also had to remove setting TerrainType to anything other then "Clear":
Code: Select all
string ttype = "Clear";
//ttype = TerrainType[surface1.TerrainTypes[t.Key.X, t.Key.Y]].Type;
because I get ArrayIndex out of range otherwise.
Posted: Thu Jun 07, 2012 5:28 pm
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.
Posted: Thu Jun 07, 2012 6:15 pm
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.
Posted: Sun Jun 17, 2012 11:02 am
by Matt
Everything is fixed now (except MIX file writing) and merged into OpenRA.