<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
 <channel>
  <title>SmaugMuds.org - Topic: determining dodge</title>
  <link>http://www.smaugmuds.org/index.php?a=rssfeed&amp;t=4220</link>
  <description>The largest Smaug community resource site. - </description>
  <language>en</language>
  <generator>SmaugMuds.org</generator>
  <ttl>60</ttl>
  <item>
 <title>determining dodge</title>
 <link>http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19349#p19349</link>
 <description>thanks for the suggestions, i think this new version is working pretty well, time will tell.&lt;br /&gt;
&lt;br /&gt;
[code]&lt;br /&gt;
bool check_dodge( CHAR_DATA *ch, CHAR_DATA *victim )&lt;br /&gt;
{&lt;br /&gt;
    double perc = ((double)number_range(50,200)/100);&lt;br /&gt;
    double dif, attacker, vict;&lt;br /&gt;
&lt;br /&gt;
    if ( !IS_AWAKE(victim) )&lt;br /&gt;
        return FALSE;&lt;br /&gt;
&lt;br /&gt;
    attacker = (sqrt(get_curr_spd(ch))*1.25) + (sqrt(get_curr_agi(ch))*.75);&lt;br /&gt;
    vict = (sqrt(get_curr_spd(victim))*1.25) + (sqrt(get_curr_agi(victim))*.75);&lt;br /&gt;
&lt;br /&gt;
    if ( attacker == vict )&lt;br /&gt;
   </description>
 <guid isPermaLink="true">http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19349#p19349</guid>
 <pubDate>Sat, 31 Oct 2009 13:49:36 PDT</pubDate>
 <category>SmaugFUSS</category>
 <author>nobody@example.com (blueice)</author>
</item>
<item>
 <title>determining dodge</title>
 <link>http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19333#p19333</link>
 <description>One problem here is that you are comparing a number that is basically unbounded with a number generated as a percentage. If the difference between them is, say, 100, then perc will always be less than diff.&lt;br /&gt;
&lt;br /&gt;
If you want to compare against a percentage, you need to find some way of normalizing the difference between their &quot;dodge scores&quot; to be comparable to the percentage roll. This isn't really a programming problem, it's a design problem. You have to make sure that you're coming up with a diff</description>
 <guid isPermaLink="true">http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19333#p19333</guid>
 <pubDate>Thu, 29 Oct 2009 13:31:04 PDT</pubDate>
 <category>SmaugFUSS</category>
 <author>nobody@example.com (David Haley)</author>
</item>
<item>
 <title>determining dodge</title>
 <link>http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19330#p19330</link>
 <description>ok so maybe i can figure this out if i focus on one thing at a time. ok based on a situation where attacker value is always greater than vict&lt;br /&gt;
&lt;br /&gt;
[code]    if ( dif &gt; 0 )&lt;br /&gt;
    {&lt;br /&gt;
        if ( perc &lt; dif )&lt;br /&gt;
            return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
[/code]&lt;br /&gt;
&lt;br /&gt;
ok so if i try it this way, it works perfectly for someone who is extremely higher than the other person, but as the difference between them gets closer, the chance to dodge increases so much that the attacker actually can barely hit the vict, if i s</description>
 <guid isPermaLink="true">http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19330#p19330</guid>
 <pubDate>Wed, 28 Oct 2009 18:59:25 PDT</pubDate>
 <category>SmaugFUSS</category>
 <author>nobody@example.com (blueice)</author>
</item>
<item>
 <title>determining dodge</title>
 <link>http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19329#p19329</link>
 <description>the problem has to be in my execution of this part&lt;br /&gt;
[code]&lt;br /&gt;
    if ( dif &gt; 0 )&lt;br /&gt;
    {&lt;br /&gt;
        if ( dif &gt;= perc )&lt;br /&gt;
            return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        perc = perc * -1;&lt;br /&gt;
&lt;br /&gt;
        if ( dif &lt;= perc )&lt;br /&gt;
            return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
[/code]&lt;br /&gt;
&lt;br /&gt;
no matter how i can change the evaluations for diference and percentage, one end of the spectrum messes up, it seems to be the middle area where it is messing up, perhaps i should only be evaluating it based on whoever has the highe</description>
 <guid isPermaLink="true">http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19329#p19329</guid>
 <pubDate>Wed, 28 Oct 2009 18:46:12 PDT</pubDate>
 <category>SmaugFUSS</category>
 <author>nobody@example.com (blueice)</author>
</item>
<item>
 <title>determining dodge</title>
 <link>http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19328#p19328</link>
 <description>it seems that no matter what i do, i have problems with fights where either a NPC that shouldnt be able to dodge a single attack does, or fights where the fighters are extremely close and almost every attack is being dodged by both parties. like u said it seems like it should work, but doesnt. strength and agility have no restrictions on my game, so the two attributes can range anywhere from 1 to 10000 and above, though the average combination for my highest experienced players is around 3000</description>
 <guid isPermaLink="true">http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19328#p19328</guid>
 <pubDate>Wed, 28 Oct 2009 15:48:12 PDT</pubDate>
 <category>SmaugFUSS</category>
 <author>nobody@example.com (blueice)</author>
</item>
<item>
 <title>determining dodge</title>
 <link>http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19327#p19327</link>
 <description>What is the problem that you're seeing with your code? I haven't gone through it beyond a cursory glance, but it looks like the general idea is what you've described. Is it behaving differently from your expectation?</description>
 <guid isPermaLink="true">http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19327#p19327</guid>
 <pubDate>Wed, 28 Oct 2009 14:12:03 PDT</pubDate>
 <category>SmaugFUSS</category>
 <author>nobody@example.com (David Haley)</author>
</item>
<item>
 <title>determining dodge</title>
 <link>http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19325#p19325</link>
 <description>i want to change the check_dodge function calculate the chance to dodge based on both the attacker and the victim, by comparing their combined attributes that affect the chance to hit/dodge, speed and agility. &lt;br /&gt;
&lt;br /&gt;
             difference =  attacker chance to hit - victim chance to dodge&lt;br /&gt;
                                  -100                        0                               100&lt;br /&gt;
completely miss |--------------------------()---------------------------------| unable to miss</description>
 <guid isPermaLink="true">http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19325#p19325</guid>
 <pubDate>Wed, 28 Oct 2009 13:38:09 PDT</pubDate>
 <category>SmaugFUSS</category>
 <author>nobody@example.com (blueice)</author>
</item>
<item>
 <title>determining dodge</title>
 <link>http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19324#p19324</link>
 <description>What exactly are you trying to do? I'm not sure I really follow what it is you're attempting enough to offer advice yet.&lt;br /&gt;
&lt;br /&gt;
</description>
 <guid isPermaLink="true">http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19324#p19324</guid>
 <pubDate>Wed, 28 Oct 2009 12:21:36 PDT</pubDate>
 <category>SmaugFUSS</category>
 <author>nobody@example.com (Kayle)</author>
</item>
<item>
 <title>determining dodge</title>
 <link>http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19323#p19323</link>
 <description>hello i have hit a wall in trying to rewrite the check_dodge function in my game. i scoured google, but the only thing i could find, besides references to world of warcraft, were function and formulas based entirely on the individual and not both fighters. just barely got back into programming so its probably something really simple, but god help me i cant figure it out.&lt;br /&gt;
&lt;br /&gt;
[code]bool check_dodge( CHAR_DATA *ch, CHAR_DATA *victim )&lt;br /&gt;
{&lt;br /&gt;
    int perc = number_percent();&lt;br /&gt;
    double dif, attacker, </description>
 <guid isPermaLink="true">http://www.smaugmuds.org/index.php?a=topic&amp;t=4220&amp;p=19323#p19323</guid>
 <pubDate>Wed, 28 Oct 2009 12:05:24 PDT</pubDate>
 <category>SmaugFUSS</category>
 <author>nobody@example.com (blueice)</author>
</item>

 </channel>
</rss>
