Home » Forum Home » Development

Topic: Dweebo's Development Notes
Replies: 7   Views: 11,404   Pages: 1   Last Post: Oct 14, 2003, 11:00 PM by: dweebo

Search Forum

Back to Topic List Topics: [ Previous | Next ]
Replies: 7   Views: 11,404   Pages: 1  
dweebo

Posts: 1,031
Registered: Dec 16, 2001
From: Powell, OH
Age: 37
Home page
Dweebo's Development Notes
Posted: Jul 20, 2003, 2:02 AM

Dweebo' Development Notes is a new thing I'm going to try, I'll post notes here on what I'm currently working on with the site and my more long term goals, etc.

Pente Rocks!


dweebo

Posts: 1,031
Registered: Dec 16, 2001
From: Powell, OH
Age: 37
Home page
Dweebo's Development Notes
Posted: Jul 20, 2003, 2:07 AM

New Table Handling

I am right now working on changing the way the tables are created and displayed. Currently there are 15 tables that are always there. We've never used that many up at once before, that isn't the problem. The issue is that it is possible for a player to hijack the server by joining all tables and making them private. Again, that hasn't happened yet and hopefully won't. But in the future that won't be a problem, because tables will have to be explicitly created by players. After that everything will be the same as before. I am also redoing the visual look of the tables display in the main room, but they will still look nearly the same. Mainly I'm doing this to better handle dynamically adding/removing tables, and also the tables could be easily sorted in the future, with players looking for matches tables at the top of the list (like Yahoo Games does).

The longer term goal of this dynamic table creation has to do with automated speed tournaments! Having the server be able to automatically create tables for matches is an important feature. I will detail more about automated tournaments in future posts.

Pente Rocks!
dweebo

Posts: 1,031
Registered: Dec 16, 2001
From: Powell, OH
Age: 37
Home page
Re: Dweebo's Development Notes
Posted: Jul 21, 2003, 10:41 PM

Well, I didn't think I was that close to being done, but these changes I just described are now up and running as of Sunday morning. I just had a few minor problems after releasing the code (always happens since I'm a lazy tester).

1. I didn't test until too late what happens when playing a computer and then leaving the table after the game. The table should be removed from the screen and it wasn't being done.
2. I was using the add() method in the Vector class, this is not compatible with java 1.1 (which is the latest version of java many browsers support and you don't choose to use the java plugin). Changed to addElement(). This was an easy catch because I now have code that reports client side java stack traces in certain cases. So I noticed it in the logs right away and fixed it.

Pente Rocks!
dweebo

Posts: 1,031
Registered: Dec 16, 2001
From: Powell, OH
Age: 37
Home page
Re: Dweebo's Development Notes
Posted: Jul 21, 2003, 10:55 PM

Improvements to Invitations and Overview of Automated Speed Tournaments

Currently the invitations are very basic, just a short message "player_xxx has invited you to table 1" with buttons for accept and reject. That is fine in most cases because it is easy to check the table to see what game is being played, the rated/timed options etc. and to also check the players rating if you're that kind of player , then decide if you want to accept or reject the offer.

If the site was popular enough, it would be better to include all that information in the invitation (game, timer options, etc. and player stats) since it would be harder to find the information elsewhere quickly. It would also be nice to allow the invitor to specify a short message, and allow the invitee to respond with a message (in the case of a rejection).

However, the real reason I plan on adding things like the above is again to support future automated speed tournaments. Perhaps a bit of background would help show my current thinking of how this will work.
1. Any user, or perhaps only certain users, would be allowed to create a new tournament and configure timers, type of tournament etc through a web page.
2. Users would then be able to sign-up for the tournament through another web page.
3. A little before the tournament is too start, a new link to the tournament will show up on the play screen. So there will be a choice of playing on the Main server, or on say Dweebo's Crazy Speed Tournament 17. So there will be a totally separate game room dedicated to the tournament.
4. Once in the tournament game room, the server controls most things, like players can't create new game rooms, and players can't change the timers, etc.
5. When a new match is to begin, a message will be posted in the main room and players will receive invitations to join a table. After playing the match the table will be closed and after all matches are done the next round will begin. Finally, after the tournament is over, the whole main room will be closed.

So you can see now how having dynamic table creations and improved invitations are necessary in order to support my plan of automated tournaments.

Pente Rocks!
dweebo

Posts: 1,031
Registered: Dec 16, 2001
From: Powell, OH
Age: 37
Home page
Re: Dweebo's Development Notes
Posted: Jul 22, 2003, 5:36 AM

Another bug was found by our extreme testers partica and progambler who found that after exceeding 15 tables problems occur.

I should have checked this of course! But I was so confident in my code I overlooked a few things. I have fixed the code and will release it tomorrow hopefully....maybe I should test it a bit more

Pente Rocks!
dweebo

Posts: 1,031
Registered: Dec 16, 2001
From: Powell, OH
Age: 37
Home page
Re: Dweebo's Development Notes
Posted: Jul 25, 2003, 9:16 PM

So I started down the path of figuring out what I needed to do to improve the invitations and realized that I really needed to implement another idea I had.

Background: currently when a player joins the game room, only their name and the color of their name is sent from the server to clients. That is all that is really needed. One other piece of information would be nice, and that is what the player type is (human or computer). This is needed by the invite dialog since you can't directly invite say mm_ai1 if they are in the main room (you have to invite it by filling in the computer options). There is also a bug in the invite/boot dialogs where a players color could be lost in those dialogs in certain cases.

It has been an idea of mine all along to send ALL player data from the server to clients instead of name and color. After I started down this path I ended up fixing a number fo other small issues at the same time which is nice! There are also some other nice improvements as well, such as player stats are now displayed much quicker (since they are cached locally) and even cooler, if you have the stats dialog open and a player's stats changed (they finish a game) the stats dialog will update automatically, you don't have to close and reopen). The dialog also will not close and reopen when you view stats for a different game for the same player, and the dialog will be positioned over the table you're currently in (there was another issue where the stats dialog would always open over the main room, not the table you're currently in, that has been fixed as well). These changes really offer the client program more flexibility, and allows future changes to be made more easily. The next step is to improve the invite dialog to display the players stats.

At the same time I've noticed/fixed a few other small issues. Thanks to up2ng for pointing out that there was an issue with the timers after restarting a non-timed game, that is now fixed. Also fixed an issue with computers hanging around in tables by themselves after cancelling a game due to player being dropped by the server. I also have added messagse to the main room whenever a player enters or leaves the room.

Hopefully I have tested everything well enough this time, I will put up the changes maybe tonight or tomorrow.

Pente Rocks!
dweebo

Posts: 1,031
Registered: Dec 16, 2001
From: Powell, OH
Age: 37
Home page
Re: Dweebo's Development Notes
Posted: Oct 8, 2003, 8:26 PM

I have been absent from DSG for awhile, too busy with school, work and other stuff. I also just discovered a cool site where you can compete against other programmers on solving small problems, its like a pente.org but for programmers and is very addictive! Check it out at http://www.topcoder.com/.

I can't even remember where I left off last, but I think some of the last changes I made are causing a few synchronization bugs. Also, there are now frequently problems with accessing the database, this is probably just growing pains now that there are so many games in the db, haven't figured that one out yet. Maybe I'll have time in the next 2 weeks to look into a few of those things (just had test last night and no class for 2 weeks now!).

-dweebo

Pente Rocks!
dweebo

Posts: 1,031
Registered: Dec 16, 2001
From: Powell, OH
Age: 37
Home page
Re: Dweebo's Development Notes
Posted: Oct 14, 2003, 11:00 PM

Well, I'm happy to report that I have made some progress in fixing several synchronization bugs (the nastiest kind).

Yesterday I started by focusing on trying to resolve weirdness issues with the creation of new tables, joining tables and small table display bugs. I sort of figured it all had something to do with the code that handles creating tables, I never was too sure about the thread safety of it. Anyways, I beefed it up and thought I'd see what happened. I also ran across some code I had worked on a few months ago but which didn't make it up yet (stuff to store cookies so that they can be used when logging into both http://pente.org/ and http://www.pente.org/ and some other minor stuff). Then I fixed the display of tables, the jumbling of timer/rating info. Finally, I decided it was high time I updated the database. I went from mysql 3.23.49 to 4.0.15 and also upgraded the jdbc drivers, maybe that will help some of our data corruption problems...probably not but it's worth a shot. So I put all of that up and everything crashed in a few hours. shucks.

Round 2. Today I did things the easier way and built me a little test client that fires up a bunch of threads to simulate different users and had each one start logging in and creating tables and sitting, etc. I quickly found the synchronization problem I was looking for, I made it worse yesterday not better! I then found more problems, yippee! One has certainly been around for a long time, but I'm not sure how often it was actually a problem, anyways its fixed now. Then I also found more bugs with those blasted timers, those suckers are always acting up. I found that a bunch of them were not getting destroyed when tables were no longer in use and they kept piling up. This might have been contributing to the memory problems, etc. I think it should work now. I also found a 1/2 solution to another problem that takes down the whole server every once in awhile. Sometimes I get a timer that keeps timing out, so every second the server starts to end the game, but then it realizes no game is in progress and stops. Then a second later it does it again. I still haven't found how the timer is staying alive, but now at least it will die after the first timeout and hence not kill the server.

Lets all hope that round 3 doesn't come so soon...
-dweebo

Pente Rocks!
Replies: 7   Views: 11,404   Pages: 1  
Back to Topic List
Topics: [ Previous | Next ]


Powered by Jive Software