30 April 2007

The new bags system is on

Last night we had a server update to include a new sword, some new books, and the new system of sending the bags to the players (I mentioned it a few posts ago).

It seems that the impact on the bandwidth is significant, the traffic going down by about 10-15%. For the people with dial up connections, the maps should load much faster, because instead of getting all the bags on a map at once, they get only the bags in their visual range. And a bag that was once seen will stay on the client until the bag dissapears (times out or is emptied), which takes care of sending a lot of bags when going back and forth an area with lots of bags.
In addition to that, some bandwidth is saved because when a bag is placed, only those nearby will get the message, rather than everyone on the map.

This allows us to have dynamic maps (the cities, in the future) without using more bandwidth than we used prior to this update, for the same number of players online.

29 April 2007

EL Age Demographics

Someone made an age poll on our forums, and the results are pretty interesting.
As of the time I am posting, it will seem that people over 20 outnumber 2 to 1 those under 20.

between 5 and 10 [ 0 ] [0.00%]
between 11 and 15 [ 33 ] [10.00%]
between 16 and 20 [ 74 ] [22.42%]
between 21 and 25 [ 57 ] [17.27%]
between 26 and 30 [ 47 ] [14.24%]
between 31 and 40 [ 67 ] [20.30%]
between 41 and 50 [ 39 ] [11.82%]
between 51 and 60 [ 9 ] [2.73%]
older than 61! [ 4 ] [1.21%]
Total Votes: 330

If we assume that half of those between 16-20 are over 18, then only about 21% of the players in our game are minors.

This is not so surprising, a lot of kids come in the game only to start yelling "OMFG THIS GAME SUCKS!!1!!". Older people are less likely to do that.

26 April 2007

Huge Yahoo Mail Security Problem

Today, for the first time in about 10 years since I am online, I almost got phished.

What happened was, while checking my yahoo mail, I got a message in my inbox (as opposed to the Bulk folder). So, as any other person would do, I opened it.
It was a message in Romanian, along the lines: "Hey, how are you, long time no see".
It was kind of strange, because I didn't know that person, but since there was no advertising or anything I figgured that maybe it's some old friend I forgot about, so I copied the address and pasted it to the Search box, to determine if I had previous messages from this person.

At that moment, I got redirected to the Yahoo log in page (or so I thought).
The URL was: http://us.f237.mail.ymauth.com/login_verify/?Y=someid

Now, that didn's look suspicious for the following reasons:
1. It looked like the Yahoo log in page.
2. My session was about to expire.
3. It had my username there (so I guess the phisher had unique IDs for each username he sent the phising to)
4. I didn't click on any e-mail links (I thought that I must have accidentally perform some Opera gesture like the back button, and my session just expired).

So I innocently typed my password, then Opera asked me if I want to save it...
Oops. Not good at all. I immediately closed the browser, hoping that the password is sent only after telling Opera whether to remember it or not. Then just in case, I quickly changed my password and forwarded the e-mail to the Yahoo abuse team.

Now, I admit I had some fault in this too, I should have looked at URL location as well. However, I think the biggest problem is with Yahoo, by not doing a proper sanity check of the e-mail (for example, anything that changes the URL without the user's permission should not be allowed).

I was lucky this time, but many others might not be so lucky.
And since a lot of people have all kind of passwords associated with their Yahoo accounts, prepare for a new wave of internet fraud (especially eBay and PayPal).

P.S. Here is the content of the e-mail: http://&/#x77;ww.custodia.it/images/custodia2/us/?id=removed&val=open&cookie=

I tried some online URL decoders but couldn't decode it properly, and I am too lazy to decode the whole thing manually.

23 April 2007

New bag bugs

A few weeks ago, I thought I finally fixed the last problem with the bags.
In case you don't play the game, the problem happens when you open a bag but can't get its content.

There were two other problems with the bags, which were fixed in the past, and I thought that this problem was related, so fixing those two bugs would fix this one as well.
One of the bugs was with the client, and when people still reported the problem, I dismissed it to them not using the latest CVS.

3 days ago, I was testing the new way of sending the bags to the client, and specifically asked everyone that wants to help to come on the test server ONLY with a recently compiled client from the CVS.
Some people reported a few issues with the bags, so in order to check if the problem is with the new way of sending the bags, I switched back to the old way, and people still reported issues.
Based on those reports, I added additional debugging code on the server, which pinpointed the problem: The client was sending spurious "close bag" messages.

The client is supposed to send a "close this bag" message only when the player presses the "x" button on the bag window.
However, the client code has been buggy for like 3 years, and it was sending that message each time the bag was closed, regardless of the way it was closed.

So this is what happened:
1. Player opens bag.
2. Player moves to another bag.
3. Server detects the move, and closes the bag the player has open, sending a "close bag" message to the client.
4. The client gets that message, and wrongly sends a "close bag to the server".
5. Sometimes: LAG
6. The player moves to another bag and opens it.
7. The server finally gets the message from the client: "close bag" (step 4)
8. The server closes the NEWLY opened bag.
9. Player tries to get the items from the bag.
10. Server sees that the bag was closed, and will not allow the client to get items from it.


Learner fixed the client bug, but we are having some problems with the CVS which is not working for most of the team members (server won't authenticate them).
Hopefully by tomorrow we can test the problem again, and put an end to a 3 years old bug.

15 April 2007

Behind the scene changes

There are a lot of "behind the scene" changes in a MMO server.
For example, one of the things I don't like about how the EL server handles stuff is the way it sends the bags to the players.
Right now, whenever you enter a map, the server sends you ALL the bags on that map, which is a waste of bandwidth. Each time a map is added or destroyed, the server sends that message to everyone on the map, which, again, is a waste of bandwidth, and it is a minor security problem. For example, I am sure that there are some modified clients which scan for such messages, and can tell a player if a spawn is taken or not from the frequency and location of those bags. (If you are a 'hax0r' and think that it would be a good idea to implement this in an illegal client, don't bother, it will be fixed soon.)

The cheating potential is relatively minor, which is why I didn't really bother to fix this problem. A fix is pretty time consuming, so I always did other things instead.

This is about to change, however. Before the Engineering skill, the problems were: extra bandwidth + slight cheating potential.
Now that we plan to add land mines, and later on the player built city stuff, we need a more flexible way of determining what a player sees in terms of dynamic map stuff (dynamic stuff includes bags, mines, and city buildings).

So what I need to do is actually add a mechanism similar to the code on how a player sees another player.
Each map has a list with all the bags that are on that map. Soon there will be another list for the mines, and later on another list for city objects.
Then there will be a super list that contains all those other lists, with an index to point out to the actual object (the actual bag, building, etc.), object type (bag, mine or building), it's location, and some other data.

Then each player, whever they move one step, will go through that super list and determine what objects they can see, and only those objects will be shown. That list will be cached on a per player basis, to speed up the processing.
Speaking of processing, this new system will increase the CPU usage by maybe 20%, but that's OK, because right now the EL server usually runs at 10-11% of the CPU, so with those new changes it will run at under 15%. Even with an estimated 1.5K players online, we should still have plenty of CPU left.
Furthermore, the whole calculation can be done in parallel with the player vs. player seeing distance calculation, since this two routines do not depend on eachother.

09 April 2007

Bug fixes and a feature freeze

The client is in a feature freeze, meaning that no new things will be added until after the update, and the focus is on finding and fixing bugs.
There are a lot of changes in this version, such as finally moving to a more optimized object format, compressed maps and objects, using the zlib library, much better special effects, a few bug fixes from the previous versions, and so on.
The problem with so many new things (submitted by many contributors) is that there are new bugs, which need to be found and eliminated before we release the update.
After all the known bugs are fixed, we will release a Release Candidate (RC), and invite people to try it and report problems. After the problems have been found and fixed (that can take from days to weeks), we will release another RC, until no serious bugs are found, and then we will proceed with the client update. Hopefully it should be ready by mid May.

Speaking of bugs, we had a few small bugs on the server that were relatively harmless, but sometimes annoying.
One of those bugs was the fact that when trying to open a bag or enter a door from a distance, you would stop just on top of the bag, or near the door, without opening the bag/entering the door. This didn't happen too often, and was impossible to reliably reproduce on the main server. On the test server, it just didn't happen at all.

Debugging a MMO server is very difficult, because you can't just use a debugger (imagine a break point being triggered late at night, when no developer is around, and have the whole server frozen until me or Learner check the debugger Window).
So since hardware break points are out of the question, and the bug was not locally reproducible, I had to write a lot of logging code, to log various function parameters and see if certain pieces of code are executed.
In pseudocode, it looked something like this:

function()
{
some code
log if the program got here
more code
log if the program got here
call some function
log the returned parameters from that function
}

Eventually, me and Learner narrowed the problem to two functions, but we still didn't know what's wrong, so even more debug code was needed. I went as far as placing software 'hardware' breakpoints, such as a piece of code to constantly analyze a variable and see if it changed when it shouldn't (I was fearing some buffer overflow destroying some variables).

Eventually, it turned out that the problem was a return in a for loop. I should have used continue instead :/ And this bug has been here for almost 4 years...

Well, at least that bug is fixed now. Another bug that is fixed is the possibility of getting two bone stacks instead of one, when taking off an equipped bone. Again, not really a big deal, but sometimes a small bug can hide a bigger one. It turned out that there was no bigger bug, and due to the fact that someone was able to reliably reproduce it, I managed to fix it pretty fast.

03 April 2007

Our 1 week vacation

I live in the US for 4 years, and this is was my first vacation here (my previous ones were to Romania).
We went to Orlando, Florida, and I must say that I was very impressed with everything there.
Florida is a very nice place, and Orlando is even nicer, being built from scratch as a tourist place. They have good public transportation, restaurants and fast food places everywhere, and anything you need in a walking distance.

We visited Disney World (MGM and Animal Kingdom), and SeaWorld.
If you haven't visited them, and you have the opportunity to, I highly recommend them, especially the Animal Kingdom and SeaWorld.

As with any tourist, we took a lot of pictures. You can see some of them here. I will add more soon.

One would assume that a 1GB XD card is enough for a whole trip, but with a 7 MP camera that wasn't the case. The XD card could store something like 250 pictures at the max resolution, and there were days when I filled the whole card in just a few hours. The reason I needed so many pictures is the fact that the camera we have takes about 1 second to focus, so since the time you press the button to the time it actually captured the photo you have to wait about 1 second, then another few seconds to save it to the memory card. This leads to a lot of missed shots, especially if you want to capture a particular moment, such as when a dolphin is in the air or when a fast paced stunt is performed. The only easy to mitigate that problem is to take a lot of shots, hoping you will get lucky and some of them will capture what you wanted to.

My new laptop was very useful during this trip. Besides for downloading the photos on it so I can free the XD card, I used it for e-mail, Skype, news, reading the forums, and even delivering some items in the game. It is the first time I am taking a laptop with me on a vacation, and it proved to be very, very useful. I am definitely going to take it with me next time I go somewhere. The only downside of having a laptop with you is that you will not relax 100%, and you can't help from doing some work, which will sometime defeat the purpose of going on a vacation :)