Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 946 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
Mario Galaxy! #339145
08/24/10 21:03
08/24/10 21:03
Joined: Sep 2009
Posts: 84
Theil Offline OP
Junior Member
Theil  Offline OP
Junior Member

Joined: Sep 2009
Posts: 84
Hi, I was reading this article on Gamasutra about Mario Galaxy's gravity, in theory it sounds and looks pretty easy, take a look at the first page of the link. I was trying to do the same with AUM 52 workshop that talks about c_trace, I have an idea of what I have to do, but I don't know how to implement it.



What I think I need to do is set the temp vector according the position of the normal that the c_trace is intercepting, also I think player.tilt should change its value according to the normal, but how do I tell the player and the trace where to turn?

is this possible in Gamestudio?

thanks for reading, I'll be waiting for an answer, this looks really interesting. laugh

Re: Mario Galaxy! [Re: Theil] #339161
08/24/10 22:57
08/24/10 22:57
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
take a look at this from Helghast or this from Superku

Re: Mario Galaxy! [Re: MrGuest] #339166
08/24/10 23:54
08/24/10 23:54
Joined: Sep 2009
Posts: 84
Theil Offline OP
Junior Member
Theil  Offline OP
Junior Member

Joined: Sep 2009
Posts: 84
That worked just great on the player, the only problem is that since the position of temp is not changing according to the position of the normal, the player is still falling down when it reaches the end of the planetoid, I need to change the c_trace(my.x,vector(my.x,my.y,my.z-150); for something else I think.


The result I'm getting:






Last edited by Theil; 08/25/10 02:55.
Re: Mario Galaxy! [Re: Theil] #339267
08/25/10 17:44
08/25/10 17:44
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl

i gues somthing like this

vec_set(temp,vector(0,0,-150);
vec_rotate(temp,my.pan);
vec_add(temp,my.x);
c_trace(my.x,temp,IGNORE_ME);

didnt test it


"empty"
Re: Mario Galaxy! [Re: flits] #339294
08/25/10 19:22
08/25/10 19:22
Joined: Sep 2009
Posts: 84
Theil Offline OP
Junior Member
Theil  Offline OP
Junior Member

Joined: Sep 2009
Posts: 84
This is the actual code, it almost work, I can go almost near to the bottom of the sphere, but I'm still falling.


my.pan += 8 * (key_a - key_d) * time_step; // rotate the player using the "A" and "D" keys
// vec_set (temp, my.x); // copy player's position to temp


vec_set(temp,vector(0,0,-5000));
vec_rotate(temp,my.pan);
vec_add(temp,my.x);
if(c_trace(my.x,temp,IGNORE_ME | IGNORE_PASSABLE))
{
vec_rotate(normal,vector(-my.pan,0,0));
my.tilt = -asin(normal.x);
my.roll = -asin(normal.y);
}
else
{
my.tilt += -my.tilt/5*time_step;
my.roll += -my.roll/5*time_step;
}

distance_to_ground = c_trace (my.x, temp.x, IGNORE_ME | USE_BOX);
movement_speed.x = 15 * (key_w - key_s) * time_step; // move the player using "W" and "S"
movement_speed.y = 0;
movement_speed.z = - (distance_to_ground - 17); // 17 = experimental value
movement_speed.z = maxv(-35 * time_step, movement_speed.z); // 35 = falling speed
c_move (my, movement_speed.x, nullvector, GLIDE); // move the player

Last edited by Theil; 08/25/10 21:54.
Re: Mario Galaxy! [Re: Theil] #340147
09/01/10 11:09
09/01/10 11:09
Joined: Sep 2009
Posts: 84
Theil Offline OP
Junior Member
Theil  Offline OP
Junior Member

Joined: Sep 2009
Posts: 84
I give up, thanks anyway.

Re: Mario Galaxy! [Re: Theil] #340148
09/01/10 11:21
09/01/10 11:21
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 could explain the problem more precisely and even upload a small testlevel where we can examine the problem, instead.
"I'm still falling" is not very helpful.

Re: Mario Galaxy! [Re: Pappenheimer] #340221
09/01/10 22:52
09/01/10 22:52
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Try out the other example. When I originally wrote it (for Pappenheimer, incidentally laugh ) the testing scenario was fairly Mario Galaxy -like.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: Mario Galaxy! [Re: MrGuest] #340239
09/02/10 07:31
09/02/10 07:31
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Originally Posted By: MrGuest
take a look at this from Helghast or this from Superku


Just to put credit where it's due; JulzMighty did that code in this thread.
I only borrowed that (but did put credit in there).

Dont want people to think I did it, just making sure laugh
(Great piece of code btw, and does exactly what you want/need)

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Mario Galaxy! [Re: Helghast] #340307
09/03/10 01:15
09/03/10 01:15
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Thanks Helghast wink I saw the credit in your code snippet, and appreciate you keeping track of that laugh

Jibb


Formerly known as JulzMighty.
I made KarBOOM!

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