Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (M_D, AndrewAMD), 1,222 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 3
Page 1 of 5 1 2 3 4 5
Animation frames blending, player input/physics #64738
02/21/06 06:25
02/21/06 06:25
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
This provides a couple different types of player movement...camera relative(keyboard or gamepad modes only...for Splinter Cell style satellite camera movement) and character relative. It also can be used with either a gamepad, keyboard only, or a mouse/keyboard combo. It also smoothly blends the player's bones animation states between one another. In other words, the transition from a standing animation to a run is smooth and not sudden. It's coded to handle idle, stand, walk, run, left turn, and right turn. It also plays a footstep sound for both walking and running.

Note that there is no camera provided, although it does require the default "camera" when using camera relative modes.

The various sensitivities, keyboard assignments, and the movement type(gamepad, keyboard, mouse/keyboard, camera/character relative) should be changed in the the "loadControlsDefault" function and not with the VAR itself. This function is the first thing that gets called, and all of the default values are handled within it. It then calls the "setKeys" function which uses "miscinput.wdl". The "hit.wav" from one of the template folders is also used as a placeholder for the footstep sounds. Make sure it is in your project folder or in your path somewhere.

This is somewhat complicated looking, but it really isn't if you understand your C-script. There's a simple player action at the end to demonstrate how to call these functions. Sorry for the minimal comments, but you shouldn't have too much trouble figuring it out. There's quite a bit of commented out code in a couple of the functions. I'm not using that, for now, but you can do whatever you want with it. I don't know if uncommenting it will break the system, though.

Credit to Pappenheimer/Gnometech for the environment/calculating functions. I've modified/simplified it a bit, but the soul of their work is still there. Credit to whoever helped me on the blending/animation function. Credit to Doug for the misc input file. It's required to set up/assign controls/keys.

Get the code below and read on further into this thread for usage instructions and updates/progress log:

http://www.geocities.com/hainesrs/blending.zip
http://www.geocities.com/hainesrs/blending.rar - same thing, just half the file size.

Last edited by Nadester; 08/17/06 23:12.

My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Animation frames blending, player input/physics [Re: Orange Brat] #64739
02/21/06 09:30
02/21/06 09:30
Joined: Oct 2003
Posts: 2,628
IL,US
FeiHongJr Offline
Expert
FeiHongJr  Offline
Expert

Joined: Oct 2003
Posts: 2,628
IL,US
very nice contribution thanks alot Cant wait to give it a try.


http://www.freewebs.com/otama_syndicate/index.htm - Each master to his own technique.

- Not me said the bee, Nor I said the fly.
Re: Animation frames blending, player input/physics [Re: FeiHongJr] #64740
02/21/06 22:39
02/21/06 22:39
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
Thank you, Orange Brat !
For what slope calculations was commented in environmentForces() ?

Re: Animation frames blending, player input/physic [Re: Lion_Ts] #64741
02/22/06 02:35
02/22/06 02:35
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
I think it just controlled the way the player interacted with sloped level surfaces. The original version was much longer than this and included code for jumping, falling, dying, and terrain, too.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Animation frames blending, player input/physic [Re: Orange Brat] #64742
02/22/06 15:46
02/22/06 15:46
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
I'll release a demo showcasing this code a little bit later on. It's 9:45am right now, and it probably won't be until after 7pm before I can start on it. These features have been requested many times, so I hope it helps those who stumble across it.

@Lion_TS: Check your PMs.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Animation frames blending, player input/physic [Re: Orange Brat] #64743
02/23/06 05:43
02/23/06 05:43
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Here's the DEMO. I integrated a 3rd person camera to showcase the code, since it wouldn't make any sense to use it in first person.

http://www.geocities.com/hainesrs/blending.rar - 380kb

OR

http://www.geocities.com/hainesrs/blending.zip - 718kb

The animation states blending will be obvious, so I don't need to explain it. However, the various movement/control modes need to be addressed, so you'll know how each value influences the camera and controls.

The VAR "movementType" has 5 possible settings: 0, 1, 2, 3, and 4. The default is "0". To change this value, find the function named "loadControlsDefault" located in "main.wdl". Simply change the value to one of the five listed above.

Here's what each one will do for you.

movementType
0 = This is a standard behind the player, 3rd person camera and is controlled with the mouse. The player moves relative to itself using W and S, and strafing is not yet implemented. This is most like the controls and camera used in Max Payne.
1 = This is a standard satellite style, 3rd person camera and is controlled with the mouse. The player moves relative to itself using WASD and would best be compared with the early Resident Evil play mechanics(i.e. tank controls).
2 = This is a standard satellite style, 3rd person camera and is controlled with the mouse. The player moves relative to itself using the gamepad.
3 = This is a standard satellite style, 3rd person camera and is controlled with the mouse. The player moves relative to the camera using WASD. This is most like the controls and camera used in Splinter Cell.
4 = This is a standard satellite style, 3rd person camera and is controlled with the mouse. The player moves relative to the camera using the gamepad. This is most like the controls and camera used in Splinter Cell.

Please note that in gamepad mode the camera should ideally be controlled with the 2nd analog stick or some other button on the input device. However, this feature is not yet implemented, so you'll have to settle for the mouse. It isn't very practical, but I'm not going to fix it anytime soon. This is valid for movementTypes 2 and 4 only.

Finally, when in modes 3 and 4 there is an animation frame problem with the "idle" and "stand" states. The way it is scripted, now, the player's state will change to its idle animation after about 8 seconds of inactivity. This works as it should with modes 0-2, but it does not function in the other two. Also, the stand state does not occur when not moving. This used to work, so I must have broke something when I was actively working on this and forgot to go back and fix it.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Animation frames blending, player input/physic [Re: Orange Brat] #64744
02/24/06 23:57
02/24/06 23:57
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
Thank you for demo, better one time to see than 10 times to hear.
Good code for me.

Re: Animation frames blending, player input/physic [Re: Lion_Ts] #64745
07/01/06 08:32
07/01/06 08:32
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Just a quick heads up to let everyone who used this or has an interest in it that I'm working on it again. I've ironed out most of the "bugs" or incomplete parts addressed in my last post. I'm just trying to polish it up and trying out a few other ideas. I'll post again when I upload the new version and will post the changes, as well.

So, don't download the files that are there for now.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Animation frames blending, player input/physic [Re: Orange Brat] #64746
07/01/06 12:36
07/01/06 12:36
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline
User
DavidLancaster  Offline
User

Joined: Nov 2004
Posts: 862
Australia
Hey this is a pretty awesome contribution! I'm really surprised that there's only been so few replies though...

Re: Animation frames blending, player input/physic [Re: DavidLancaster] #64747
07/02/06 05:31
07/02/06 05:31
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Maybe it's because of my longwinded, convoluted explanations or something. That's the reason for the demo. Full blown, working animation blending is rare in 3DGS projects but common place in realworld, professional games. It's essential if you want to release something commercial that is both polished and professional and if you want to be taken seriously.

Anyway, I'm getting close to the new release.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Page 1 of 5 1 2 3 4 5

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1