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 ).
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.
• 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...
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
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.
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.
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)
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.
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
30th April, 2004 at 04:00:29 -
I'll have to take Chris Branch's side. What if you wanted 360^ for 100 objects? You can't do that with counters can you? Alterable values are unique and if you want a clearer name on them besides "Alterable A" and "Alterable B" then just rename them to "Angle" and "Speed" or is that beyond you? I bid you good-day.
• They can store decimal numbers (positions can't, try it next time before you complain) "
Do you need a position to accept a float???? No you dont, break your monitor and you will find the screen colour mask. This makes sure the elctrons hit the correct colour phosphors, This means that there is a minnimum value you can move a object, defined by the colour masks max resolution. So is there any point AT ALL of passing a float to a position? its like passing a float to the putpixel command in SDL, quite stupid.
So TGF CAN do trigonometry just as good as MMF, just work on everything 10 to the 4 bigger than divide it by 10000 (or an even bigger power), because MMF MUST round up to move an object on the screen anyway (can you place a object at 620.45678 x 345.765 ? according to your text, you can ). Cant you rename counters?? And If you bothered to read to my post i say its perfectly acceptable to use it for AI players
Dont get me wrong i aint cussing Chris Branch or Tigs there still probably more intelligent than me (You both write extensions and how in the world of bagels did tigs code the FISI object?????????) its just that i think for tutorials its is far better to use counters for learning purpouses. Like i could'nt understand the car example, but i got the idea (using a simple momentum triangle, taught in a level physics) and writ my own to correctly emulate the momentum, but i couldnt read the alterable values at all.
correction on last post: "still probably more intelligent than me", to "are more knowledgeable with how klik works" **blames guinness for how i am now **
"Do you need a position to accept a float???? No you dont, break your monitor and you will find the screen colour mask. This makes sure the elctrons hit the correct colour phosphors, This means that there is a minnimum value you can move a object, defined by the colour masks max resolution. So is there any point AT ALL of passing a float to a position? its like passing a float to the putpixel command in SDL, quite stupid."
You've missed the point. The alterable value represents the "real" position of the object, while the x-coordinate is just an approximation as you point out. You're passing the float to the position, but that's just the visual element. All the calculations you do will use the float, and therefore be more accurate.
An example: An object moves with speed X, which is added every 1/50 seconds to its position. Say X = 5. After one second the object will have gone 250 pixels. Now say X = 0.3. You see the problem? After 1 second, the object will have gone nowhere. If however, you added the speed to an alterable value and then set the position to that alterable value, the object would move 15 pixels in one second. Similarly, if the speed is any non-integer value then the alterable value method will always end up more accurate.
They are used to combat the very problem you describe -- you can't put an object at (300.467, 143.876), but using alterable values you can say that's where it is, even though its actual visual position is a slight approximation.
3. does it really make a diference whether my posts are informitive?
maybe i should just leave, i never learn anything here anyway... i think i will
Mr Icekirby says so!
OBEY ME!
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
30th April, 2004 at 17:28:32 -
Hagar - I understand what you are talking about now. Newbies that don't understand alterable values will be stuffed! And counters will make it easier for those newbs who still do not understand alterable values. Nice thought.
Counters take up extra memory as they are extra objects, alterable values are built-in allready created counters built into active objects. So using counters in stead of alterable values take up more memory and adds more objects into the game.
So, values specific to a single object or instance of an object should use the instance alterable values. Both to save objects/memory but also because this makes eg AI cleaner and easier to produce. A game with a variable number of enemies (or just many enemies) is tedious to construct with counters as every single enemy needs its own set of events to drive its AI. Using alterable values a single set of instructions (events) can control all instances of one/more enemies/objects (given they behave alike of course).
Furthermore it should really not be all that difficult to understand what an alterable value is. Even newcomers should be able to understand it if described properly. Its really just a built-in set of counters so to speak. They are altered much the same way as counters.
Im not saying counters should never be used. Not at all. Counters should generally be used when displaying things onscreeen (eg HUD, hiscore etc) ... they are valid useable objects.
And some may need the floating point precision alterable values give you, but thats just a bonus in most cases and not the actual reason why alterable values should be used (unlees you really need the precision of course).
Alterable values are easier to understand when using MMF because you can name the alterable values and make them more meaningful.
But I understand that alot of people can be put off being seeing lots of alterable values used in cases in tutorials when counters can be used instead.
However, I think it should be noted somewhere in these tutorials, mainly for reference and keeping good programming effeciency, and of course saving objects, that Alterable values are far more effective when coding the actual game. Although this is more suited to 'extreme' cases where you need the most out of your object limits and effective coding.
That's why I'd dread to see anyone seeing the coding in my more complicated games. I'm lucky to use one counter in a level, even with a HUD and all, where I tend to use string objects.
MUGGUS
Come and annoy me more at
www.muggus69.tk STOUT ANGER!!!
Once I made an RPG engine in TGF. The inventory/battle/speech/movement/menu systems were all in one frame, so I wouldn't have to save anything from one to the other. It even had health/mana percentage counters.
Chris: Im fully aware of what type of data a trig function returns and i am fully aware that what i do is VERY bad practice in MMF (is there a advanced math object for mmf??????). But in tgf it doesnt hurt, as you divide by 10,000 or 100,000 or even more if your working at higher accuracy (the power), i have had to write programs in C using double's (double length floating point for better accuracy when doing trig etc) and do software for calculus, differentiation etc so im fairly up on all that jazz .
Im still a beginner, but when i first started making stuff with mmf, just trying to figure it out by myself without studying other peoples tutorials, i always used a lot of counters. Thanks to the brillant and helpful tutorials by tigerworks and others i started working out how to use alterable values (among other things) for the same purpose. The result was my code was totally simplified.I only recently started doing this so im still quite excited because its opened up a lot of new ground for me to explore. The point is that if only dumbed downed examples were given id probably never figure out the good stuff. And for me the hard part with the movement tutorials is not the alterable value concept actually thats easy! I havnt studied math for 12 years so its really hard to understand the mathmatical concepts. Anyway i really appreicate seeing how people really write code, its helped me -thanks!