Product Chat (Early Access) / [SOLVED] Camera Shake When Shooting etc

Author
Message
Corghis
2
Years of Service
User Offline
Joined: 21st Jul 2022
Location:
Posted: 21st Jul 2022 21:51
Hi all. I saw on the last broadcast that there was camera shake when the player was getting hurt. As the title suggests, I think it would be a good idea to let us put camera shake in other actions as well, like shooting (idk if this is planned, correct me if I missed something). I think that a lot of feedback to the player is missing on stuff like that, and that would make any game better and give some much needed feedback from the game to the player. For example you can check the last modern warfare, or Tarkov, when the player shoots the camera shakes a bit, in combination with the recoil. Now I'm not talking about having mechanics like that and I know its impossible in GGM, but think of the possibilities. Like for example, if you wanted to make a Night Vision mechanic, having the screen shake a bit when its activated, or have different shake amount(?) in every weapon (which would make every weapon feel different.) The mechanic is allready there, we just need more control over it I think. What are your thoughts?

The author of this post has marked a post as an answer.

Go to answer
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 22nd Jul 2022 11:24
Just call GamePlayerControlAddShakeTrauma( num ) where num is 1-100.

There are other functions you can call to alter the shake behaviour but they require a deeper understanding of camera shake to really use them properly.

The Trauma is additive btw (that's why it is called AddTrauma) so if several events occur at the same time it will strengthen the shake, so for example if both events Add 25 (the default) then the result will be a Trauma of 50.
Been there, done that, got all the T-Shirts!
PM
science boy
16
Years of Service
User Offline
Joined: 3rd Oct 2008
Location: Up the creek
Posted: 23rd Jul 2022 00:46
I think there is a multitude of opportunity for cam shake

Not just shooting (very limited imagination)

Earthquakes
Landslides, cave ins,
Collapsed buildings, bridges, nuclear explosions and bombs,
Cold and exposure (survival)
Transport and crashes


This would be good to have as an added script to an action
Or player in zone.
Lots of options

Question
Player in zone (trigger zone) is there going to be or is there possibility to add multiple actions for trigger zone

Eg in basic...
You enter zone

1. Cam shake
2. Play sound
3. Entity appear
4. Animate entity
5. End all

Food for thought

Im 50 now aint a kid travelled the world been in terrorist bombing shot at near kidnapped. Have an audi a house a fiancee a cat and ex dj and promoter and now home Manager. Have a degree and lots of quals and this is actually all true
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 23rd Jul 2022 13:56 Edited at: 23rd Jul 2022 13:56
Have a word with Necrym59
He has already done a pretty cool one and could probably add features you would like.
No one ever really leaves.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 23rd Jul 2022 14:04 Edited at: 23rd Jul 2022 14:05
Have a script:
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 23rd Jul 2022 23:21
Never mind .. Amen's works a treat also
No one ever really leaves.
PM
Corghis
2
Years of Service
User Offline
Joined: 21st Jul 2022
Location:
Posted: 25th Jul 2022 08:26
Thanks a lot for the comments but this isn't really what I'm saying. The idea of things like earthquakes and stuff like that all tho good (and very imaginative) is of course based on a script when you enter a specific zone. I'm talking about contextual actions (that's why I mentioned shooting). I'm talking about small camera shakes in specific actions, again for example, shooting, of when the mag enters the weapon during the reload animation. Small things like that, that I feel conveye information to player. And just as a disclaimer,I know the camera kicks up from the perceived recoil during firing, but I mean more like a shake from left to right.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th Jul 2022 11:54
This post has been marked by the post author as the answer.
Detect the player shooting (there is a global variable for that) then get the weapon name and based on that generate a shake.

Simple bit of scripting.
Been there, done that, got all the T-Shirts!
PM
Corghis
2
Years of Service
User Offline
Joined: 21st Jul 2022
Location:
Posted: 25th Jul 2022 14:51
Thank you Amen,I will give it a shot. Although I'd like to have different values for different guns. For example shooting 5.56 wouldn't be the same as firing a .50 bmg. I know I'm probably asking for a lot here. I just thought that, since the mechanic is there with the player trauma, it could be also used in other cases as well.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th Jul 2022 15:36
It's not very realistic though, your eyes don't shake when you do things like reload a weapon or even when you fire it.

You may get something like that if sat in a tank when the main gun fires, or on a ship when the guns go off but not for any actions you are physically responsible for.

I've fired many weapons at the range and even with weapons with considerable recoil you can keep your eyes locked on target during the shot, you don't notice any aberration of vision.
Been there, done that, got all the T-Shirts!
PM
Corghis
2
Years of Service
User Offline
Joined: 21st Jul 2022
Location:
Posted: 25th Jul 2022 15:56
Let me maybe re iterate. I'm talking about and effect similar to moder warfare's style. https://youtu.be/anCIKG8djIg notice here how the camera shakes a bit as well as going up. It's more about conveying the feeling that you are firing a weapon more than anything. Pure visual aesthetic. Its just a nice detail in my eyes. It's conveys info from the game to.player(the sound and animations of course do that as well,but I feel that's an extra detail that adds a lot). Again I'm not talking about anything too exaggerated,just a small detail that you notice more when it's not there than when it is. I hope I'm being clear enough and don't seem like rambling
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th Jul 2022 17:25
I understand what you are saying, just pointing out it's not realistic.

Whether it adds something to the experience or detracts from it is a matter of opinion.

I'm not too bothered as long as it can be turned off, I just implemented it and gave it to TGC, what people do with it is up to them.
Been there, done that, got all the T-Shirts!
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 26th Jul 2022 01:10
Not sure what effect this would have in VR ?
If its likely to cause any nauseous then they would probably avoid it.
No one ever really leaves.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 26th Jul 2022 10:37
Quote: "Not sure what effect this would have in VR ?
If its likely to cause any nauseous then they would probably avoid it."


Camera shake should never be used in VR.
Been there, done that, got all the T-Shirts!
PM
science boy
16
Years of Service
User Offline
Joined: 3rd Oct 2008
Location: Up the creek
Posted: 26th Jul 2022 11:55
Or could create the max vr camera shake challenge...
Im 50 now aint a kid travelled the world been in terrorist bombing shot at near kidnapped. Have an audi a house a fiancee a cat and ex dj and promoter and now home Manager. Have a degree and lots of quals and this is actually all true
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 26th Jul 2022 11:59
Quote: "Thank you Amen,I will give it a shot. Although I'd like to have different values for different guns. For example shooting 5.56 wouldn't be the same as firing a .50 bmg. I know I'm probably asking for a lot here. I just thought that, since the mechanic is there with the player trauma, it could be also used in other cases as well."

you can detect when a gun is fired and what gun it is so it's just a case of doing the logic check and shake as needed.

Quote: "Camera shake should never be used in VR."

as someone that gets very easily motion sick in VR i agree but it should/could still be an option as some people will still enjoy it even in VR
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 26th Jul 2022 14:45
It is a general rule for VR that you don't use camera shake effects, I'm not making it up!

I imagine that the effect would be like IRL having your eyeballs moving independently which your brain is not going to like!

The gunfire thing is a tad more difficult in MAX than I first thought, the global variable does not tell you when the gun fires, instead it tells you when the player presses the trigger!

This means that even if the weapon is empty or jammed the variable still goes to 1 when you press the trigger. More importantly it stays at 1 if you keep you finger on the LMB!

I haven't figured out yet how to determine that a single actual shot takes place.
Been there, done that, got all the T-Shirts!
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 26th Jul 2022 15:07
Quote: "I I'm not making it up!"

Absolutely not .. Camera shake in VR is certainly to be avoided.
Even watching a bad recording in VR is enough to make you want to throw up.
For some simple forward and rotation is enough to make you sick which is why the teleporting and step rotations are a feature in almost every game.
No one ever really leaves.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 26th Jul 2022 15:44 Edited at: 26th Jul 2022 15:47
Quote: "The gunfire thing is a tad more difficult in MAX than I first thought, the global variable does not tell you when the gun fires, instead it tells you when the player presses the trigger!

This means that even if the weapon is empty or jammed the variable still goes to 1 when you press the trigger. More importantly it stays at 1 if you keep you finger on the LMB!"

seems to indeed be a little broken for max in that it registers an empty shot but it does reset to 0 here if the gun doesn't actually keep firing (while held)

Quote: "I haven't figured out yet how to determine that a single actual shot takes place."

count the ammo?
the g_PlayerGunFired variable seems to work correctly in classic though so i assume Max's is just not quite implemented the same atm
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 28th Jul 2022 16:06 Edited at: 28th Jul 2022 16:07
So using smallg's method here is a simple gunfire shake script:
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Corghis
2
Years of Service
User Offline
Joined: 21st Jul 2022
Location:
Posted: 28th Jul 2022 20:20
Just tried Amen's script, works (almost) like a charm! And i thank him a lot as well as smallg for take the time. I really like the effect, only problem is, as Amen suggested in an earlier post, that the shake is additive, so when you fire full-auto it can get pretty hectic.
PM
Kraven W
Valued Member
5
Years of Service
User Offline
Joined: 28th Dec 2018
Location: United States
Posted: 28th Jul 2022 22:46 Edited at: 28th Jul 2022 22:49
Quote: "as Amen suggested in an earlier post, that the shake is additive, so when you fire full-auto it can get pretty hectic."

Couldn't you check to see if the ammo went down already within x m/s, and if it did, don't shake the screen again?

Also, thanks @AmenMoses, @smallg for the scripts. As usual, they are always much appreciated. Trying to learn from them.
Once a wolf, always a wolf.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 29th Jul 2022 17:59
It's just a starting point to show how it can be done, lot's of ways it can be improved upon.
Been there, done that, got all the T-Shirts!
PM
Corghis
2
Years of Service
User Offline
Joined: 21st Jul 2022
Location:
Posted: 29th Jul 2022 18:55
Fair enough! Will look into it when I have time. Thanks again for taking the time to help me out!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 30th Jul 2022 13:05
Quote: " Amen suggested in an earlier post, that the shake is additive, so when you fire full-auto it can get pretty hectic."


Increase the fade value to 2.5-3.0 and the shake will fade enough before the next shot of full auto.

Suggested values to use: Trauma 15, Fade 2.8, Period 30
Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-12-21 18:22:49
Your offset time is: 2024-12-21 18:22:49