Conclusion of Herding Cats
So, it is Wednesday now. The two group projects are now done. The results are kind of interesting.
The game project was fun, if exhausting. Some unfortunate problems though. One member was just way too inexperienced. So it was like there was only two people in our team. He tried! He very definitely tried. But he needed to communicate his skills better. But even with his strengths, it still took far too much time. But nevertheless, we have mostly finished the game.
Its a spiritual descendant of metal gear solid, but because we have no capability to make our own art resources, we had to use the provided stock resources that comes with the Neverwinter Nights Aurora toolset, all medieval. So… a medieval gear solid. Its okay. It definitely has its bugs. It has some limitations. It is possible to circumvent 40 or so minutes of effort, and finish the game quickly, thereby missing 90% of the story.
I hate putting out something that has bugs. I absolutely hate it. One more week, and we could fix these issues. Just one. If we had worked harder in the beginning, we’d be much farther along. But the amount of work required is a lot. Games require a lot of work, and most of it is spent on aesthetic issues. Crafting items, making a good level, balancing monsters, these all take a lot of time and sweat and blood and effort.
Everyone’s game had something different that really differentiated them. We had our absolutely awesome, five minute cut-scene created by Josh. One team had a neat branching story, another had a real intro cutscene and had voice overs. And the last group had the best humor and entertainment factor.
The AI project, I think, was where the real fun was. (Quick background: We had to do it in Java and play the Game of Amazons) Despite the fact we lost a team member for 13 days, and he lost all his code, we… won the AI tournament this week. The tourny was only within the class, but we won. We worked like dogs for 4-5 days, lots of editing, and dealing with suicide, but our overall score was 4 wins, 2 losses. Our AI initially was at times suicidal, in that it would make, very rarely, a move that kills itself. So we had to rush today to find out why it was killing itself. And the fix turns out to be a missing set of five lines that did not set the initial conditions properly. For most of the time, the move generators would work properly, but sometimes when a queen was at the top of the board, it would fail early, and not generate all the moves.
Finding the bug was an odyssey in itself.
Our first clue was the observation that the move generators were only generating 1632 moves compared to the 2175 opening moves of Amazons. Obviously something was wrong. We quickly whipped up a comparison of a working generator, which generates all the moves at once, versus the defective generators, which generate a move one at a time(significantly less memory overhead, and with pruning game trees, this results in a significant runtime reduction. The proof is left to the reader.)
So we wait till the 1632nd move, and see why the generator fails at this point. And lo and behold, it was a missing set of initialization lines, so the conditionals in the subsequent loops were subtly wrong. So much effort to find the error, and such a simple cause. We fixed it, and the generators worked properly.
In addition, during other classes this morning, I found a way to make our heuristic function significantly faster, by breaking up a bunch of big loops, so that they were much smaller, and some loops would be executed less. This allowed us to evaluate on average at the start of the game 10% more nodes, which is a huge number! With these two modifications, our next four games turned out startlingly well, all of them victories. We crushed the opposition. Our only two losses were while the program was still suicidal. So… we rule.
Links:
- You will need Neverwinter Nights patched to 1.69
- Unfortunately, it needs a couple of packages to work properly. One of those is the nanoxml package. Use Google. The other is one specifically for our course, and the only file that needs that is Network.java. Otherwise, it should work well.