Author Topic: Problem with adding a new AI and AI Teams  (Read 2539 times)

Offline Cobra!

  • Antweight
  • Posts: 51
  • Rep: 0
    • https://www.facebook.com/
    • Cobradabest
    • View Profile
    • Gamerstorm
    • Awards
  • See profile for gamer tags: Yes
  • Skype: cobradabest
Problem with adding a new AI and AI Teams
« on: March 23, 2014, 01:05:16 PM »
I'm trying to add some AI to the game, I recently installed a Robot Wars AI Pack to the game, and I ended up loving the AI in that so much, that I wanted to add my own teams to the game, and pit my AI robots against the pack's.

I've been editing Bindings files, and replacing robot names for quite a while now, but I had no idea how to add a new team, if you could at all, so I asked around and I was told that to add a new team, I have to edit the teams.txt file, and add a new team in that, so that's what I did. I created a new team folder, and added 2 bots to it (I got all the naming right). I went to test it, and the team was added, but as expected, the game crashed when I try to select any of the robots in that team. So I then added the 2 robots I added into the Bindings.

So I went to test it, and it crashed at startup, and no matter what I do, I can't stop it from crashing, I made absolute sure that nothing was wrong with my bindings or my added team in the txt file, and couldn't find anything wrong, so I don't know what's going on.

Here's what I'm trying to add to my teams.txt:
Quote
index 15
Test Team
"Test"
AI\spin.bmp
Robots: 0 1 2 3 4 5
Robot In Event: -1
0
16
16
0
0
0
0
0
100000
true
0
false
0
-1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0
0
0

Here's what I'm trying to add to my bindings (Yes, I copied and pasted the line for both of them):
Quote
list.append( ("Cobra!'s Robot", "Omni", { 'radius':1.2, 'nose' : math.pi, 'turnspeed' : 1.0, 'topspeed' : 12.0, 'throttle' : 110, 'weapons': (1) }) )
list.append( ("Tank", "PusherPlus", { 'radius':1.2, 'nose' : math.pi, 'turnspeed' : 1.0, 'topspeed' : 12.0, 'throttle' : 110, 'weapons': (1) }) )

What am I doing wrong?

Offline Lemonism

  • *
  • Posts: 666
  • Rep: 16
    • View Profile
    • Awards
Re: Problem with adding a new AI and AI Teams
« Reply #1 on: March 23, 2014, 01:22:53 PM »
If you have only added 2 robots, then I think you should change the line here:
Code: [Select]
Robots: 0 1 2 3 4 5to this:
Code: [Select]
Robots: 0 1.
At least, I think that's right. Try it out and see if it works.
Download Mortis.py
Download some of my DSL2.2 Bots

Offline Cobra!

  • Antweight
  • Posts: 51
  • Rep: 0
    • https://www.facebook.com/
    • Cobradabest
    • View Profile
    • Gamerstorm
    • Awards
  • See profile for gamer tags: Yes
  • Skype: cobradabest
Re: Problem with adding a new AI and AI Teams
« Reply #2 on: March 23, 2014, 02:01:28 PM »
If you have only added 2 robots, then I think you should change the line here:
Code: [Select]
Robots: 0 1 2 3 4 5to this:
Code: [Select]
Robots: 0 1.
At least, I think that's right. Try it out and see if it works.
Okay, I've done that, and it still crashed...

Offline Lemonism

  • *
  • Posts: 666
  • Rep: 16
    • View Profile
    • Awards
Re: Problem with adding a new AI and AI Teams
« Reply #3 on: March 23, 2014, 02:03:51 PM »
Huh. I don't know then. Are there 2 team 15s or something?
Can we see the whole teams.txt? It might be that you pasted the new team just slightly wrong or something like that.
Download Mortis.py
Download some of my DSL2.2 Bots

Offline Cobra!

  • Antweight
  • Posts: 51
  • Rep: 0
    • https://www.facebook.com/
    • Cobradabest
    • View Profile
    • Gamerstorm
    • Awards
  • See profile for gamer tags: Yes
  • Skype: cobradabest
Re: Problem with adding a new AI and AI Teams
« Reply #4 on: March 23, 2014, 02:47:58 PM »
Huh. I don't know then. Are there 2 team 15s or something?
Can we see the whole teams.txt? It might be that you pasted the new team just slightly wrong or something like that.

Alright, here:


Offline cephalopod

Re: Problem with adding a new AI and AI Teams
« Reply #5 on: March 23, 2014, 02:51:38 PM »
Is it actually crashing on startup or when you load the bots into the arena? Because when I was trying, like I told you, Cobra!'s Robot kept crashing the game no matter what the AI line.
bristol bot builders / two headed death flamingo / snappy robots
//
kindest and friendliest '13, '15, '16, '17 / favourite staff member '14, '15

Offline Cobra!

  • Antweight
  • Posts: 51
  • Rep: 0
    • https://www.facebook.com/
    • Cobradabest
    • View Profile
    • Gamerstorm
    • Awards
  • See profile for gamer tags: Yes
  • Skype: cobradabest
Re: Problem with adding a new AI and AI Teams
« Reply #6 on: March 23, 2014, 04:05:56 PM »
It's crashing on start up.

I remade Cobra!'s robot, and made an AI of that, it kind of works, the robot itself isn't the problem now. Sometimes it works, sometimes it doesn't, this is happening with both of my robots.

When I try to add both robots, the game crashes, so I take out one, it still crashes, so I replace the remaining robot with the robot I took out, and then it works. Which robot is which depends on which one I take out first, it's really strange.

I tried grabbing the backup I had of the stock RA2, made another copy of RA2, and added the DSL and Robot Wars packs, but I'm getting the same problem with that.

Offline thesnowingsteak

  • Middleweight
  • Posts: 284
  • Rep: -1
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
Re: Problem with adding a new AI and AI Teams
« Reply #7 on: March 23, 2014, 04:07:58 PM »
Out of interest who did this ai pack.
The art of insanity is the very core of art itself.

Offline Cobra!

  • Antweight
  • Posts: 51
  • Rep: 0
    • https://www.facebook.com/
    • Cobradabest
    • View Profile
    • Gamerstorm
    • Awards
  • See profile for gamer tags: Yes
  • Skype: cobradabest
Re: Problem with adding a new AI and AI Teams
« Reply #8 on: March 23, 2014, 04:20:29 PM »
WhamettNuht did. I provided a link to the mod in the first post. (I hyperlink-ed "Robot Wars AI Pack".)

Offline thesnowingsteak

  • Middleweight
  • Posts: 284
  • Rep: -1
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
Re: Problem with adding a new AI and AI Teams
« Reply #9 on: March 24, 2014, 11:34:13 AM »
What page did you get it from
The art of insanity is the very core of art itself.

Offline Lemonism

  • *
  • Posts: 666
  • Rep: 16
    • View Profile
    • Awards
Download Mortis.py
Download some of my DSL2.2 Bots

Offline Trovaner

  • *
  • Posts: 1222
  • Rep: 32
    • View Profile
    • Awards
Re: Problem with adding a new AI and AI Teams
« Reply #11 on: March 24, 2014, 01:15:54 PM »
@thesnowingsteak: If you have any further questions in regards to Wham's mod, please post them in that thread or start a new one (it will make it easier for people to answer both Cobra!'s and your questions if they aren't in the same thread).

It's crashing on start up.
What kind of dialog is Windows giving you when it crashes? ("stopped responding," "stopped working," "runtime error," etc.)

When does it crash? (first loading screen, second loading screen, or third loading screen)

When I try to add both robots, the game crashes, so I take out one, it still crashes, so I replace the remaining robot with the robot I took out, and then it works. Which robot is which depends on which one I take out first, it's really strange.
What exactly are you doing? Hitting the undo button or manually changing things back?

Offline Cobra!

  • Antweight
  • Posts: 51
  • Rep: 0
    • https://www.facebook.com/
    • Cobradabest
    • View Profile
    • Gamerstorm
    • Awards
  • See profile for gamer tags: Yes
  • Skype: cobradabest
Re: Problem with adding a new AI and AI Teams
« Reply #12 on: March 24, 2014, 02:17:05 PM »
It's crashing on start up.
What kind of dialog is Windows giving you when it crashes? ("stopped responding," "stopped working," "runtime error," etc.)
A dialog comes up saying it's stopped working.

When does it crash? (first loading screen, second loading screen, or third loading screen)
First loading screen.

When I try to add both robots, the game crashes, so I take out one, it still crashes, so I replace the remaining robot with the robot I took out, and then it works. Which robot is which depends on which one I take out first, it's really strange.
What exactly are you doing? Hitting the undo button or manually changing things back?
I think I was hitting the undo button every time. Should I be doing it manually?

Offline Trovaner

  • *
  • Posts: 1222
  • Rep: 32
    • View Profile
    • Awards
Re: Problem with adding a new AI and AI Teams
« Reply #13 on: March 24, 2014, 07:27:57 PM »
The first two questions tell me that you have a syntax error in one of the python files found in the AI folder. The third question tells me that the error is one of the changes made inside of Bindings.py.

With that in mind, I looked up at the bindings that you posted and immediately saw the mistake (I didn't see them the first time I scanned this thread). In python, tuples need a comma after the first item so that they are interpreted as more than one item. As such, your bindings should look like this:
Code: [Select]
    list.append( ("Cobra!'s Robot", "Omni", { 'radius':1.2, 'nose' : math.pi, 'turnspeed' : 1.0, 'topspeed' : 12.0, 'throttle' : 110, 'weapons': (1,) }) )
    list.append( ("Tank", "PusherPlus", { 'radius':1.2, 'nose' : math.pi, 'turnspeed' : 1.0, 'topspeed' : 12.0, 'throttle' : 110, 'weapons': (1,) }) )

Offline Cobra!

  • Antweight
  • Posts: 51
  • Rep: 0
    • https://www.facebook.com/
    • Cobradabest
    • View Profile
    • Gamerstorm
    • Awards
  • See profile for gamer tags: Yes
  • Skype: cobradabest
Re: Problem with adding a new AI and AI Teams
« Reply #14 on: March 24, 2014, 07:41:11 PM »
The first two questions tell me that you have a syntax error in one of the python files found in the AI folder. The third question tells me that the error is one of the changes made inside of Bindings.py.

With that in mind, I looked up at the bindings that you posted and immediately saw the mistake (I didn't see them the first time I scanned this thread). In python, tuples need a comma after the first item so that they are interpreted as more than one item. As such, your bindings should look like this:
Code: [Select]
    list.append( ("Cobra!'s Robot", "Omni", { 'radius':1.2, 'nose' : math.pi, 'turnspeed' : 1.0, 'topspeed' : 12.0, 'throttle' : 110, 'weapons': (1,) }) )
    list.append( ("Tank", "PusherPlus", { 'radius':1.2, 'nose' : math.pi, 'turnspeed' : 1.0, 'topspeed' : 12.0, 'throttle' : 110, 'weapons': (1,) }) )
It still doesn't work, I'm afraid. I even copied and pasted the code to make sure I got it right, and it still crashed.

Offline Trovaner

  • *
  • Posts: 1222
  • Rep: 32
    • View Profile
    • Awards
Re: Problem with adding a new AI and AI Teams
« Reply #15 on: March 24, 2014, 08:30:18 PM »
Huh... that's odd.

Are you sure that you have exactly 4 spaces at the beginning of both of the given lines? I tried to cover all my bases by including it in my response.

Offline Cobra!

  • Antweight
  • Posts: 51
  • Rep: 0
    • https://www.facebook.com/
    • Cobradabest
    • View Profile
    • Gamerstorm
    • Awards
  • See profile for gamer tags: Yes
  • Skype: cobradabest
Re: Problem with adding a new AI and AI Teams
« Reply #16 on: March 25, 2014, 07:00:29 AM »
Ah, that was the problem! One of the lines had 4 spaces at the start, and the other had a big space you get when you press tab. I had no idea something like that would've been the problem! Well, it's working now, thanks for your help!
« Last Edit: March 30, 2014, 06:03:32 AM by Cobra! »