Jump to content


Photo

Project K


  • Please log in to reply
38 replies to this topic

#21 Endorel

Endorel

    GMC Member

  • Banned Users
  • 191 posts

Posted 07 February 2010 - 01:42 AM

You can't do that very easily, unless you have the real Kingspace. You'll need to download Kingspace, but there's only one problem: I don't want to upload it for you (Sorry I am too busy). Ask Slayer64 to upload it.

#22 slayer 64

slayer 64

    GMC Member

  • GMC Member
  • 3278 posts
  • Version:GM8.1

Posted 07 February 2010 - 02:22 AM

oh god, moving platforms...ones that don't glitch? O_o
it'll be a while.
  • 0

#23 3D2DGAMES

3D2DGAMES

    GMC Member

  • GMC Member
  • 638 posts

Posted 07 February 2010 - 04:00 AM

I figured out a loophole muahaha!

used this script that I pulled from the GMC somewhere. lost the link to where it was. the guy's name who posted it started with link. i gave it a name and put the arguments in place

//scr_nearest(x,y,z,obj)
int = noone; //current closest instance
dis = 10000; //just a big number
for (i=0; i<instance_number(argument3); i+=1)
{
	o = instance_find(argument3,i);
if (sqrt(power(argument0-o.x,2)+power(argument1-o.y,2)+power(argument2-o.z,2))<dis) {
int = o;
dis = sqrt(power(argument0-o.x,2)+power(argument1-o.y,2)+power(argument2-o.z,2));
}
}
return(int)

after adding that to the scripts I added the following piece of code to the end step event of the player

//am I on a platform?
i=scr_nearest(x,y,z,obj_platform);

if place_meeting(x,y,i)
{
	if z>i.z and z<i.ztop or z=i.ztop
	{
		z=i.ztop+radius;
		onground=1;
		//zspeed=0;
		x=x+lengthdir_x(i.speed,i.direction);
		y=y+lengthdir_y(i.speed,i.direction);
		xx=x;
		yy=y;
		zz=z;
		shadow_z=i.ztop;
	}else{
		if z<i.z
		{
			if z+radius>i.z{zspeed=-1;}
		}
	}
}
this is what follows after this piece of code. I thought I should be a little more specific as to where I put the code. I did not write the following:

//set the new vector of motion. it is the vector from the previous position to the new position
if x!=xx
or y!=yy
or z!=zz
{
	hspeed=xx-(x-hspeed);
	vspeed=yy-(y-vspeed);
	zspeed=zz-(z-zspeed);
}


//set the balls position to the position the collision code calculated
x=xx;
y=yy;
z=zz;


//control the camera
obj_control.x=x;
obj_control.y=y;
obj_control.z=z;

//fell off
if z<-200
{
	x=xstart;
	y=ystart;
	z=zstart;
	zspeed=0;
}

the obj_platform must have two variables z and ztop. ztop is the top of the platform where the player will stand. the programmer has the freedom to move the platform with direction and speed arguments and the character will move with it. just make sure that ztop is updated whenever the z value changes.

anyway it is a sloppy throwtogether but it works! also note that I gave the player a 16x16 mask and the platform has a 32x32 mask. this also means that the platform model must be the same shape as the mask. sorry but it was the best I could do. its been a long time since I have used gamemaker.

please feel free to improve on my fix or figure out a better way.

that's my $.02 :)

Edit:
oh and I forgot to mention a bug.
if you use this method and the character is on the platform then he can not be pushed off the platform by existing terrain. standing on the platform will cause the player to ignore collision checking for the terrain. so no making platforms run through the terrain alright guys haha.

Edited by 3D2DGAMES, 07 February 2010 - 05:08 AM.

  • 0

#24 Robert3DG+

Robert3DG+

    VR Games

  • GMC Member
  • 1849 posts
  • Version:GM:Studio

Posted 05 April 2010 - 07:29 AM

Has anyone figured out how to make dangerous pieces of terrain like lava? I tried using the "if point in triangle" script but I failed horribly ^_^
  • 0

#25 RamboFox

RamboFox

    Tainted Fortune

  • New Member
  • 992 posts

Posted 07 April 2010 - 12:12 PM

Has anyone figured out how to make dangerous pieces of terrain like lava? I tried using the "if point in triangle" script but I failed horribly :rolleyes:

First: You need to make it so that the editor saves level data/polygons stored with numbers for each polygon (for example: 1 = grass 2 = dirt 3 = lava)
Second: Look through the scripts where it checks for collisions against polygons. Use that to your advantage.

I would help, but my computer wiped itself some time ago.
  • 0

#26 Robert3DG+

Robert3DG+

    VR Games

  • GMC Member
  • 1849 posts
  • Version:GM:Studio

Posted 08 April 2010 - 03:00 AM

Yes, exactly and that is what I'm working on now Rambofox.

Though this data would need a new container. You couldn't just throw a random terrain ID number into the model file that Master Editor generate or GM would freak out when it tried to read it.

Edited by Robert3DG+, 08 April 2010 - 03:04 AM.

  • 0

#27 RamboFox

RamboFox

    Tainted Fortune

  • New Member
  • 992 posts

Posted 09 April 2010 - 04:43 AM

Yes, exactly and that is what I'm working on now Rambofox.

Though this data would need a new container. You couldn't just throw a random terrain ID number into the model file that Master Editor generate or GM would freak out when it tried to read it.

Precisely, you'll need edit the loading and saving scripts to include the extra value. Hopefully it'll be backwards compatible with older map/world files.
  • 0

#28 Robert3DG+

Robert3DG+

    VR Games

  • GMC Member
  • 1849 posts
  • Version:GM:Studio

Posted 09 April 2010 - 06:21 AM

Hmm, any idea how do this Rambo? I'm not too familiar with the loading and editing and eventual exporting of files in GM. I can read the code and understand it but I can't wrap my mind around the concept to make any use of it, especially for something like this.

I wish more people would use the ProjectK+MasterEditor2 combo and work on adding to it. I believe Slayer is done with adding on. The only thing I've been able to add is moving platforms and even then aren't that good. I guess the ProjectK+MasterEditor2 combo won't catch on until Slayer64 finishes his 3D level designer, or if someone does it before him.

It's frustrating, but I'm willing to work at it.
  • 0

#29 RamboFox

RamboFox

    Tainted Fortune

  • New Member
  • 992 posts

Posted 09 April 2010 - 09:23 AM

It's as simple as making it so that the save/load scripts saves an extra line that is used for saving variables, as it is already able to save the texture id/texture vertices to individual polygons.

And as we already both know, within the step event of the player there is a polygon checking script that you could take advantage of, so as to detect what the value of the polygon it is intersecting with. An easier way to do it (and not as flexible) would be to use the shadow script and simply return the id of the polygon directly below it.
  • 0

#30 slayer 64

slayer 64

    GMC Member

  • GMC Member
  • 3278 posts
  • Version:GM8.1

Posted 09 April 2010 - 05:57 PM

you guys seem to be getting into project K. i uploaded a gm8 version with more efficient collision code. less reading too. i didn't solve the dangerous triangle problem because pro editor will be able to handle that. moving platforms should be pretty easy once pro editor is more mature.
  • 0

#31 Gamer3D

Gamer3D

    Human* me = this;

  • GMC Member
  • 1590 posts
  • Version:GM8.1

Posted 19 April 2010 - 03:03 AM

Man. It's been a LONG time since I scrolled through the Kingspace movement engine. It was awesome back then, so I made my own sphere-based collision system. Then promptly lost it.

Some things to consider implementing (I might get around to editting this engine in my spare time):
  • Collision Structure: Grid or quadree/octree to minimize the collision checks. Can make the algorithm be approximately O(log n) if done right. In layman's terms, increasing the triangle count doesn't increase the time required as much.
  • Greater model loading support: GM models waste space and time. 3DS is rather good all around.

EDIT: Found the documentation had my engine summary. Felt silly. Got over it.

Edited by Gamer3D, 19 April 2010 - 05:44 AM.

  • 0

#32 _191717

_191717

    GMC Member

  • New Member
  • 60 posts
  • Version:GM8

Posted 20 November 2011 - 10:14 AM

thanks for sharing, i need 3d triangle collision scripts.. :)
  • 0

#33 loverock125

loverock125

    GMC Member

  • GMC Member
  • 1606 posts
  • Version:GM8

Posted 24 November 2011 - 04:49 PM

Is the link down? Cause I'm getting a 'The page you were looking for doesn't exist'.

And it looks so promising..
  • 0

#34 JonathanPzone

JonathanPzone

    GMC Member

  • GMC Member
  • 1199 posts
  • Version:GM:Studio

Posted 25 November 2011 - 01:57 AM

It's due to the change in subdomain.

The new link would be:
http://sandbox.yoyog...om/games/102726
  • 0

#35 BluePotato1994

BluePotato1994

    GMC Member

  • GMC Member
  • 184 posts
  • Version:GM8

Posted 27 November 2011 - 08:33 AM

You can walk through the left side of most walls (GM8 Version) Was this a bug before it was converted to GM8
  • 0

#36 Robert3DG+

Robert3DG+

    VR Games

  • GMC Member
  • 1849 posts
  • Version:GM:Studio

Posted 28 April 2012 - 05:49 AM

Bump because this is worth it.

I am getting weird glitches in the GM8 version as well. Are we going to see any updates Slayer64? Collisions like this have the potential to change the playing field of 3D in GM.
  • 0

#37 slayer 64

slayer 64

    GMC Member

  • GMC Member
  • 3278 posts
  • Version:GM8.1

Posted 30 April 2012 - 02:35 AM

i don't know about any glitches. i updated the files. it's gm81 now though
  • 0

#38 Qon

Qon

    GMC Member

  • GMC Member
  • 85 posts

Posted 20 July 2012 - 02:53 AM

Was a long time ago since I tested K, but from my testing you can fly through the model if your speed is really high. That is the second reason I won't use this. The first is I prefer to write my own engine, which I also have done (almost finished) xD.
  • 0

#39 291540

291540

    GMC Member

  • GMC Member
  • 25 posts
  • Version:GM:Studio

Posted 04 February 2013 - 02:48 AM

Can you get a file that works with studio?
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users