gametechmods

Robot Arena => General Support => Topic started by: Cobra! on March 23, 2014, 01:05:16 PM

Title: Problem with adding a new AI and AI Teams
Post by: Cobra! 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 (https://gametechmods.com/forums/index.php?topic=13673.0) 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?
Title: Re: Problem with adding a new AI and AI Teams
Post by: Lemonism 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.
Title: Re: Problem with adding a new AI and AI Teams
Post by: Cobra! 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...
Title: Re: Problem with adding a new AI and AI Teams
Post by: Lemonism 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.
Title: Re: Problem with adding a new AI and AI Teams
Post by: Cobra! 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:

Title: Re: Problem with adding a new AI and AI Teams
Post by: cephalopod 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.
Title: Re: Problem with adding a new AI and AI Teams
Post by: Cobra! 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.
Title: Re: Problem with adding a new AI and AI Teams
Post by: thesnowingsteak on March 23, 2014, 04:07:58 PM
Out of interest who did this ai pack.
Title: Re: Problem with adding a new AI and AI Teams
Post by: Cobra! 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".)
Title: Re: Problem with adding a new AI and AI Teams
Post by: thesnowingsteak on March 24, 2014, 11:34:13 AM
What page did you get it from
Title: Re: Problem with adding a new AI and AI Teams
Post by: Lemonism on March 24, 2014, 12:05:24 PM
http://www.datafilehost.com/d/3474956d (http://www.datafilehost.com/d/3474956d)
http://speedy.sh/BXSbx/Robot-Wars-Beta.rar (http://speedy.sh/BXSbx/Robot-Wars-Beta.rar)
http://www.sendspace.com/file/v9hln1 (http://www.sendspace.com/file/v9hln1)

Pick your fave.
Here.
Title: Re: Problem with adding a new AI and AI Teams
Post by: Trovaner 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?
Title: Re: Problem with adding a new AI and AI Teams
Post by: Cobra! 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?
Title: Re: Problem with adding a new AI and AI Teams
Post by: Trovaner 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,) }) )
Title: Re: Problem with adding a new AI and AI Teams
Post by: Cobra! 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.
Title: Re: Problem with adding a new AI and AI Teams
Post by: Trovaner 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.
Title: Re: Problem with adding a new AI and AI Teams
Post by: Cobra! 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!