Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Enhanced Animations

Author
Message
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 27th Jul 2016 10:58
Hello community,

I want to make animation blending for my character to look smooth and seemless and not choppy when i a slide through idle anim and then immediately in the walking position so i thought that enhanced animations will do that trick.

Any idea where to download it? Do you guys have any links?

Thank you very much!
Alex Matei CEO
www.alexmatei.com
James H
16
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 27th Jul 2016 12:53 Edited at: 27th Jul 2016 12:55
It is a discontinued product - like all of the previously purchasable plugins, other than what has been made free of course and this is not one of them. Think the bloke who made it was called Ron Erickson
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 27th Jul 2016 14:12
Hi James,

Yes, i had found that post myself but no use to me since i can't find the addon. Anyways, any other way to blend animations and to eliminate the choppiness?
Alex Matei CEO
www.alexmatei.com
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 27th Jul 2016 14:32
Could create an intermediate animation to play for a transition, depending how many animations you are blending though, this can add a lot of bloat.

Can also work with the limbs to blend them yourself in code, won't be as performant as the plugin probably, but should get the job done


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 2nd Aug 2016 11:58
Hello Ortu,

Any code for example?

Thank you very much!
Alex Matei CEO
www.alexmatei.com

Attachments

Login to view attachments
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 2nd Aug 2016 18:09
I don't sorry as this would basically be writing an entire custom animation system.

In short though, for each limb you would get the position and rotation of the current frame, the position and rotation of the target frame, and compare them to get the total difference. Divide that difference by the amount of time you want to transition them, then you get the amount of change you need to apply to those limbs per unit of time.


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 2nd Aug 2016 18:58
Hmm that sounds interesting Ortu. I will try to make a function out of this.

Thank you!

PS: If someone else has another idea or some bits of codes , please post and thank you for your time!
Alex Matei CEO
www.alexmatei.com
kasapin
11
Years of Service
User Offline
Joined: 11th Dec 2012
Location:
Posted: 24th Oct 2016 20:30
this is how i manage my player :
like Ortu said my player object have intermediate animations

first i create sequences

type tscen

br `this is the nomber of sequence
frst `first frame of sequence
frend `last frame of sequence
sound `sound of sequence
spid `animation speed of sequence

endtype

function _ScenInit()

dim scen() as tscen
add to queue scen()

endfunction

function _scenar(s,frst,frend,sound,spid)

add to queue scen()
scen().br=s
scen().frst=frst
scen().frend=frend
scen().sound=sound
scen().spid=spid

endfunction


`this functions load all sequences of your animation in program
scene:
_scenar(1,0,20,0,10)
_scenar(2,21,57,1,62)
_scenar(3,58,94,2,80)
_scenar(4,95,115,0,-50)
_scenar(5,116,126,0,-50)
_scenar(6,126,136,0,-50)
_scenar(7,137,157,0,10)
_scenar(8,158,178,0,40)
return

`this is the function that you use while program looping only when it`s triggerd in loop
`(the function sets the current animation of player)
`the values of scen().spid and scen().sound may confuse you but the negative values are used to set the animation on"PLAY" and not on "LOOP"(thats why this values are inside the ABS() brackets)

function _Stejdz(s)

if scen(s).spid>0
loop object 1,scen(s).frst,scen(s).frend
set object speed 1,scen(s).spid
endif
if scen(s).spid<0
play object 1,scen(s).frst,scen(s).frend
set object speed 1,abs(scen(s).spid)
endif
for t=1 to plSounds
stop sound t
next t
if scen(s).sound>0 then loop sound scen(s).sound
if scen(s).sound<0 then play sound abs(scen(s).sound)

endfunction


`Now this is the part that is caculated every loop

ano:

if crouch=0
if crouched=1
scena=5
if object frame(1)>135 and object frame(1)<=136 then crouched=0 `this animation is transition beatvine crouched and stand position
endif
if crouched=0
scena=0 `this animation is stand position
if presha=1 `this variable cheks for keypress
scena=1 `this animation is walking
if shiftkey()=1 then scena=2 `this animation is running
endif
if skok=1 then scena=3 `this animation is jumping
endif
endif

etc.......

`Every time you change the variable scena (that is the Nr of pertiqular sequence) ,this function will be triggerd

if scena<>oldscena
_Stejdz(scena+1)
oldscena=scena
endif

return

I hope this helps you
happy coding
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 25th Oct 2016 00:08
This is kind of a rudimentary example if you want to use DBP commands only
The model has been rigged and animated by me just for a basic walk animation and a quick test. ( run, idle etc.. are missing )
with better animation sets much better results can be had.
It needs quite a lot of fiddling and playing with the frames chunks and it's not an easy task ( as you may notice looking at the code)
But You may get some useful ideas understandng how it works and how to use the commands for what situation.
Some bits are rather crude, like the turn animation when standing still , just stripped out of the walk cycle. With proper frame chunks it can work much better.
I just put it quickly together because I wanted to try some ideas and seeing your post I thought I could share.
Cheers
Scorpyo

Attachments

Login to view attachments
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 25th Oct 2016 07:32
Here's slightly less "verbose" version of the Playercontrol subroutine


Cheers
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 25th Oct 2016 17:06
Rather than using loop object or play object, I calculate the frame (similar to calculating position in timer based movement) and use set object frame.

This desyncs animation speed from frame rate similarly, and gives me greater control over what happens when a loop or sequence finishes, such as allowing me to use a call back function to trigger other things (when an attack animation finishes, check defence/apply damage/play hurt or defend sequence on target), check if a loop should continue, check if a different variation of the sequence should cycle in etc.


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 26th Oct 2016 14:33
Hey community thanks for your help on this!

I have another quick question: How can i get current animation key on an object with Enhanced animations? Like, I use this command: firanim= EnAn_oacGetCurrentFrame(character, 1) but the whole application crashes. Any ideas?

Thank you big time!
Alex Matei CEO
www.alexmatei.com
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 26th Oct 2016 20:39
This example is better than my previous one, though not perfect.

Attachments

Login to view attachments
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 26th Oct 2016 21:47
Scorpyo,

I made something possible in Enhanced Animations, so the animation part is ok on this side. However i cannot retrieve the animations from EA
Alex Matei CEO
www.alexmatei.com

Login to post a reply

Server time is: 2024-03-29 01:04:00
Your offset time is: 2024-03-29 01:04:00