04 Oct, 2010, Dean wrote in the 1st comment:
Votes: 0
This post isn't looking for how to go about adding more races, I already know how to do this (at least, in terms of keeping it in the "Core"). Instead, I'm intrigued to know which route people have gone (extending races to a module, doing it in python or other), why they opted for that route and any potential implications for going down that route.

An example might be: Joe Smith adds all the races he wants in races.c (module or no), but will be doing most of the "game logic" in python. If I remember correctly, races aren't exposed to python and so this might cause issues down the road (If I'm wrong, it's only an example anyway :lol:).
04 Oct, 2010, ixokai wrote in the 2nd comment:
Votes: 0
The Joe Smith route is perfectly valid, and I actually went down that road at first (when Idea 1.0 of my mud actually would have consisted entirely of three whole races :)), but have decided personally to go a different route.

Its true that races/bodies are not very well exposed to Python, and I actually think that's a buglet (and therefore am willing to help anyone who needs it on doing the wrapping, if you're not experienced in C– not that I am a great deal, but I know the Python/C bits pretty well).

Me, though, I decided to go a very different route in my as-of-yet still prototype game. I want *all* game-mechanics to be in Python: where I'll profile and rewrite in C as needed (actually, more likely Cython and/or Stackless Python, we'll see). It's just far easier and faster to experiment with "mechanics", and I don't have a fully realized game system yet in my head.

So I need races/bodies in Python. So, my basic strategy is… I'm just idly ignoring races.c, and related files, in their entirity, and making the NakedBody system! ;-) Basically, I'm writing a generic little module which replicates everything races.c/body.c/etc do in Python, but do so in a way which is more readily extensible (and OLC-able).

It has three primary parts: "species" definition which defines a race, which is a set of attributes and body parts (which can be specified in a very simple way, or in a far more complex way to enable advanced features– and the two methods are compatible… i.e. I'm probably going to specify my npc races simple, my pc races complex. They'll interact seamlessly).

"body", which will present a single PC/NPC (char)'s actual body: ch.body.list_parts(); ch.body.get_parts("left arm") –> ["left shoulder", "left arm", "left hand", "left held", "left ring"] and such. It's completely stat-system agnostic, but is designed to plug into whatever you want your stat-system to be or do.

Then there's "gear", which creates an item type which is meant to be fitted onto body parts… then plug into your stat-system again, so you can do things like add stat bonuses when certain gear is worn, or blow up if someone wears some conflicting types of magic gear.

Its all designed to be very generic and customizable, more as a framework with some examples, then a real, final solution: my use will, for example, include "layered" gear so you wear a t-shirt, with some leather, then chain, and plate over it. But it'll also have a mode for the more traditional gear setup, where you have basically one item in each "slot".

Anyways. This is my approach. I'm going to release it on the nakedmud.org wiki when its done (a week or two: should have been a week or two ago, but the day job is busy) all MIT-licensed and the like, but if anyone's at this part of their development and are interested in using it eventually and have ideas– let me know, I'm curious about what all the needs gear/body/race-wise of other people's systems, to try to see if I can solve in a generic way the problem better for anyone. Either PM here I guess, or ixokai on #nakedmud.
04 Oct, 2010, Dean wrote in the 3rd comment:
Votes: 0
This has certainly left me with some good points to consider. Thanks and also welcome to Mudbytes, Ixokai.
04 Oct, 2010, Rudha wrote in the 4th comment:
Votes: 0
I think 99% of people will end up overwriting nakedmuds races.c - which makes me wonder why it was done like that. Its poorly exposed to python and for some people the bodypart system is of limited utility. For me it wasnt nearly sophisticated enough, and I ended up overwritimg it so people could wear more than one layer of clothing. I also reimplemented races in python since I prefer to keep game logic in the py scripts.

04 Oct, 2010, Runter wrote in the 5th comment:
Votes: 0
I'm skeptical that with network libraries like Twisted there is much of a reason to deal with any C unless you're trying to host your mud from your smart phone..
04 Oct, 2010, hollis wrote in the 6th comment:
Votes: 0
Rudha said:
I think 99% of people will end up overwriting nakedmuds races.c - which makes me wonder why it was done like that.

It was the first thing I wrote and I wrote it poorly. Redoing bodies and races are on my todo list. I don't have races on my mud, so it is perhaps low on my todo list :)