Author Topic: A question...  (Read 1900 times)

Offline Urjak

  • *
  • Posts: 2753
  • Rep: 6
  • Shell Spinner King
    • http://www.youtube.com/wa
    • View Profile
    • Awards
A question...
« on: August 25, 2010, 06:02:52 PM »
So I was conducting some AI battles with a few bots and a thought occurred to me: Why do battles with the same bots, the same AI, the same arena and start location end up happening differently? If all the variables are the same, shouldn't the battles always be the same?

If anyone has any thoughts or explanations for this I would like to know.
Any comments would be appreciated. :D

Offline Somebody

  • *
  • Posts: 7201
  • Rep: 13
  • CP: +2
    • View Profile
    • Awards
Re: A question...
« Reply #1 on: August 25, 2010, 06:16:24 PM »
I think that it is because there is no and can never be a robot that can be guaranteed to beat another robot of its equal weight.
I built that big robot on that TV show that time


Offline Urjak

  • *
  • Posts: 2753
  • Rep: 6
  • Shell Spinner King
    • http://www.youtube.com/wa
    • View Profile
    • Awards
Re: A question...
« Reply #2 on: August 25, 2010, 06:19:21 PM »
I think that it is because there is no and can never be a robot that can be guaranteed to beat another robot of its equal weight.

I honestly don't see how that answers my question. I am really wondering why battles with the same variables are not EXACTLY the same, meaning robots make the same moves and do the exact same damage.
Any comments would be appreciated. :D

Offline Somebody

  • *
  • Posts: 7201
  • Rep: 13
  • CP: +2
    • View Profile
    • Awards
Re: A question...
« Reply #3 on: August 25, 2010, 06:27:11 PM »
What I was trying to mean was exactly what variables are. The variability of whether or not wedges get under each other, if a bot is a little skewed one way or another, causing a weapon to not hit, etc.

What I am trying to say is that there are so many variables that no two battles can be EXACTLY the same.
I built that big robot on that TV show that time


Offline Urjak

  • *
  • Posts: 2753
  • Rep: 6
  • Shell Spinner King
    • http://www.youtube.com/wa
    • View Profile
    • Awards
Re: A question...
« Reply #4 on: August 25, 2010, 06:32:42 PM »
What I was trying to mean was exactly what variables are. The variability of whether or not wedges get under each other, if a bot is a little skewed one way or another, causing a weapon to not hit, etc.

What I am trying to say is that there are so many variables that no two battles can be EXACTLY the same.

The preset variables in a match seems to be the AI, the bots used, and the arena. Those are the only things I can think of that effect the way a match plays out. So then why do two battles with the same preset variables mentioned above come out different? Why does a bot get under it's opponent in some, and yet get out wedged in others? What is the factor that adds randomness to the battles?

Does the AI always behave the same? Is it pre-programmed to make the game interesting? There has to be something that is changing the battles.
Any comments would be appreciated. :D

Offline Naryar

  • Posts: 23267
  • Rep: 20
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
Re: A question...
« Reply #5 on: August 25, 2010, 06:37:55 PM »
Because the AI of the robot doesn't always acts the same exact way. And a popup VS HS battle can depend perfectly only on a single aiming error.

Oh and this

Now for RA2. Ra2 runs on the Havok physics engine, there is an element of randomness to it so it CANNOT be predicted at ANY time (for the most part)

From the robot building techniques wiki page.

Offline Urjak

  • *
  • Posts: 2753
  • Rep: 6
  • Shell Spinner King
    • http://www.youtube.com/wa
    • View Profile
    • Awards
Re: A question...
« Reply #6 on: August 25, 2010, 06:40:05 PM »
Now for RA2. Ra2 runs on the Havok physics engine, there is an element of randomness to it so it CANNOT be predicted at ANY time (for the most part)

Ooooohhhh... the physics engine. Didn't think of that. That must be what generates the different behavior.
Any comments would be appreciated. :D

Offline Somebody

  • *
  • Posts: 7201
  • Rep: 13
  • CP: +2
    • View Profile
    • Awards
Re: A question...
« Reply #7 on: August 25, 2010, 06:44:08 PM »
A good example of the Popup vs. HS luck is Chernobyl vs. Revenge of Dr. Wham. in BBEANS 5. RODW was bounced away a certain, yet different way, because of the spinning, the route the bots take, the arena shape, etc. That bounce sent Chernobyl up, and at just the right angle, and a well-timed hit KOed it.

A good example IRL is like trying to dribble a football like a basketball. You can TRY to do it a certain way (bouncing it on the flatter part of the football), but it does not always go to plan because of all of the variables.
I built that big robot on that TV show that time


Offline Urjak

  • *
  • Posts: 2753
  • Rep: 6
  • Shell Spinner King
    • http://www.youtube.com/wa
    • View Profile
    • Awards
Re: A question...
« Reply #8 on: August 25, 2010, 06:52:46 PM »
A good example of the Popup vs. HS luck is Chernobyl vs. Revenge of Dr. Wham. in BBEANS 5. RODW was bounced away a certain, yet different way, because of the spinning, the route the bots take, the arena shape, etc. That bounce sent Chernobyl up, and at just the right angle, and a well-timed hit KOed it.

A good example IRL is like trying to dribble a football like a basketball. You can TRY to do it a certain way (bouncing it on the flatter part of the football), but it does not always go to plan because of all of the variables.

The main reason for my confusion is that RA2 is a computer program, and unless specified in the program or elsewhere, the computer will always run a program exactly the same, every time. So thus if RA2 had nothing in its programming to make the matches different, they would be identical as long as the modifiable variables are identical (robots, AI, arena). The main reason for my posting this thread was to ask if anyone knew what particular part of RA2 guarantees match outcomes will vary. The physics engine like Naryar proposed seems like the likely culprit.
Any comments would be appreciated. :D

Offline ACAMS

Re: A question...
« Reply #9 on: August 25, 2010, 08:02:54 PM »
The arena floor is rough and the bots bounce and that is what makes the difference....

Offline JoeBlo

Re: A question...
« Reply #10 on: August 26, 2010, 04:02:14 AM »
if you had to wedged robots, both pop ups and capable of 1 hit KO's moving towards each other straight on a flat plane (like the BBEANS v2 floor) the results should be identical

the AI in RA2 dont follow paths like you would find in some older racing games.. all they simply do is head for the opponent while navitagting around walls and hazards (the 'radius' tells the robot how far to say away from these) so basically anything between point A and B that isnt a arena hazard or wall is 'winged' by the AI...

Offline Zog

  • *
  • Posts: 1173
  • Rep: 0
  • I suck.
    • georgedbabingdon
    • View Profile
    • Awards
Re: A question...
« Reply #11 on: August 26, 2010, 07:04:26 AM »
I always thought variables were called variables because they vary what is going to happen... Say you use numeric variables between the numbers 1 and 10.

So it picks a number from random. Say, 8, for example.The next time that variable is used, it picks a different number from random, so it might choose 5.


That's how I've always pictured them. And because there's so many variables, then no two battles can be the same.
how do i
how do u
what
no

Offline Serge

  • *
  • Posts: 1530
  • Rep: 13
    • View Profile
    • http://www.q3k.org/
    • Awards
Re: A question...
« Reply #12 on: August 26, 2010, 09:14:21 AM »
rand()
home | twitter | yt | gmf de/compiler | component freedom | xmpp: q3k@q3k.org | email: q3k@q3k.org

Offline Zog

  • *
  • Posts: 1173
  • Rep: 0
  • I suck.
    • georgedbabingdon
    • View Profile
    • Awards
Re: A question...
« Reply #13 on: August 26, 2010, 09:24:59 AM »
@Serge - wat
how do i
how do u
what
no

Offline Serge

  • *
  • Posts: 1530
  • Rep: 13
    • View Profile
    • http://www.q3k.org/
    • Awards
Re: A question...
« Reply #14 on: August 26, 2010, 09:40:36 AM »
home | twitter | yt | gmf de/compiler | component freedom | xmpp: q3k@q3k.org | email: q3k@q3k.org

Offline Naryar

  • Posts: 23267
  • Rep: 20
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
Re: A question...
« Reply #15 on: August 26, 2010, 09:58:28 AM »
Random function. I'm guessing it calls a random number between 0 and 1

Offline Serge

  • *
  • Posts: 1530
  • Rep: 13
    • View Profile
    • http://www.q3k.org/
    • Awards
Re: A question...
« Reply #16 on: August 26, 2010, 10:05:56 AM »
Random function. I'm guessing it calls a random number between 0 and 1

Functions don't call. You call functions, and they return a value.

In C and C++, functions are defined like so:
Code: [Select]
returnValueType functionName(argument1Type argument1, argument2Type argument2, ...etc...) {
    //function code goes here
}
//example, although you usually don't have to write this, most OS's do this for you already
int rand() { //return type integer, no arguments
    // insert linear congruential generator implementation here
}

and are called like this:

Code: [Select]
returnValueType someVariable = functionName(argument1, argument2);
//example
int someRandomNumber = rand();
// new value of type int, set it to the result of a rand() call
someRandomNumber = someRandomNumber % 10;
// set someRandomValue (notice the type is given only when a variable is first referenced, this is called declaring a variable) to its previous value, but with modulo operator of 10 applied to it

In this case, when you call rand(), it returns a pseudorandom integer between 0 and RAND_MAX, a constant depending on your OS / environment / compiler / position of the planets.
home | twitter | yt | gmf de/compiler | component freedom | xmpp: q3k@q3k.org | email: q3k@q3k.org