Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - apanx

Pages: 1 ... 3 4 5 6 7 8 9 [10]
181
Modifications / How is such a thing possible?
« on: July 26, 2009, 07:06:14 AM »
One-Wheeled FBS works too.


 
How is such a thing possible?
 
Yes it is a melty brain control system implemented in AI, but there is another tweak too.

182
Modifications / How is such a thing possible?
« on: July 25, 2009, 07:51:07 PM »
But then there is this problem, how to do it with only two spinmotors.
 


 
How is such a thing possible?

183
Modifications / Robot Arena 2 - What goes on behind the GUI
« on: July 25, 2009, 06:33:12 PM »
Well, I tried pyHook, which hooks the keyboard input, but that only works in the GUI parts and not in the game part. It seems like the game uses DirectInput for the actual game part with all 3D stuff. Which cannot be hooked using pyHook. Only by hooking DirectInput, or doing some other esoteric stuff will it be possible to get raw input in-game

184
Modifications / How is such a thing possible?
« on: July 25, 2009, 04:24:36 PM »
Quote from: System32;54796
AHA! The inner drive is using spin, it works normally..

Wrong Answer

185
Modifications / Robot Arena 2 - What goes on behind the GUI
« on: July 25, 2009, 03:22:13 PM »
Long post with lots of text. It is not guaranteed to be all comprehensive or correct.
 
When the Robot Arena 2 executable is loaded. The first thing it does that is related to Python is to load the Main.py found in the Scripts folder. The Main.py starts by importing all the C++ commands that is avaliable in Python form, the plus library. It also reroutes all console output from Python scripts to the Debug box, which makes this an excellent place to add a file output to.
Code: [Select]
class giScript_stdout:
    def write(self, s):
        giScript.debug_stdout(s)
        output = file("debug.txt", "a")
        output.write(str(s))
   
class giScript_stderr:
    def __init__(self):
        self.count = 0
    def write(self, s):
        self.count += 1
        output = file("debug.txt", "a")
        output.write(str(s))
        giScript.debug_stderr(s)
    def flush(self):
        pass

It then initiates the loading of Arenas followed by AI. The Arena and AI folder is interpreted by Python, which starts by reading __init__.py. The Practice arena is the first to be loaded. After that, the loading of all avaliable AI begins which continues by creating a list containing all bindings, which is what bindings.py does. In order to draw up all the GUI portions, the game queries the gib files found under the UI folder. These contain instructions on how to draw up all the elements on the screen.
In order to populate the Player and the AI teams, the game queries the Teams.txt and fills up the slots accordingly. Unfortunately it does not create the folders (Team1, Team2... and so on) if they are missing, leading to problems with creating new teams in-game since the data cannot be saved in a nonexisting path. All components and textures are also loaded at this stage.
 
When a match is started, the Arena chosen is created by the game. Which gets its basic properties from the SuperArena in __init__.py. The resulting Arena is a combination of the python code for the Arena and the SuperArena takes care of the sections that are not defined in the current Arenas own python code.
 
This is followed by a cleaning up of the AI stack which disables all running AI by emptying the running_ai global variable. The game then reads the name of the AI bot and queries the Binding list created earlier for the AI script to be loaded.
 
Every AI gets the Invert and Unstuck tactics assigned to themselves by the __init__.py, or SuperAI. All AIs are additions to the SuperAI, which provides basic functionality to the AI. The code in the SuperAI can be overridden by adding the same section in your own AI.
 
The Arena and AI are activated and the code under the Activate section is run. During the match the code under the Tick section for both the Arena and the AI is run. Usually the time between each tick is 250ms for an Arena and 125ms for an AI. This continues until Winners are declared, or the game quit by user.

186
Modifications / How is such a thing possible?
« on: July 25, 2009, 01:17:34 PM »
Why raw-input will take time to implement.
 
Robot Arena 2, as many other games, uses DirectX to handle most game functions. This includes the game controller input, which is handled by the DirectInput part. As there does not seem to be any easy way to access this part via the C++ commands avaliable from Python. The only alternative that remains is to hook the DirectInput via Python which is possible, but difficult.
 
Another video for you all to watch. This time it is an AIed Full Body Spinner. Using ordinary SpinMotors for direction control. No servoes, no extra hassle.


How is such a thing possible?

187
Modifications / How is such a thing possible?
« on: July 24, 2009, 12:18:25 PM »

 

 
How is such a thing possible?

188
Modifications / How is such a thing possible:o
« on: July 24, 2009, 12:14:52 PM »

 
How is such a thing possible:o

189
Other Tutorials / Get more than nine buttons on the controller
« on: June 15, 2009, 03:54:05 PM »
Pesky nine button limit ruining your dreams of a AI controlled Machine-gun tank?
All the cool kids have more than nine buttons on their controllers so why should you not?
You only need to take up the dark art of bot file editing for it to work.

1. Wire up nine slots.
2. Realise you need more
3. Open bot file using text editor capable of interpreting linefeed(0x10) only as newline, that means Notepad++ or TextPad (or vi or EMACS)
4. Hax :P. Find the section describing your controllers.

Looks like this

Name: Forward
2 0 1
2
1 0 3 0
1 0 2 0

or this:

Name: 1
0 0 4
1
0 0 8 0

or like this:

Name: Spin
2 0 2
1
0 0 57 0

Now the first row is the name, the second row is the one we are interested in. You see, the standard uncool controller only gives us positions X= 0-2, Y=0-2. By moving already defined controls out to lets say X=3,Y=4. We can free up space from the part the uncool kidds can play with. It is also possible to stack controllers on each other, just be sure you do not want to change them, cause that is going to be annoying.
(X,Y,Type of control 1=analog, 2=switch, 4=button)
The third row is just the number of keys that are bound to the control. 1 for swtiches and buttons, 2 for analog.
The fourth row is some cryptic keycodes. Dont mess with these unless you have a cheat sheet tucked away somewhere.

5. If you need even more keys, Goto 1 else end.

GL HF


You too can have a nice controller. Do not touch it(edit anything in botlab), or it will break.

190
Tutorials and Tips / AI-ing (.py files, coding, R+D, and help)
« on: June 02, 2009, 01:37:03 PM »
Yes, here is a picture
Still got all the files left.
Other crazy thing
Sadly I cant find the file for this one anymore.

191
Tutorials and Tips / AI-ing (.py files, coding, R+D, and help)
« on: June 02, 2009, 01:23:17 PM »
Well, I kind of stopped working on it when it turned out that the game crashed when the huge chassis got damaged. Could have resolved it by using the same method as HoJ, but then med school kind of made me busy. Having exam on Thursday, but after that I will experiment with a Full body spinner AI concept I thought out.
(Apanx: check your email/IM for PW. Mad)

192
Tutorials and Tips / AI-ing (.py files, coding, R+D, and help)
« on: June 01, 2009, 07:16:15 AM »
No need really to fiddle with the tacitics.py if you want to do your own AI.
Too easy to screw something up.

Just put the instructions in the Tick part and remove the assigned tactics from the AI.

Just remember that the inverthandler overrides the Tick part if you plan on staying immobile for too long

Pages: 1 ... 3 4 5 6 7 8 9 [10]