Saturday, April 5, 2008

SVN upto r63: New Stuff

Well, updates have been happening yet we have been slow to post here. Currently I have particles working. To use the particle effect, go to the arena and use the 'e' key. I have, slowly, but surely been working on getting physics up, hopefully by next week some will be working. Also, testarena and vc.h have finally been removed from the repo. Enjoy!

Keep an eye out, progress is being made,
Justin

P.S.
Something I left out:
The options menu now allows you to go back to the main menu with a Go Back button, and you also have an option in there finally which is the availability to turn on and off the background sound.

Tuesday, March 11, 2008

SVN r51/r52/r54: The Main (Joystick) Event

Okay. This one's sort of a doozy, so bear with me.

Up until r51, there was a functional difference between joystick and keyboard events. Joystick posted events to Player, which crafted Irrlicht events as necessary and made the system run. This would be all well and fine, if we wanted to use gamepads as keyboards. However, our goal is quite the opposite: We want the gamepads to be our main input devices, with the keyboard as a fallback and debugging tool.

So, here's the basics. Player should be a lightweight class. Joystick will generate events as necessary, using StateManager to determine when keyboard events should be synthesized in addition to joystick events. The struct JoystickEvent will be used to pass around joystick events. Joystick and JoystickManager will become smarter, and Player will become dumber. This is the plan.

r51 and r52 put down stubs and the initial code move from Player to Joystick. r54 simplifies the code, since being in Joystick means that less Joystick-specific information needs to be passed around.

TODO: Test this stuff. I haven't been able to test it yet. Also test OpenAL on Windows and get Irrlicht to use vsync on Linux.

~ C.

SVN r50/r53: VC2005 Support

r52: VC2005 finally works! It takes a load of work to setup, but I have written a readme that explains how to do all of it.

r50: Simple clean up.

Sunday, March 9, 2008

SVN r49: No More Duplicates

In rev48 when you left the arena and re-entered the model form the previous arena was still being drawn, this revision fixes that problem thankfully. And all it took was a simple little line node->remove(), but of course I had to spend forever figuring that out. I also did some code clean up as well.

Anyway, small fix, but very worth while.

Keep an eye out, progress is being made,
Justin

SVN r48: Some Player maturity and bug fixes.

The player class is now creates and handles the models for itself rather than the Arena creating them. The arena is able to handle up to four players now, but since there are input limitations, only one is created for now. With the advancement in the Player class there is no reason now for the PlayerManager class and it's construction was removed from opensmash.cpp.

I also fixed a bug in the console that caused opensmash to crash when you backspaced too far. The bug was a string shrinking smaller than size 0.

Keep an eye out, progress is being made,
Justin

SVN r47: Cool new stuff.

R41 was my commit, but sadly, it was just code that I had slightly touched on and was too lazy to go back and try to remember everything about what I was doing.


Now there is r47. This is an excellent and much needed commit. I have fully obsoleted ArenaTest, made Arena work, but a major bug exists that is stumping me right now.

ArenaTest was the old way that the arena was loaded. There were many issues with it, mainly everything was hard coded; not very flexible or pretty.

Arena, oh Arena, thankfully it has come. I have been sitting on this idea for FAR too long. Arena now loads maps from an xml file. When we have more mature item and player classes the features of this new Arena class will extend heavily, look forward to that in the (hopefully) near future.

Sadly though, there currently exists a bug where the loaded player does not get deleted when you leave the Arena. When you leave and re-enter the Arena, the previous player(s) is still there and a new one is drawn.

Keep an eye out, progress is being made,
Justin

SVN r45/r46: Saturday Night Commit Fever

Hmm. I seem to be making a lot of broken-up, patch-style commits. Must be from working on git-based projects. At any rate, it's nice that the code is getting mature enough that variated commits aren't breaking the tree.

So, r45 brings Character Select up to feature parity with Menu. It's got FPS in the corner, and a Console hook, so the console displays properly. I'm considering making a global setting "show_fps" to control whether there's FPS in the corner for all states that support it, and also a global macro for making all drawing classes automagically have the Console included.

r46 makes the Console actually display in Character Select.

For some reason, Character Select both runs faster and is less responsive for me. I need to figure out why.

Talking about the future now. I need to find out why Irrlicht doesn't respect vsync, and also where the joystick mangling code in Player should go.

TODO: Settings-ify Character Select and Menu.

~ C.

Friday, March 7, 2008

r42/r43/r44: Potpourri

(Note: r41 is Justin's, so it's his problem to write it up.)

So, yesterday was busy. Justin and I sat down and talked extensively about code, and ended up writing a bunch of stuff. I'll go in order, trying to explain everything along the way.

r42 was mainly to commit a few changes to configure.in. I've been trying to move to a pure autotools framework, and part of that is moving all of the libraries that need to be linked from the Makefile.in stubs to configure.in. The final library, Xxf86vm, was finally moved in this commit, making us purely autotools now. (And of course, we may move to cmake or something similar in a while, but for now we're staying firmly put.)

I've mentioned OpenMP briefly, but I won't get into it here. It was enabled if your compiler (GCC 4.2 or newer, ICC) supported it, but for now I've disabled it. Passing --with-openmp to configure will enable it again. So far, the speed increases are negligible, and only occur in a few limited STL calls. We'll figure more of it out later.

There are also small fixes to Arena, CharacterManager, and a few headers. Also vsync is now enabled by default.

Next! r43 adds a 14pt monospace font for the Console and ArenaManager, which is like CharacterManager but for Arenas.

r44 was basically this:
$ optipng -v -o7 media/fonts/*.png
$ svn ci
For those not familiar with optipng, it is a cool utility that shrinks PNGs. (What? I was bored!)

TODO: Get the entire CharSelect path working. ArenaManager should be very easy to integrate. Also consider using XML files to lay out the character select and arena select screens.

Justin, Derrick, please write up your commits.

~ C.

Sunday, March 2, 2008

SVN r40: MinGW/Win32 support

So, we now officially support MinGW building using the autoconf/automake system. (That's cross-compiling, for the new guys in the crowd.) It's not the biggest commit, but it's not anything minor, either; 300+ lines of changes total.

This is not Visual C++ support, although I see no reason why it won't build on VC. This is support for MinGW, which is a port of GCC to Win32. It runs natively, linking to Win32 core runtimes, and acts just like any other application. The catch is that this support is only for automake-based MinGW, which is pretty much limited to Linux cross-compiling. (At some point Derrick and Justin will make a VC-based version for building on Windows, I'm sure.)

In case you were wondering (and I know you weren't,) r38 belongs to Derrick and r39 was accidental and reverted by r40, so they don't get posts. (Well, Derrick was supposed to say something, but he's lazy.)

TODO: Win32: Fix bug where music does not play.

~ C.

Tuesday, February 26, 2008

SVN r36/37: Settings

I added Settings, a singleton class that stores key/value pairs on a global basis. So far, I've added std::string and std::wstring values. Keys are always std::strings (or std::wstrings, thanks to the magic of overloading.)

I'm sorely disappointed in the STL. There's no standard way to tokenize std::strings! My meager improvisation is lacking, I'm sure, but it gets the job done. Console now has a slight idea of how to get and set values for keys.

TODO: Give Console some global functions, and also a nice 15pt monospace font.

~ C.

Sunday, February 24, 2008

SVN r35: The Runtime Directory

I've created a "runtime directory." What is a "runtime directory," you might ask? Good question. A runtime directory is a directory containing a relative directory structure which supplements a program. In our case, we need, at a minimum, the media/ folder to be present in our runtime directory.

Up until now, I've not worried about this concept; I've just let the scripts handle it automagically. However, when Derrick tried to run the Kdevelop project, it silently died, leaving cryptic comments in the logs. We eventually figured out that the problem was that media/ wasn't being found correctly due to a missing symlink. Well, symlinks are an ugly hack for getting a relative path right, so I decided to make a compile-time runtime directory.

This is harder than it sounds. I've altered the autoconf to guess `pwd` for the runtime dir, or to take it on the command line with "--with-runtime-dir":
./configure --with-runtime-dir=/home/simpson/os
Works excellently.

Now, of course, the story doesn't end there. Autoconf turns this setting into a command-line define (-DRUNTIME_DIR=\"/home/simpson/os\"), and then we have, in opensmash.cpp, a few lines that set up the working directory and path. Cool, right? Right?

Right?

TODO: Dunno, good question. Sleep?
~ C.

SVN r34: New libtool

So, Gentoo finally bumped the libtool version they ship with, so I updated the libtool config macro version in OpenSmash. I know that they shouldn't be in there, but Makefile.cvs bitches at me if I don't ship 'em, so whatever.

I also refactored to since there's no reliable way in autoconf to know whether or not /usr/include/irrlicht is being included, and after all headers might live in /usr/local/include/irrlicht, which autoconf can't detect and the maintainer would have to figure out case-by-case. (Guess who the autoconf maintainer is.) Anyway, Irrlicht itself is alright with this, so that's my story and I'm sticking to it.

Also, I cleaned joystickmanager.cpp. Whoever coated it with ^Ms, I'm pissed at you for doing it but proud that you worked on a Linux game from a Windows environment. Stickin' it to the man, indeed. (The sarcasm doth drip from mine lips.)

Bigger post to come in a few on r35.
~ C.

Thursday, February 21, 2008

SVN r32/r33: More Console

More Console flesh has been put in with these two reverts. I'm lumping them because r33 fixes a few files I forgot to add in r32.

The Console now is integrated into the menu and correctly renders pretty much everything. I'm going to upload a monospace 16pt font for it in a bit, along with some more plumbing code. There's not much else to say at this point.

~ C.

Tuesday, February 19, 2008

SVN r31: Goodbye, AL_EXT_vorbis

Okay. First, a little background. For our sound backend, we're using OpenAL, which is a threaded, cross-platform, cross-driver sound system with optional hardware acceleration and support for 3D effects. Pretty cool, huh?

OpenAL has an extension system similar to OpenGL, and one extension popular in Linux games is AL_EXT_vorbis, which adds Vorbis stream support to OpenAL. The mechanism is through a callback system which essentially takes care of decoding Vorbis streams for us.

Now, up until now, I've detected AL_EXT_vorbis, and I've been debating whether or not to use it. However, after digging into the code originally provided by Loki Games which implements AL_EXT_vorbis, and looking at the parts of Sound Manager which I retooled way back in r17, I decided that the space and time gains from using AL_EXT_vorbis were simply not worth it, so I removed the detection code.

Also, Sound Manager now exclusively uses the LOG_*() macros. While we're not grepping through the code to put them in, they should be fixed whenever possible, because between this:
StateManager::getSingleton()->getDevice()->getVideoDriver()->getLogger(str, irr::ELL_INFORMATION);
And this:
LOG_INFO(str);

Which would you rather have to read?

TODO: Wire up alutInit() to take argc and argv on Linux, without screwing up Win32 WinMain().

~ C.

SVN r30: Console

Hi, people. We're moving OpenSmash discussion to this blog so that all three of us can write about stuff.

So, this revision brings in the Console. As you might imagine, this is a Quake-style console that pulls down with a backtick/tilde key, and allows you to type commands into a debugging environment. This commit mostly just lays down the foundations, and shows an example implementation in the Menus.

Derrick is to blame/praise for this, as it was his idea.

TODO: Make console transparent. Make console respond to text. Make console stateful. Make console work. Make console pretty.

~ C.