Monday, March 31, 2008

Fish in the water

I have just deployed the "real" logic for Torpedoes. This should make them a lot more deadly (maybe too deadly, but we'll see).

They still won't be much good against fast ships, but they will be quite a worry for large ships. Torpedos have a 360 degree field of view, so you cannot break their lock by out turning them. They also have an infinite lifespan, so they will never run out of fuel or self destruct (all the other missiles self destruct after 30 seconds or so).

They are still affected by decoys, but only temporarily -- torpedoes are the only projectile that can aquire and re-aquire its own targets. Even if its target is destroyed, it will search and prioritize nearby targtes and go after one of them.

Basically, once a torpedo is launched, it *will* hit something eventually. There are only two permanent defenses against torpedoes:
1) other ships. Another target that flies near to the torpedo may be too much temptation for it to resist, so it may pursue this new ship instead of its original target. So you can sacrifice a lancer to save your DCD for instance.
2) Mine fields. Torpedoes can hit mines just like anything else.

Another difference from regular missiles: torpedoes are launched at their top speed -- all other missiles are launched at a relatively slow speed and then they accelerate from there.

This change will affect new games starting from now. As always, let me know what you think.

Friday, March 28, 2008

Don't Panic

Your ships and all of your games have disappeared. This time intentionally! I have deleted all the game data except for the players statistics (Command Points, wins, losses, etc.). Everything else is gone.

This was needed because I had to redesign the data storage for the entire game. This site started as an experiment in game logic and I wanted to see if it was possible to set up a web based game and get players to show up. I spent an absolute minimum amount of time in designing/coding things that didn't affect the "game play". I also did not know what kind of restrictions I would be under with a hosting partner. I wasn't sure if a Microsoft SQL or MySQL database would be available. So everything was just stored in XML files on the server. This works fine, but it is slow and very inefficient with disk space.

Now that the game is playable and we have players showing up every day to play it, it was time to address that shortcoming. So I moved everything to a Microsoft SQL database and the only thing still saved to XML files are the "archived" game turns. Each turn is saved so that you can go back and review past battles and/or study your opponents. Since performance isn't an issue, that data is stored as XML and compressed to the file system. Everything else is in the database.

This should make the game more scalable for the future as more players sign up. It should also help eliminate any data corruption bugs that we might otherwise have seen.

So I am sorry about any games you had in progress and about your ships. But you can now rebuild your fleet and start new games. Hopefully there won't be another data wipe needed.

All Command Points have been refunded. Any that you have earned in battle, you still have, so you are not completely back to square one.

In addition to the data wipe, there are a few small game play changes:

1) When a player joins a game you started, you will get an in game message.
2) The heavier ships now carry heavier weapons. There are now three classes of missiles (Falcon, Hawk and Eagle) and three classes of mass drivers (Mk I through III). The higher classes are more maneuverable, faster and hit harder. This should increase the value of the heavier ships.
3) The MCC has been nerfed a little bit. Its triple missile launcher has been replaced by a double and a little bit of weight has been added.
4) The cruisers are now a bit faster as I added engine power to them.

So the heavier ship classes should feel very different and their weapons should be more potent.

Enjoy, and as always -- let me know if you see any bugs. This is a *HUGE* change in the code base and it was designed to solve some bugs we were seeing, but it is very likely to have introduced some new ones.

Sunday, March 23, 2008

And they're back!

The in game and lobby chats are back online. This also means that the "player status" indicators in the game client are back and working. So you can play a game with both players online now and everything should work as normal.

Saturday, March 22, 2008

Chat(s) down

The lobby chat and the in-game chat are both down right now. This will also affect the "traffic light" status indicators in the game.

The problem is that the client and the chat server are written with a beta version of Adobe Flex. Well, Adobe just released the final version of Flex this week and for some reason, they decided it would be a good idea to kill any application using the beta. So the chat server had to be rebooted and now the server software won't run saying the beta is expired.

I have the final version now, but I will need to update the game client, the chat client and the chat server. It is a bit tricky to update anything right now because I am in the middle of porting the game data storage to a database. This involves changing a lot of the data structures in the client and the server. So I am not sure when I will be able to fix the problem.

You *should* still be able to play games in a turn-based manner. But if you and your opponent are online at the same time, you will not be able to play or chat properly because when you click "ready" on the status indicator, his game client will not get the message, so the game will not advance.

So please hang in there. Sorry about this!

Wednesday, March 19, 2008

Don't hold your breath

There haven't been any updates in a week (since the release of mine fields), and there probably won't be for close to another week. This is because I have decided to rip out a lot of the guts of the game engine.

When I started writing Fleet Combat Online, I didn't know if I would actually release it or not. It was just something to play with and see where it went. Since it was just an experiment, I didn't bother using a proper database for storage of game objects and the games themselves. All I did was put in a quick mechanism to serialize the game data to XML and save that XML to a file. It was super quick to code (a couple of minutes) and it worked.

But now that the game is up and working, that isn't a solution that is going to fly for very long. So I am porting the storage of the game data over to an SQL database instead of using XML. The "ships vanishing" bug and the "stuck game" bug are both due to the XML file storage issue. Storing things as XML files is slow and unreliable compared to a database and it is this that has caused some of these bugs. The "stuck game" bug mostly happens when two or more game clients call the server and ask it to process the turn at the same time. Since there is latency in reading/writing to the file system sometimes those different requests step on each others toes. With a database, the game record can be properly locked while the turn is being processed. Then when the turn is done, all the clients will be informed and get the latest game data.

Anyway, it is quite a bit of work (which is why I didn't write it like this in the first place) so it will be a while before it is ready. I haven't decided if I am going to go to the effort of making it compatible with the current game data. If I don't do that extra effort, then all current game data (games, ships, etc.) will be incompatible. So there will be a game wipe in that case. Player information is fine as that is already stored in the database. But game related data might go bye bye.

Wednesday, March 12, 2008

Deadly Space

I predict that the Columbia Class Corvette and some of the larger ships are going to get a bit more popular...

I have just deployed a major change that enables mine fields. Up to now, the mine layers have been pretty useless because they haven't created proper mine field. But now they do and they are quite deadly. Please read this wiki article about mine fields as I think it will have a big impact on tactics and fleet composition. Two highlights: mine fields are almost invisible to your enemy, and mine fields have the potential to stop incoming missiles. This change will affect games in progress.

Other changes in this release:
1) reduced some of the "message spam" in the game client. If your helm is damaged, you won't hear about it a hundred times each turn. You will now get one message saying how far off your helm might be (of course you don't know exactly, because its damaged). Same goes for engine damage that limits your speed. Note: if your engines go offline or your speed is limited to a slower speed than you are currently travelling, your ship will not just suddenly stop or suddenly be going the new limited speed -- it will slow down to that speed (or to a stop) gradually.

2) You will now get a message about each subsystem that is damaged by a hit so you don't have to go to the damage control panel to see. The message will tell you how badly damaged the system is or if it is offline.

3) Fixed some bugs related to subsystem damage

4) Hopefully fixed a bug where the turn would not advance -- the timer counts down and the screen refreshes and your status is set back to "not ready", but the turn did not actually advance. This one is kind of tough, but maybe it is fixed now...

5) Fixed a bug where you set your status to "ready" and then a second or two later, it reverts back to "not ready".

6) Fixed a bug where you could assign more ships to a battle than the CP Limit for the game would allow.

7) Implemented data compression on the server. Each turn of a game is about 100KB worth of data. Games seem to take about 100 turns and all turns are kept (so that you can review past battles). So the amount of space used has been adding up and reaching my hosting account's limit. Increasing that limit is surprisingly expensive, so hopefully the compression will help...

8) When setting your initial orders for a battle, the "heading" will automatically be set based on what "approach" you have set. So if you choose to approach from 090, then your ships heading will initially be set to 270. If you approach from 180, then your heading will be 0. You can of course change this, but this will help eliminate the mistake of entering the battle facing backwards.

Friday, March 7, 2008

Damage

I have just deployed a change that enables damaged subsystems. Well, the subsystems have always taken damage, but it had no effect until now.

When a subsystem is damaged, its performance will be affected proportionally. So if your engines or your reactor is damaged by 50% then your ships top speed will be reduced by 50%.

If your weapons are damaged, there is a chance that they will misfire. You should get a message when a turn is processed if anything was affected by system damage.

I will be adding more effects soon like engine damage hurting acceleration as well as speed, etc. So just keep an eye on those messages and make sure you assign repair teams to fix the problems as they come up.

This should also help reduce the effectiveness of the Lancer Scouts as they are too small to have repair teams. So if they are hit and they sustain damage, they may lose their engines or weapon permanently.

Thursday, March 6, 2008

More Fan Requests

I love my people, so I do what they ask :)
I have just deployed the following changes which pretty much all come from player requests:

1) Spectator mode is now complete. When you are at the game detail page and you are not playing in that game, there will be a "Watch this game" button. Clicking that will launch the game client in spectator mode. The ship control panel will be gone, but everything else is functional. When spectators join a game, a message will show up in the chat window announcing it. Spectators can chat with the players and vice versa. If I get complaints about spectators griefing players, I will add a feature to mute or kick spectators. But for now I think it is a nice feature to chat with your audience. This works by the way for old games too. If the game is over, you can still watch it and use the VCR buttons to go back to the beginning and watch the battle from the start.

2) When you enter the game client, the chat window will tell you if other players are online. Before, if player A was online and then player B came online, player A would get the message "player B is online". But player B, having come online later would not be told that player A was there. Now when you login, you will see a message telling you who is already online in that game.

3) There is now a "Turn Deadline" feature. When you setup the game, you can choose to have a deadline or not and set it to between 1 hour and 1 week. This is so that if one player goes inactive during a game, the other(s) can keep playing. Obviously, the inactive player is going to lose, but at least it doesn't cause the game to sit there forever waiting for that player to come back. After the deadline passes, any player that logs in to the game client and sets their status to "Ready" will trigger the next turn whether the other players are ready or not.

4) There is now a "Cancel Game" button on the game detail screen. This is visible after you have created a game, but before you have clicked "Start Game". So if you created a game and no one ever joined, you can cancel it. Once it is started though, you can't cancel it.

5) The "Online Now" and "Last Activity" features on the browse player screen are fixed. I still have that time-zone issue that I haven't fixed yet, but at least it accurately shows if someone is online right now or not.

6) There are now Zoom In and Zoom Out buttons in the game client. You can zoom in and out best with the mouse wheel. But if you don't have a mouse wheel, there are now small up/down buttons next to the scan range box that you can use instead of having to type in ranges manually.

Thanks for all the suggestions! Please keep them coming, the more you ask for, the more I will do :)

Tuesday, March 4, 2008

Stupid Rotating Earth

If you haven't noticed by now, FCO has a bit of an issue with time zones. In theory, the technology I am using (ASP.Net and MS SQL 2005) should take care of that automatically, but it clearly isn't. Maybe it has something to do with bits of the application being in California and some bits being somewhere in Canada that is in the US Central time zone.

This is why when you go to the "Browse Players" page you don't see anyone listed as "Online Now" -- not even yourself. Because the server thinks your last activity was 8 hours ago or something.

Anyway, I am going to be trying to fix this. But for now the "Online Now" feature will be pretty unreliable. As will the dates and times of messages you receive. Oh, and forum posts. Basically just any Date/Time you see on the site is complete BS. No biggie though. :)

Monday, March 3, 2008

Major Update

I have just deployed some changes. Some of these were suggested by users -- thanks JinnTann and 123 (whoever you are).

Here are the changes. Please let me know if any bugs have been introduced with this deployment:

1) There is now a "Browse Players" link on the left hand menu. You can see all players and click into their profile. In the future, there will be a search here, but it is not needed with the measly number of users we have now

2) There is a "Send Message" button on the player profile page.

3) The player proflie page shows the players battle history.

4) On the battle detail page, the invite users box now only accepts one user at a time. This was to allow it to have the user-name autocomplete feature like when you are composing a message. Now, just type one username or email and click invite, then do the next one.

5) There is the *beginnings* of a spectator mode. Once a game has begun, if you are not in the game, you will see a "Watch this game" button on the battle detail screen. Clicking that will take you into the game even if you are not in the battle. The game interface doesn't yet account for spectators, so some funny things might happen in the game interface, but it should work for the most part, but I have not tested it. I will be making changes to the game client to support specator mode soon.

6) There is now a "Surrender" button in the game. Clicking this will remove your ships from the game on the next turn. If it is a two player game, the game will end. It will count as a loss for you.

7) If all ships are out of ammo, the game will end. This will count as a "win" for both players since each player had surviving ships still in the game.

8) Command Points are now awarded when a battle ends. This is highly experimental right now, so it may change in the future. The amount of points you get is equal to the average CP of all the ships in the battle -- the bigger the ships are on average, the more CP you will earn. If you lost the game, you will get half of this value. If you surrendered, you will get one third of this value. Some of you are owed CP from battles that ended before this. I will account for that later once I see that this award system is working OK.

9) There are now AI players in the game! You can play by yourself against one or two AI players, or you can invite AI players to a game with other people. AI players work with all the same restrictions of normal people in the game. To play against the AI, just invite an AI player to your game. Their names all start with "AI". So type "AI" into the invite box and the auto-complete should pop-up with all the AI players. Pick one and click the "Invite User" button. The AI will join your game and set his initial orders.

10) The in-game chat and the chat lobby have been improved a little. There should be no more problems with text wrapping or other glitches.