[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Stat system/ Display exp per hit

Stat system/ Display exp per hit

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Lex_Luther   Canada  (4 posts)  [Biography] bio
Date Tue 10 Feb 2004 10:55 PM (UTC)
Message
How Would i display exp gains per hit ? And then i want to know how to up the max stats for smaug codebase. I'm really new to this and trying to learn fast thanks all for you help.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Tue 10 Feb 2004 11:11 PM (UTC)
Message
I'm not sure it calculates experience per hit. I think it is per kill based on the relative experience between you and the mob you kill. However, I might be wrong.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #2 on Fri 13 Feb 2004 01:57 AM (UTC)

Amended on Fri 13 Feb 2004 02:03 AM (UTC) by Zeno

Message
It actually does calculate the exp gained. In the fuction, "gain_exp" in update.c, add near the end:

ch_printf( ch, "You gain %d experience.\n\r", modgain );

Something like that.

As for stats, edit handler.c to change max_str, max_con, etc.

[EDIT] I just tried this myself, and it causes some "problems".

You **** SMITE **** a large demon!
You gain 1414 experience.
A large demon is DEAD!!
You receive 97 experience points.
You gain 97 experience.


As you can see, it displays the exp gained twice, when killing a mob.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Aidan   (8 posts)  [Biography] bio
Date Reply #3 on Sat 14 Feb 2004 11:57 PM (UTC)

Amended on Sat 14 Feb 2004 11:58 PM (UTC) by Aidan

Message
Nick is right, SMAUG calculates experience gained on a per kill basis, not per hit. SMAUG has a rather complicated experience system anyway...MOB's each have a base experience worth generated by a slew of numbers, most of which don't even make sense to apply. Basically, any stat that a MOB has can be (and pretty much are) used to calculate the experience that a player gets when he/she kills the MOB.

All that to say that you can't display exp gained per hit because you don't gain exp per hit. As for Zeno's suggestion (I'm assuming he suggested having it display exp gained at the end of a fight, at least that's what it looks like to me), SMAUG already displays exp gained at the end of a battle. So you don't really need to bother yourself with that.
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #4 on Sun 15 Feb 2004 12:21 AM (UTC)
Message
My last post was the way of showing exp gained, per hit. Yes, you do gain exp per hit, and it is a variable, and can be displayed. I tested it myself.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Sun 15 Feb 2004 02:15 AM (UTC)
Message
Zeno, is this stock SMAUG? I can't find the words "You gain" when searching all the .c files.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #6 on Sun 15 Feb 2004 03:50 AM (UTC)

Amended on Sun 15 Feb 2004 03:52 AM (UTC) by Zeno

Message
No, I was meaning to add that line, so it shows how much you gain... But I was using SmaugFUSS when I added it. Doh. Sorry, I forgot to say "Add" in my first post.

[EDIT] Oh wait... I did say Add. Oh well.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Sun 15 Feb 2004 04:06 AM (UTC)
Message
Oh, sorry, I see what you mean.

However this raises the question - your extra line shows:

Quote:


You **** SMITE **** a large demon!
You gain 1414 experience.
A large demon is DEAD!!
You receive 97 experience points.
You gain 97 experience.


So, you gain 1414 experience from your addition, but then the normal response shows only 97 experience for the kill. My question is, do you really gain the 1414 experience, or is it rounded down at the kill based on your experience relative to the mob's?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #8 on Sun 15 Feb 2004 04:55 AM (UTC)
Message
You actually gain that much. I had exp in the prompt, and I calculated it. You gain experience per hit, unless the mob is out of your range.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Aidan   (8 posts)  [Biography] bio
Date Reply #9 on Sun 15 Feb 2004 02:00 PM (UTC)
Message
You really gain exp per hit? I'll admit, I'm a little skeptical. But, that's okay...I'm quite interested also. If you gain experience per hit is it only added to your total exp after you kill the MOB?
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #10 on Sun 15 Feb 2004 06:43 PM (UTC)
Message
No, the amount gained when you kill a mob, like this...

A large demon is DEAD!!
You receive 97 experience points.

Is sort of a "bonus" for killing it. This is not the total exp gained throughout the battle.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Aidan   (8 posts)  [Biography] bio
Date Reply #11 on Mon 16 Feb 2004 08:09 PM (UTC)
Message
Most interesting...I just tested this out. I had a level two Paladin who had 2395 exp before I began fighting a giant ant. Upon the ants defeat the MUD displayed that I had gained 54 exp points. However, when I checked my score again I had 2811...some quick math tells us that I gained a total of 416 exp throughout the fight. I hit the MOB four times, so an average of about 100 per hit. If we subtract the 54 exp "bonus" at the end of the fight, that means that the xp gained was about 90.5 per hit (assuming that it is computed per hit). Does any one have any other information on this? I'd really be quite interested since I've gone all this while thinking that xp was awarded per kill.
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #12 on Mon 16 Feb 2004 10:35 PM (UTC)

Amended on Mon 16 Feb 2004 10:37 PM (UTC) by Zeno

Message

k cub
You attack a bear cub!
You DESTROY a bear cub!
You gain 3 experience.
You dodge a bear cub's attack.
A bear cub brushes you.
You PULVERIZE a bear cub!
You gain 2 experience.
A bear cub is DEAD!!
You receive 1 experience points.
You gain 1 experience.

Before this, I had 143756 exp. After, I had 143762. Thats a difference of 6. Its fine. The extra "You gain 1 experience." at the end is simply a repeat of "You receive 1 experience points." So it all is fine...

[EDIT] Whoops sorry, thought you were saying the calculation is not correct. More info? All I can say is that you can exp per hit.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Aidan   (8 posts)  [Biography] bio
Date Reply #13 on Tue 17 Feb 2004 (UTC)
Message
Hmmm...okay, I would like to get in touch with someone who knows more about this though. LOL...I wonder if Thoric responds to e-mails?
[Go to top] top

Posted by Typhon   USA  (112 posts)  [Biography] bio
Date Reply #14 on Sat 28 Feb 2004 01:51 PM (UTC)
Message
do_damage
/*
* Get experience based on % of damage done -Thoric
*/
if ( dam && ch != victim
&& !IS_NPC(ch) && ch->fighting && ch->fighting->xp )
{
if ( ch->fighting->who == victim )
xp_gain = (int) (ch->fighting->xp * dam) / victim->max_hit;
else
xp_gain = (int) (xp_compute( ch, victim ) * 0.85 * dam) / victim->max_hit;
if ( dt == gsn_backstab || dt == gsn_circle )
xp_gain = 0;
gain_exp( ch, xp_gain );
}

it does calculate exp per hit

Your cleave **** SMITES **** a carrion crawler! <<320000>>
You have now obtained experience level 5!
msg from server-> 'Testr has raised a level'
Your gain is: 13/63 hp, 0/157 mana, 10/140 mv 2/8 prac.
The gods are pleased with your progress, and have restored you!
A carrion crawler is DEAD!!
You receive 141 experience points.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


28,171 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]