RTS AI workbench

Started by
15 comments, last by LeventeZs 12 years, 9 months ago

If I was going to actually work in the biz, then I needed to break away from what I was comfortable and play along with the rest of the kids.



Well, I don't want to work in the "biz", and this is a mere hobby project. On the other hand in academia quite a few people use java in AI related fields (see Weka, Jess or Pellet), and C++ is less popular. Also, I don't think Java programmers are less intrested in modding a game, it's just the AAA shiny engines are in C++/Lua for performance (shininess) reasons.

By the way it wouldn't make sense to make the core in C++, and create Python bindings, as the AI will be in user "scripts", and that's where the computational heavy lifting will be (especially in the offline learning mode; remember the goal here isn't shininess). Also, I'll heavily rely on the reflection API to create IDE like features ( Inspector widget e.g. for user defined units).
Advertisement

[By the way it wouldn't make sense to make the core in C++, and create Python bindings, as the AI will be in user "scripts", and that's where the computational heavy lifting will be (especially in the offline learning mode; remember the goal here isn't shininess).

A bizarre misconception: any "computational heavy lifting" in Python code should be as efficient as it would be in C++, or possibly even more, because it relies on Numpy, or similar efficient libraries, or your own C/C++/FORTRAN extensions encapsulating your own learning algorithms.
Implementing linear algebra operations on large inputs with thousand of separate heavyweight Python objects instead of arrays is mere idiocy, not a problem with specific programming languages.

Also, I'll heavily rely on the reflection API to create IDE like features ( Inspector widget e.g. for user defined units).
[/quote]
Another bizarre misconception: the planes of user defined units (more generally, of game rules scripts) and of AI scripts for specific game rules should be completely separate, and there's no reason to implement rules and game state views with impoverished and cumbersome tools like ad-hoc classes and primitive "poking" with reflection instead of a general object model and a UI layer that takes advantage of it.

Omae Wa Mou Shindeiru



A bizarre misconception: any "computational heavy lifting" in Python code should be as efficient as it would be in C++, or possibly even more, because it relies on Numpy, or similar efficient libraries, or your own C/C++/FORTRAN extensions encapsulating your own learning algorithms.



1, If you use default Python arithmetic it's much slower. (And not only the arithmetic is slower.) If you want fast arithmetic, you have to explicitely use numpy, and it only benefits matrix operations.
2, "[color=#1C2837][size=2]Implementing linear algebra operations on large inputs with thousand of separate heavyweight Python objects instead of arrays is mere idiocy, not a problem with specific programming languages."
[color="#1c2837"]I would benefit fast matrix oprations, if I would use neural networks (MLP/RBF/SVM) for training, but I use a genetic algorithm framework.

[color="#1c2837"]

[color="#1c2837"]"[color=#1C2837][size=2]Another bizarre misconception: the planes of user defined units (more generally, of game rules scripts) and of AI scripts for specific game rules should be completely separate, and there's no reason to implement rules and game state views with impoverished and cumbersome tools like ad-hoc classes and primitive "poking" with reflection instead of a general object model and a UI layer that takes advantage of it."
[color=#1C2837][size=2]

[color=#1C2837][size=2]The only use of reflection is to display the custom properties of user defined units to the user, which is exactly what reflection was invented for. There's no reflection in game rules/AI part.

Actually, Python has pretty crappy performance characteristics for truly heavy computation, and even worse characteristics for multithreading.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]


Actually, Python has pretty crappy performance characteristics for truly heavy computation, and even worse characteristics for multithreading.

Aaah... but remember, C++ "is too low level a language to program AI in". (There's a rationalization statement if I've ever heard one.)

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

I have to be careful with this one lest I hang myself with my own words, especially after the GDC talk :-D

I wouldn't say Python is unsuited to doing AI - in fact, there's plenty of counterexamples in shipped games. Rather, to be strictly literalistic about my earlier post, Python is problematic for heavy computation and multithreaded scenarios. If you can run your AI in a single thread, cool; write it in Python (or Lua, or your own DSL, or whatever else). Otherwise... if you need to do low-level stuff, do it in a low-level language.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

I made some progress and some documentation.
Now there's pathfinding, and a very simple computer opponent, a map editor and you can load/save a game. There's no networking or machine learning stuff in it yet.

You can check it out here the 0.2.1 version stuff:
https://sourceforge....e-wisdom/files/

The documentation (at the moment embedded in Javadoc):
http://infinite-wisd...iew_description

This topic is closed to new replies.

Advertisement