Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (M_D, AndrewAMD, Quad, Ayumi), 806 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
ANM_CYCLE - workshop 21 - problem #256226
03/15/09 13:17
03/15/09 13:17
Joined: Mar 2009
Posts: 8
S
Sonne Offline OP
Newbie
Sonne  Offline OP
Newbie
S

Joined: Mar 2009
Posts: 8
Greetings,

I've gone through the workshop tutorial pretty easily and didn't notice this until I came across the problem on my project I am making from scratch. What I am trying to do is if no buttons are pressed my model does a 'stand' animation for .. well .. forever. However after some time the model stops cycling through 'stand' and begins cycling through all the animations. So I first checked my code and compared it to the examples on the forums, wiki, manual, workshop and found no differences. Then I loaded up workshop 21 again and saw the exact same behavior. Regardless of the animation_percentage multiplier, the model goes spaztastic around 45 seconds (based on total_secs)

Code:
action walking_guard()
{ 
	while (1) 
	{ 
		ent_animate(my,"walk",walk_percentage, ANM_CYCLE); // "walk" animation loop
		walk_percentage += 3 * time_step; // 3 = animation speed for "walk"
		wait (1); 
	} 
} 



As shown in the screen shot the model is in frame 'attack' but based on the code it shouldn't get there. Wondering if anyone else has encountered this and how to fix, resolve, work-around it.

I am using the trial version; SED 7.11.1 MED 6.902 WED 7.7 v6.89.

~ Thanks in advance

Re: ANM_CYCLE - workshop 21 - problem [Re: Sonne] #256233
03/15/09 14:27
03/15/09 14:27
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Add this line before the wait and see if it helps.
walk_percentage = cycle(walk_percentage, 0, 100);

PS: Welcome aboard.



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: ANM_CYCLE - workshop 21 - problem [Re: EvilSOB] #256240
03/15/09 15:06
03/15/09 15:06
Joined: Mar 2009
Posts: 8
S
Sonne Offline OP
Newbie
Sonne  Offline OP
Newbie
S

Joined: Mar 2009
Posts: 8
Originally Posted By: EvilSOB
Add this line before the wait and see if it helps.
walk_percentage = cycle(walk_percentage, 0, 100);


The walk_percentage (animation_percentage) value was something I also considered. When I watched that it would continually climb well past 100 but the animation still cycled through normally for the first 45 seconds normally. I think I could achieve the same thing by using:

Code:
walk_percentage %= 100;


I did try it though and same result. Although the percentage working normally with a higher value is explained by George Pirvu in his workshop:

Quote:
"animation_mode" tells the engine to play the animation in a cyclic loop (animation_mode == ANM_CYCLE) or to play a one-shot animation (animation_mode = 0). If the animation_percentage value grows over 100 in a cyclic animation, it will just continue with the first frame again; on the other hand, a one-shot animation will stop at the last frame.


Thus it is problematic, because I am not sure what is causing the problem. Is it safe to assume other people have no problem running one continuous animation for long periods of time? So I continued on with my project and added the walk animation. Got that working good using Basic Player Movement script from the wiki. When I stand, the 'stand' animation cycles and when I move, the 'walk' animation cycles, so glad to have that working. Regardless though with the current script no matter what state I am in at 45 seconds the animation runs wild still. Hmm.

Originally Posted By: EvilSOB
PS: Welcome aboard.


Thanks grin I remember a time when I used to stay up all night trying to figure out code. Lately I've been staying up all night playing games, so pretty thrilled I am rekindling my passion for coding again.

Re: ANM_CYCLE - workshop 21 - problem [Re: Sonne] #256252
03/15/09 15:53
03/15/09 15:53
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Yeah, %= does the same I believe.
Im a bit too very-old-school to use the =operators "naturally".
I do that sort of thing at 'clean up and document code' time smile

Let keep at it anyway. The sample you posted in your initial post is
your 'walk'ing animation, can you post the code thats around the code
that handles your 'stand' animation instead? And do you use the templates?
And are you using lite-c or c-script?


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: ANM_CYCLE - workshop 21 - problem [Re: EvilSOB] #256274
03/15/09 18:20
03/15/09 18:20
Joined: Mar 2009
Posts: 8
S
Sonne Offline OP
Newbie
Sonne  Offline OP
Newbie
S

Joined: Mar 2009
Posts: 8
Well I have no problem posting my code but since I can replicate the identical issue in the Official Online Tutorial I figured more people have gone through it so maybe more familiar with the script.

Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////

var walk_percentage;
var death_percentage;

function main()
{
	video_mode = 7;
	level_load ("work21.wmb");
	wait (2); // wait until the level is loaded 
	camera.z = 120; // choose a convenient height
	camera.tilt = -15; // and tilt angle for the camera
}

action walking_guard()
{ 
	wait (-35); // added this as a test
	while (1) 
	{ 
		ent_animate(my,"walk",walk_percentage, ANM_CYCLE); // "walk" animation loop
		walk_percentage += 3 * time_step; // 3 = animation speed for "walk"
		wait (1); 
	} 
} 

action dead_guard()
{ 
	wait (-5); // wait 5 seconds
	while (1) 
	{ 
		ent_animate(my, "death", death_percentage, 0); // "death" one-shot animation 
		death_percentage += 3 * time_step; // 2  = animation speed for "death"
		wait (1); 
	} 
}


I decided to re-download the tutorial files and try it again from scratch. There was a difference, now instead of 45 second delay it is now 25-30 seconds. Ha. I noticed playing with my script the animate seems independent of any values and is based on time which, would be bizarre. So to test this I added the wait (-35); in the above script and as soon as the wait completed the animate went straight into whacko mode ignoring the 'walk' and playing all frames of the model. I put the 'death' entity on ANM_CYCLE mode as well and just like walk after the period of time it cycled through all frames. Thus I was thinking it was something with ANM_CYCLE. Just ran a test with the wait 35 animate with a mode 0 and though it did only perform one animation it cycled through all of them. So it appears that after some time frame of 25-45 seconds ent_animate ignores the animation_name. I doubt it would be software issue because if it were, there would be much more chaos about it. So the only other possibility if it is something they attached to the trial version. Anyone else with trial and the litec-samples workshop want to run workshop 21 until it times-out to see if the walking guard behaves abnormally? I'm always up for new options.

Here is my code. Sloppy, just piecing things here and there to learn 3DGS. Other than this animation issue it works just the way I am hoping it to at this point.

Code:
////////////////////////////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>

////////////////////////////////////////////////////////////////////////////////////
ENTITY* player;
VECTOR temp;
var anim_percent = 0;
var dist_ahead = 0;
var dist_down = 0;

function main()
{
	video_mode = 7;
	level_load ("test.wmb");
	wait (2);
	}

action move_me()
{
	while (1)
	{
		if (key_a) me.pan += 10 * time_step;
		if (key_d) me.pan -= 10 * time_step;
		camera.x = me.x + fcos(my.pan,-1 * 250);
		camera.y = me.y + fsin(my.pan,-1 * 250);
		vec_diff(temp.x,me.x,camera.x); //make the camera look towards the player
		vec_to_angle(camera.pan,temp.x);
		camera.z = 25;
		camera.tilt = -20;

      var dist_ahead = 5*(key_w-key_s)*time_step;
      dist_ahead = sign(dist_ahead)*(abs(dist_ahead) + 0.5*dist_down); // adapt the speed on slopes
      c_move(me,vector(dist_ahead,0,0),vector(0,0,-dist_down),IGNORE_PASSABLE | GLIDE); // move the player

		// animate the player according to its moved distance
      if (dist_ahead != 0) // player is moving ahead
      {
         anim_percent += 1.7*dist_ahead; // 1.7 = walk cycle percentage per quant
         ent_animate(me,"walka",anim_percent,ANM_CYCLE); // play the "walk" animation
      }

      else // player stands still
      { 
         anim_percent += 5*time_step; 
         ent_animate(me,"stand",anim_percent,ANM_CYCLE); // play the "stand" animation
      }
		wait (1);
	}
}


Originally Posted By: EvilSOB
And do you use the templates?
And are you using lite-c or c-script?


Don't use templates though dabbled with one briefly only to be more confused. I prefer from scratch, 1 line at a time method. I use lite-c. Downloaded the free trial ... day before yesterday, I think.

Last edited by Sonne; 03/15/09 18:29. Reason: Answer questions
Re: ANM_CYCLE - workshop 21 - problem [Re: EvilSOB] #256343
03/16/09 09:59
03/16/09 09:59
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Unless anyone else has any ideas, Im stumped. Your code has been running
untouched on my machine for half an hour in "stand" mode and he is still
just looking around, not going spastic at all.

Maybe create a new level with just your entity in it on a big ground block
and see how that goes...

PS - Im currently using A7 7.70 commercial on a dogbox of a computer(here at work).


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: ANM_CYCLE - workshop 21 - problem [Re: EvilSOB] #256358
03/16/09 11:21
03/16/09 11:21
Joined: Mar 2009
Posts: 8
S
Sonne Offline OP
Newbie
Sonne  Offline OP
Newbie
S

Joined: Mar 2009
Posts: 8
Thanks Evil. At least that is reassuring that it is definitely not a problem with the script. When I get home from work tonight I'll start on a new project with a new model and new WED environment and see if the issue reoccurs. I'm not too hopeful though since the problem also occurs on the workshop files as well.

Re: ANM_CYCLE - workshop 21 - problem [Re: Sonne] #256359
03/16/09 11:33
03/16/09 11:33
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
It may be just a faulty install of your engine.
Maybe try a re-install too.
Otherwise maybe log a post in the bugs section.

Im not implying anything, but if its a hacked copy,
or youve ever had a hacked copy if 3DGS on that computer,
the hacked copies damage some registry settings so even a
legit copy of of 3DGS wont work perfectly on that machine
until a windows re-install, or so Ive been led to believe.



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: ANM_CYCLE - workshop 21 - problem [Re: EvilSOB] #256485
03/17/09 01:08
03/17/09 01:08
Joined: Mar 2009
Posts: 8
S
Sonne Offline OP
Newbie
Sonne  Offline OP
Newbie
S

Joined: Mar 2009
Posts: 8
I emailed support with this issue as well. I uninstalled using the uninstaller and reinstalled. No change.

Here it gets weirder. I decided to get the trial fraps to show what is happening since its hard to reproduce. While fraps is recording it does not happen. How bizarre is that. As soon as it stopped recording animation went crazy again. So I tried to continuously record but it did it in between recordings. Trial fraps only allows 30 seconds of recording at a time. So how does fraps affect 3dgs at all. So maybe it is something with my system, so I updated my video driver but that didn't help.



Re: ANM_CYCLE - workshop 21 - problem [Re: Sonne] #256501
03/17/09 06:01
03/17/09 06:01
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Only reason (that I can think of) that fraps may affect it is to lower the 3DGS framerate cause
fraps is using horsepower.
Try putting fps_max = 60; at the start of main to see if anything changes.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 1 of 2 1 2

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