Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Announcements and Showcase
FPS Camera controller - Animated !

Robo
Guest
Quote
2021-03-12 15:39:14

With a few days of work adjusting Dieter's third person controller I managed to get a working FPS controller out of it along with all character animations showing up to boot !

See my video here:
https://www.youtube.com/watch?v=huymK9BIHXA

You can download the full ccb file here:
http://lasttrump.net/Downloads/FPS_Camera.zip


You can now get crouching working with crouching animations along with any animation you like :)

If Dieter or anyone wants to maybe smooth the jump animation or recode something so it has adjustable vertical angle limitations feel free...


marcw
Registered User
Quote
2021-03-12 19:40:45

Hello Robo,

Thank you very much for sharing your project relative to your contribution in the improvement of a FPS controller.

I watched your interesting video tutorial and I played with your demo.

Your demo works nicely.I noticed that the mouse pointer is invisible and that's good for me.

To make the player invisible, I apply a fully transparent alpha map like this one ( https://1drv.ms/u/s!AjokN1FU3jK1... ) to the materials assigned to the player.

:-)


smnmhmdy
Registered User
Quote
2021-03-13 16:32:22

This is an awesome idea, Thank you and csp-games!

This can be rewritten to work with the built-in fps camera controller instead, to overcome the mouse limitations with the screen edge and allow the max vertical angle to be adjusted, plus compacting the movement and animation handlers into a single behavior.

https://www.dropbox.com/s/32aeh4...
Here's my first attempt at doing that, I lifted most of the logic from my tp controller, and I'm sure it can be improved further.

Let me know what you think :)


hadoken
Guest
Quote
2021-03-13 22:00:20

Being a huge classic arkane studios' DMoM&M fan I like that first person whole body immersion a lot. Thanks for the idea and for working on it. Definitely a good feature for CopperCubers!


Robo
Guest
Quote
2021-03-14 09:33:30

Thanks for that marcw, smnmhmdy & hadojen.

I really like your first attempt smnmhmdy - smoother than what I have which is nice and fixes the mouse problem also.

Can the animation movement amount be changed via a menu item ? and I notice when you jump the player stops moving forward and wants to go striaght up even when running. Can this be fixed so he continues to move forward at the same speed during the jump ?

Other than that very nice ! - hope to see next update soon :)


smnmhmdy
Registered User
Quote
2021-03-16 16:13:32

Hey @Robo, There is a huge problem with my version and I've been trying to fix it for the past few days with little to no success. The animation on the camera gets less noticeable the further away you get from 0,0,0. It is a "bug" with camera's target value in general, if you add (0,0,1) to the camera's target while it's position is at 0,0,0 You get much more pronounced movement than if you would add the same amount when the camera position is at 100,0,0 for example. The only workaround I've found is to get the camera's position length and multiply it by whatever vector you're trying to add to the target. It works fairly good, But it this case, it also introduces extreme desync between the camera's position on the body and it's target (specially when the player is moving sideways).
Regardless, I'm actively trying to make it work because I really like the idea, But I guess for the time being the version that I've shared is obsolete :(


Robo
Guest
Quote
2021-03-17 00:22:50

Ok, thanks for the update. If anyone is able to fix it its you..I will wait for when your ready to relase the next update. cheers!


just_in_case
Moderator
Quote
2021-03-18 00:48:43

Very cool, but wasn't it known that anything that is attached to animated node will follow the animation as well.


Robo
Guest
Quote
2021-03-18 04:59:23

wrote:
Very cool, but wasn't it known that anything that is attached to animated node will follow the animation as well.


Yes, but getting the camera to work properly using any default camera controller causes issues - cant use many of the default settings..


hadoken
Guest
Quote
2021-04-29 10:44:52

Hello @smnmhmdy,

are there possibly any news from your meshbasedFpsController script? Have you maybe been able to overcome the mentioned difficulties since your last post in this thread? Would be a pity if this other excellent approach of yours had to be abandoned ;-)

P.S.:
I am also still racking my brains with player platform rotations. As soon as my alternative ideas may work I hope I might be able to give an update on the matter from my perspective.


smnmhmdy
Registered User
Quote
2021-04-30 09:56:11

Hey @hadoken I did manage to get it to work the last time I was working on it, but it's still far from perfect as the animation intensity is not tweakable, and the desyncing still happen specially on lower frame rates / faster movements.

https://www.dropbox.com/s/gi8qyz...

I don't recommend using it as of right now but if it's fine for your specific use case then make sure to check the ccb file as the set up is a bit different from the last version :)

I am also still racking my brains with player platform rotations. As soon as my alternative ideas may work I hope I might be able to give an update on the matter from my perspective.

To be honest, I'm out of ideas on how we can overcome the issue, so I'm looking forward to hearing from your side.


hadoken
Guest
Quote
2021-05-01 22:32:01

Thank you very much for the remarkable update @smnmhmdy! I find your updated solution very cool & usable but you're right - it's still not perfect.

How CopperCube handles the FPS camera target in relation to the cam position is really quite annoying & some primary show stopper.

My attempts of forcing the target's z value in facing direction to a constant interfered heavily making FPS mouse look unusable.

But if there's one thing I've learned so far from working with CC, it's that there can always be found some workaround to make visions reality.

So I came up with another approach by emulating some kind of camera shaking effect by altering the camera's UpVector over time. Although is not the right rotation for real head or body bobbing I like the resulting effect a lot.

Therefore I wrote a behavior and put a basic demo for it together to share with you & anyone being interested:

https://www.dropbox.com/sh/7zbsd...

The demo has still two minor drawbacks:

- reliable key triggering is not perfect for now
- for some unknown reason the camera shaking effect strength gets lowered when looking at one special direction (you can test this e.g. by running the .ccb file with debug console output and with not having moved yet looking with camera target at around the following values x=5, y=any, z=25


smnmhmdy
Registered User
Quote
2021-05-02 10:08:53

Hey @hadoken, Yes I'm aware of the up vector method, I've made a subtle use of it on that first person shooter behavior, and an extensive use of it in my codename drop project, It works really well and I think it's the closest we can get to a good looking camera shake, However it indeed is artificial still and doesn't look as immersive as following the players third person head model (with less intensity of course)

for some unknown reason the camera shaking effect strength gets lowered when looking at one special direction

Looking at your code, it seems like you're applying the upvector float to both x and z axis, and as a result the strength is doubled when you look at certain angles (north east, north west, south east, ...)
The better approach is to calculate the upvector float as a vect3d on the x axis (upvector, 1, 0), rotate this vect3d to the camera's rotation, and applying the result as the camera's up vector.


hadoken
Guest
Quote
2021-05-02 12:33:12

thanks for the valuable feedback @smnmhmdy!

Yes my code is applying the upvector to both x and z axis intentionally for better results from my POV without knowing about vector rotation alignment between upvector and camera rotation. Your help seems to confirm that the upvector is meant globally, which I supposed to be meant as a local camera vector. In theory your advice sounds logically to me what to do to get the effect in the same strength for all directions. Unfortunately I'm clueless how to forge this into code with maybe Niko's Matrix transformation handler or with whatever. So I'll have to live what I have so far until I can compensate the drawback with a simpler workaround. Or maybe your time would allow to help our CC community out with your powerful programming skills another time...? ;-)

One thing I bothers me very much when experimenting with the camera upvector: Why do x and z rotate the camera's sideward view angle steplessly/continuously with corresponding values while the y value only toggles between either up or down looking regardless of different float values? If the y upvector would allow for more differentiation we could simulate forward/backward head rotating with the upvector method. But this feature seems to be missing?

Besides while we have global vs. local location (Position <-> PositionAbs) in CopperCube we seem not to have the same level of control over global vs. local rotation?


hadoken
Guest
Quote
2021-05-02 12:48:14

here is an older try with real head bobbing while walking workaround construction. It's not bad but unfortunately I could not get the sideward strafe movements right with it so far (maybe some else can fix this):

https://www.dropbox.com/sh/0bfqt...


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internatio?al" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact