Wednesday, May 30, 2012

Server network architecture

The client will communicate solely with an Apache HTTPD configured as reverse proxy. This server is the only machine exposed to the internet. Depending on the request URL it will forward the client requests to the webserver serving the official website, the game content webserver or the gameserver.

WebSocket is supposed to work through proxy servers which aren't aware of the websocket protocol. I just hope that's also the case for Apache HTTPD's mod_proxy_http.

The gameserver pulls the game content it needs from the content server using NFS. Having the client and the server game data in the same location makes maintainance a lot easier, because I don't have to worry about what's client-sided, what's server-sided, what's shared and if they are in sync or not.

The website webserver runs on a LAMP configuration. It also has access to the game database running MongoDB. This will allow integration between the game and interactive parts of the website. This could be used for sharing user accounts between game and website, user-pages showing character status or real-time game statistics on the website. The website will also likely need a good old MySQL database for 3rd party components like a forum, a CMS or a blogging software - also I want to separate the website data from the game data where possible to avoid game and website DOSing each other.

These five servers will run virtualized on the same machine at first. I will then put them on separate physical servers when necessary. Should these servers become overstressed, Apache, MySQL and MongoDB can already be sharded when necessary. My gameserver can not be sharded yet, but I designed the server architecture in a way which will make it easy to add support for this later.

Tuesday, May 29, 2012

Hotkey bar

The hotkey bar and the drag&drop functionality from the spell window for it work now. There is a bug in jQuery which breaks the drop functionality when the draggable icons in the spell window are recreated. This happens whenever the spell windows content changes. I will have to find a workaround for this issue somehow. But this can wait until Milestone 9 when this can actually happen while playing.

A problem is that the icons for all spell levels look the same, so they are hard to tell apart in the quickbar. But that's a purely content-sided problem. I can easily change the actions.json on the server to tell the client to show a different icon for each spell level.

Before I close this milestone I want to look into adding tooltips for the spell icons to show some more of the spell information available to the client.

Monday, May 28, 2012

Spell Window

The new spell window with some cheap, pillow-shaded spell icons. All data in this window is received from the server (icons as filenames). The server gets the spell data from a JSON file and the spells available to each character from the database. This information is now also used for spellcasting and damage calculation on the server. The only problem is that there is no way to change the available spells except for hacking them into the database. This will have to wait until scripting in Milestone 9.

Next will be the ability to drag&drop those spells into the hotkey bar to cast them. Then Milestone 6 will be history.

Wednesday, May 16, 2012

Roadmap updated

While I ported the client from Metro to HTML5 I  lost track of my roadmap. I implemented some features which were planned for much later milestones (like some steps into the direction of inventory and item management) while forgetting about things which are much more important in the intermediate future. Time to get my priorities straight again.

Milestone 6 (growth):
  • Flexible GUI infrastructure
  • Character system
  • EXP gain and leveling
  • Increasing base attributes
  • Combat mechanics
  • Mana points, mana regen and mana use 
  • Spellbook
Milestone 7 (opposition)
  • Monster database
  • Monster AI
  • Spawn areas on maps
  • Character death and respawning
Milestone 8 (wealth):
  • Items and Inventory
  • Player trading
  • Shops
Milestone 9 (adventuring):
  • NPC interaction
  • Scripting
Milestone 10 (security):
  • Permission management
  • Database logging of
    • Logins
    • Administrative actions
    • Usage statistics
  • Logins
  • Brute force protection
 Milestone 11 (eye candy)
  • Animated sprites
  • Animated tiles
  • Particle effects

Rest of Milestone 6

  • Move hit points to game system
  • add mana points, mana regen and mana use
  • Store spell palette in the database
  • communicate spell palette to the client
  • drag&drop spell palette to hotkey bar
  • save hotkey assignment server-sided
  • monster database storing monster stata
  • monster ai implemented using strategy pattern (movement strategy and attack strategy)

fuck those monsters - that stuff goes to another milestone.

Tuesday, May 15, 2012

Exp progress in status window

I added progress bars for exp to the status window. In order to do so, I "objectified" the progress bars, so I can reuse them for other things.

Saturday, May 12, 2012

Window managing

I created a simple window managing system. A button bar in the upper right corner can be used to show and hide windows. Every window got a header bar with a close button which hides the window.

Friday, May 11, 2012

Status window

This is the new status window. Unfortunately it isn't updated in real-time yet. The server only sends an update on login. But when I teach the server to do so, the client will be able to handle it. Whenever something changes, the server sends an update which only contains whatever changed.

Thanks to jQuery, it is drag-able across the canvas. I also used jQuery to make some other parts of the client code more readable.