• News

• Industries

• Learning & Support

• Community

• Marketplace

# Game story modification, effects increase or decrease depending on movement

Is there a way to code something that changes game story and environment depending on how much you move mouse or move around? Like in the horror games, if you get to scared, start to panic and move the mouse around or run the game story and it’s visual effects change and also clockwise - if you stay calm everything is fine.
Might be complicated, but I’m just curious. I think it must be something involved with AI coding on the client, player side and in response it plays out as an AI who controls the story. Sounds pretty twisted, but interesting

Indeed. You could accumulate mouse delta - it would give you an idea of how far the mouse has travelled and the average direction (could be useful if the spiders are coming from the top of the screen - did the player flinch?)

Now, you’d need some playtesting to get the average scare factor from the target audience. Once you have a rough idea of how much folks experiencing it for the first time wiggle the mouse, you could run isInRange logic based on that number and decide whether something else happens.

1 Like

I’d go ahead and make it so the vector added gets multiplied by a float and if the result is more than a certain number then it sets an Enumeration to say what’s going to happen. Mine is less descriptive than his but I like it more

Thanks! Im not a programmer, but I kinda understand it, just in more creative way.
What exactly is Make Vector 2d and what it does? I could visualise this whole thing as geometric plane, where you hit certain points with the mouse movement, supported with eye view center point.
How about sound input usage in the same way for this idea? There was some game that you needed to scream just to play it or something like that, don’t remember the name.
Also same way you could use camera for facial recognition of fear and calmness, but I think that’s just way too much and would take forever to make it work.

It’s a two dimensional vector that stores 2 floats. As the mouse moves you can store how much it moved this frame in screen XY.