The Daily Click ::. Forums ::. Klik Coding Help ::. Stop using alterable values for movement tutorials
 

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
29th April, 2004 at 09:19:44 -

Theres no need at all. They compilicate code and make it far harder to debug and learn.

A pro's 360 tutorial i downloaded set the current aa x pos to value a and then set the alterable value a to (aletrable value a + (sin alterbale value b * speed)) and then set the x pos to to value a!!! (its clever~ish using the event sequnce but it still sucks)

This totally stinks and is poor klikking, i can understand it but a noob has as much chance as a snowball in hell.

why not

always

set x pos to current x pos + sin(angle counter * speed counter)

Done nice and easy...

This annoyed me so much I am going to start writing my own 360 tutorials using normal counters and not alterbale values for everything.

So i call for no more alterbale values in movement tuts (unless its for ai players then its acceptable ).

Image Edited by the Author.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
29th April, 2004 at 10:35:22 -

So are you talking about only 360 movement engines?

 
.

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
29th April, 2004 at 11:19:22 -

what mine?

 
.

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
29th April, 2004 at 11:42:54 -

The system you mentioned is entirely intentional. An X co-ordinate or Y co-ordinate can only be an integer value. Since trigonometry deals with floats, the result is rounded off to a whole number so it can go to that co-ordinate. This can mean loss of accuracy in the movement, or it not working at all. Alterable values can store floats accurately so that's why the example stored the float position in an alterable value, then set the coordinate to what was in the alterable value.

 
- Tigerworks

Sage



Registered
  02/01/2004
Points
  43
29th April, 2004 at 12:01:08 -

Yeh I never use alterable values when making tutorials.

 
-Sage

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
29th April, 2004 at 12:23:16 -

Reason for alterable values:

• They can store decimal numbers (positions can't, try it next time before you complain)
• They're unique for each instance of the object, so it's easy to duplicate a movement across lots of objects. Try that with counters.
• You can rename them, so there should be less confusion than using a counter instead


Now give me a good reason to use counters instead...

 
n/a

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
29th April, 2004 at 12:33:04 -

Oi! He wasn't talking about using counters, read his post properly Mr Chris Firebranch Monkey

 
n/a

Kramy



Registered
  08/06/2002
Points
  1888
29th April, 2004 at 13:45:23 -

I agree with him. I actually didn't learn alterable values for a year. Probably why all my games sucked until then.

 
Kramy

Hagar

Administrator
Old klik fart

Registered
  20/02/2002
Points
  1692

You've Been Circy'd!Teddy Bear
29th April, 2004 at 14:45:06 -

Yes of course a monitor has subpixels, silly me. I'll remember not use my 1024.678 x 768.123 resolution again!, I must set the position to a floating point value...

And of course TGF can do decimal points in Alterable values, they must be majic...

Sorry for the sarcasm but my 360 engines in TGF work just as good

Image Edited by the Author.

 
n/a

Arf :: FPP Games



Registered
  15/05/2002
Points
  1364
29th April, 2004 at 14:52:27 -

Can't you still use a decimal system in TGF if you use the Advanced Math object's decimal offset?

Either way, storing a full decimal value rather than rounding to an integer at every step will always be more accurate, and sometimes that's very important. Your TGF engines will still work fine, but that doesn't mean they're the peak of accuracy and efficiency.

 
n/a

xXAaronXx



Registered
  09/06/2002
Points
  1012
29th April, 2004 at 15:15:41 -

Well im not sure what movement your talkin about but for platform movement I only use 1 value. I just use the regular platform engine and use one value for head collisions and in maybe 4 total events or so I can make a platform movement that works better than custom platform movements ive seen in other games and custom movements ive made myself that use tons of events.

 
I Don't Know...

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
29th April, 2004 at 18:35:09 -

Ah, but he was. And I quote:

"This annoyed me so much I am going to start writing my own 360 tutorials using normal counters and not alterbale values for everything."

Maybe you should read his post properly and not look like a fool

 
n/a

clwe



Registered
  17/12/2002
Points
  702
29th April, 2004 at 20:39:05 -

Well...if we're being really 'nerdy', I heard from someone that alterable values take up more memory than counters, because you're having to keep track of the activ object as well as the value. So if optimization is your middle name , then you might want to use counters instead. Or a numerical array in MMF. Anyway, you should use counters whenever possible in tutorials, to make them easier to understand.


Arf - "Can't you still use a decimal system in TGF if you use the Advanced Math object's decimal offset?"

Sort of. You can move the decimal offset of the object, so that all calculations have their decimal places shifted. For example, a decimal offset of 3 would change 0.707 to 707 (10^3). You retain most of the accuracy, just with larger numbers. To position an object correctly from here, you would set the X and Y to these large values, divided by 10 to the decimal offset. Or alternatively, you can move the object 1 pixel for every 10/100/1000 (whatever), and keep whatever's left over for the next move. So long as the 'precise' values are stored in counters, rather than relying on the object's current position.


Also...I've actually made a tutorial in TGF that does basic 360 degree movement, without alterable values. Don't know if anyone would be interested...? (I don't think it's worth making a download, myself)

 
n/a

Mr Icekirby



Registered
  18/12/2003
Points
  846
29th April, 2004 at 20:44:28 -

this is a pointless argument, its just his opinion, and if thats what he thinks, then thats what he thinks

it doesn't mean you have to go and disprove his idea

PS: hagartech, why not just keep your opinion to yourself unless you think it would revolutionize to world of klik, no offence

 
Mr Icekirby says so!
OBEY ME!

Echisketch(PS)



Registered
  20/03/2004
Points
  852
29th April, 2004 at 21:02:10 -

What stand do you have to say a pointless arguement kirby, pretty much every post you have is uninformative, annoying, and it screams newbie. Do you even click?!

 
"Everytime you use Kazaa, a metallica band member dies a little."
Quote Jonathon Smeby.
   

Post Reply



 



Advertisement

Worth A Click