Toribash
Originally Posted by tripwire View Post
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.

I don't care if YOU have access to a lot of computing power. No-one else does, and we'd be using only YOUR neural net in that case, making it nigh useless, at most a proof of concept thing.

You CAN'T remove 'unnecessary frames'. Toribash, without rendering, would not run any faster. The simulation is too complex to run thousands of times in a few minutes on a single machine like you'd need. Regardless of how much CPU power you have, because of how Toribash is coded. Please research more before jumping to your own ideal conclusions.


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!!

They won't work fast enough to be of any use to Java.

External libraries can't be used with TB Lua, because it's a security risk that hampa would have to take. Go take it up with him if you need more info.
Originally Posted by Jok View Post
I don't care if YOU have access to a lot of computing power. No-one else does, and we'd be using only YOUR neural net in that case, making it nigh useless, at most a proof of concept thing.

Uh huh. Please pretend youre not a retard and just stop posting
The only way you can say something so baffling and stupid is if you completely fail to understand at all how neural nets work.

You CAN'T remove 'unnecessary frames'. Toribash, without rendering, would not run any faster. The simulation is too complex to run thousands of times in a few minutes on a single machine like you'd need.

REALLY?? So tell me how much cpu power you think physics simulations do need! I'm curious since I've implemented simple physics engines before but surely you know more about it than me!! Apparently its more than is available with a gigantic computer lab or something??

Regardless of how much CPU power you have, because of how Toribash is coded. Please research more before jumping to your own ideal conclusions.

Cool, your condescending while actually knowing less about what you are talking about than me. No wonder no one posts in this forum.
They won't work fast enough to be of any use to Java.

Let's let the actual java programmers worry about that, ok!

External libraries can't be used with TB Lua, because it's a security risk that hampa would have to take. Go take it up with him if you need more info.

That's fine, since we can use standard lua IO functions theres no need to even use external libraries.
It's obvious really have no idea what the hell you are talking about here. If you don't think graphical output bottlenecks toribash in any way are a complete fucking mental case.
There is a built in frame or "tic" limiter that prevents toribash from running at more than standard pace. You can even enable some form of frame skipping from the options.

Since you know so much about what Toribash CANT do I'll let you go ahead and do nothing. Just don't respond to me if you don't understand what I'm asking!


Newbluck: Thanks for the suggestion about the replay for dismemberments. It seems like thats the most promising route I can take to get some information.

What Toribash SDK are you referring to? If you mean the lua files in the SDK directory I've read them all, I'm aware of how to get joint positions and info from world state and whatnot. What I was planning to do to figure out dismemberments was check for when every joint in one of the players was relaxed, since thats what happens when a joint breaks; the problem is the false positive of a player which was going to be relaxed anyway without actually being dismembered.
I'm sorry to intrude, but we don't need to turn a help/suggestion thread into a flaming thread. You're not making much progress with this script, just an exchange of corrections in the last ones idea/comment. >.>
Why don't you just use an external program in cooperation with tb.exe? So it can check and record the ingame values, sorta like a hex editor. That way you could get every possible value you need. Wouldn't that just be easier? And then you can use lua to move uke with the output from, for example, a text file recorded by the external program. It's not like it's hacking or anything, since it's for single player.
(warning: I am nub at what you talk about)
Last edited by Nuyashaki; Feb 28, 2008 at 07:10 PM.
Originally Posted by NewbLuck View Post
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.

There's actually a function listed right in the SDK called get_joint_dismember().
Radioactive torso's description should be, "You have cancer like wow."
Originally Posted by Nuyashaki View Post
I'm sorry to intrude, but we don't need to turn a help/suggestion thread into a flaming thread. You're not making much progress with this script, just an exchange of corrections in the last ones idea/comment. >.>
Why don't you just use an external program in cooperation with tb.exe? So it can check and record the ingame values, sorta like a hex editor. That way you could get every possible value you need. Wouldn't that just be easier? And then you can use lua to move uke with the output from, for example, a text file recorded by the external program. It's not like it's hacking or anything, since it's for single player.
(warning: I am nub at what you talk about)

I agree, lets have no more silliness in this thread, its not conducive to getting anything done. I'll agree to be civil if everyone else does.

Jok, I think we are talking past each other. I haven't explained myself clearly enough, so I will elaborate on what I am asking.


I am making a lot of progress with my script; I just haven't posted what I've got working yet. It will probably reduce everyone's confusion if I better explain what I'm making:

I am going to be doing 2 things.
First: I am making A.I.s for Toribash. I will be releasing these A.I.s as LUA scripts that you will be able to download, and load up, similar to how Ukebot works. I am not "hand coding" these lua scripts, I will be generating them with a program.

My goal is that you will be able to load a LUA script for a specially evolved A.I. and have fun practicing against it in single player (for example, there might be an AI thats trained for jumping attacks, or for grabs, or for blocking, or whatever).

Second: In addition to making these A.I.'s, I will eventually be releasing a third party application that people will be able to use, to train their OWN A.I.s
This is a more long term goal though, and I have to make sure my system for evolving AI works flawlessly before I let other people go nuts with it.


My progress on goal one is this:
-I have designed the system that will evolve these A.I.s:
The system is composed of 2 programs, Toribash and JNEAT; I have written scripts in each to make them play well with each other.

JNEAT will generate a population of "controllers", and then it will request a score for how well each controller does in Toribash. It will do this by writing the neural net to a file and signalling Toribash to take over. Using my script, Toribash will read the neural net from the file, and "play back" whichever moves the neural net wants. After the round ends in Toribash, my lua script writes the "score" for that controller to a file, and signals JNEAT to take over.

After JNEAT has finished testing the entire population of neural nets, it makes a new generation of neural nets that are better than the old generation, and it starts testing again.


After doing this many many times, the neural nets will automatically get better and better at doing what they are being trained to.

All that stuff works so far, I've written and tested it; there is no I/O problem or difficulty getting TB and this java program to communicate.

The problem is that these tests in Toribash are too slow; this is because right now it takes about 30 seconds to a minute for a match to play out.

What I'm doing to work around this is using virtualization to have Toribash run many times at once; this way I get about 350 tests done in an hour, instead of about 60.

Now, if there is some way to stop Toribash from wasting time on OpenGL calls I could get that number up to maybe 100,000 tests per hour. Despite what Jokker thinks, this IS POSSIBLE!
One way I can think of is to write my own OpenGL driver with dummy functions, so Toribash thinks that everything is working normally but nothing gets drawn to the screen. This will work, but its a lot of effort that I don't want to waste.

Again, Jok is simply wrong about physics taking most of the CPUtime. There is about 70 physically simulated objects at most in any match. The amount of time it takes to calculate their positions and orientations once per frame is measured in nanoseconds. I know it sounds plausible that physics is a CPU hog, but Jok overestimates it by several orders of magnitude. (If you don't understand why I'm making fun of JOK its because I actually write these things and know what I'm talking about, being told be a 16 year old that you got it wrong by about a factor of a billion is a little funny).

What I want to know is if there is an easier way to speed Toribash up.

I've pm'd hampa asking him, but I assume hes a busy guy and probably doesn't get time to answer these things right away.
I'll reply to your arguments and ignore the inane flaming.

Originally Posted by tripwire View Post
Uh huh. Please pretend youre not a retard and just stop posting
The only way you can say something so baffling and stupid is if you completely fail to understand at all how neural nets work.

You seem to have misunderstood me, or how neural nets work. After training a specific neural net, you will get a 'pattern' of sorts, based on the weights that have been set. I meant that if only YOU could train new neural nets, because only YOU have access to the massive CPU power needed for it, people would likely ignore it.

90% of the coolness in neural nets is being able to train one yourself and to teach it. Not simply as a bot.

REALLY?? So tell me how much cpu power you think physics simulations do need! I'm curious since I've implemented simple physics engines before but surely you know more about it than me!! Apparently its more than is available with a gigantic computer lab or something??

You massively misunderstood. I meant, the way Toribash is coded now, you can't simulate it FASTER. It goes at a predefined pace, which CAN'T be as fast as you need. You'd need a special TB version from hampa.

Cool, your condescending while actually knowing less about what you are talking about than me. No wonder no one posts in this forum.
Let's let the actual java programmers worry about that, ok!

I am a professional Java programmer, and have been for two years, on and off. I know much more than you, and I'm willing to prove it if you want to.

That's fine, since we can use standard lua IO functions theres no need to even use external libraries.

That comment I made was in reply to you asking why external libraries can't be used.

It's obvious really have no idea what the hell you are talking about here. If you don't think graphical output bottlenecks toribash in any way are a complete fucking mental case.
There is a built in frame or "tic" limiter that prevents toribash from running at more than standard pace. You can even enable some form of frame skipping from the options.

I know way more than you about how games are coded, having coded several already.

The "tic" limiter is HARDCODED into the game. I meant that you would have to get HAMPA, or a DEV, to give you a version of Toribash which has that limiter REMOVED or MODIFIED. I was talking about the CURRENT version of Toribash if you didn't notice. Not a 'what if hampa was willing to modify the code and give you a copy to use it' scenario. That scenario is possible, but I wasn't talking about it. Asking hampa would be the way to go, since it's likely he'll agree to help.

Since you know so much about what Toribash CANT do I'll let you go ahead and do nothing. Just don't respond to me if you don't understand what I'm asking!

I know enough about what Toribash CAN'T do, because I have tried it already. Having tried and failed at doing x, y, or z means I know Toribash currently isn't fully capable of doing said x, y, or z things.


Originally Posted by tripwire View Post
I agree, lets have no more silliness in this thread, its not conducive to getting anything done. I'll agree to be civil if everyone else does.

As I stated earlier, I will ignore above flaming, to keep things civil. However I will not simply end an argument without coming to a conclusion.

Jok, I think we are talking past each other. I haven't explained myself clearly enough, so I will elaborate on what I am asking.


I am making a lot of progress with my script; I just haven't posted what I've got working yet. It will probably reduce everyone's confusion if I better explain what I'm making:

I am going to be doing 2 things.
First: I am making A.I.s for Toribash. I will be releasing these A.I.s as LUA scripts that you will be able to download, and load up, similar to how Ukebot works. I am not "hand coding" these lua scripts, I will be generating them with a program.

My goal is that you will be able to load a LUA script for a specially evolved A.I. and have fun practicing against it in single player (for example, there might be an AI thats trained for jumping attacks, or for grabs, or for blocking, or whatever).

Just to let you know, no-one's going to particularly enjoy them. All the fun in neural nets is training them yourself, not simply using premade ones.

A solution to this is talking to the devs, and figuring out a way to be able to give the training capability to the players too. hampa and the lot are particularly supportive of things like these and will really help. Getting in IRC and talking to them is a good idea.

Second: In addition to making these A.I.'s, I will eventually be releasing a third party application that people will be able to use, to train their OWN A.I.s
This is a more long term goal though, and I have to make sure my system for evolving AI works flawlessly before I let other people go nuts with it.

Yeah, however, unless you manage to remove the limits I mentioned, it will be too much work for the casual gamer and only the hardcore enthusiasts will be interested.

My progress on goal one is this:
-I have designed the system that will evolve these A.I.s:
The system is composed of 2 programs, Toribash and JNEAT; I have written scripts in each to make them play well with each other.

JNEAT will generate a population of "controllers", and then it will request a score for how well each controller does in Toribash. It will do this by writing the neural net to a file and signalling Toribash to take over. Using my script, Toribash will read the neural net from the file, and "play back" whichever moves the neural net wants. After the round ends in Toribash, my lua script writes the "score" for that controller to a file, and signals JNEAT to take over.

After JNEAT has finished testing the entire population of neural nets, it makes a new generation of neural nets that are better than the old generation, and it starts testing again.


After doing this many many times, the neural nets will automatically get better and better at doing what they are being trained to.

I'm a tad rusty in terms of terminology, but I'm fairly certain this isn't exactly only a neural net. It's a progressively evolving system, as it's based on generations, and fitness ranks. The terms I learned aren't in english, so I wouldn't be able to tell exactly which you're discussing.

The neural nets I know as 'progressively evolving neural nets' are the ones that are formed of 3 layers of simple neurons, input, hidden and output, which are formed of 'neurons', which, based on the input and a weight value, output either 1 or 0, or any number of values in more complex nets. The weight value is what changes after a training session. Basically it adds a fraction of the error mark from the last 'generation', and tests to see if it's better. If it works better, it becomes the new generation, else it's scrapped, and a different error mark is added, other weights are changed, etc. As such, it always evolves. However this type of neural net isn't particularly effective in complex situations such as fighting. My experiments with neural nets in TB showed that at most, I could get one neural net, consisting of ~500 inputs (positions, former positions, speeds, former speeds, delta, etc), ~2500 hidden neurons, and 21 outputs, to 'try' to balance itself to keep from falling down. After about 5000 iterations, it manages to stay up, while occasionally somersaulting backwards because it misjudged something.

My idea would be using several neural net, one for each limb, or one for each task (balancing, positioning for attacks, etc), and one main one that judges the outputs of the others AND the current status, and chooses which one would work best, and uses that one. However that would be way too CPU-intensive according to my tests, if you were to get it to learn constantly. I never tried making it without learning capabilities once it's been trained, so that might be plausible.

All that stuff works so far, I've written and tested it; there is no I/O problem or difficulty getting TB and this java program to communicate.

The problem is that these tests in Toribash are too slow; this is because right now it takes about 30 seconds to a minute for a match to play out.

What I'm doing to work around this is using virtualization to have Toribash run many times at once; this way I get about 350 tests done in an hour, instead of about 60.

Now, if there is some way to stop Toribash from wasting time on OpenGL calls I could get that number up to maybe 100,000 tests per hour. Despite what Jokker thinks, this IS POSSIBLE!

As I said, it is possible if said limit is removed. Talk to the devs and have them help.

See post #2. Character limit is too short.
One way I can think of is to write my own OpenGL driver with dummy functions, so Toribash thinks that everything is working normally but nothing gets drawn to the screen. This will work, but its a lot of effort that I don't want to waste.

Again, Jok is simply wrong about physics taking most of the CPUtime. There is about 70 physically simulated objects at most in any match. The amount of time it takes to calculate their positions and orientations once per frame is measured in nanoseconds. I know it sounds plausible that physics is a CPU hog, but Jok overestimates it by several orders of magnitude. (If you don't understand why I'm making fun of JOK its because I actually write these things and know what I'm talking about, being told be a 16 year old that you got it wrong by about a factor of a billion is a little funny).

I never said it was CPU intensive, I said no matter how much CPU power you HAVE, it won't run faster, because of the hardcoded limit. Meaning, just because you have lots of CPU power, Toribash as it is now, won't use it. It'll simply top out. Removing the limit would help in that case.

Like I said, you misunderstood me greatly in some cases. Also, judging me by my age is something that I've rarely seen smart people do. From what I've seen of you, you are a smart person, so I'll take it as a fluke and ignore it. I have just as much, if not more, programming experience and knowledge. Likely more, and not limited to Java, C, C++, Pascal, Lua, or these languages I know proficiently. I am a professional coder. I may be 16, but I'm making money out of my coding, and it's working perfectly. That's got to count for something.


What I want to know is if there is an easier way to speed Toribash up.

I've pm'd hampa asking him, but I assume hes a busy guy and probably doesn't get time to answer these things right away.

Try getting on IRC when he is on. (He lives in Singapore, so you can judge when he'll be on, provided his sleeping schedule isn't as messed up as mine is)

Also, he may be on a trip. I seem to remember something about him going to San Francisco a while back, or I may be confusing it with someone else's trip.


Excuse the above wall of text, and the doublepost.

[/post]
LOL, "I'm a professional 16 year old programmer, I can prove I'm smarter than you". Ok there champ! You sure are adversarial, why don't you try to see where I'm coming from instead of assuming I'm a retard.

I don't think we are even disagreeing on many points, just talking past each other. I guess its easy to miscommunicate this stuff; don't take it personally.

Are you on IRC at all jokker? It'd be easier to talk about this stuff if I wasn't constrained to making posts and waiting for replies.
Originally Posted by tripwire View Post
LOL, "I'm a professional 16 year old programmer, I can prove I'm smarter than you". Ok there champ! You sure are adversarial, why don't you try to see where I'm coming from instead of assuming I'm a retard.

I don't think we are even disagreeing on many points, just talking past each other. I guess its easy to miscommunicate this stuff; don't take it personally.

Are you on IRC at all jokker? It'd be easier to talk about this stuff if I wasn't constrained to making posts and waiting for replies.

Well, excuse me for being so formal, it seems sarcasm is a must-have in a conversation with you.

You failed to spot the point where I said I think you are smart, and that you judging me by my age was probably just a fluke. But apparently it's not exactly a fluke.

I can assume you know Java to a good extent, seeing as how you do know what you're talking about, but more I can't assume because you haven't shared a single bit of info on that.

I am a 16 year old. I have been programming since I can remember. I know Java, C, C++, Pascal, and several others, to a high enough level to call myself skilled, and to a high enough level to be called 'smart'. I come from Romania, and have participated in the national olympics for Computer Science, programming side, in 2001, and would have won 1st prize if not for my bad habit of not saving, and a badly timed power failure. I was placed 13. I have been working for pay in Java, and C/C++ for the last year and a half, and have made quite a bit by doing so.

I'm not on IRC any longer, since a week or so ago, when veb proceeded to ban me from the place after my modship was removed and he wouldn't let go of the issue. I'm probably unbanned, but I'm not coming back, since I'd have to set up a new irssi session on the box I bounce through, and I've since lost the ip to said box, so I'd have to do some log-digging. (That is because my ISP blocks IRC connections to anything other than irc.quakenet.org, so I have to either bounce through an external box, or not connect)

I have proven you either wrong or have proved that you misunderstood what I said on every point you brought up so far, and you still insist I 'see where you come from'.

Believe me, I've been there, thinking of making a system to do x thing for Toribash, then spending 6 months coding it, only to realise it's so bug-filled and slow it won't ever work properly. I'm trying to spare you the pain. When I saw you wouldn't budge, just like I didn't when I attempted various things, I suggested the best solution to your problem, meaning talking to hampa.

Not once before this post did I attempt to suggest you are mentally disabled, slow, stupid, retarded, or any other such thing. I simply recognized the way I used to act when I was still able to give a rat's ass about my projects, and was trying to help you so you don't end up annoyed over not being able to do something and quitting the community, or coding overall. The reason why I wasn't able to make a working neural net isn't because it's impossible per-se. It's because things always came up, problems, communication with hampa was tough because of timezones, and whenever I had a breakthrough, something new came up. Eventually, I lost interest. IF I had a year to waste with this, I would have probably ended up with a half-broken, half-working, system that sort of works. However it isn't worth it. I should have spent those months I was coding this at least doing something more productive, such as stuff the community would need. Not a neural net system that will never work, and even if it would, it would be useless due to bugs.

You are free to do as you wish, I never attempted anything more than to show you why it won't work, and how hard it would be to make them work. I'm not going to pursue this argument any more, due to the simple thing of me being as civilized as I can possibly be, and you using sarcasm and insults to get your flawed point across.
O_O Long posts Jok.


I also doubt this could be done, if not ever done without the help of a special suped-up version of toribash.
Church of BnW