Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (ozgur, TipmyPip, AndrewAMD), 1,209 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Questions on bone animation #407403
09/12/12 12:56
09/12/12 12:56
Joined: Nov 2011
Posts: 274
de
lemming Offline OP
Member
lemming  Offline OP
Member

Joined: Nov 2011
Posts: 274
de
Hey everyone!

I'm working on an animation script for a customizable character but I think my approach is not so great. I hope you can give me some advice.

I have a basic model (a "naked" character) and up to about 7 armor pieces (feet, torso and so on). The armor is placed at the character position and by ent_animatefrom animated the same way as the character (character and armor have the same bones).
This is ok at 16 characters, but with more it starts to consume too much fps.

Is there a way to do it better without shaders (I have the Extra Edition)?

I tried copying the bone angles directly without "animating" the armor, but the speedup was practically nothing.


Another question I have in mind: I've seen basically two different types of bone animations. One with a "connected" skelleton (one bone starts where another ends) and one with a "disconnected" skelleton (bones are distributed over the model and not directly connected). Which one is in which case to prefer? Does this also affect the framerate?

Thank you for your answers!

Re: Questions on bone animation [Re: lemming] #407408
09/12/12 14:08
09/12/12 14:08
Joined: Jan 2010
Posts: 145
Doc_Savage Offline
Member
Doc_Savage  Offline
Member

Joined: Jan 2010
Posts: 145
hey there, im not the best at gamestudio, but im certanly not the worst.
did you try checking your game code to see how many functions are runing at the same time? too many running at the same time can cause hanging, hit f11 in game to see a list of everything, "fnc" should be the number of functions.

also ive heard a good way to animate weapons/armor, etc with models is to animate it WITH the model, as in put your armor on your guy, animate him, then sae your armor as a separate model. im a bit unsure as to the details of this strategy, but perhaps someone else could put a word in?

i hope i was able to help laugh


Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Re: Questions on bone animation [Re: Doc_Savage] #407409
09/12/12 14:22
09/12/12 14:22
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
and if you convert bone animations to vertex animation, it will consume more memory but will be really faster. more ugly way, but works.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: Questions on bone animation [Re: sivan] #407428
09/12/12 21:39
09/12/12 21:39
Joined: Nov 2011
Posts: 274
de
lemming Offline OP
Member
lemming  Offline OP
Member

Joined: Nov 2011
Posts: 274
de
@Doc: Thanks, but it's not the functions. I made a testscript especially for the animations that runs nothing else.

@Sivan: I guess I can't get around bones, as vertex animations can't be blended or mixed. =/ But I need these features.


I read in several other threads about combining meshes. Is this possible in this case, too?

Re: Questions on bone animation [Re: lemming] #407436
09/13/12 07:23
09/13/12 07:23
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
yes if you need nice blended animations you cannot use vertex animation, it is only for simple things, like in a RTS with a relatively far camera view


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: Questions on bone animation [Re: lemming] #412338
11/26/12 05:06
11/26/12 05:06
Joined: Aug 2008
Posts: 36
California USA
tunisod Offline
Newbie
tunisod  Offline
Newbie

Joined: Aug 2008
Posts: 36
California USA
Hey Lemming, can you give me a quick example on how you used ent_animatefrom?
I'm trying to use it but i cant get the armor animation to sync with the model.
I'm using the same skeleton and animations for both the model and the armor.
The manual dosent really provide an example for ent_animatefrom and I've
checked out the bone example in the tutorial and
it's great if I want a bone to act independantly.

Thanks for any help anyone can give me.

Re: Questions on bone animation [Re: tunisod] #412341
11/26/12 07:40
11/26/12 07:40
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Quote:
can you give me a quick example on how you used ent_animatefrom?


Code:
ENTITY* anmsource;
action AnmSource_Model() //apply to model with animations
{
 anmsource = me;
}
action Model_NoAnims()
{
 while(!anmsource) wait(1);
 while(1)
 {
  my.skill1 += time_step;
  ent_animatefrom(me, anmsource, "idle", my.skill1, ANM_CYCLE)
  wait(1);
 }
}



Quote:
Like ent_animate, but loads the bones animation from a separate entity. This way entities can share bones animation scenes.


Edit:
@lemming
Did u set the passable flag of the attached "bodyparts" ? Might save some frames...
greets

Last edited by rayp; 11/26/12 08:03.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Questions on bone animation [Re: rayp] #412390
11/26/12 20:10
11/26/12 20:10
Joined: Aug 2008
Posts: 36
California USA
tunisod Offline
Newbie
tunisod  Offline
Newbie

Joined: Aug 2008
Posts: 36
California USA
Awesome, thanks for the quick responce RayP.

That example really needs to go into the manual.

Re: Questions on bone animation [Re: tunisod] #412402
11/26/12 22:22
11/26/12 22:22
Joined: Nov 2011
Posts: 274
de
lemming Offline OP
Member
lemming  Offline OP
Member

Joined: Nov 2011
Posts: 274
de
rayp was faster, but if you're still interested in my code:

Code:
void pl_Animate(ENTITY* chara, STRING* scene, var percent, var mode)
{
	ENTITY* piece;

	if (chara != NULL)
	{
		ent_animate(chara, scene, percent, mode);
		
		if (chara.phair != NULL)
		{
			piece = (ENTITY*)chara.phair;
			ent_animatefrom(piece, chara, scene, percent, mode);
			vec_set(piece.x, chara.x);
			vec_set(piece.pan, chara.pan);
		}
		if (chara.pchest != NULL)
		{
			piece = (ENTITY*)chara.pchest;
			ent_animatefrom(piece, chara, scene, percent, mode);
			vec_set(piece.x, chara.x);
			vec_set(piece.pan, chara.pan);
		}
		// and so on
	}
}



phair and pchest are skills I use to store pointers. The codeblocks repeat for all armor/clothing/whatever pieces.

Re: Questions on bone animation [Re: lemming] #412410
11/27/12 00:08
11/27/12 00:08
Joined: Aug 2008
Posts: 36
California USA
tunisod Offline
Newbie
tunisod  Offline
Newbie

Joined: Aug 2008
Posts: 36
California USA
No, that's great. The more info the better since I
really didnt have much to go on before you and RayP.

I did have a quick question. do you still use proc_mode = PROC_LATE; or is that only used for vertex?

Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

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