Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,619 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
fps decrease when attatching model to player #342320
09/26/10 15:03
09/26/10 15:03
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
as the title says, it signifigantly decreases when attatching a model, perhaps i should explain, im doing the "KH MOVEMENT" tutorial, and im up to the part with attatching weapons. it decreases fps with any model. this wont be a problem for my gaming rig im guessing, but nonetheless, is there any way to resolve this? i can supply code if its needed.


Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Re: fps decrease when attatching model to player [Re: Doc_Savage] #342321
09/26/10 15:11
09/26/10 15:11
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Did you set the attached model to passable?

If not, the models are permanently colliding and that costs computing time of the collision system.

Last edited by Pappenheimer; 09/26/10 15:13. Reason: explanation added
Re: fps decrease when attatching model to player [Re: Pappenheimer] #342322
09/26/10 15:12
09/26/10 15:12
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
ah, yes i did.

and thank you for responding laugh

Last edited by Doc_Savage; 09/26/10 15:13.

Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Re: fps decrease when attatching model to player [Re: Doc_Savage] #342325
09/26/10 15:20
09/26/10 15:20
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Possible reasons:
- model has significantly much vertices
- model has skin with alpha channel and permanently covers big parts of the screen
- model is created every frame again
- model is not set by the mere vector but moved to the vertex position by c_move
- model is set to vector more than ones per frame
...

Re: fps decrease when attatching model to player [Re: Pappenheimer] #342326
09/26/10 15:24
09/26/10 15:24
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
ok lets say its created every frame again, how do i fix? it looks like that could be the problem

Last edited by Doc_Savage; 09/26/10 15:33.

Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Re: fps decrease when attatching model to player [Re: Doc_Savage] #342328
09/26/10 15:35
09/26/10 15:35
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
best is to post the relevant codelines

Re: fps decrease when attatching model to player [Re: Doc_Savage] #342329
09/26/10 15:36
09/26/10 15:36
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
You have to create it outside the while-loop.

Re: fps decrease when attatching model to player [Re: Pappenheimer] #342330
09/26/10 15:38
09/26/10 15:38
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
Code:
var temp2[6];
ACTION attach_weapon {
my.passable = on;
proc_late();
WHILE (you != null) {
vec_for_vertex(temp.x,you,125); //hand palm base
vec_for_vertex(temp2.x,you,130); //hand palm tip
vec_set(my.x,temp.x);
vec_diff(temp.x,temp2.x,temp.x);
vec_to_angle(temp.pan,temp.x);
vec_set(my.pan,temp.pan);
wait(1);
}
}

action player_()
{
	player = my; // I'm player 
	my.invisible = off; // player is invisible or not
	my.narrow = on;
	my.hp = 100; // sets health to 100 at the beggining
	while(my.hp > 0) // while I'm alive
	{
	ent_create("sword.mdl",my.x,attach_weapon);
	wait(1);




yea heres the relevant stuff


Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Re: fps decrease when attatching model to player [Re: Doc_Savage] #342331
09/26/10 15:42
09/26/10 15:42
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
Quote:
while(my.hp > 0) // while I'm alive
{
ent_create("sword.mdl",my.x,attach_weapon);
wait(1);


well, you create a weapon every frame.
Only create it once, and delete it when the player is dead

just call the ent_create("sword.mdl",my.x,attach_weapon); before the while loop

Re: fps decrease when attatching model to player [Re: Damocles_] #342332
09/26/10 15:44
09/26/10 15:44
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
aaah ok. i was going along the lines of, you cant hold a weapon while youre dead HAHA well that works! i took your advice and its perfetly smooth now! thank you all for such a quick response! XD i love this place haha


Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Page 1 of 2 1 2

Gamestudio download | 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