Total servers: 1
Modern Warfare1.0 – 20lt
Game Mode: Death Match
Lives: 0
Max Kills: 12
Version: OpenLieroX 0.58 rc5
Pages: [1]   Go Down

Author Topic: Hackontest documentation  (Read 1204 times)


Hackontest documentation
« on: September 25, 2008, 06:31:45 am »
This is the documentation about what we have done on Hackontst. It describes the features, how we implemented it and the problems we had to deal with.

SVN webinterface:
SVN trunk:
SVN log:
Last revision before Hackontest: 2373 (9:50)
Last revision of Hackontest: 2451 (9:55)
Release Beta6 of last revision before Hackontest:
Release Beta7 at the end of Hackontest:

    game-speed multiplicator

    This multiplicator changes the speed of the physics in the game. For example, if you set the multiplicator to 2, everything will be twice as fast as usual.

    To implement that, there was a new option needed in our option file and configuration system. This option also has to be editable from the local game lobby and from the host game lobby. The client game lobby should also show the current value of the server. If you change the value in the host game lobby, all clients should get an update. When the game starts, they have to use the same multiplicator as the server.

    To keep backward compatibility, there were some additions needed. Backward compatibility is not possible at all if you start the game with a multiplicator != 1. In that case, when you start the game, all older clients should be kicked out. We added a general function to make that possible in an easy way. If multiplicator = 1, we don't have to care about anything anymore as we added the new information in a way that an old client would just ignore this additional data.

    The main feature was ready in revision 2387 at time 13:38. One last fix was made in revision 2425.

    The most important changes in code:

    Options editable from everywhere in the game

    Many times you jump into the game and find out that your keys are wrong. Then you have to leave the server (very troublesome, especially for the host), go to the options and then go back to the game (if the people were so kind and have waited for you). The problem would be solved if one could edit options from everywhere. A small button that would open the options window would do the trick.

    Ready since rev 2396, time 16:02.

    force random weapon selection (with the extensions to have the same weapon for all players)

    With this feature, you can force a random weapon selection for all players. Until now, that was not possible, every client was always able to do it's own weapon selection.

    We implemented this feature in a more general way, that the server can select the weapons of the clients if the server wants to. The server has to inform the clients if they should do the weapon selection by themself or if they should wait for the weapon selection by the server. At this time, the only case where the server choosed the weapons was, when force random weapon selection was used. Later on, we used this also to implement the same weapons for all players. Anyway, with this server side weapon selection enabled, old clients become incompatible. Therefore, if it is enabled, the server has to kick all old clients again. We used the already implemented function there.

    Force random weapon selection (and the implied server side weapon selection), together with all options in the GUI, the whole network stuff and so on, was ready with rev 2395, time 16:02.

    The extension was implemented in a way that the first server worm can choose the weapons and all other players will get the same weapons. This one was a bit tricky as there are many special cases to check. For example if there are no server worms (on a dedicated server), this feature cannot be used. Or if the server has multiple local worms, only the first one should do the selection. When it is a bot, there was even another weapon selection function which had to be modified a bit.

    This extension was ready with revision 2404, time 18:29.

    Most important code:

    automatic weapon selection if only one weapon is available

    For example if there is only the mortar launcher weapon and nothing else, the selection should be done automatically. (It's annoying if you miss the weapon selection timeout and to get kicked because you are away for a second.)

    Since rev 2392, time 14:29.

    notify application window on events

    If the app window is in the background (because you are waiting in lobby or out-of-game and you put OLX in background) and the game starts / ends / similar important event, the window should do a notification. This is dependent on the system. On Windows and most X11 window managers, the window-bar in the tasklist will start blinking or just turn into another color. On MacOSX, it will make the application icon bouncing.

    This was a bit tricky to implement as all systems (Carbon, X11, Win32) are doing that very differently and a lot of web searching was needed to get the necessary information together. Sad but true, but the X11 implementation was the most difficult part here.

    Finally, we finished also that feature in revision 2438, time 6:03.

    Most important code changes:

    Auto-completing for chat commands

    This auto-completion support is very much like in any Unix shell. If you type "/something[tab]" in the chat, it will complete up to the most longest well-defined command part. If that is not possible, a list of possibilities will be shown.

    We wanted to have this done forward compatible, that it always completes all available commands. The first implementation introduced two new packages, one for requesting an auto-completion on the server and another one when the server sends an auto-completion solution to the client. If there are multiple solutions, the server just sent a list via chat to the client. In the small reimplementation, we introduced a third package where the server can send this list. This is better for forward compatibility, because we can handle the list better and we don't have to parse any chat message later on.

    Ready working version in revision 2423, time 1:03. Another small reimplementation to be more forward compatible in revision 2442, time 7:59.

    Most important changes:

    Command button for host in game

    It is a bit troublesome and time-consuming to kick a player from the server using the console. For host there is a command button in the game menu/weapon selection scoreboard that would give the host the ability to kick/ban/mute etc. the player like in lobby.

    Ready in revision 2444, time 8:24.

    Show player online status

    When player is typing something in a chat during game, or put the game window in background, all >=Beta7 get informed about that and they will show it in the name.

    Ready in rev 2440, time 7:14.

    Most important code:

    Client info dialog

    For host there is a dialog (accessible from the command button menu) that show info about the player, for example: IP, Country, Client version and so on

    Ready in revision 2444, time 8:24.

    Copy & paste for chatbox

    We started this feature but sadly it was more complicated than we expected at the beginning. The finished part of it can be seen in the News tab in network play (the same control will be used for the chatbox later).

    Breakpad support for those platforms who support the client Breakpad library

    This would need a lot of testing and hacking in the beginning, therefore we skipped this feature.

    Local Tournament

    A possibility to play kind of a tournament. You start with one easy bot, when you kill him you get a harder bot, later even harder bot or more bots etc. At the end you will be declared as a winner of the tournament. If you fail to win some round, you can repeat it until you win.

    This is a very interesting feature and we thought already earlier about how to implement that. We even discussed it already. We get to the conclusion that if we want to do that in a nice way, that allows also other players to create their own tournaments, we need some sort of scripting language here.

    To add the support for a scripting language (like Lua for example), to design/write the interface, to test it and to write a small tournament is just too much for 24h. Perhaps we could have done this as the only feature on the whole contest but we didn't want to have any hacky, unstable implementation, therefore we skipped also this.

    localization files

    This needs some serious redesigning in some core parts of the game. If we would have started that, we could have easily been stuck in a non-working state. Also the font system is currently not able to view more than the first 1024 unicode characters (mainly for performance reasons).

« Last Edit: September 25, 2008, 10:26:54 am by albert »
Pages: [1]   Go Up