The Daily Click ::. Forums ::. Klik Coding Help ::. Walls are hard
 

Post Reply  Post Oekaki 
 

Posted By Message

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
3rd September, 2008 at 06:47:20 -

I've been trying to find a solution to my problem for a couple days now, and I can't think of one.

I have a wall, and I need to find the angle of it at runtime at any given time. I can't have the wall's angle predetermined.
Any ideas?

Image Edited by the Author.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
3rd September, 2008 at 07:07:31 -

is the wall a rotated sprite?

if its a map loaded from a file you can have all the angles and positions of walls loaded at the beggining of a level and then you can use the rotated angle of the wall.

if not, im pretty sure pixeltheif has loads of info to drop on you on this subject.

 
n/a

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
3rd September, 2008 at 07:19:15 -

If the walls are destructible then it is impossible to do it that way.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
3rd September, 2008 at 07:31:09 -

are you going to be calculating EVERY wall constantly? or only a single wall under certain conditions?

 
n/a

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
3rd September, 2008 at 07:40:41 -

A single wall under certain conditions. Rather, a wall segment under certain conditions.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

aphant



Registered
  18/05/2008
Points
  1242
3rd September, 2008 at 07:58:25 -

If the walls are destructible, then they must be active objects, right? That means that they would have alterable values that can be referenced, right? If you can't make alt values work, would you be able to use the object's direction?

 

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
3rd September, 2008 at 08:14:18 -

You would have to compare it to a fixed point.

OR

Find the distance between the top Y, bottom Y, left X, right X of the sprite

E.g tan A = Y/X

Tan A = (Y top - Y Bottom)/(X left - X right)

therefore A = arctan (Tan A)

however i think MMF does this result in radians.

pi radians = 180 degrees

So A in degrees = A * 180/pi

This should theoretically work, if you can do it using this method.

 
My signature is never too big!!!

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
3rd September, 2008 at 09:07:42 -

MMF can't handle immense active objects without crying and stealing system resources. The walls are all backdrops. That math will work, and that's what direction I was headed in already, but how do I find that with a backdrop?

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
3rd September, 2008 at 09:35:22 -

MAGIC

create 2 very small active objects at each point

(i.e one at 0,0 and one at x,y relative to the wall, when creating the wall backdrop, and get the positions between these)

 
My signature is never too big!!!

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
3rd September, 2008 at 10:22:48 -

http://www.create-games.com/download.asp?id=7299

take a look at how I do it.

Cast a ray towards the wall, finding the point of collision with it
create two 2 active objects, set on the perimeter of a circle, both initially facing back towards your ray
rotate each object in opposing directions until they both collide

find the angle between the two objects.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
3rd September, 2008 at 10:27:38 -

Just wondering, would corners or tight spaces defeat that method? That's what messed up my attempts.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
3rd September, 2008 at 10:49:58 -

depends on how you want to use it. It will just give the inbetween angle on corners, instead of an exact up or down, but thats only within a small pixel span; I used 8. If you really need 8 pixel depth on those intersections, you can have it run another set of collision points, further away, and compare the angles with its next in line. In general thats pretty unnecessary though.
Image

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
3rd September, 2008 at 10:55:36 -

I've been messing around with it, seems to be pretty solid! I noticed small 5-8 pixel gaps make it screw up a little. Is that just a problem with the platform engine or the wall angle checker?

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
3rd September, 2008 at 10:58:14 -

Why the heck would you have 5-8 pixel gaps?

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
3rd September, 2008 at 11:01:28 -

I wouldn't intentionally put a 5-8 pixel gap anywhere, but I don't control my players and who knows if they'd do that.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
3rd September, 2008 at 11:14:45 -

most platforming engines break down if you have extremely odd surfaces, like I doubt even the mario galaxy engine by nintendo would work if you threw him into a cloud of 1 pixel volume obstactle particles.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
3rd September, 2008 at 13:00:15 -

Nice tutorial Pixelthief I can see the issue with small details, however when you start getting that small you are down to pixels which are always at right angles to each other so the detection gets difficult. You will have to take an average, like an 8 pixel area like Pixelthief suggested.

 
n/a

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
3rd September, 2008 at 20:09:51 -

Yep, all I'm worried about is the ray slipping through the pixel gaps and taking the wall behind the intended wall. This would work perfectly otherwise. Thanks a lot!

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
   

Post Reply



 



Advertisement

Worth A Click