Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by AndrewAMD. 12/05/23 10:56
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (3run, AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip), 605 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: [Workquestions] Pipes, Ramps and Loops [Re: EvilSOB] #260123
04/08/09 23:44
04/08/09 23:44
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
no problem...
At the moment it´s just the ball and the plates ( + a testlevel )..

So, here for everyone:
http://daten.rmxpworld.de/Glayder.rar

Control:
Hold A-Key to move the ball forward on his x-axis


Really hope someone has the key for that clue ^^


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: [Workquestions] Pipes, Ramps and Loops [Re: Espér] #260124
04/09/09 00:04
04/09/09 00:04
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Got him.. I'll have a look as soon as I can sneak it in.
Damn I hate working day shift on weekdays...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: [Workquestions] Pipes, Ramps and Loops [Re: EvilSOB] #260138
04/09/09 04:22
04/09/09 04:22
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Snuck it in during lunchtime, when no-one (but me) was about.
Everything that needed changing was in that little c-trace snippet you trusted me with....sorry.
In addition, you will see added lines marked DEBUG, leave them for now as they are highlighting the "slab"
you are currently c-tracing against, and using for tilt value.
(I just realised, A and D are now controlling a slower ball, to ease testing, easy to undo Im sure wink )

It is currently looking good but fails at the top of the vertical climb.
That because the last TRULY vertical slab has a roll of 90,
but the next one up is at 270. thereby flipping the ball and from there on fails its c-trace
and never finds the slabs again.
I didnt get time to edit the WMP to test this. The first problem plate is the first plate in the last group.
Thats as far as I looked, so the whole group may be the same...

Code:
action player_action()
{
	player = my;
	vec_set(my.scale_x,vector(0.5,0.5,0.5));
	wait(1);
	c_setminmax(my);
	VECTOR tmpV;
	/*DEBUG*/	ENTITY* high_light;
	while(1)
	{
		if(key_d)	{c_move(my,vector( 10*time_step,0,0),nullvector,GLIDE);}
		if(key_a)	{c_move(my,vector(-10*time_step,0,0),nullvector,GLIDE);}

		vec_set(tmpV, vector(my.x,my.y,my.z-9999));
		vec_rotate(tmpV, my.pan);
		c_trace(my.x, tmpV, IGNORE_ME | USE_BOX);
		if(you != NULL)
		{
			/*DEBUG*/	high_light = you;	
			/*DEBUG*/	set(high_light, UNLIT);
			my.tilt   = you.roll;	
			my.skill1 = vec_dist(my.x, you.x);
			if(my.skill1 < 20)
			{
				c_move(my,vector(0,0,20-my.skill1),nullvector,GLIDE);
			}
		}
		vec_set(camera.x, vector(my.x,my.y-400,my.z));
		wait(1);
		/*DEBUG*/	reset(high_light, UNLIT);
	}
}



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: [Workquestions] Pipes, Ramps and Loops [Re: EvilSOB] #260191
04/09/09 11:03
04/09/09 11:03
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
hmm works great..
Only thing i needed to change, are the plates in WED.. Seems like:
Copy the group => rotate it 180°

makes the slope-plates to 270° and above...

I set them now by hand.. works great.. Now i try steep-circles


Edit.. ok. new problem..
I wanted to set the camera behind the ball, but a bit higher:
Code:
function camera_handling()
{
		VECTOR tmpV2;
		var hight;
		while(1)
		{
				vec_set(tmpV2, vector(camera.x,camera.y,camera.z-9999));
				vec_rotate(tmpV2, camera.pan);
				c_trace(camera.x, tmpV2, IGNORE_ME | USE_BOX);
				if(you != NULL)
				{
						camera.tilt   = you.roll;
						camera.roll   = you.tilt;
						camera.pan    = player.pan;
						camera.tilt -= 10;
						hight = vec_dist(camera.x, you.x);
						if(hight < 20)
						{
								c_move(my,vector(0,0,20-hight),nullvector,GLIDE);
						}
				}
				else
				{
						vec_set(camera.pan, vector(player.pan, player.tilt - 10, player.roll));
				}
				wait(1);
		}
}


But the cam is not rotating with the ground-plates...

Last edited by Espér; 04/09/09 11:42.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: [Workquestions] Pipes, Ramps and Loops [Re: Espér] #260200
04/09/09 12:00
04/09/09 12:00
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I dont understand the point-of-view you mean.

Is this it?

Code:
function camera_handling()
{
	VECTOR tmpV;
	while(1)
	{
		if(player)
		{
			vec_set(tmpV, vector(-100,0,25));  
			vec_rotate(tmpV, player.pan);
			vec_add(tmpV, player.x);
			vec_set(camera.x, tmpV);
			vec_set(camera.pan, player.pan);
		}
		wait(1);
	}
}


If not, where am I wrong?


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: [Workquestions] Pipes, Ramps and Loops [Re: EvilSOB] #260266
04/09/09 20:34
04/09/09 20:34
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
not really.
See that Video for a visual Information:


The ball glides normally to the beginning of the slope.. And teh camera follows.. Everything is right..

BUT,
when the ball glides up the slope, the camera sets itself to the players angels.. and that´s worng.. because the camera should always show the ball.. and not the heaven ^^

Edit: The lags in the videos are made by me.. i stopped the moevemtn there.

Last edited by Espér; 04/09/09 20:35. Reason: ...

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: [Workquestions] Pipes, Ramps and Loops [Re: Espér] #260271
04/09/09 21:50
04/09/09 21:50
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Ah yea I get you. Thats was my intention once Ive perfected the code.
Its just that my quick and dirty code doesnt get the camera angle right yet.
I'll get on it.

Im also going to try to smooth out the 'clunk' of the camera as the ball
changes from one tilt to the next.
Unless your tracks are going to be 'smooth' in the final version, then I can
skip it.

But, just to verify, once the ball is travelling on the 'ceiling',
should the camera view be just as inverted as the ball?
(So visually, the ball 'appears' to be running across the floor, assuming
you ignore any background visuals, ie you can only see the ball and track.)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: [Workquestions] Pipes, Ramps and Loops [Re: EvilSOB] #260272
04/09/09 21:52
04/09/09 21:52
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
hmm. smooths angles..

Any way to trace the pan/tilt/roll of the ground, if the ground is a terrain????
Meins, the ground is a complete modeled level, without those plates..



@EvilSOB:
Thanks.. i´m very thanksfull to you for your help here ^^
The camera should always be behind the ball. At the End, it´ll be a Wipeout like game, with gliders and futuristic tracks... So, the camera has to be always behind the glider ^^

Last edited by Espér; 04/09/09 21:53.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: [Workquestions] Pipes, Ramps and Loops [Re: Espér] #260276
04/09/09 22:31
04/09/09 22:31
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Hmmm, I should be able to do a c-trace to the terrain or model-mesh and get the tilt/roll of
the individual poly/s it is over, which I belive is functionally the same.
I'll look into that as I progress.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: [Workquestions] Pipes, Ramps and Loops [Re: EvilSOB] #260318
04/10/09 06:16
04/10/09 06:16
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
OK ALMOST there, and almost at my poor brains limits...
Now implemented ::
1> Height and Ball-Angle now calculated from single poly of the surface below the Balls z-axis.
2> "Surfaces" recognised are WED blocks, Models, and Terrains. (theoretically but untested prefabs too)
3> Collision detection added to prevent camera passing through solids.
4> Camera follows Ball, even upside-down. (See NOTEs below)
5> Camera-smoothing added. The smoother the motion, the slower the camera moves. Tweak to preference.

NOTE: This is working well but Im not CERTAIN it is bulletproof. If you ever implement the ball to use its PAN at all,
which I suspect you will, the camera MAY go psycho at 180 degrees of pan. If it does I'll have to rethink 3 or 4 lines
of code. Any changes shouldnt grow much beyond 3 or 4 lines, and should not require any code changes elsewhere.
I'll keep thinking on this issue, but Im out of ideas for now Im afraid.


Give me a performance review please....
Code:
action player_action()
{
	var SetHeight = 20;				//TWEAK :: distance of ball from ground.
	player = my;
	vec_set(my.scale_x,vector(0.5,0.5,0.5));
	wait(1);
	c_setminmax(my);
	VECTOR tmpV;
	while(1)
	{
		if(key_e)	{c_move(my,vector( 5*time_step,0,0),nullvector,GLIDE);}
		if(key_q)	{c_move(my,vector(-5*time_step,0,0),nullvector,GLIDE);}

		vec_set(tmpV, vector(my.x,my.y,my.z-9999));
		vec_rotate(tmpV, my.pan);
		c_trace(my.x, tmpV, IGNORE_ME | USE_BOX);
		if(trace_hit)	// if SOMETHING hit
		{
			vec_to_angle(tmpV, normal);		//get angle of "ground". (Terrain, Entity, or WED block)
			my.tilt   = 90 - tmpV.y;		//apply angle to ball
			if((my.skill1=vec_dist(my.x,target))<SetHeight)
			{	c_move(my,vector(0,0,SetHeight-my.skill1),nullvector,GLIDE);	}
		}
		wait(1);
	}
}



function camera_handling()
{
	VECTOR tmpV, pos_off, ang_off;	//working space
	vec_set(pos_off, vector(-50,0,25));			//TWEAK :: distance of camera from ball.
	vec_set(ang_off, vector(0,15,0));			//TWEAK :: angle of camera, so it looks OVER ball
	var	smoothness = 0.2;						//TWEAK :: smaller is smoother but slower (camera lags behind a bit)
	ENTITY* cam_det = ent_create(0,0,0);	//used for camera-collision-detection only.
	while(1)
	{
		if(player)
		{
			//position camera
			vec_set(tmpV, pos_off);
			vec_rotate(tmpV, player.pan);
			vec_add(tmpV, player.x);
			vec_sub(tmpV, camera.x);
			vec_scale(tmpV, smoothness * time_step);
			c_move(cam_det, NULL, tmpV, IGNORE_YOU|GLIDE);
			vec_set(camera.x, cam_det.x);	
			//rotate camera toward Player
			vec_set(tmpV, player.x); 	vec_sub(tmpV, camera.x);	
  			vec_to_angle(camera.pan, tmpV);
			if(tmpV.x<0)	{  camera.pan -= 180;	camera.tilt = 90-(camera.tilt-90);  }
  			vec_add(camera.pan, ang_off);
		}
		proc_mode = PROC_LATE;
		wait(1);
	}
	ent_remove(cam_det);
}




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

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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