Gamestudio Links
Zorro Links
Newest Posts
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
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, howardR, EternallyCurious, 1 invisible), 770 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Movement code + AutoJumping #457588
01/22/16 21:20
01/22/16 21:20
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
A small demo (experiment) of a movement code which combines Superku's gravity code and simple horizontal movement code (I used two different bbox models, one for horizontal movement and another one for vertical). Plus it has some simply animations and 3rd person camera that has collisions. There is an auto-jump thing I was inspired from old school type of games like Zelda on Nintendo 64. To make it work in your games with this code, you have to make sure that the surface from which you want to perform auto-jumping should have FLAG6 set in WED (look into the level setup of this demo via WED). There are a lot of things to tweak actually, so play with the code if you want to. Anyway, I hope someone might find this useful. I want to thank Superku for his awesome gravity code, and MasterQ32 for giving me some math tips tongue

Quote:
CONTROLS:
WASD - movement
SPACE - jump
SHIFT - run
MOUSE RIGHT + MOUSE MOVEMENT - rotate camera
MOUSE WHEEL - zoom


Here it is:
Download link

Useless screen (it looks promissing, I know):


Edit: I've uploaded new version, with a small bug fixes and smoothed Z movement up on stairs (could be tweaked as well).
Edit2: UPDATED! Even more fixes...

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Movement code + AutoJumping [Re: 3run] #457598
01/23/16 16:35
01/23/16 16:35
Joined: Jun 2010
Posts: 71
L
LawnmowerMan Offline
Junior Member
LawnmowerMan  Offline
Junior Member
L

Joined: Jun 2010
Posts: 71
Thank you, it is very useful

Re: Movement code + AutoJumping [Re: 3run] #457603
01/23/16 18:33
01/23/16 18:33
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Pretty solid indeed, good job!


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Movement code + AutoJumping [Re: Superku] #457604
01/23/16 18:36
01/23/16 18:36
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: LawnmowerMan
Thank you, it is very useful
You are welcome! Happy to hear that it's useful.

Originally Posted By: Superku
Pretty solid indeed, good job!
Thank you! To be honest I didn't even hope to get good results at first try, cause I always failed before (I tried for about 3-4 times in the past).

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Movement code + AutoJumping [Re: 3run] #457605
01/23/16 18:49
01/23/16 18:49
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
Good work! I enjoyed running it and it will be a great learning tool later.

Re: Movement code + AutoJumping [Re: Steempipe] #457606
01/23/16 19:04
01/23/16 19:04
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Thank you! I hope it will be useful!

Edit: I'm working on a movement code that works with native physX (character controller). So maybe soon we'll have another contribution! grin
Edit2: Just a little screenshot:

Quote:
DONE:
* graivity + jumping (to traces)
* simple trigger example
* cloth setup example (almost same as in samples folder)
TO DO:
* crawling

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Movement code + AutoJumping [Re: 3run] #457973
02/10/16 14:53
02/10/16 14:53
Joined: Jun 2010
Posts: 212
tagimbul Offline
Member
tagimbul  Offline
Member

Joined: Jun 2010
Posts: 212
hey i have a cool adition for your code grin

downside the code line who you have write
Code:
if(heroallowMove == 1)



make this here
Code:
if(my.SPEED_Z > 0)
{
DEBUG_VAR(my.SPEED_Z,30);
vec_set(toVec, vector(my.x, my.y, my.z + 18 ));
// trace UP to it from our origin position:
COLLISION_UP = c_trace(my.x, toVec, TRACE_FLAGS | IGNORE_FLAG2 | SCAN_TEXTURE | USE_BOX);
}
else
{
COLLISION_UP = 0;
}
 
DEBUG_VAR(COLLISION_UP,50);	
if(COLLISION_UP != 0)
my.SPEED_Z = 0;



and in the begin of the action make
Code:
var COLLISION_UP = 0;




its make a trace from he ca. middle to ha higer place and if this trace contact with something above hem if he Z_SPEED = 0 and he fall down

and know have the player collision to the things upside from hem
=)

Last edited by tagimbul; 03/21/16 16:51.

meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Movement code + AutoJumping [Re: tagimbul] #457981
02/10/16 19:25
02/10/16 19:25
Joined: Jun 2010
Posts: 212
tagimbul Offline
Member
tagimbul  Offline
Member

Joined: Jun 2010
Posts: 212
A fix:

search this line
Code:
// rotate angle towards the movement input:	
vec_to_angle(LERP_ANGLE.pan, ABS_DIST.x);




and change it to this:

Code:
if(FORCE.x != 0 | FORCE.y != 0)
vec_to_angle(LERP_ANGLE.pan, ABS_DIST.x);


the reason is:
ABS_DIST go, if the player dont move, all three af 0
but vec_to_angle continues
and the my.parent.pan rotate slowly to a false direction
but with this fix is my.parent.pan, after stop moving, on the right direction

greets tom
=)

Last edited by tagimbul; 03/21/16 16:52.

meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Movement code + AutoJumping [Re: tagimbul] #457985
02/10/16 21:37
02/10/16 21:37
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Thank you for your help with improving this man. Keep it up! laugh

Greets!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Movement code + AutoJumping [Re: 3run] #458017
02/13/16 02:18
02/13/16 02:18
Joined: Jun 2010
Posts: 212
tagimbul Offline
Member
tagimbul  Offline
Member

Joined: Jun 2010
Posts: 212
hey.

here is a update and i need help:

new functions:
-plattforms
-collision to cover
-slide down to steep slope
https://youtu.be/1n9DDK_NApg

the function works greatly but...

i try to make a climb code
in the video you can see the animation
if the model have hes last frame from the climb animation
i set the position of the position from this last frame

the last frame have the same frame from the stand animation
but if the player set new i can see fragments by moving....

have anyone a idea to make this better?....

here the project zip:
http://www9.zippyshare.com/v/3qazMTOa/file.html

search in the code:
// BUG ZONE

greest tom

Last edited by tagimbul; 02/13/16 02:31.

meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

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