Kaillera FAQ:
(FAQ made mostly by peeking stuff written by Kaillera users in the forums.)
Last edited by soulctcher on 9/25/02


  1. What is Kaillera?
  2. Where does the name "Kaillera" come from?
  3. Why is my game so laggy when I play?
  4. What is lag? What is desync? What does "Ping" mean?
  5. What is the "connection" setting used for, and what should I put there?
  6. Help! My game goes out of sync (aka. desync)! Why?
  7. I have only 56K/ISDN/DSL/CABLE. Will it be enough to play emulators online?
  8. My server keeps crashing!
  9. When is the next version coming out?
  10. It seems like the Kaillera libraries are not open source. Is Kaillera going to be open sourced sometime in the future? Why is it not open-source?
  11. Wait a minute! I thought the MAME team said that every project based on it should be open source! It looks like the MAME version of Kaillera is in violation of the MAME license agreement!
  12. Why is there no Linux/Mac/etc. client port?
  13. I want to integrate Kaillera into my game/emulator/etc. What do i need to do?
  14. Where can I download roms for my emulator?
  15. How do I create/run/configure a Kaillera server?
  16. But my server says "unkn0wn serv0r" and only lets 10 people connect!
  17. Other useful tips!

- What is Kaillera?

Kaillera is software called middleware. Middleware gives applications, such as emulators, the ability to do things not originally supported by the original application. Kaillera makes it possible to play emulators and other applications online. It adds little overhead, and little problem to the developers who choose to incorporate it.

In the future, Kaillera may develop into more of a community of users. But first, We will concentrate on making the Kaillera client/server architecture work better and more efficient.

(Back to the top.)

- Where does the name "Kaillera" come from?

"Kaillera" is a misspelling of a french word that is used for defining bad people who lives in "ghettos"; people who burn cars, kill people, etc.. I think you get the idea.

(Back to the top.)

- Why is my game so laggy when i play?
- What is lag? What is desync? What does "Ping" mean?
(contributed by Mystiq and Fugu)

When you play games over the internet, you can be playing against someone that is across the world . When speed is concerned, you start to run into concept of the speed of light.

Say I'm in New York, and I want to play a server in Tokyo. That's about 6760 miles. The speed of light is approximately 186,000 miles per second. In ideal conditions, your signal has to go from your computer to the server, and back. Assume that this electronic communication happens at the speed of light. (Which it does not. There are other problems due to overhead, A/D conversions, etc. Not to mention that electricity travels a bit slower than the speed of light.)

So, we have to go 6760 miles there, and 6760 miles back. That's 13520 miles. At the speed of light, it would take about 72.688 ms ([13520mi / 186000 mi/sec] * 1000ms/sec). So, at best you can have a 72 ms ping. (Not taking into account time lost by routing hops, A/D conversion, network overhead, latency, etc.)

You really can't defeat the speed of light.

Lag: AKA network latency and ping time. If you say you are "lagging", network-savvy people are going to think that when you press a key, your actions are delayed. Lag is NOT shown when you are playing but the game appears to have locked and none of the keys work. That is called...

Packet Loss: Over the TCP/IP and UDP protocols and the others, data is sent out in little packets of data. I believe it is approximately a few hundred bytes, (someone who knows, please let me know). The receiving computer reassembles these packets, according to stamps on them, into what it was supposed to be. In UDP, which Kaillera uses, these can be received out of order and there's a timestamp on them so that they can expire. Ex.: If you're playing a fighter and you press a punch, you don't want it to be received after the kick you pressed first; fighting would be downright hilarious. You may never get a UDP packet since it is just sent once and that's it. Once it's expired, if your computer ever DOES get it, the packet is checked against the computer's clock and just ignores it.

In TCP/IP, packet loss does not happen as often, and the participating computers' connection seems to last longer, usually until both computers feel the connection has just been lost. (This is why IRC, laggy as all hell, still works). TCP/IP replies with what we call an "ACK" (acknowledgement) when a packet has been received. Until that, the other computer keeps sending the little packet out until it gets the "ACK". I don't know the frequency of resending. (Again, someone who knows, please send the information in. I would imagine it's more than 300 or so milliseconds.) The problem is, this takes up bandwidth on a connection, thus for things like Kaillera, UDP is much more preferred so lag can be reduced.

Choppiness: You will see choppiness in the game if there is some lag happening. The resulting effect from packet loss in UDP is that you may have some packets that are not received. This would not only cause lag, since the timing would be held back, but you may also miss a transmitted move or button press. One of the benefits of UDP is that all of the bandwidth of both computers is used to full and not wasted resending packets. The problem is if a packet is not received the computer that was supposed to get it has nothing to do. With the way Kaillera is set up, (which it has to be, or desyncs would occur whenever a packet is lost) the program is set to stick until it receives a packet so the other player(s) can move. Work some brain cells for a second and you can see this was the only sensible thing to do. This prevents Kaillera from desyncing. Those of you who frequently get perfect games feel rested: you are getting relatively low packet loss: less than 5%. 0 is quite uncommon just because there's so much traffic everywhere. High speed connections usually have much lower rates of packet loss than dialup. This entire process works so fast however that even though you think you're playing a smooth game, packets are still getting dropped and despite the fact that this is happening, you can't tell Kaillera has stopped working for 2 milliseconds.

In addition, Kaillera implements modern technology which make UDP packet transmission much more reliable. But even with that, if your connection is bad, there's no magical way around it.

If your games keep getting choppy, check out what's going on with your internet connection. For instance, if you're in the middle of any file transfer while playing with Kaillera or are using other bandwith-eating applications.

(Back to the top.)

- What is the "connection" setting used for, and what should i put there?

You usually should leave it on its default setting of "Good". The "Connection" setting will tell Kaillera how many packets it will send each second. A rate of 20 packets per second is usually good for all types of connections. See the above entry regarding packet loss. If you send less packets per second, the connection will be more reliable and your game will be less choppy. The downside is that if you choose a connection setting too low, you may feel that it is too tough to complete complicated moves, such as those required in most common fighting games. The "Good" setting is truly and decent medium.

(Back to the top.)

- Help! My game goes out of sync (aka. desync)! Why?
(contributed by Mystiq)

Desync is a thorn in the side of playing emulators over a network. If you want to know why this also happens in PC games, keep reading this paragraph, otherwise skip down a bit. This also comes up in real time strategy games. For example Starcraft, those of you that play(ed) it, you know each player can have around 100 or more units, not to mention buildings, at once. Maybe each on screen "entity" takes about 200 bytes. That's 200 entities for each player, 4 kilobytes for those entities. If there are 8 players, that's 32k. Your 56k modem can not send 32 kilobytes per second reliably. In the game Black and White, you can have unlimited amounts of villagers. The more villagers, the more houses, food, wood, and prayer power you get. That's a ton of data that needs to be sent to EVERY player. Peer-to-Peer games do not usually send every single piece of data to each computer. Obviously, that would be too much data to send consistently, and quite a waste of time. So instead, they do something like what Kaillera does, send tiny updates.

In essence, Kaillera just sends keystrokes. The server you connect to is the host. NOT whoever makes the room for the game. Every key you press while playing is sent to the server you connect to and it then routes it back to you and to everyone else. Again, it does not matter who hosts a game, the playing experience on a single server will be the pretty much the same unless one player reconnects to their ISP.

When you press a key while in Kaillera, as stated above, it is sent to the server and sent to everyone else:

       - Player 1 
Server - Player 2
       - Player 3
If player 1 presses punch, it goes to the server, and then it follows the lines back to each player. If one player is experiencing heavy packet loss, all players stick because as mentioned in the above topic:

Kaillera waits for keystrokes. As you can imagine this is very unreliable. It's like telling a person to remember a sentence for you and you can tell them to go back and forward, delete words and add words. If one of you screws up going forward, back, add or remove and then you both write the sentence out, you get modified sentences. The result is one of you could still have the correct new sentence but since the other person screwed up, you are "desynced." This is exactly what happens with a desync. One of the players' Kaillera will "think" about something differently. It could also be caused by packet corruption that was somehow received, (though the likelihood of that is low, it does happen.) Since nothing but keys are sent, there is no way currently feasible to synchronize. One possibility that is being explored is to copy byte for byte the game's "state" from one computer to all the others. Technically you could "teleport," if you were playing a game like Dungeons & Dragons, to each other and you would be synched but usually it's not that easy. You could have different scores and stuff. This tiny update stuff is the blind leading the blind. Each client blindly assumes the other clients have exactly what it has. Usually this works. When there's a desync, it doesn't.

With the keystroke method the best way to check for a desync is compare scores. Tell each player your score and have them tell you what they see your score as. If it's different, you're desynced. You can also check to see if players are hitting air (note: they could just be drunk) or dancing ballroom style.

Packet corruption would seem the most likely culprit for desync. This is when somehow, over the network, the packet gets a bit or more changed in it. TCP/IP has a quick check I think and discards corrupted packets and doesn't send the ACK. UDP doesn't care, and just drops it. Corrupted packets are supposed to be dropped but it can be possible to receive a corrupted packet and try to use it. I don't think this happens often, however, it has been known that on early firmware versions, the LinkSys routers can corrupt packets. Usually corruption is faulty hardware. I don't know if this is the case, but if these corrupted packets are sent off as being correct, received and used, this causes HORRIBLY unwanted results.

(Back to the top.)

- I have only 56k/ISDN/DSL/CABLE. Will it be enough to play emulators online?

Yes. Kaillera has been designed to allow mostly everyone to play, even users with 56k dialup modems.

(Back to the top.)

- My server keeps crashing!

Kaillera is still constantly developing software. Some problems have been known to exist on some servers, however a majority of them do not have this problem. One suggestion is to chrontab the server and just restart it during non-peak hours.

(Back to the top.)

- When is the new version coming out?

We don't know. The developer works on Kaillera in his spare time. (His current employer, Nullsoft wants him to focus on the Winamp3 project, which he fully understands and does.) Right now, Kaillera may not be full-featured, but it works quite well. With exception to known bugs, there is not really any rush for new versions.

(Back to the top.)

-It seems like the Kaillera libraries are not open source. Is Kaillera going to be open sourced sometime in the future? Why is it not open-source?

Kaillera is not open-source right now because the protocol is always changing and evolving. We don't really want the code released to the public at this time due to people changing and compiling their own version s with a different Kaillera protocol. The impact this would have on the servers would be quite dramatic.

(Back to the top.)

- Wait a minute! I thought the MAME team said that every project based on it should be open source! It looks like the MAME version of Kaillera is in violation of the MAME license agreement!

No and no.

First, Kaillera itself is NOT part of MAME in ANY WAY, nor is it based on or contain any code from MAME. We do have a Kaillera-enabled version of MAME called MAME32k and its source code available for download on the Kaillera website. The MAME license does not say that every project based on it has to be open source. Furthermore, MAME is not GPL. Its policy just asks each "forked" project to change the name so it doesn't interfere with the MAME name.

Kaillera supports the MAME project! We enjoy and encourage its further development.

(Back to the top.)

- Why is there no Linux/Mac/etc. client port?

There are plans in the works to port the Kaillera client to Linux. Currently, we can not release any details regarding that project, and we still want to iron out all the bugs in the current client and server before the ports happen.

(Back to the top.)

- I want to integrate Kaillera into my game/emulator/etc. What do i need to do?

Download the Kaillera SDK available on the download page. Everything should be self-explanitory and contained within the .h file, but if you need some samples, we suggest you take a look at the source code from the integration of Kaillera into MAME32k.

(Back to the top.)

- Where can I download roms for my emulator?

If you use MAME with Kaillera, you can right-click on the game name while in the server chat room to automatically launch the appropriate page where you'll be able to see information for the rom that you would like. Unfortunately, no longer carries the actual roms, and we are unable to furnish further information as to where you can get them. We do suggest, however, that you search on Google for the roms that you are looking for. A little hunting goes a long way!

(Back to the top.)

- How do I create/run/configure a Kaillera server?
(contributed by toqer)

So you want to run a server! Running one off your dsl or cable modem at home is not going to be the best way to go. It will work, however you will find that you're quickly up against the limits of the technology.

Your best bet is to find a shell account. What is a shell account, you ask? Basically its a way of running stuff on a remote machine that is connected to large amounts of bandwidth. They vary in price. Usually, you can find one for about $15(US) a month. Call up your ISP and ask them if they offer shells. If they ask what you want a shell for tell them that you want to run a cgi shopping cart program, usually ISP's are very finicky about what runs on a shell because of all the 3r33t irc kiddies that run bots or eggdrops. Why do they care? Well many times a person running a eggdrop might have offended someone, in some way, and the only way to get back at them is to DOS (denial of service) the machine until it breaks and the bot disappears. Hence, the reason you don't want to tell them about running a Kaillera server just yet.

Now that you've purchased your shell account, you're probably wondering how to use it. First thing's first; make sure your isp gives you the ip or url for the shell server as well as your username/login. To get there, quickly just click on the Windows Start button, go to Run, and type in "telnet <>" (without the quotes) and click OK. Now, a window should pop up asking for your username and password. Enter those as given to you by your service. If successful, you're now in your shell! The built in windows telnet client is not very full-featured, we recommend using NetTerm. You can get NetTerm at

Most shells come equipped with lynx installed. Lynx is a text-based web browser. At the shell prompt type in "lynx" (again no quotes) and hit enter. Press G then type in Use the arrow keys to go to the different links, find the download page and download kaillera for Linux, BSD, or whatever OS version your provider's shell is running on. Save the file and press q to quit lynx.

Type in "ls" (no quotes) and hit enter. Hopefully you're going to see kaillerasrv.tar.gz. If so, go to the next step. If not, try and download it again. (Alternatively, you can download it to your local computer, then use an ftp program to transfer it to your shell.)

Type "tar -xzf kaillerasrv.tar.gz" and hit enter. You should now have a few more files in your home directory.

Next, type "chmod +x kaillerasrv" and hit enter.

Finally, type "./kaillerasrv" and hit enter. You'll see some stuff about touching the master server and so on. Congrats! Your server is working.

So now you've gotten it to run, but every time you quit your telnet program, your server dies. That's easy enough to fix. Instead of the above command, just type "./kaillerasrv &". The "&" makes it run in the background. IMPORTANT: If you get all the touching kaillera server crud on your screen just hit ctrl-c. Kaillerasrv will still run. Also, there will be a number given after you hit enter, that's the process ID. Make a note of it in case you have to bring the server down later. Alternatively you can use the command "top" to find the process ID if you forget/lose it.

If you decide you want to log the content of your Kaillera server, use the following steps to start your server.
First, type "touch kaillerasrv.log", hit enter. Then type "./kaillerasrv > kaillerasrv.log &". This will log your server's output to the kaillerasrv.log file. IMPORTANT: This method will make your log file grow VERY quickly. We suggest periodically clearing out the contents of your log file.

(Back to the top.)

- But my server says "unkn0wn serv0r" and only lets 10 people connect.

Do a search for VI faq on Google. (Pronounced vee aye, not vi! Some *nix diehards will take your firstborn child for making that mistake!) VI is much like notepad, a text editor. It's pretty daunting to a first time user, so you may be better off just opening the kaillerasrv.conf file in notepad, then ftp it to your shell account.

(Back to the top.)

- Other useful tips!
(contributed by toqer)

Having fun with a log file:
Ok I'm not a grep master, and I wont pretend to be one. Hopefully someone will contribute here, but here is some stuff I've done with it.

Count how many visitors you've had:
grep connected kaillerasrv.log -c

You can also redirect it into a text file:
touch count | grep connected kaillerasrv.log -c > count

That's useful if you want to have a web page with a count of how many visitors you've had. Poke through the log file, there are many interesting greppy stuffs you can do with it, only limited by your imagination.

"My log file is 80 megs and my ISP is pissed!"
There is a program out there called logrotate. You can run it as yourself. I don't think root access is required for it, but you will have to d/l it to your shell if you're going to use it. Basically it will rename kaillerasrv.log to something else, touch a new kaillerasrv.log and compress the old one on a scheduled time.

"Ok, it's been running for a few weeks now and I need to restart it."
Remember earlier when I said write down that number after you did a "./kaillerasrv &"? Here is where we put it to use:
kill 32134 <----put your own PID in
or you can do a:
killall -9 kaillerasrv

Another tip:
Making the Kaillera server something the ISP wants is easy. Just make sure you mention their name and URL in either the server name or location field in the kaillerasrv.conf file. Something as simple as "(hosted by myISP" would suffice. Most of the time, the shell admin is going to see the kaillerasrv process, then go digging around in your home directory to find out what it is. If they are smart enough to put 2+2 together, they'll see its for Kaillera, and they'll look at your .conf and log file. Once opened, they'll see that you've been giving them free advertising, and a ton of users have been seeing it. Hopefully, that'll be enough for them to leave you alone.

(Back to the top.)

(c) 2001, 2002 Christophe Thibault.
Some parts use the amazing JNetLib from the incredible Justin Frankel
Kaillera logo, page design and layout by Erik Winblad.
All Rights Reserved.