ES Recruitment Drive
Original Post
Python replay reader
I know this is not a lua program. But it is related to helping with writing lua programs. The library is nice if you are reading large sets of replays, like over 10k. (sidenote:if there are lua programmers that can provide a lua example of the library, that would be great)

cget_variables_from_game is a relatively fast library for parsing replay files. the library has one function and is used like this:

winmovelist,losemovelist=cget_variables_from_game("name_of_replay_file")
and returns a list of winning moves, losing moves and all the joint information (see example).

#wvl=win dataset, lvl=lose dataset
wvl,lvl=cget_variables_from_game.cget_variables_from_game(game)
#for each data set generated by a turn in the winning data list
for turndata in wvl:
	framenum,pos,vel,avel,jointstate,frac,crush,score=turndata
This program is useful for reading replays and gathering data on best moves, winning replays, etc.

There are three files included:
cget_variables_from_game.so - shared c++ library for reading replays
toribash_reading_example.py - a python program demonstrating the library
test_judo_replay.rpl - sample judo replay file
Attached Files
Last edited by gmon; Apr 22, 2010 at 02:58 AM.
What defines a "winning move" and a "loosing move"? Is it the whole set of joint movements for each turnframe for whoever wins and whoever loses?
:D
Blam, yes I should have said "winning routine" As it is the set of moves for both the winning routine and losing routine. The routine list starts at frame zero and ends with the final move. If you want to figure out which player it is, I just look at the starting y position. If the y-position at the start of the match is negative, the player is uke.

I use this routine for finding new openers. I was also thinking about using the data to render Toribash in POV, Blender or some other animation software. I think that would be a fun project. I would love to see Toribash rendered in POV.
You can already export TB for pov-ray use, people used to do it before shaders came out to make awesome vids.

The screenshot key ( f8 ) takes one single frame and exports it to a pov file and the record toggle key ( ctrl+f7 ) exports the frames it sees (aka you can change replay mid way through) into a single pov file.
:D