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!