Author Topic: Button to export walkable areas, hot spots, etc. rather than 100-step plan  (Read 1002 times)

AHA! Indexed Colour - thank you Privateer :D
I got confused because I kept thinking RGB more or less meant 256 colour, and... I don't know :tongue:

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
I thought someone would respond with 'good idea, we'll get straight on that and have a release in MM, YYYY' or 'No, *@& off, too hard.'
I did not realise that simply making the post would put it in the feature request cue.

That's not too hard, I believe, and I would not see a problem to add this export feature.
But someone need to find time to look into the code. As we are not the original creators of AGS, it will take more time to investigate the program first.
Right now nobody cannot tell when the release will be, because in the lack of active developers this process is not organized so well.
So all we can say: maybe.
Maybe, I could look too, if no one else does, but I cannot give promises because right now I am both trying to find a job and working on mine own hobby project.



BTW, The fact that AGS does not accept your 8-bit BMPs means only that you are not saving BMPs correctly.

Alright, fair enough - but how *do* I save them properly?
I must change the image, in order at least to resize.
If I save in paint.exe as a 256-colour BMP, it reduces the quality of the colours, making them useless to re-import.

Regarding BMP - Now I remember using Paint.NET. MS Paint is a bit weird. Now when I tried it, it definitely changes color hues a bit, but that might mean that you need to use colors that distinct more from each other.

Well, Privateer Puddin' already explained how to do that in Photoshop, so I guess that's a better solution.

Snarky

  • Global Moderator
  • Mittens Earl
  • Private Insultant
    • I can help with proof reading
    •  
    • I can help with translating
    •  
Privateer Puddin' already showed you how you could improve your workflow. I'll only add that you can do much the same using the magic wand, invert selection and crop. This is a really quick task once you get the workflow down!

The other thing I want to point out is that warnings from paint programs that reducing color depth will reduce color quality can almost certainly be ignored. It will, if there are more colors in the picture than there are in the palette, but that shouldn't be the case when your picture only contains the mask. And even if Paint distorts the colors somewhat when doing so, it shouldn't matter (as long as it doesn't introduce dithering, or merge two colors into one), since we don't care about the actual color, only the color/palette slot. The main challenge is if the application doesn't give you any control over which color goes in which palette slot, and hence which mask it will be imported as (in particular which color is 0: no mask).

Gilbert

  • * KILL* * KILL * * KILL *
    • Lifetime Achievement Award Winner
    •  
Haven't read all the posts, but AFAIK JPEG doesn't even support 8-bit (or indiced for that matter) images (unless it's GREYSCALE), so attempting to save something as a 8-bit JPEG is horribly wrong.

In fact, if JPEG works for mask importing, that could be considered a bug.

You mean - that it is included in a file filter?
I think AGS uses same file filter for all image-related open/save operations.

Yes, the file selector isn't filtering anything out, but there is a check after loading that should stop incompatible formats being used.

Code: C#
  1. if (bmp.PixelFormat != PixelFormat.Format8bppIndexed)
  2. {{
  3.     // don't use bmp
  4. }}

Earlier versions of the AGSExportPlugin would dump all hotspots, regions, walkable areas et al out to individual PNG files.  It now uses a different format but this could be forked to output to whatever format was needed.
XAGE - Cross-Platform Adventure Game Engine (alpha)

Which version? Not version 0.6, and there's no other on the code page (or the site, which is down).
This would be perfect for me (and for the code to make the export button) - is it a whole section of code or just a switch (SaveAsPNG)? Is it still in the 'master' branch? (doesn't seme to be any others)

Also in 0.6 there's some code that appears to export to PNG's:

Code: Adventure Game Studio
  1.         private void WriteBackgrounds(XmlTextWriter output, ILoadedRoom room, string roomName)
  2.         {
  3.             output.WriteStartElement("Backgrounds");
  4.             for (int j = 0; j < room.BackgroundCount; j++)
  5.             {
  6.                 using (Bitmap bmp = new Bitmap(room.Width, room.Height))
  7.                 using (Graphics g = Graphics.FromImage(bmp))
  8.                 {
  9.                     // NEW - store as seperate .png file
  10.                     editor.RoomController.DrawRoomBackground(g, 0, 0, j, 1);
  11.                     string roomFileName = PathRoomBackgrounds + GetValidPath(roomName) + "_" + j + ".png";
  12.                     //MessageBox.Show(roomFileName);
  13.                     bmp.Save(roomFileName, ImageFormat.Png);   //THIS LINE
  14.                 }
  15.             }
  16.             output.WriteEndElement(); // Backgrounds
  17.         }

...but not in the plugin GUI. So... I dunno :/
« Last Edit: 08 Apr 2018, 22:46 by bx83 »

Anyone...?

I've added links to some older versions of the plugin on the other thread.  Hopefully you can get some use out of it.
XAGE - Cross-Platform Adventure Game Engine (alpha)

Thank you, I’ll try them out :D

(Ps the link to the the forum is: http://www.adventuregamestudio.co.uk/forums/index.php?topic=39050.0  )
« Last Edit: 10 Apr 2018, 04:02 by bx83 »

Ps do you have the code from v<0.6?

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Ps do you have the code from v<0.6?

bx83, just a little suggestion, since this thread is filled with all kinds of stuff already, that may be more convenient to discuss Clarvalon's plugin in its own thread? (You linked it above yourself)

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
bx83, I realize this is probably be too late for your project (hopefully you managed to make use of the Clarvalon's plugin); but I finally found time to do this, and there is an upcoming change that just adds "Export mask" button to the room editor toolbar (near "Import mask" button). It saves only 1 mask at a time (the one selected in the room mode). Of course this is not close to automated solution that Clarvalon's exporting plugin provides, but will at least give an opportunity to user to export particular masks when needed.

You were right that it did not take much code to make one (although it took a while to find necessary functions to use). This could have been done much earlier.
« Last Edit: 15 May 2018, 00:55 by Crimson Wizard »