Monday, April 16, 2012

Episode 9 - Baptizing Bots, Cursing C++ Updates, Shrinking Songs

Awesome bot names

Team Trivia features, at least in the initial testing phase, bots. These cool little automatons will fill up your team to 4 players whenever there are not enough human players available in the lobby.

To give the bots a bit of personality I wrote a simple syllable-based random name generator. The generation is based on three arrays with syllables taken from the characters of the Oz books. Some of the entries are deliberately empty to create two-syllable words. All in all, nothing fancy, but I really like the names it spits out.



Update from hell - Visual Studio SP1

Time for a rant. I wanted to try building http://1337haxorz.de/products.html and then using it (one way or another) from Delphi. I don't have a decent C++ compiler on this laptop yet, so I downloaded Visual C++ 2010 Express and installed it. Which was a nice and smooth ride, but then... I run it.

First off, it complained about finding other Visual Studio 2010 components running on the system, but ooooh those were SP1, so Visual C++ couldn't run until it was updated as well. Excuse me? I just want to compile some standalone C++ code, do I really care about the exact update version of ASP.net or SQL Server? If it is so darn important that "everything runs on the exact same version", why have me download an outdated version in the first place? But ok, I'll click the button on the dialog that downloads SP1 and install it...

... which apparently takes 4x as long as doing the full Visual C++ 2010 Express installation in the first place. Oh, and it requires a reboot too...

... which then ends in a black-screen-with-mouse-cursor, where it is installing stuff without any visual feedback (i.e. "it just sits there"), for well over an hour! Dear developer people designing this install process, please realize that this sort of user experience is Unacceptable. I can't use my machine (it zapped about _all_ the personal coding time I get on a weeknight), I haven't got a clue how long it is going to take, and most importantly: I'm seriously worried! Is it still running? Is it breaking just my Visual Studio, or trashing my hard disk completely? Will my machine ever come out of it, again?

If you are going to lock me out of my own machine for this amount of time, at least have the decency to warn me beforehand, but even then... what the heck are you installing on my machine that takes so frighteningly long? The entire MSDN?


 
Building a tiny V2 executable with VS2010

As Fabian "Ryg"Giesen just published loads of Farbrausch tools on GitHub, all of this will probably become irrelevant really fast, but here is how you do it:

Prerequisites
- Install Visual C++ 2010 express. Gnash teeth whilst enduring any SP1 updates.
- Get nasm. Install it anywhere, but make sure to put the location into the path.
- Copy nasm.exe to nasmw.exe. This is probably not the best way to do this, but it works.
- Get the official kkrunchy binary from ryg's Homepage . Put anywhere on your disk.
- Get the V2 sources . Again, the project is now on Github, so you might want to pull it from there.

Building
- Open up example/tinyplayer.sln from the V2 source folder. Visual C++ will automatically upgrade the solution to 2010
- Open up the project property pages.
- Change the Base Address to 0x800000 (or anything significantly bigger than the default 0x400000, really). This will suppress kkrunchy's warning about the resulting executable not working on win 9x.
- Change the Randomized Base Address to No (/DYNAMICBASE:NO). If you leave this setting on th default Yes, the kkrunched executable will immediately crash when started.



- Close the property pages and build the project (F7).
- Open up a CMD prompt, run kkrunchy on the resulting tinyplayer.exe . Done. 16kb of tiny music madness.


1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete