Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)
players can accidentally trigger events just by clicking somewhere on the map

This is a game. It is an artificially created environment. If something there can be accidentally triggered when it is not the right time for the event, then this is a bug. Instead of fixing that bug, you think about restricting the whole input system.

Think about it in reverse. You have a mega bomb in your space shooter game and can activate it with space key and by clicking the icon with the mouse. But you notice that you can fire the bomb even if you are out of ammo if you press space. The solution: deactivte the keyboard.

That's what your solution sounds like, to me.

Finally, I think I'll try to design a plugin so that the left mouse click doesn't act as an action key and will only be used for movement. 

Although I still think that moving around using the keyboard is more reliable, some colleagues have suggested that I keep the mouse mainly for accessibility reasons, as perhaps not everyone can use just the keyboard...

Thank you also for your funny comment about the mega bomb, I found it very amusing. 

In fact, to avoid accidental activation, the safest thing would be to deactivate both the keyboard and the mouse as well. 😁

... or how about deactivating the event when it is not time for that event.

If the event can be activated no matter the cause, that will lead to additional trouble. Like being able to activate the event multiple times. You seem to not have a logic inside the event (or at the even starter) to check if the event is allowed to be activated. Like entering a room that you do not have the key for.

The specific case is, imagine something buried in a part of the ground that is exactly the same as the rest, there is no difference. Or a passageway under a carpet.

The player uses the left mouse button to move around and also to activate events by clicking on them. In the cases I mentioned, you may click accidentally, as both are part of the terrain you can walk on. 

However, with the keyboard, you have to position yourself exactly where you want to ‘interact’ on the terrain and press the ‘action’ button, which is different from the movement button.

Therefore, to leave mouse input enabled, what I am going to do is try to modify the behaviour of the left click. It should be used to move, but it should be separate from the action button.

I hope I have explained myself clearly...

Which makes me wonder how does a keyboard moving player know when to press the action button.

Well, in the cases I mentioned, finding a map that marks an exact spot, or a clue that says “dig (for example) just to the right of the well, or next to the burnt tree...”  

The rest of the interactions are obvious: pick up an object, open a cupboard, open a door...

In that case you could deactivate the events till the clues are found and then activate them for either input system. While it is easier with mouse, running around and randomly hitting the action button is possible with keyboard too, if you allow for things to be found without clue.

Input devices are not equal. All have advantages and disadvanteges in comparison. A touch screen vs mouse for example means you can have several pointers hovering over the screen instead of one cursor to move. That's almost cheating in a whack a mole game.

For the mouse movement/action input you could also check, if the interaction-object is "visible" or "hidden". Hidden objects could only be activated while already standing there. Finding a clue would make the objects unhidden. I remember games where you could dig up treasure and such, but that was a disctinct different action than move/action. You could still brute force it, but it was basically impossible due to map size and time required for a dig attempt.

"I remember games where you could dig up treasures and things like that, but that was clearly different from movement/action. You could still do it by brute force, but it was basically impossible due to the size of the map and the time it took to try to dig." --> That's exactly what I'm looking for. 

The problem is when the move button is the same as the one you would use to dig, which is what happens to me with the native mouse behavior. I could also disable events until clues are found, but it seems more organic to me if the player decides to activate “action” on one of the 100,000 squares on the forest floor and JUST happens to be on top of the “treasure” and finds it. Such luck would deserve a prize. Imagine the look on their face. I'm sure they would start digging all over the map :D 

I'm working on a plugin that keeps the left mouse button to move, but doesn't activate the action button, which will be triggered by the right mouse button or the keyboard.

(Sorry for my english...)