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

bx83

  • Get 'Er Doooooone
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)

bx83

  • Get 'Er Doooooone
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 »

bx83

  • Get 'Er Doooooone
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)

bx83

  • Get 'Er Doooooone
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 »

bx83

  • Get 'Er Doooooone
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 »

bx83

  • Get 'Er Doooooone
Hi Crimson - thankyou, very helpful :)  It 'might not be much', but to me it's fantastic.
Which release is it in? Not 3.1.4.15, obviously..?
« Last Edit: 25 Oct 2018, 13:59 by bx83 »

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 you were successful in using Clarvalon's exporter, so added it to next WIP version, found here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=55829.0
« Last Edit: 25 Oct 2018, 14:50 by Crimson Wizard »

bx83

  • Get 'Er Doooooone
When will it **aproximately** be released? I’m only asking — in the next 3 months or the next year? Helps to define when I can start using new (larger/longer) backgrounds. In future I will try to get rooms hotspot and walkable areas NOT made in the editor... :p


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!
When will it **aproximately** be released? I’m only asking — in the next 3 months or the next year? Helps to define when I can start using new (larger/longer) backgrounds. In future I will try to get rooms hotspot and walkable areas NOT made in the editor... :p

There are roughly two bigger feature we are planning to have in, one is the custom room viewport and another related to easier sprite (re)import.
The preliminary estimate for this is couple of months, but it still may take more for the final polish, updating the manual and so on.
The biggest question there is when this version will become stable enough (which may be earlier than the final release), but that's hard to predict.
« Last Edit: 25 Oct 2018, 23:04 by Crimson Wizard »

bx83

  • Get 'Er Doooooone
Cool, it's all happening :)

One thing - I didn't really use Clarvalon's thing because it was.... a bit useless. What it does:
-save hotspots etc. as sections of the background, not solid colours
-save them as separate images, not as part of the wider screen map, thus elliminating the main feature of this: to actually have hotspots/walkable areas etc. pixel perfect.

So basically, I've come up with this super-fun workaround:
1. If you're running Greenshot screenshot programme - don't
2. Open the room in the editor, select ie. Hotspots, change trans to nothing (so it's all solid colours)
3. Pres PrintSc; flip to paint.exe (the 'original' programme - in Windows 10); paste
4. Save as 16-colour bitmap
5. Close file, re-open in paint.net
6. Select the screen (pixel perfect section of the shot that;s the background only), crop it
7. Get rid of all the 'extra colours' and background; widen or shorten or whatever the canvas size
8. Save as 'defaults' - dithering 8, 8bit bmp
9. Import into AGS, and voila! You now have to start the tedious task of further get rid of all the extra crap, and changing colours which were invalid to their proper colour :P

So anyway, IF your export plugin doesn't do this (copys all walkable areas/walk behinds/hotspots, in the original colours, in a window the size of the background); then you might want to change it.
However, if it's too much work for the moment, I understand - I have my own process now for getting the walkables etc. anyway :)

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!
So anyway, IF your export plugin doesn't do this (copys all walkable areas/walk behinds/hotspots, in the original colours, in a window the size of the background); then you might want to change it.

It's not a plugin, it's a feature inside the editor. You could download the 3.5.0 editor, make the copy of your game and try this new version on that copy; that would be much easier to find out if it does what you want. After all, that's the purpose of posting a WIP version: to let users try out how it works early.

The tool button to export a mask is located close to the button that imports new mask. The only caveat is that it exports one type of mask at a time (you need to switch between modes) but that was the most trivial way to integrate this command in the existing UI.
« Last Edit: 26 Oct 2018, 11:29 by Crimson Wizard »