Top Mud Sites Forum

Top Mud Sites Forum (http://www.topmudsites.com/forums/index.php)
-   MUD Coding (http://www.topmudsites.com/forums/forumdisplay.php?f=9)
-   -   Combat system (http://www.topmudsites.com/forums/showthread.php?t=271)

Blade 11-06-2003 01:45 PM

I am starting to try to build my own mud using Melville mudlib and DGD. I have to basically code everything from scratch, but the actual base part of the mud is runnable already. Now I just need to implament all the stuff in it.

Anyways... my question is: Is it really hard to make a combat/magic/skill system. I myself don't know how to program yet, but a friend of mine does a little. I think he knows enough. Can anyone direct me to some source code that would give an example of a combat system in C or C++?
Thanks.

Koryon 11-06-2003 03:11 PM

If you're friend needs examples of stuff, he probably isn't good enough to tackle the massive task of building a combat system, and skills, and spells.

Of course:

[code]
int damage()
{
return (1+(int) (10.0*rand()/(RAND_MAX+1.0)));
}
[/quote]

Could be called an example of a combat system, but I think you're looking for something a *little* more complicated?

Looking at an example is not they way to do that, that one begins with a pencil, a piece of paper, a lot of caffeine and a lot of free time.

Alastair 11-07-2003 05:50 AM

While I'm not familliar with Melville, nor even DGD-specifics, two things:

- C / C++ combat systems ought to have an example value in the more distant sense only for what you need. Especially things like the temporal flow of combat is highly dependent on how your codebase is being built, and LPC, being interpreted, tends to implement things a bit differently than a compiled MUD.
- You'll probably want to have a look at the combat modules from other mudlibs instead as they ought to be closer to what you need.

In practice, combat flow usually involves making the necessary amount of targets aggro at each other, determining the order of attack, the chance to hit, evasion / dodging, applying damage vs. armor / resistance then against health, checking the target for death / incapacitation, applying potential counters, then advancing to the next target in time order. Whether you'll add "special" damage like additional spell damage on weapons and their resistances is up to you, and you'll also want to determine at what point the player can interrupt actions to use skills and spells, and what the indirect consequences of such interruptions are, if any (if spell casting is a lengthy affair, what happens to the opponent's attack? Is the caster helpless? for how long? etc).

Beyond those considerations, your coder (and you) will have to decide whether the combat system will be based on call_out or on heart_beat, which might influence the pace of the whole thing - and depends on how well DGD manages either in short time intervalls (although the best choice _seems_ to be heart_beat by default, this isn't always the case).

From your post, hoewer, it looks like neither you nor your coder are really at ease with the tasks at hand. Coding a mudlib isn't exactly easy to get into, I would only advise you to either realize you're in this enterprise for the very long term, or try to get both of you hired as staff on an established MUD for a couple of months to learn the ropes from experienced people.

angelbob 11-07-2003 08:03 PM

Heya! I *am* pretty familiar with DGD, LPC and Melville. That's mainly because I'm the author of the Phantasmal MUDLib for DGD :-)

DGD supports call_out but not heart_beat by default, but it's easy enough to build a heart_beat facility. Phantasmal uses a Daemon for that, or you could do it in your AUTO or DRIVER objects (the objects in your mudlib that interface directly with DGD).

Building a simple combat system isn't too bad. You could look at the 2.4.5 mudlib for DGD, which has a combat system and a heart_beat. But an interesting combat system, especially with magic and spells, is harder and requires a lot of design. If you've never done it before and haven't done a *lot* of reading, expect serious problems.


All times are GMT -4. The time now is 04:22 AM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Top Mud Sites.com 2022