Ranking
Original Post
[DISC]Suggestions and help for NEAT A.I. script
Hi, I wanted some feedback/suggestions for a really cool idea I had that I'm trying to program right now.

I'm making an A.I. for Toribash using Neural Nets. That means that the A.I. needs to be "trained" by playing games of Toribash, and getting rated on its performance.. I need suggestions on what to rate it on though.

A neural net works by getting input values (for example, how much damage the player has received), and providing output values (in this case, which joints to extend or contract).

The problem is, neural nets are too stupid to learn how to do cool stuff right away, you have to teach them simple things at first and build on them in tiny tiny steps. This particular implementation I am using (called NEAT) is very powerful and can plug into any sort of problem with a little work.
---------------------------------------
Ok so my big questions:

Does anyone know what information I can pull from Toribash using LUA to feed into this neural net program? The neural net needs some inputs and the more useful they are, the faster a good A.I. will evolve.

Should I be training the NN by running individual games of Toribash and using LUA to transmit the moves?

I know Toribash uses a replay system to record all the input for the 2 players.
Has anyone figured out how the replays are encoded? (maybe I could be generating replays with my neural net instead of playing individual matches of TB)

If I have to run individual games of Toribash, does anyone know if theres ways to speed it up or turn the graphics off altogether, since I just want to record some value like damage or distance?



Thanks for reading!


-------------------------------

A program I am making requires me to run many thousands of matches in Toribash in order to retrieve the values of some variables (things like joint positions and damage inflicted on both players, at round end).

Is there any way to speed up this process so Toribash runs as fast as possible? I don't want to watch the matches taking place, I just want as many results as fast as possible.
Last edited by Jok; Feb 27, 2008 at 09:09 AM. Reason: second post was in a separate thread
If you open the replay in notepad it shows all the values. Just check a replay hacking tut to understand it better. Don't really know if that helps though.
"When the pin is pulled, Mr. Grenade is not our friend."
-U.S. Army Training Notice
*breaks door*
Originally Posted by Redwards View Post
If you open the replay in notepad it shows all the values. Just check a replay hacking tut to understand it better. Don't really know if that helps though.

Thanks, I didnt realize that they were in a human readable format (sort of).
I can't find any replay hacking tutorials.. can you point me to one?
http://forum.toribash.com/showthread.php?t=19742

that would work well to start off with

there is also one from a member named skjef, but i cba to find it
5:13 PM - vasp: everybody's nuts is so good
[00:18:38] <&vespesi3n> you should see when i swallow
[21:49:37] <&vespesi3n> >my mouth when
[21:49:43] <&vespesi3n> >my tastebuds when
Originally Posted by Redwards View Post
If you open the replay in notepad it shows all the values. Just check a replay hacking tut to understand it better. Don't really know if that helps though.

Originally Posted by mosier View Post
http://forum.toribash.com/showthread.php?t=19742

that would work well to start off with

there is also one from a member named skjef, but i cba to find it

Thanks.
After reading the tutorial skjef made, I'm convinced replays is not the way to go now; it seems that the replay is an explicit description of what happens in a match. That means that if the replay doesn't say someones arm is dismembered, it won't happen.

I want toribash to take a set of commands for tensing/relaxing joints and tell me the results of those commands, but it seems like the replay does not do that at all.
Originally Posted by tripwire View Post
Thanks.
After reading the tutorial skjef made, I'm convinced replays is not the way to go now; it seems that the replay is an explicit description of what happens in a match. That means that if the replay doesn't say someones arm is dismembered, it won't happen.

I want toribash to take a set of commands for tensing/relaxing joints and tell me the results of those commands, but it seems like the replay does not do that at all.

Nothing will do that, other than an actual game being played using those joint states.

Not to mention, you seem to think you would be able to feed thousands of matches in a few seconds. Impossible, simply simulating those thousands of matches would take hours and hours. Toribash won't be sped up just because it wouldn't be drawing anything. Physics still make it very slow.

Once again, I believe you can't use NEAT because including external libraries isn't allowed in TB Lua.
Originally Posted by Jok View Post
Nothing will do that, other than an actual game being played using those joint states.

Not to mention, you seem to think you would be able to feed thousands of matches in a few seconds. Impossible, simply simulating those thousands of matches would take hours and hours. Toribash won't be sped up just because it wouldn't be drawing anything. Physics still make it very slow.

Once again, I believe you can't use NEAT because including external libraries isn't allowed in TB Lua.

Wrong wrong wrong
FIRST I have access to a LOT of computing power at a university lab for AI research. I will be automating the process of running toribash many thousands of times simultaneously. CPU time is expensive and I will obviously be interested in preventing toribash from drawing unnecessary frames thousands of times. I'm positive this can be accomplished with dirty hacks but it will be time consuming so I want to know if theres an easy way to do it.


SECONDLY, why exactly is it that external libraries cannot be used with TB lua? There isn't a lot of documentation for it that I'm seeing form the sticky threads so I'm completely mystified as to what I CAN do with it.
__________________
OK after reading the lua docs a bit more and testing it, it looks like the standard io. open write and close commands work fine!!
Last edited by tripwire; Feb 27, 2008 at 09:47 AM.
Even if external libraries aren't allowed, what's to stop a port from Java or whatnot to Lua?
Squad Squad Squad lead?
The standardization of Toribash Squad roles may have gone too far!
It would be a wise idea to actually study the toribash lua sdk first to see what options you have to collect data from. You can get_joint_state, and you can get damages and other information from get_world_state. As far as dismemberments go, theres no easy way to check for those in code other than checking distances from body piece to body piece. You might want to pull that bit from the replay files.
 ____  _____  __  __  _  _  ___  _  _ 
(  _ \(  _  )(  )(  )( \( )/ __)( \/ )
 ) _ < )(_)(  )(__)(  )  (( (__  \  / 
(____/(_____)(______)(_)\_)\___) (__)