Thursday, April 7, 2011

d20 Dabbling

I was speaking with a friend of mine today about an ongoing project that I have been working on for many years.  Converting the d20 3.5 game system into code.  There is more than one point to this exercise. 
First, writing games is a fun way to explore the capabilities of a programming language and/or compiler.  The first version was built in Microsoft Access with successive versions in VB.Net using 2005, 2008 and now 2010.  Along the way I've learned about classes, inheritance, generic types and collections. 
Second, converting a complex list of vague and often contradictory requirements into a functional application is a necessary skill for any IT professional, especially developer.  Take for instance the Changeshape ability of some monsters.  I had to determine the best method to determine the augmented properties of two randomly created dynamic objects (in this case monsters) while using the minimal amount of system resources.  When you only use a limited number of monsters with a few properties, as most video games do, the process is rather simple
 
Public Class Monster
    Public Size as SizeID
    Public HitPoints as Integer
End Class
Public Class Stats
    Public Size as SizeID
    Public HitPoints as Integer
End Class
Public Function Goblin as Monster
    Dim M as New Monster
    With M
        .Size=SizeID.Small
        .HitPoints = 4
    End With
    Return M
End Function
 
Public Function Minotaur as Monster
    Dim M as New Monster
    With M
        .Size=SizeID.Large
        .HitPoints=20
    End With
    Return M
End Function
 
Public Function ChangeShape(BaseCreature as Monster, AltCreature as Monster) as Stats
    Dim S as New Stats
    With S
        S.Size = AltCreature.Size
        S.HitPoints = BaseCreature.HitPoints
    End With
End Function
 
However when you have thousands of monsters with  thousands of properties, many of which only apply to specific monsters, the task becomes far more complex and you have to consider custom structures to keep your class definitions from getting out of hand.
 
Finally, for the writer in me.  I love thinking about an infinite virtual world with rules of terrain and interaction that can be randomly generated.  A well-written world generator would feel like artificial intelligence at work.  I had a university professor at on time who said that the purpose of higher education was to learn how to think.  I say we should never stop learning, never stop striving for the world of what could be.  For writers, especially, isn't that what life is all about?

Friday, April 1, 2011

In Space No One Can Hear You Scream

The newest offering from Poe Little Thing is now available.

I was fortunate enough to have International Intrigue included in the collection.  I'm very excited to see this Agatha Christie inspired murder mystery in print.  I'm looking forward to reading the sci-fi, fantasy and horror contributions of fellow authors as well. 

I've added links to the authors' websites for your convenience.