Toribash
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.