Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex, DotBot

Members: 0
Guests: 6
Stats
Files
Topics
Posts
Members
Newest Member
481
3,734
19,366
618
Micheal64X
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » Few questions regarding the r...
Forum Rules | Mark all | Recent Posts

Few questions regarding the resist magic system and a few ideas
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jan 6, 2006, 7:04 am
Go to the top of the page
Go to the bottom of the page

Dralnu

GroupMembers
Posts14
JoinedJan 15, 2006

Anyone who has been on Nick Gammon's forum should have an idea who I am (maybe), so you'll know I'm fairly new to coding and, honestly, have a hard enough time with some snippet installs (most I can do, but one or two give directions that make as much sense and Sandskrit does to a mule in Siberia. Anyways, I want to pretty much remove the resistance system and replace it with a percentage resistance system. I have an idea on what I need to do, but am kind of kittish about removing code that I cann't be sure I'll need again later on. I'm running this codebase on my own comp at home, the base being SmaugFUSS 1.6 under SuSe 9.3 Pro, for all that matters.

Anyways, the idea I had was basically stripping Smaug of its added components (spells, magic resist system, ect), and making like a Smauglet codebase so people could have something fairly well known to start from, but don't have to go through and replacing all the code already there, but don't have to deal much with rebuilding the build system (which, minus a few problems, is fairly good imho)
       
Post is unread #2 Jan 6, 2006, 4:37 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

Wow, sounds like a fairly massive undertaking.. as for being kittish (or even skittish) about removing code that you might need again later, don't remove it, just comment it out until you can establish that you won't need it again or that you did need it afterall at which point you can delete it or uncomment it respectively.
       
Post is unread #3 Jan 7, 2006, 9:09 am
Go to the top of the page
Go to the bottom of the page

Dralnu

GroupMembers
Posts14
JoinedJan 15, 2006

well, some comments on it would be nice. I want to nip some bugs in the bud before going into real detail with magic and combat, and I hate the idea of redoing the entire MUD's basis mid-game, and changing the laws of combat. Doesn't seem right to me...

If anyone knows of a good place I could get a snippet for this, as well as a revamped combat code that uses armor as armor instead of dodging ability, I'd love it, or just general comments for help.

Thanks for the comment btw Conner, but one thing that bothers me is that I don't have any other players, so there is the problem with doing alot of work and then having someone join and the game crashing for 6 diffrent reasons, hence why I'm skiddish on removing code in any way.
       
Post is unread #4 Jan 7, 2006, 9:28 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,873
JoinedJul 26, 2005

Well the fact that you don't have other players means that you dont have to really maintain support for old pfiles other then your own till its updated. ( Personaly I always like that lol ).

With most changes comes a chance of wierd crashing at some point and time later ( if it doesn't do it right then ).
Even now days lots of bugs that have been around since SMAUG are still being found and taken care of lol.

Now on to your main question(s).
Don't know of any snippets for such things.
I would suggest you start out on the smallest part of it and work on it as you go, testing as you go, until its all finialized.

What does armor as armor instead of dodgeing mean?
In the code you get a chance of the armor helping, you also can dodge an attack or lots of things.
You should probably take a very long look at one_hit and multi_hit in fight.c ( Believe those are the functions for the main parts of it lol ).
       
Post is unread #5 Jan 8, 2006, 4:06 am
Go to the top of the page
Go to the bottom of the page

Dralnu

GroupMembers
Posts14
JoinedJan 15, 2006

Ok. The armor bit I understand. I saw those two functions yesterday, but as for working on the smallest part and working from there with the resist system, I think you lost me there. From what I see the resist system needs to be replaced, and hence starting in one place and working on from there gives the ever popular question "Where do I start?".

As for armor as armor, I mean if you have 2000 (or -2000, depending on how you set things up), when you take damage (Lets say 2050), instead od it checking to see if they can hit you because of your armor level (least that is how I understand it), it would be more like 2050 dmg - 2000 armor = 50 damage taken, which would then allow for the damcap to be removed and open up new spell/skill combos that could deal with that, as well as reducing the change of going so far into the armor system that it is pointless.
       
Post is unread #6 Jan 8, 2006, 4:28 am
Go to the top of the page
Go to the bottom of the page

Dralnu

GroupMembers
Posts14
JoinedJan 15, 2006

if (IS_NPC (ch))
{
thac0_00 = ch->mobthac0;
thac0_32 = 0;
}
else
{
thac0_00 = class_table[ch->Class]->thac0_00;
thac0_32 = class_table[ch->Class]->thac0_32;
}
thac0 = interpolate (ch->level, thac0_00, thac0_32) - GET_HITROLL (ch);
victim_ac = UMAX (-19, (int) (GET_AC (victim) / 10));

/*
* if you can't see what's coming...
*/
if (wield && !can_see_obj (victim, wield))
victim_ac += 1;
if (!can_see (ch, victim))
victim_ac -= 4;

/*
* "learning" between combatants. Takes the intelligence difference,
* and multiplies by the times killed to make up a learning bonus
* given to whoever is more intelligent -Thoric
* (basically the more intelligent one "learns" the other's fighting style)
*/
if (ch->fighting && ch->fighting->who == victim)
{
short times = ch->fighting->timeskilled;

if (times)
{
short intdiff = get_curr_int (ch) - get_curr_int (victim);

if (intdiff != 0)
victim_ac += (intdiff * times) / 10;
}
}

/*
* Weapon proficiency bonus
*/
victim_ac += prof_bonus;

/*
* The moment of excitement!
*/
while ((diceroll = number_bits (5)) >= 20)
;

if (diceroll == 0 || (diceroll != 19 && diceroll < thac0 - victim_ac))
{
/*
* Miss.
*/
if (prof_gsn != -1)
learn_from_failure (ch, prof_gsn);
damage (ch, victim, 0, dt);
tail_chain ();
return rNONE;
}

/*
* Hit.
* Calc damage.
*/

if (!wield) /* bare hand dice formula fixed by Thoric */
/*
* Fixed again by korbillian@mud.tka.com 4000 (Cold Fusion Mud)
*/
dam =
number_range (ch->barenumdie,
ch->baresizedie * ch->barenumdie) + ch->damplus;
else
dam = number_range (wield->value[1], wield->value[2]);

/*
* Bonuses.
*/
dam += GET_DAMROLL (ch);

if (prof_bonus)
dam += prof_bonus / 4;






That is the code in one_hit that apparently deals with hitting and damage. I'll post what I get in the end, but I wanted to put this up so if anyone has any idea a good way to get this to work the way I would like it to, they could make a comment. Anyways, I'm off to play and will post what I got so hopefully it will work well.
       
Post is unread #7 Jan 8, 2006, 4:32 am   Last edited Jan 8, 2006, 4:36 am by Dralnu
Go to the top of the page
Go to the bottom of the page

Dralnu

GroupMembers
Posts14
JoinedJan 15, 2006

That isn't the entire code, but it is pretty much only the stock fight.c, so if anyone wants to make a comment, please do. I looked through it, and without pretty much having someone to walk me through it I'm lost for the most part. I found the one_hit and multi_hit functions, but I'll stick to the original idea of this post in that I'd like to fix up the magic system (no, this isn't me going off to do somethig else because I don't know, its because I'm waiting till I understand what is going on a little better)
       
Post is unread #8 Jan 8, 2006, 11:33 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,873
JoinedJul 26, 2005

well personaly it sounds to me like instead of making them miss you would like to reduce the damage by their armor correct?

Should be fairly simple over all, but I would suggest mixxing it up somehow :)
Like maybe make you a armor_damage or something (about like how there is a ris_damage) and pass dam through it to see how well it should reduce the damage etc... maybe use something random etc... I don't think every single damage should be reduced by the amount of armor they have. Also make sure you keep damage checked so its not going < 0 because if you let it, then it will probably just start healing them lol. That would be funny heh, You do -500 damage and they gain 500 hp :)
       
Post is unread #9 Jan 8, 2006, 1:40 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

That's what I got out of that too, he wants the armor to absorb damage equal to the armor class instead of the D&D-ish method it uses now to determine hit/miss difficulty. But I agree, if you were going to make armor take the damage instead of the character, you need to watch two things: 1> You don't wnat the armor to be able to heal the character by absorbing damage to the point that the character recieves negative damage from a given hit, and 2> you probably want the armor itself to be damaged and thus lose armor rating when it absorbs that damage.
       
Post is unread #10 Jan 8, 2006, 2:26 pm
Go to the top of the page
Go to the bottom of the page

Dralnu

GroupMembers
Posts14
JoinedJan 15, 2006

if dam_through <= 0
return 0

or something like that you mean?
Yeah, I realize that could have been a problem, thanks for the comment. I'd like to recode dodge as well (that I thik will be fairly simple I think. Dex vs. Dex + Int check or something like that.), so that combat will end up more sta-based then just 'I have ___ Hitroll and ___ Damroll' and thats the end of things.

D & D style combat is good for games like D & D that you only play for a little bit before restarting, or can change the rules of on the fly. I'd like to do alot of things and get something somewhat unique going, but before I do that I want to cure some serious problems first, these two being the biggest I see right off the bat, not to mention biggest.
       
Post is unread #11 Jan 8, 2006, 2:32 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

Yeah, that's what we were talking about...

Wait, "D & D style combat is good for games like D & D that you only play for a little bit before restarting, or can change the rules of on the fly"??? It's your mud, you can do whatever you want in it, but who plays D&D for a little bit just to start over?? And what DM lets you change the rules on the fly unless it's a change that's going to be established from that day forward in their games? As a DM, myself, if I decide on a rule change it's a permanent change for my games from that point forward and only after serious consideration and really good rationale, just like if I decide to change a rule on my mud.. to be honest, I see players on muds restart to try out a new character much more often than any of the D&D players I've met. :(
       
Post is unread #12 Jan 8, 2006, 2:44 pm
Go to the top of the page
Go to the bottom of the page

Dralnu

GroupMembers
Posts14
JoinedJan 15, 2006

As for the resist system, to get back on topic somewhat, I'd like armor to manage part of that as well (Hit with fireball, check to see if armor is magic, and if so reduce the damage taken by 1/2 or 1/4 the armor level of the player), and add in absorbtion based on a %. 120% resist from Fire means you gain 25% of the damage dealt as health. Anyways, lookin through the function one_hit and multi_hit, while they may seem simple to you I havn't dealt with code in awhile, so alot of the calls make little sense to me. I know its pretty much rewritting one or two parts, but with the added weapontypes snippet, I also have to call in the weapon profs. I don't know, maybe I'm blowing this out of proportion, but anyways, oh well. I'll look into it a little later. On the wrong OS to do it now.
       
Post is unread #13 Jan 9, 2006, 7:56 am   Last edited Jan 9, 2006, 8:01 am by remcon737
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,873
JoinedJul 26, 2005

Heh, some idea's as far as resist and immune and all go: Personaly I always wondered why it was so limiting, most will agree that for one thing you have something that goes against that, like Fire and Water/ice etc..., I normaly end up adding quite a bit of new ones to the current ones in Smaug.
Like stock has these
#define RIS_FIRE		  BV00
#define RIS_COLD		  BV01
#define RIS_ELECTRICITY	  BV02
#define RIS_ENERGY	  BV03
#define RIS_BLUNT		  BV04
#define RIS_PIERCE	  BV05
#define RIS_SLASH		  BV06
#define RIS_ACID		  BV07
#define RIS_POISON	  BV08
#define RIS_DRAIN		  BV09
#define RIS_SLEEP		  BV10
#define RIS_CHARM		  BV11
#define RIS_HOLD		  BV12
#define RIS_NONMAGIC	  BV13
#define RIS_PLUS1		  BV14
#define RIS_PLUS2		  BV15
#define RIS_PLUS3		  BV16
#define RIS_PLUS4		  BV17
#define RIS_PLUS5		  BV18
#define RIS_PLUS6		  BV19
#define RIS_MAGIC		  BV20
#define RIS_PARALYSIS	  BV21
/* 21 RIS's*/

Mine has these
/*
 * Resistant Immune Susceptible flags
 */
typedef enum
{
  RIS_FIRE,   RIS_COLD,      RIS_ELECTRICITY, RIS_ENERGY,
  RIS_BLUNT,  RIS_PIERCE,    RIS_SLASH,       RIS_ACID,
  RIS_POISON, RIS_DRAIN,     RIS_SLEEP,       RIS_CHARM,
  RIS_HOLD,   RIS_NONMAGIC,  RIS_PLUS1,       RIS_PLUS2,
  RIS_PLUS3,  RIS_PLUS4,     RIS_PLUS5,       RIS_PLUS6,
  RIS_MAGIC,  RIS_PARALYSIS, RIS_HACK,        RIS_LASH,
  RIS_WIND,   RIS_ICE,       RIS_WATER,       RIS_EARTH,
  RIS_HOLY,   RIS_SHADOW,    MAX_RIS_FLAG
} ris_types;

And before you ask yes I did change them over to ext_bv as well as lots of other stuff.
NOTE: Don't try changing them over unless your prepared for alot of annoying things to have issues lol :)
I'm sure there should probably be some more but thats the ones I normaly at least go with lol.
       
Post is unread #14 Jan 9, 2006, 6:43 pm
Go to the top of the page
Go to the bottom of the page

Dralnu

GroupMembers
Posts14
JoinedJan 15, 2006

I want to pretty much bring the damageing spells down to a smaller set of resist (Ever play Guild Wars?). GW has a decnet system set-up as far as I am concerned, and I'd like to put things into a kind of Magic The Gathering type way. Earth, Wind, Water, Fire, Spirit/Energy. The rest I'd like to get rid of pretty much so that in the end, spell damage would be either Physical/Earth , Fire, Lightning/Air, Ice/Water, and Energy/Spirit, then allow spells to combine types (Meteor - Fire + Earth) to mix things up some so that you cann't equip to be anti-fire and fight someone else pk-wise without them being able to throw something strange in there (I'd like to add in a system to gain favor points amoung elements to affect what they do). I'm also planning on removing the physical resistences possibly, or using that to effect damage vs. diffrent armor materials (swords cut organic, maces work well vs. metal, something like that possibly), but that I'm still working on.

I think I'm going to look into magic.c to see what all is there and see how I could start working on this (maybe make a seperate func to check resist/immune/susept so I don't have to write and rewrite code dozens of times). Any helpful suggestions would be nice
       
Pages:<< prev 1 next >>