More Fixes To File Loading

July 3rd, 2009

A week ago I wrote about Mono not being happy with XmlElementAttribute.  I had cleaned up loading/saving for players and zone files, but skill and spell data needed some work.  I took care of that today, so all of the xml serialization is happy now.

I’ve hired the wife as a QA tester to do some preliminary “how broken is it” testing so I know what needs to be fixed before the real work (building) can begin.

Goodbye, Pizdook

July 2nd, 2009

One of the things that I do for the FindMUD mud listings is check connections once in a while (approximately monthly) to see if a MUD server is running and then display a log of connection attempts on that MUD’s listing page.

When I was on shared hosting, that was a process that was far more involved than it should have been.

Step 1:  Get a list of currently active mud listings to query.  For that I created a custom hidden view in Drupal that I could copy and paste into my connection test app.

Step 2: Run the connection tests.  I wrote an app specifically to do this by checking telnet connections to each MUD on the list.  If would generate two sets of SQL queries.  The first contained the connection results, while the second contained any changes to IP addresses.  I called the executable file “Pizdook”, which is a scathing insult used in Orson Scott Card’s Homecoming series of novels.  It represented my annoyance at having a multi-step process due to the limitations of using shared hosting.  Here’s a screenshot:

Step 3: Log into PHPMyAdmin and paste the queries generated by Pizdook into the “execute SQL” window to update the database.

Thanks to some new-found knowledge of SQLAlchemy, I’ve rewritten the app as a Python script that I can run with a monthly cron job.  Suddenly it’s hands-off, a single-step automated process that I no longer have to spend any effort on.

Resource Usage For Basternae 3

July 1st, 2009

Here’s the resource usage for Basternae running on Mono on Ubuntu with 1 active user and 6 zones loaded:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     24624  0.2  6.9  39284 25548 pts/0    SNl  21:40   0:08 mono Basternae.exe

I have to imagine with a full complement of zones and a few active players that the memory usage will reach 64MB VSZ and 48MB RSS with probably about 1.2% CPU usage.  This would be well within the abilities of the current hosting and would use about 15% of the overall available resources.

What I am a little afraid of is memory leakage.  Contrary to popular folklore, running C# does not completely eliminate memory leakage, it just makes it easier to avoid.  The nice thing is that I’ve designed all of the game objects with instance counters, so at any time I can get a count of how many rooms, objects, mobiles, etc. exist in memory at any given time, whether they’re actually active in the game or not.  This will make it easier to track down leaks if any happen.

Worst case is if resource usage expands drastically we may have to upgrade from the Linode 360 to the Linode 540.  In that case, running Basternae would cost a total of $120 per year.  I’ve been spending that much on lunch every two weeks (I really need to cut down, but I work next to all of the best restaurants in my city), so it’s not exactly a huge number in the grand scheme of things.

It should also be mentioned that on Windows, memory usage is only 14MB.  Running on Linux/Mono requires a lot more resources.  Part of this is because some of the things used by .NET are automatically loaded by the Windows OS so they don’t contribute to memory size, and part of it is because in a way Mono is actually a “Windows software emulator” and is less optimal than something like a C executable compiled to run natively.

A New Job

June 30th, 2009

For the past two years I’ve been working for a home automation company, first as a developer and then as a development manager.  Unless you’re deaf, dumb, and blind you know that the real estate market has been far less than optimal for the past year or three.  That makes it pretty challenging to work in an industry driven primarily by new home sales and secondarily by stock and investment markets.

I’ve just been offered a development job with a glass company, one that’s not particularly affected by real estate market cycles.  I start in two weeks.  It’ll be great to have a change of technology/scenery/responsibilities.  I’ll miss the people where I am now — I worked with some pretty kickass programmers and great people — but I have hit something of a plateau by not being exposed to any new environments lately.

What’s that have to do with Basternae?  Pretty much nothing, other than the fact that your friendly neighborhood codemonkey might get smarter by being exposed to new things.

Today’s Update

June 29th, 2009

I spent a while working on the code today.  Nothing specific, just reorganizing some things, cleaning up some excessive logging, fixing a bug or three.

I ran FxCop again and it came up with 961,407 checks and 9,557 issues, a ratio of 9.94 issues per 1000 checks.  This is an improvement of 6.49% over last check.  I think I’m going to mothball FxCop for now since following its rules doesn’t actually result in better, more stable code.  All FxCop cares about is how “pretty” the code looks.

Elfsong

June 28th, 2009

I just finished reading Elfsong by Elaine Cunningham, book 9 of The Harpers and the sequel to Elfshadow.  It was a 3.5-star book.  It had decent characters, and was your typical sword-and-sorcery novel.  A tale well-told, but not a tale you can’t live without.  Read it if you like the other Harpers books.

A Better To-Do List: Got-It-Done.com

June 27th, 2009

If you’ve explored this blog much in the past you would have noticed that I had a “to do list” published.  It wasn’t well-sorted, and not all that easy to edit.

Since much of what I do in life is todo-list-driven, I’ve always tended to fill post-its and notebook pages with lists of things I need to get done, lists of ideas, tasks, etc.  While I’m at work, I’ll think of things I need to do and jot them down on whatever scrap of paper is handy.  It helps me stay focused, but I tend to have quite a clutter of papers on my desk.

The perfect solution for me to get rid of some of the clutter and make these lists available to me in more places than just my desk is an online solution.  There are already a solid handful of sites you can use to do that, but I’m far too hardcore for my own good.

Instead, since I wanted to get more familiar with the Django web framework and the jQuery JavaScript library, I built my own online task management application.  It was fun, challenging, and immediately useful.  I’ve moved the Basternae to-do-list to it and make use of it for everyday organization.

It’s free to create an account, so feel free to try it if it’s something you might find useful.  Here’s a screenshot of it in action:

Got-It-Done Task List Screenshot

Check it out at http://got-it-done.com.  It’s pretty beta, so feel free to offer suggestions and/or let me know if you have any errors.

Mono 2.01 Doesn’t Like XmlElementAttribute

June 26th, 2009

I have zone files loading on Mono now.

I had a sneaking suspicion that it had something to do with the XmlElementAttribute that I used to keep the XML tags in the zone files compatible with the encapsulated, property-based classes.  I spent a few hours updating the zone converter application so I could remove the XmlElement attributes.  After loading the MUD on Mono, all zone files magically loaded.  “All” being the ~6 that I’m officially authorized to use so far.

Since I’m running Ubuntu 9.04, the native version of Mono is 2.01, a bit behind the current version of 2.4 (which will ship with Ubuntu 9.10).  Installing Mono 2.4 on Ubuntu 9.04 is not as easy as one would hope, and I can’t say for sure that it would take care of the problem.  Mono has made great advances lately, so I’d be surprised if the latest version had the same problem.

Small FxCop Update

June 23rd, 2009

Down to 9,788 issues in 920,226 checks for a ratio of  10.63 issues per 1000 checks, an improvement of 4.23% over last time.  So slow.

Slight FxCop Improvements

June 22nd, 2009

Numbers are at 10,218 issues in 920,224 checks for a ratio of 11.10 issues per 1000 checks, an improvement of 3.31% over a day and a half ago.  There’s still a very long way to go here.