MODULE: Hint Highlighting

Started by artium, Sat 15/09/2018 20:48:32

Previous topic - Next topic

artium



Did you ever play an adventure game and got frustrated by not being able to find the next clue of a puzzle?

You try every item and click on every location, but there is no success...

So you open the walk-through and what is written there disappoints you.

It turns out that it was not something clever that you missed, but you did not notice that little pixel sized, not so outstanding, brick at the corner of the screen.

No more frustration for you players!

As part of learning to work with AGS, I developed a module that allows displaying hints.

After the easy integration (simply download and add it into your game), pressing an "SPACE" key (actually this is configurable) will highlight all the enabled hotspots/characters/objects on the screen.



It has several other configurable options that are explained in the "asc" file. Of course you can modify it as you wish, for example making the highlight visual style fit you game's theme.

If you find bugs or have suggestions or improvement requests, feel free to write me :)

Danvzare

I remember something like this called "ShowInteractiveAreas" by Billbis.
I wonder how yours differs though, and which is better. :-D

VampireWombat

I just checked and confirmed that something similar is part of the Extended ALARCOST template. But that makes green dots over the hotspots.
Dunno if I'd say any of them is better. Just slightly different.

Danvzare

I've been messing about with your new module, and I've improved it a tiny bit. Firstly by drastically increasing the speed in which it calculates everything, although now a hotspot has to be at least 2x2 to be detected. Secondly, by making the various rectangles more identifiable from each other.

Here's my version of your module, incase you want to incorporate any of those changes: LINK.
I don't know how to use GitHub, hence why I'm putting it here.

A few things to note though, that you need to improve on your module yourself.
Firstly, it only points out hotspots. What about objects and characters?
Secondly, you really need to make it pause the game when it's being used, because if you hold in the H key while walking in a scrolling room, the drawn rectangles follow the screen.
Thirdly, consider changing the default key to the spacebar, since that's usually what most games set this kind of hint thing to.

artium

I was not aware that there is already a module doing this. We have mostly the same functionality but there small differences I can see. It is not really important because this is a project for helping me learn AGS.

Quote from: Danvzare on Sun 16/09/2018 17:48:08
Firstly by drastically increasing the speed in which it calculates everything, although now a hotspot has to be at least 2x2 to be detected.

Great idea. Requiring the hotspots to be at least 2x2 is reasonable.
Nevertheless, currently, the overlay is calculated only when a button is pressed, not every cycle and even not while it is held. Therefore there is little requirement for speedup.

Quote from: Danvzare on Sun 16/09/2018 17:48:08
Secondly, by making the various rectangles more identifiable from each other.

This is a great addition as well!

Quote
I don't know how to use GitHub, hence why I'm putting it here.

I really loved your changes and want to incorporate them. But maybe this is an opportunity for you to learn git, and to make a name for yourself in somebody's else repository. I can send you a link to an interactive git tutorial and to guide how to work with github. PM me if you are interested.

Quote
Firstly, it only points out hotspots. What about objects and characters?

That is on my TODO list.

Quote
Secondly, you really need to make it pause the game when it's being used, because if you hold in the H key while walking in a scrolling room, the drawn rectangles follow the screen.

Agree, I will add it.

Quote
Thirdly, consider changing the default key to the spacebar, since that's usually what most games set this kind of hint thing to.

Agree a well.

Monsieur OUXX

did you host your source code online, on github or similar? It would be nice to always adopt that practice nowadays.
 

artium

Quote from: Monsieur OUXX on Wed 19/09/2018 10:54:38
did you host your source code online, on github or similar? It would be nice to always adopt that practice nowadays.

Yes I did. It is hosted on Github: https://github.com/alkhimey/HintsHighlight

Monsieur OUXX

Quote from: artium on Wed 19/09/2018 19:02:25
It is hosted on Github: https://github.com/alkhimey/HintsHighlight

EXCELLENT!


EDIT : Was- Was the github address at the top of the first post the whole time? :X
 

Crimson Wizard

Quote from: Monsieur OUXX on Thu 20/09/2018 09:24:12
EDIT : Was- Was the github address at the top of the first post the whole time? :X

Yes...

artium

Updates to the module are available:

  •     Randomized border color. (thanks to Danvzare )
  •     Sped up calculation time by only checking every other pixel for a hotspot. (thanks to Danvzare )
  •     Addition of border padding.
  •     Addition of hints for objects and characters.
  •     Improved README.

Additionaly, it is possible now to download an scm file.

CaptainD

#10
Apologies for digging up such an old thread, but I've given it a try and I'm getting an error, not sure if it's something I've done (or not done), or possibly related to the game's resolution (1280x720)?

Error running function "repeatedly_execute": Error (line 331): Script appears to be hung (a while loop ran 150001 times). The problem may be in a calling function; check the call stack.

The line number corresponds to the middle of static function HintsHighlighter::CalculateHintsForRoom().

I haven't changed any of the imported script (I realise this may be the problem).
 

Crimson Wizard

Quote from: CaptainD on Sun 19/11/2023 20:48:15Error running function "repeatedly_execute": Error (line 331): Script appears to be hung (a while loop ran 150001 times). The problem may be in a calling function; check the call stack.

The line number corresponds to the middle of static function HintsHighlighter::CalculateHintsForRoom().

This is fixed by adding a "noloopcheck" to the function's definition:

Code: ags
static function noloopcheck HintsHighlighter::CalculateHintsForRoom()

CaptainD

 

SMF spam blocked by CleanTalk