Solutions to Project 2

Started by
11 comments, last by Emmanuel Deloget 16 years, 8 months ago
Better late than never (mmmm... not sure if the idiom translate well from French to English; or maybe I missed something...): here is my implementation of the "bare minimum" (ie: the required feature only). It may seems very large to all of you, and you'll be quite right. But then you'll notice that it actually reads everything from xml files (classes, races and skillset atm).

Skills are not shown in this code. However, you can modify the program to be able to chose them (based on your skill points and on the class skill list). This is as easy as searching for the string "// --SKILLS--" in the source code and uncommenting what comes a few lines of code.

A better implementation is on the way.



Code: 142KB RAR archive



Things I forgot:
  • Hum. The Green Dragon. Can "Test" be considered as a valid colorful dragon?
Things that I changed in the requirements:
  • Height and weight are in USI. No inches, no lbs, just plain, simple centimeters and kilograms. I have the French SRD to help me, so that was easy [smile].
Things that (I believe) are cool:
  • the classes you can select depends on your alignment. ".class" files (in bin/rules/ contains a "requirements" section which can be populated to automate this. For example, the requirements for the druid class are: neutral (on either the law-chaos or good-evil axis). This is implemented by using:
        <requirements>        <alignment-concat type="or" />        <alignment axis="LawChaos" min="33" max="65" />        <alignment axis="GoodEvil" min="33" max="65" />    </requirements>
    The <alignment-concat /> tag is optional. In this case, it's used to say "consider at least one of these alignment requirements". If it's type is "and" or if it's not present, the system will match all alignments. For example, this is the one for the paladin (which muct be lawful-good):
        <requirements>        <alignment axis="LawChaos" min="66" max="100" />        <alignment axis="GoodEvil" min="66" max="100" />    </requirements>
    As you guessed it, the alignment values are stored as a 0-100 value, 0 being chaotic or evil (depending on the axis), and 100 being lawful or good.
  • This requirements system shall be extended in the future. It already checks for ranks in skills, alignments, classes levels and (to some extent, as they are not implemented yet) feats. That means that you can add prestige classes quite easily: just create the correct .class file, and that's all.
  • You can extend the race pool as well: add a .race file (the XML format is not very difficult; check elf.race for an example with nearly everything). This makes it easy to support monstruous races. Note that ELC are still not supported (but that's coming as well)
  • multiclass! yep, you can select whatever class you want when you go to the next level; this makes multiclassing as easy as it should be.
  • Every 4 level, you gain an ability point. True. That's in the rules [smile]
Things I believe are NOT cool
  • ability score assignment - the user interface is quite weird (for each ability: type a number from 1 to 6+return, or type 'r'+return (reroll) or type return directly (take the first unassigned score) if you assign a score that was previously asigned, the system asks you to assign another score to the ability to which the score was assigned before). It must be changed to a better implementation, really. Anyway, the current implementation allows you to reroll 10 times and to select to which ability you want to assign which score.
  • not all classes are implemented. In fact, the sorcerer and the wizard are not. it would not be difficult to add them (in fact, I could do it in less than 15 minutes). But I'm lazy. I will do it for the next release.
  • The level builder is to be improved - design is quite poor.
  • most of my string comparisons are strict (using operator==()). They should be case-independant (so I should use string.Compare(a,b,true)==0 instead).
  • many small things...




Imrovements to come:
  • a better handling for skills
  • handling of feats, special abilities and spells. Each of these might require a good setup made of script files and xml files. That's going to be teh fun.
  • combat management - AC, BAB, attack count, etc; this will come first, as everythign I need is already there
Voilà. Have fun deciphering my comentless code!
Advertisement
Project 3 will be posted later today.

Cheers!
Jeromy Walsh
Sr. Tools & Engine Programmer | Software Engineer
Microsoft Windows Phone Team
Chronicles of Elyria (An In-development MMORPG)
GameDevelopedia.com - Blog & Tutorials
GDNet Mentoring: XNA Workshop | C# Workshop | C++ Workshop
"The question is not how far, the question is do you possess the constitution, the depth of faith, to go as far as is needed?" - Il Duche, Boondock Saints
Quote:Original post by JWalsh
Project 3 will be posted later today.

Cheers!

Don tell me that you were waiting for me! [smile]

Well, I can already tell you that I will be late [grin]. Anyway, it means that you're going to improve my havingfunnyness by a factor 10 - at least.

Update notes: in order to test my implementation, I added the Assassin prestige class to my class collection - and I implemented the wizard and the sorcerer. You can select the assassin class only if you are evil and if you have hide=8 ranks, move silently=8 ranks and disguise=4 ranks. I had a few of bugs (there are only 10 levels in the Assassin class) but on the overall, it worked well. Other prestige classes can't be implemented yet as I haven't implemented the spell level/type requirement. But it comes... And then, I'll have to port everything to my XNA-based framework.

This topic is closed to new replies.

Advertisement