Author Topic: An RPM-monitoring AI  (Read 6691 times)

Offline Clickbeetle

  • *
  • Posts: 3374
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
An RPM-monitoring AI
« on: March 19, 2010, 08:35:13 PM »
This is something that's been on my to-do list ever since apanx made his melty brain AI, and I've finally got around to finishing it.  It's an AI that measures the RPM of its spinning weapons, and won't move until they're spinning at a certain speed.


Get it here: https://gametechmods.com/uploads/files/SpinupOmni2.zip


Directions for using it are at the top of the .py file.  One thing you should know that I might as well repost here: RA2 can't measure times less than 1/30 second, even if you set the tick interval lower.  So the RPM calculator is fairly limited.  It can't measure anything faster than 1500 RPM, and it gets less accurate the faster a bot's weapons are spinning.  It still works pretty well for most bots, though--it turns out that spinners in RA2 are generally pretty slow, even in DSL.


One cool feature is if you put 'DisplayRPM':1 in the Bindings, you get an in-game display that shows the current RPM of the bot's spinner, the maximum RPM, and the average RPM over the whole match.  If you've ever wanted to know how fast Diarrhea Of A Madman's weapon spins, now you can find out.


Corollary: the 1/30 second limit also means that apanx's FBS.py uses an unnecessarily low tick interval.  It should be able to be increased from 0.001 to 0.0333 with no loss in performance, thus decreasing lag.

To lack feeling is to be dead, but to act on every feeling is to be a child.
-Brandon Sanderson, The Way of Kings

Offline Madiaba

Re: An RPM-monitoring AI
« Reply #1 on: March 19, 2010, 08:39:49 PM »
Cool tweek.
Where'd you decide to put the display box?  Where the usual debug stuff displays?
Do you enter the motor # in the Bindings line so it knows which motor to monitor?
Can it do servos?

I'll try it out this weekend.  And then maybe read the directions,,, hehe.
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline Clickbeetle

  • *
  • Posts: 3374
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
Re: An RPM-monitoring AI
« Reply #2 on: March 19, 2010, 08:44:55 PM »
The RPM display is in the upper left corner, as usual.


The motor ID is set in the Bindings.  'MotorID' and 'Motor2ID' for a second motor (the AI can monitor up to 2)


And yes it can do servos, since all it does is GetMotorAngle and count how long it takes to make 3/4 of a revolution.

To lack feeling is to be dead, but to act on every feeling is to be a child.
-Brandon Sanderson, The Way of Kings

Offline Madiaba

Re: An RPM-monitoring AI
« Reply #3 on: March 19, 2010, 09:24:04 PM »
CB, I was just thinking:

1. Moding your coding to monitor the weapon(s) spin motor(s), and do not tell the bot to attack (or even some evasive tactic),...till weapons are up to speed...

2. Or monitor your opponent's weapon's motor speed,....
 and if tooo hairy, head for the hills till situation improves (hits a wall, another bot,...).
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline Clickbeetle

  • *
  • Posts: 3374
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
Re: An RPM-monitoring AI
« Reply #4 on: March 19, 2010, 09:27:58 PM »
CB, I was just thinking:

1. Moding your coding to monitor the weapon(s) spin motor(s), and do not tell the bot to attack (or even some evasive tactic),...till weapons are up to speed...


That's what it does.  The AI sits still until the weapon reaches some target RPM set in Bindings.  Your Evade tactic isn't done yet is it?  Otherwise that would be another good option.

To lack feeling is to be dead, but to act on every feeling is to be a child.
-Brandon Sanderson, The Way of Kings

Offline JoeBlo

Re: An RPM-monitoring AI
« Reply #5 on: March 19, 2010, 09:43:48 PM »
very cool and might be usful for all the spinner robots in Backlash (credit issued to yourself of coarse)

Oh and why I think of it, you should use it for hypnodisc in DSL 3 since in real life it was there strategy to move slow until the weapon was up to speed  ;)

Offline Naryar

  • Posts: 23267
  • Rep: 20
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
Re: An RPM-monitoring AI
« Reply #6 on: March 20, 2010, 04:28:37 AM »
Excellent ! This is going to seriously help the spinner world.

Hell, it might even be possible to calculate the spinning speed of a SnS...

Edit: OMG THIS IS AWESOME we can calculate ANY SPEED on ANY BOT if we designate drive motors !

(AKA dividing the RPM's of a wheel by her perimeter)

Offline Madiaba

Re: An RPM-monitoring AI
« Reply #7 on: March 20, 2010, 10:10:07 AM »
Nar, cool idea. An FBS's RPM could be calculated by tracking the bot's heading/direction to the arena, and thus it's rotations.  Then calculate, and display.
 
CB, Nice then.  I'll check it out.... 
As for my 'Evade' tactic, I've only had time to bring it to a rudimentary stage that works ok, but not sophisticated at all.  Trov took my skeletal work and fleshed it out nicely, IMHO.  I haven't talked with him in a week or two, so I don't know where he's at with it.  I'll talk with him.  Would be nice to 'evade' until your up and 'ready for battle'...
 
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline Jack Daniels

  • *
  • Posts: 2719
  • Rep: 9
  • Losing Tournaments with Style
    • matt.morrill.12
  • Awards BOTM Winner
    • View Profile
    • My abandoned online RPG project.
    • Awards
Re: An RPM-monitoring AI
« Reply #8 on: March 20, 2010, 11:57:59 AM »
You guys are amazing at figuring this stuff out. 

Offline LiNcK

  • Super Heavyweight
  • Posts: 1179
  • Rep: 1
    • 8linck8
    • View Profile
    • Awards
Re: An RPM-monitoring AI
« Reply #9 on: March 20, 2010, 12:06:37 PM »
You guys are amazing at figuring this stuff out.

QFT!! ;D
 
I have no idea how u guys do this, But soon AIs will drive better than real people O_O

Offline Squirrel_Monkey

  • Squirrel_Monkeyweight
  • *
  • Posts: 7582
  • Rep: 7
  • [Insert clever and witty comment here]
    • 0SquirrelMonkey0
    • View Profile
    • Awards
Re: An RPM-monitoring AI
« Reply #10 on: March 20, 2010, 12:07:33 PM »
But soon AIs will drive better than real people O_O
My AI already does, e.g. FBS,py
Better than GK since 2009.
I think SM is a pretty cool guy, eh builds unicycle-bots and doesn't afraid of anything

Offline SKBT

Re: An RPM-monitoring AI
« Reply #11 on: March 20, 2010, 11:33:25 PM »
So does this mean that we could see the real flipper tactic of ram with the back to slow down a spinner then turn around and fire the flipper?

Offline Naryar

  • Posts: 23267
  • Rep: 20
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
Re: An RPM-monitoring AI
« Reply #12 on: September 21, 2010, 03:33:43 AM »
*downloads*

I'm going to try and implement a RPM-measuring thing in Omni.py

Edit: lol it already is in NAR AI :P

Offline JoeBlo

Re: An RPM-monitoring AI
« Reply #13 on: September 21, 2010, 04:28:19 AM »
:O Awesomez Bumpage Dude

Offline Naryar

  • Posts: 23267
  • Rep: 20
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
Re: An RPM-monitoring AI
« Reply #14 on: September 21, 2010, 05:33:20 AM »
:O Awesomez Bumpage Dude

*clenches fist*

Don't you think an awesome thread needs awesome bumps ?

Plus by bumping this I hopefully make people read the thread more, hence am advertising for your master...

...and you still complain ?  :ermm:

Offline JoeBlo

Re: An RPM-monitoring AI
« Reply #15 on: September 21, 2010, 05:46:14 AM »
what made you think I was complaining mr angry  :gawe:

Offline Naryar

  • Posts: 23267
  • Rep: 20
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
Re: An RPM-monitoring AI
« Reply #16 on: September 21, 2010, 05:51:15 AM »
what made you think I was complaining mr angry  :gawe:

Hmm. There are various reasons... may be my slight paranoia, may be because you do like to pick on me, or maybe something else ?

*happily off topic*

Offline JoeBlo

Re: An RPM-monitoring AI
« Reply #17 on: September 21, 2010, 06:14:31 AM »
yeah probably should get back on topic :P

sorry if I do pick on you.. I don't mean to convey such image, only having fun.. you seem to react more then other people :P

so when you say already in NarAI you mean the edited omni or Clicks original one ?

Offline Naryar

  • Posts: 23267
  • Rep: 20
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
Re: An RPM-monitoring AI
« Reply #18 on: September 21, 2010, 06:49:47 AM »
sorry if I do pick on you.. I don't mean to convey such image, only having fun.. you seem to react more then other people :P

It is fine. I enjoy clashing with people (well sometimes at least :P). But yes, it's not really fitting to your "nice guy" position !

so when you say already in NarAI you mean the edited omni or Clicks original one ?

Click's original one. I started an OmniPlus project but abandoned quickly.

But this AI is complicated, and i do not know much about python. I'll try nevertheless.

Offline JoeBlo

Re: An RPM-monitoring AI
« Reply #19 on: September 21, 2010, 07:03:24 AM »
I might have a go if you dont work it out... could be a useful backlash AI :P