The Daily Click ::. Forums ::. Klik Coding Help ::. Alterable Values (for n00bs)
 

Post Reply  Post Oekaki 
 

Posted By Message

Teapot

Does he even go here

Registered
  02/10/2003
Points
  2631

VIP Member
30th April, 2004 at 22:19:33 -

Ok, someone recently attacked engines that use alterable values, because n00bs don't understand them or something.

So heres the low down:

What is an alterable value?

An alterable value is like a counter. That means it is basically a number that you can manipulate at will.

What makes them better than counters is the fact that they are specific to one object. This is VERY useful.

For instance:
Your character is fighting mindless goons. Each goon is called "Active Object 2". You want them to have a certain amount of stamina. What do you do? You could have a counter that goes up when you hit them, and when the counter gets to a certain point they die. But that wont work for each one SEPERATELY. How about instead of telling a counter to go up, tell the object's ALTERABLE VALUE to go up. Now they each have their own INDIVIDUAL stamina, despite all being the same object.

YAY!!! Isn't that fun?!!

And what's more is, each object can have more than one value, on tgf you get three, and on mmf you get heaps!! Don't you just love the alterable values!!!! YIPEEEE!!

And you dont have to use them just for health. You could use them for thousands of things. One example is using them for movement as shown in my platform tutorial (shameless promotion): http://www.create-games.com/download.asp?id=4289 . Check it out. Now your one step away from being a n00b. YEHAW!!!

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
1st May, 2004 at 07:00:21 -

This would make an excellent article. Or a popup in MMF's Tip Of The Day. ;P

 
n/a

Hagar

Administrator
Old klik fart

Registered
  20/02/2002
Points
  1692

You've Been Circy'd!Teddy Bear
1st May, 2004 at 11:35:57 -

You have obviously not read my post, i say to use counters in tutorials and not for CPU/AI momvement, by all means use it your own games but not tutorials. Read my post FULLY before you start typing and taking the urine , congratulations on making yourself look reather idiotic **cheers and claps**. No offence

Isnt amazing the main 'attackers' still have not replied to the other thread, either they have not read it, or I am right and you can not move an object to pixel 345.56787 x 234.56784 etc so whats the point of passing such a high precision float to it when its going to round up anyway?. I await a reply...

Image Edited by the Author.

 
n/a

Kramy



Registered
  08/06/2002
Points
  1888
1st May, 2004 at 12:39:03 -

The main problem with alterable values is people are always renaming them. It's a lot easier to see "Alterable Value A = Gravity" than "Gravity = Gravity....what's gravity!? I never saw a GRAVITY counter!"

Btw. That quote was taking about a year ago.

 
Kramy

Arf :: FPP Games



Registered
  15/05/2002
Points
  1364
1st May, 2004 at 12:44:25 -

"Isnt amazing the main 'attackers' still have not replied to the other thread, either they have not read it, or I am right and you can not move an object to pixel 345.56787 x 234.56784 etc so whats the point of passing such a high precision float to it when its going to round up anyway?. I await a reply..."

I have made a lengthy reply in the other thread, before you made this post in fact.

As for not using alterable values in tutorials, well, perhaps. You're right that tutorials should be as understandable as possible, but sometimes you have to assume some prior knowledge on the part of the reader. People can always find out about things they don't understand from other sources, for example the excellent post at the beginning of this thread.

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
1st May, 2004 at 12:59:51 -

And considering that using alterable values will be pretty much essential for anything the user is going to do (related to movement), there's no point saying 'Here's how you do it with counters' because you'll get a zillion comments asking you how to do it with multiple objects.

 
n/a

Hagar

Administrator
Old klik fart

Registered
  20/02/2002
Points
  1692

You've Been Circy'd!Teddy Bear
1st May, 2004 at 17:41:33 -

Well lets not argue were all here for the same reason, becuase we klik. its just that i belive its useful for noobs to learn.

Arf your arguments flawed, why not decrease the time per loop and move a pixel at a go, as it cant move to .3 of a pixel

 
n/a

Echisketch(PS)



Registered
  20/03/2004
Points
  852
1st May, 2004 at 18:12:52 -

Exactly, thats why Values is teh better, otherwise all Sagahachi Ninja enemies would die in one hit, and all RPG elements would not exist.

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

Mr Icekirby



Registered
  18/12/2003
Points
  846
1st May, 2004 at 19:14:49 -

you know this is going to start a forums war sometime

but it really depends on the person's preference whether they want to use the alterable values, or if they want to use counters, meyself, i switch back and forth,

and thats a good point you bring up teapot, most new people can't understand alterable values right away, it makes the job harder for the little people

 
Mr Icekirby says so!
OBEY ME!

Teapot

Does he even go here

Registered
  02/10/2003
Points
  2631

VIP Member
1st May, 2004 at 19:38:52 -


EDIT: Changed "mad" to "made".

Everyone CALM DOWN. This wasn't entirely made because of that other post. And seriously, what's with all the arguing?!!?

The other post simply reminded me that three years ago I had no idea what an Alterable Value was, and this is to help n00bs like I was.

As for making this an article: No way Lucy!!

Maybe if I re-wrote it and added proper grammar I'd do it, but do we really need it there?

And lastly about using counters in tutorials: NO!! Counters are ugly, confusing and too restrictive. We must use good old Alties!!!

Image Edited by the Author.

 
n/a

Teapot

Does he even go here

Registered
  02/10/2003
Points
  2631

VIP Member
1st May, 2004 at 19:42:20 -

And for Dustin: That is true but you don't have to call people 'tards.

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
1st May, 2004 at 20:21:50 -

Although it makes him feel better.

By the way Hagar, you need to learn what kind of values the trig functions return. If we all use your method, we can move at 10 degrees and still go up in a straight line. Floats introduce accuracy in movement, but accuracy in displaying is stupid and unnecessary.

 
n/a

Cybermaze



Registered
  03/04/2003
Points
  853
2nd May, 2004 at 04:55:49 -

A sidenote on the counter/alterable value discussion.

A counter takes up extra memory as it is an independant object (obvious. I know!) where as every active object has a number of alterable values included from the beginning.

I would generally use a counter if:
- The result is supposed to be shown on screen.
- I want to keep track of something that is not tied up to a single object or instance of an object.

I would generally use alterable values if:
- The value I want to keep is specific to a single object or instance of an object. Eg. how much health an anemy has, what state the enemy is in (eg. 1=search mode, 2=shoot mode, 3=flee mode etc) to apply the right actions to him etc etc.

If someone should not know what I mean by an instance of an object (newcomers/newbies/n00bs). When you have created an object "Active Object 3" that is an enemy and you place the object in a level (either in the level editor or with the event editor) each "Active Object 3" enemy is an instance or a copy of the actual active object you created.

 
If you knew, I would have to kill you...

Arf :: FPP Games



Registered
  15/05/2002
Points
  1364
2nd May, 2004 at 08:58:56 -

"Arf your arguments flawed, why not decrease the time per loop and move a pixel at a go, as it cant move to .3 of a pixel"

You could do that, but then you'd have to write extra code to deal with small values, when using my method the engine copes with absolutely any value. Plus what would you do about non-integer values greater than zero? My whole point was that you can't move .3 of a pixel! You're still missing the idea that you don't need to be able put an object between pixels for a decimal value to be useful. Why would I be making this up? It's a testable fact which I've used in my own engines before.

 
n/a

Mr Icekirby



Registered
  18/12/2003
Points
  846
2nd May, 2004 at 09:33:48 -

i don't like it when people call me a tard

 
Mr Icekirby says so!
OBEY ME!
   

Post Reply



 



Advertisement

Worth A Click