What is a good way to make objects glow in Imagemaps - Ren'Py

TotalHarem

Harem Cartel
Game Developer
May 23, 2023
61
424
Hey - I'll make it quick - the game I'm working on has lots of imagemaps. Right now, to highlight clickable objects, I just fire up Photoshop, use the selection tool, and then adjust the brightness.

university_library_state1.png university_library_state1_hovered.png

university_science_state1.png university_science_state1_hovered.png

However, as you can see, it has some sharp edges, looks grainy, and there are some annoying bits like other things get highlighted too (bad selection).

Are there any best ways to do it? The game has lots of imagemaps and I really need to boost their quality. Thanks!
 

TessaXYZ

Active Member
Game Developer
Mar 24, 2020
686
1,497
Re-render the image with only the character and layer it onto the base image with adjusted brightness.

Side-note, it's not great UX design to not signify what parts of the image can be interacted with, so you may want there to be some indication as such.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,581
2,219
My personal solution (which is very similar to what you are already doing):

  • Load the full sized rendered image into your image editor of choice (Photoshop, Paint.Net, GIMP, etc).

  • Duplicate the main image onto a new (2nd) layer. Duplicate 3rd, 4th, etc. layers depending on how many clickable buttons your image will be using.

  • Hide all the layers except the one you are currently interested in.

  • Carefully remove any/all parts of the image which will not be part of the current button. Leaving just the button image.

  • Increase the image brightness and contrast for the resulting button (make it stand out a little against the background).

  • Save the resulting image/button as a filename that makes sense using a file format that supports transparency. (webp, png, etc).
    Include the word "idle" as part of its name.
    (Personally, I'd save the image at its full size. So a button image might still be 1920x1080 with only a small fraction of that not being empty space).

  • Increase the image brightness and contrast again. By a larger amount this time. Perhaps add a halo/corona to the button too. And/or add a color tint to the whole button. Anything to add more distinctiveness compared with the idle image.
    Save this to a separate file. Include the word "hover" as part of its name.

  • Rinse and repeat for each of the buttons within your screen.

  • Save the base image file, including all layers somewhere else. Just so you can tweak things if needed.

  • Write your RenPy screen to use the background image, with imagebuttons using the idle/hover images on top.

The end result will be 1 background image (your original render) and 2 images per button (idle/hover).

Since both the idle and the hover images were made from the original render, any jaggedness will only be as a result of how careful you are at "cutting out" each button. The longer you take and the smaller the brush sizes you use to remove the background - the more seamless things will appear.

Edit: The contrast/brightness adjustments I suggested for the idle images will aid in what Tessa was suggested, where even the idle image stands out against the background. Though honestly, lots of other options are available to you... make the idle images black and white is one very visible answer.

Here's a couple of example posts I've made in the past where I've done exactly (or near enough) this.
https://f95zone.to/threads/how-to-make-an-imagemap.147846/#post-10064909
https://f95zone.to/threads/help-with-imagemaps.50306/post-3336130
https://f95zone.to/threads/finding-...point-click-game-on-renpy.25325/#post-1565577
https://f95zone.to/threads/intelligent-imagebuttons.63595/post-4333668

The 4th one is a bit over the top for your goals. But three of those four threads includes a link to a "test bench" game which can be downloaded and played (and the code viewed to see how it works).
 
Last edited:

TotalHarem

Harem Cartel
Game Developer
May 23, 2023
61
424
My personal...
Thanks a lot! Before posting, I tried checking the forums, but couldn't find relevant posts. Guess I'll make a .psd file per imagemap, and then have layers for various states (aka different people, positions on the empty imagemap).

Yes, that makes a lot of sense. Just need to make sure not to mess up cutting out the models.

Side-note, it's not great UX design to not signify what parts of the image can be interacted with, so you may want there to be some indication as such.
Do you mind giving an example of good ways you saw it being done? Like outlining the hotspot, or having some lower-level glow? I've been trying to resolve this problem but didn't find a good solution. Maybe throwing in some "INTERACT" sort of button on the hotspots.

Or if you could point me at a game that you think does it well would also be lit.
 

TessaXYZ

Active Member
Game Developer
Mar 24, 2020
686
1,497
Thanks a lot! Before posting, I tried checking the forums, but couldn't find relevant posts. Guess I'll make a .psd file per imagemap, and then have layers for various states (aka different people, positions on the empty imagemap).

Yes, that makes a lot of sense. Just need to make sure not to mess up cutting out the models.



Do you mind giving an example of good ways you saw it being done? Like outlining the hotspot, or having some lower-level glow? I've been trying to resolve this problem but didn't find a good solution. Maybe throwing in some "INTERACT" sort of button on the hotspots.

Or if you could point me at a game that you think does it well would also be lit.
I personally have interactions as a separate button over the character/object/area being interacted with. Alternatively, you can have an arrow over the character, a pulsing outline, etc. There's no right answer, it's a matter of how intrusive you're okay with it being.
 
  • Like
Reactions: TotalHarem

noping123

Well-Known Member
Game Developer
Jun 24, 2021
1,510
2,451
You've obviously gotten a couple ways to do this, but I'll share mine, which is a little bit different. Primarily, I don't really spend too much time in photoshop this way. (Honestly? It takes about the same amount of time as it would take me in photoshop, it's just a different way of doing it)

first: How it looks in my game.

screenshot0009.png


screenshot0010.png


(Note: I personally hate having anything "intrusive" on top of the images, unless its a mouseover like in that screenshot. Instead if you notice the 3 lines to the top right? That is a drop-down objectives menu, which tells you everything you can do. I have a tutorial explaining it all beforehand.)

Now - as I said, I spent very little time in photoshop for this. Instead, I use daz. Specifically? Canvasses.

I just opened daz (no scene loaded, so there's a few things missing) for a screenshot, here:

1701751312758.png


By default canvases is not selected, and alpha isn't either - those both need to be checked off. Next step, is to select the objects you wish to render, and then goto the "Nodes" dropdown, and choose "From selected". It'll ask you to name the node, then it will appear in the node list. Select it from the node list, render and....

What it does, is it will render ONLY what you selected in the scene - so if you select a figure (and their clothes, and anything else you want as part of the button), it will ONLY render that, but it will still take into account all the other objects in the scene. What this means is shadows, lighting - even other objects in the way, will all be considered. But ultimately the only thing rendered is what you selected, and everything else is simply transparent. (Or black if you don't check the alpha box - that bit is important.)

Example from the above screenshots:

fr1_clara1_idle.png

In this one I selected her, and the bottle, so that's what rendered. The table and everything else was accounted for, and still hid the parts of her that should be "hidden".

That image is my button - or more specifically, the idle button.

Adding an outline and lightness to that to create a hover image at that point is easy. Personally I just increase the lightness, add a stroke, and I'm done. You could do it any way you wish.

Here's an important note: I do not use imagemaps - so no hotspots or anything like that. I simply use full screen PNGs as the button (Idle and hover versions), and have them on top of the main render. By setting a focus_mask to the button, it ensures that ONLY the area that isn't transparent is clickable.

Another important note: Rendering a canvas in this way, takes almost as long as rendering the full image (Since it's still processing the full image, just rendering the majority of it transparent). For me this isn't a problem since #1 - render queues exist, and #2 - a render on average takes at MAXIMUM 20 minutes, usually well under, so the time it takes to render is about the same as I'd spend in photoshop messing around with layers and shit anyway, so I just find doing it like this a lot easier. Adjusting the lightness and adding an outline is trivial and takes a few seconds.




There's quite a few ways to accomplish this all, but that's mine anyway. I find it relatively painless and effective.
 

TotalHarem

Harem Cartel
Game Developer
May 23, 2023
61
424
You've obviously gotten a couple ways to do this, but I'll share mine...
That's nice, thanks for sharing! Since I'm so used to Photoshop, it's a bit more convenient for me, because I have a fixed camera at a single background that has lots of different states (states = what characters and at what positions they are present) - so it's easier to do it in psd.

Also, storing folders within each imagemap is convenient within Photoshop, so you have a master file for each location.

I ended up settling on the approach suggested by TessaXYZ and kinda just ended up throwing the interact button on top of all areas where you can interact. While you can argue about intrusiveness, this saves a huge amount of time, especially since you don't need to spend so long fixing every single glow/outline area.


It's definitely hacky, but in my case, it's easy to scale because I have a shitload of those.

I also realized that buttons work better for mobile. All about saving time I guess.