Debug server

So, in the previous post I mentioned debug server and only realised now that I haven’t blogged anything about that yet. So, off to fix the situation.

Debug server is really simple website, hosted directly inside of the game. This is done by running web.py. User can connect to it simply pointing his web browser to http://localhost:8080/ (port can be changed from command line when starting the game).

Server so far has 3 pages: player character, map, factory. Player character simply shows status of player:

Name Adventurer
Body 6
Mind 8
Finesse 7
Speed 2.5
Hit points 9 / 9
Location (21, 12)
Inventory
light mace
Weapons

Map shows simple ascii presentation (hadn’t had time to figure out how to serve dynamic images) of the map, which is useful when trying to locate stairs to next level or quickly viewing how level generator works.

Third page, factory, is the latest addition. Player can use it to spawn new enemies. This way he doesn’t have to go hunting that special, super-rare monster just to see if it works as designed.

In the future, I’m planning on adding more interactivity on the server, like generating items and manipulating the player character. It is pretty error prone currently, because it’s “good enough for now” and “designed for people who know what they are doing”. In the future this won’t be enough, so I need to add proper error handling, help texts and such there.

Having debug-server is really nice. It makes viewing and manipulating the internals of the game simpler and you don’t have to play around with debuggers. Of course it is much more limited, but for person who doesn’t want to fiddle with technical things, it might be a really useful.

Btw, I got the idea for this from FlightGear, which is really outstanding open source flight simulator.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s