The Daily Click ::. Forums ::. Klik Coding Help ::. 360 directions needed... possibly more!
 

Post Reply  Post Oekaki 
 

Posted By Message

Hagar

Administrator
Old klik fart

Registered
  20/02/2002
Points
  1692

You've Been Circy'd!Teddy Bear
25th November, 2004 at 18:45:34 -

Kris: In thoery yes there is infinite angles.

In a game being displayed on a monitor there is no such thing as true infinite angles, have a look at the table, i have proved this to be correct, see how often it moves a by pixel on either axis.

 
n/a

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
25th November, 2004 at 18:50:40 -

ahh, on a computer, sorry I thought you meant in every-day advanced maths :3

 
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
25th November, 2004 at 18:50:57 -

With an infinitely large monitor you'd have an infinite number of angles. Reality has graininess, too, it just has much smaller pixels.

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
25th November, 2004 at 19:11:41 -

So you're trying to disprove it by throwing a trig table at us? Anyone can tell you that the more you multiply by, the greater the integer precision. If you multiplied by 300000, you're going to get visible changes in the coordinates.

Apart from the fact that it's wrong (the theoretical X should be 300 when the angle is 0 and no more) you're missing the point in that stuff still moves over a period of time and needs the precision if it is to be accurate. If you convert a velocity vector to cartesian coordinates and then round the i/j values to integers, you will not end up with the same direction or magnitude you started off with. If you multiply the original vector and the rounded vector by an arbitrary high number, they are NOT going to be the same. This difference is accentuated when you use a small magnitude, for obvious reasons.

I mean, just look at games that use 32 directions for shooting and compare them to those that use trig, and you'll find that the latter hits the target wherever you place the target. There's no point denying it, it's there as clear as day.


Like you Hagar, I'm capable of exactly the same Maybe not to the same extent, but I'm in AS year after all, and come from an engineering background...

 
n/a

Hagar

Administrator
Old klik fart

Registered
  20/02/2002
Points
  1692

You've Been Circy'd!Teddy Bear
26th November, 2004 at 09:41:01 -

The table is correct as i do not start at 0 for some reason .

Yes it does need accuracy, but what that i think that table proves is that putting angles into a engine greater than 3dp is pointless (in that aiming reticule example), as the monitor simply cannot display to that accuracy level and all the possible directions.

Sure if you write 3d engines which are vector based and terefore can run on any resolution then sure use that accuracy (heh in 3d 32 bit numbers give rise to gaps in the wall joins as the precision is'nt high enough - playstation 1).

And im fully aware of the old 8 direction movement custom movement, of course you need to 'slow' the one axis down, or your player will move at double speed on diagnols (been there done that ), but his displacement or velocity in a certain direction will remain the same.

You are capable of far more on the software front so i'm gonna stop arguing .

Image Edited by the Author.

 
n/a

Pete Nattress

Cheesy Bits img src/uploads/sccheesegif

Registered
  23/09/2002
Points
  4811
26th November, 2004 at 09:50:23 -

can't you guys argue about something more interesting? like kittens or something.

 
www.thenatflap.co.uk

Hagar

Administrator
Old klik fart

Registered
  20/02/2002
Points
  1692

You've Been Circy'd!Teddy Bear
26th November, 2004 at 10:42:03 -

nope were engineers for gods sake!

now i have talked bull, both need to be slowed down .

Also kittens get stuck in trees!

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
26th November, 2004 at 11:35:19 -

Yes. Trees are cruel to kittens. Let's chop them all down.

 
n/a

Dave S.



Registered
  26/09/2003
Points
  924
26th November, 2004 at 14:02:02 -

Ok, well I think I've sussed out the 'advanced direction object' extension for MMF but I'm not sure how to stop it when it completely overlaps another object (detector). At the moment the object looks in the direction of the detector and then travels toward it. When the object has more of less the same co-ordinates of the detector it will then shimmer over the top of it as it doesn't land exactly. It repeatedly tries to look in the direction of the detector object.

 
n/a

Arf :: FPP Games



Registered
  15/05/2002
Points
  1364
26th November, 2004 at 14:09:54 -

I just wish to add that I am in favour of kittens.

Anyway, if you only want to aim at a distance of 300 pixels then obviously decimal accuracy won't make much noticeable distance. The point is that, in general, it is much better to allow decimal accuracy. This is especially true in movement engines. Try and make any engine that requires low speeds and you'll see how useful it is to use decimals. Once you start adding them together 50 times a second they quickly add up to whole pixels that can make an important difference.

EDIT: If you have sufficient accuracy, you should only need to point it in the right direction once (i.e., when you tell it to move), rather than telling it to always point towards the detector. Then just test if it's within a certain area around the detector object to tell when it has arrived (X > X("Detector")-10, X < X("Detector")+10 etc.), or just use the "Overlapping another object" condition.

Image Edited by the Author.

 
n/a

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
26th November, 2004 at 20:08:54 -

you can have as many angles as are provided by the precision of decimals in MMF -Me, earlier.

Stop nit picking at the details and just get the gist of it!
Decimal angles is the same code as 360 directions, so you may as well throw in the extra precision!

 
- Tigerworks

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
26th November, 2004 at 20:29:12 -

Dave S - you may find the Move Safely object to be useful for moving stuff right up to but not beyond an object, and it's easy to use too.

 
n/a

Hagar

Administrator
Old klik fart

Registered
  20/02/2002
Points
  1692

You've Been Circy'd!Teddy Bear
28th November, 2004 at 06:25:52 -

But at normal ranges you can't anyhow i blame it on the boogie.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click