<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">It is half the distance because the ships travel two squares in 1 turn, IOW<br>2 squares = 1 'light years' = 1 turn.<br>This is desirable behaviour in my opinion, otherwise if ships took twice as many turns to move the same distance the game would be much slower and more boring.<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Pinaraf <pinaraf@gmail.com><br>To: Jack Grahl <mnvl16@yahoo.co.uk><br>Cc:
KDE games development <kde-games-devel@kde.org><br>Sent: Sunday, 20 May, 2007 9:59:46 AM<br>Subject: Re: [Kde-games-devel] Konquest - patch for distance function<br><br>Hi<br><br>The problem now is : why is it half the euclidian distance ?
Honestly, I don't remember...<br>The distance==0 problem is different. If you divide by two, you get 0 between (0,0) and (1,1) because 1/2 and 1/2 are 0 when converted to an integer...
<span class="e" id="q_112a6d979be57d92_1"></span><br><br><div><span class="gmail_quote">On 5/20/07, <b class="gmail_sendername">Jack Grahl</b> <<a rel="nofollow" target="_blank" href="mailto:mnvl16@yahoo.co.uk">mnvl16@yahoo.co.uk</a>> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
Hi Pinaraf,<br>Glad to hear that you are maintaining <span id="st" class="st">Konquest</span>.<br>The patch that I sent you was the wrong way around! It should have replaced the code where you divide by 2 half way through the calculation, with dividing by two only at the end. According to what you told me, this modification has already been done. The older version of the game that I have actually does have the
<span id="st" class="st">distance</span> function such that the <span id="st" class="st">distance</span> from (0,0) to any of (1,0), (0,1) and (1,1) is zero!<br>Just to make things clear, the current function is half the correct Euclidean
<span id="st" class="st">distance</span>, or the <span id="st" class="st">distance</span> if the unit is taken as being two grid squares.<br>I'm pleased that the AI patch was also included. Sorry to bother you with comments about stuff that has already
been fixed. Clearly I should get hold of the KDE4 version, and get back to you if there are any more improvements to be made.<br><br>Best wishes, and thanks for getting back to me so quickly<br>Jack Grahl<div><span class="e" id="q_112a6d979be57d92_1">
<br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Pinaraf <<a rel="nofollow" target="_blank" href="mailto:pinaraf@gmail.com">
pinaraf@gmail.com</a>><br>To: KDE games development <<a rel="nofollow" target="_blank" href="mailto:kde-games-devel@kde.org">kde-games-devel@kde.org</a>><br>Cc: Jack Grahl <
<a rel="nofollow" target="_blank" href="mailto:mnvl16@yahoo.co.uk">mnvl16@yahoo.co.uk</a>><br>Sent: Sunday, 20 May, 2007 12:52:45 AM<br>Subject: Re: [Kde-games-devel] Konquest - patch for distance function
<br><br>Hi<br><br>I'm maintaining Konquest (ok, problem is : I don't really know what to do...)<br>I started maintaining it for KDE4 only, I never looked at the KDE 3.5 code and honestly I don't want to, I think it'd be a great waste of time to backport the changes : scalable graphics (even without svg), better user interface, better AI...
<br>The AI patch has been integrated in KDE4, and it was a shame it wasn't applied before in KDE3.5.<br>The distance computation code in KDE4 is the following :<br> Coordinate diff = p1->sector()->coord() - p2->sector()->coord();
<br> return sqrt( double( ( diff.x() * diff.x() )<br> + ( diff.y() * diff.y() ) ) ) / 2;<br>And it's mathematically correct. The distance between two points is half the square root of the sum of square differences... (hard to explain)
<br>If you have two points, (0, 0) and (1, 1). The distance between them is sqrt(2)/2<br>With your computation code, it's 1 ==> there is no difference between going to (1,0), (0,1) and (1,1)<br><br>Also please before modifying Konquest : look at the KDE4 version.
<br>I don't think it's worth the effort of maintaining the KDE 3 version considering that KDE3 end is near, most distributions are now packaging KDE 4 parts (for instance Suse 10.3 will include Kdegames 4...), and KDE 4 games are just great.
<br><br>Of course, I'm open to any suggestion on Konquest, and the same apply for other kde games. But for konquest, please... don't care about the KDE 3 version, I don't want to play with that code :p<br><br>
<br><div><span class="gmail_quote">On 5/20/07, <b class="gmail_sendername">Jack Grahl</b> <<a rel="nofollow" target="_blank" href="mailto:mnvl16@yahoo.co.uk">mnvl16@yahoo.co.uk
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi there,<br>I've written a modification to the 'distance' function in Konquest, which calculates the distance between planets. The new function is essentially the same, but changes the order of operations to better conserve accuracy. The accuracy isn't critical since the number of turns ships take to travel between planets is obviously an integer. However the new function is more understandable (when using the ruler) and easier to estimate by eye (since it is closer to usual distance in the plane). Of course this changes the strategy, but not critically since the relative distances of the planets are more important than their layout in the plane.
<br>I was also wondering whether this game is being actively maintained at the moment. Someone submitted a nice patch several years ago which improved the AI for the game and would have simplified improving it further, by abstracting it from the core game engine. This patch doesn't seem to ever have been applied. There are also several more modifications to this game I'd like to do gradually - mainly to do with useability. Perhaps someone could let me know what the situation is?
<br>Best wishes,<br>Jack Grahl<br><br><br>--- kdegames-3.5.5/kdegames-3.5.5/konquest/gamecore.cc 2007-05-19 21:26:38.000000000 +0100<br>+++ kdegames-3.5.5-dist/kdegames-3.5.5/konquest/gamecore.cc 2005-09-10 09:18:23.000000000
+0100<br>@@ -49,10 +49,10 @@<br> double<br> CoreLogic::distance( Planet *p1, Planet *p2 )<br> {<br>- int k = (p1->getSector().getRow() - p2->getSector().getRow());<br>- int l = (p1->getSector().getColumn() - p2->getSector().getColumn());
<br>+ int k = (p1->getSector().getRow() - p2->getSector().getRow()) / 2;<br>+ int l = (p1->getSector().getColumn() - p2->getSector().getColumn()) / 2;<br><br>- return (sqrt(double((k*k) + (l*l))) / 2);
<br>+ return sqrt(double((k*k) + (l*l)));<br> }<br><br> double<br><br><br><br><br><br> ___________________________________________________________<br>Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
<br>now.<br><a rel="nofollow" target="_blank" href="http://uk.answers.yahoo.com/">http://uk.answers.yahoo.com/</a><br>_______________________________________________
<br>kde-games-devel mailing list<br><a rel="nofollow" target="_blank" href="mailto:kde-games-devel@kde.org">kde-games-devel@kde.org
</a><br><a rel="nofollow" target="_blank" href="https://mail.kde.org/mailman/listinfo/kde-games-devel">https://mail.kde.org/mailman/listinfo/kde-games-devel</a><br></blockquote>
</div><br>
</div><br></span></div></div></div><span class="ad"><br>
                <hr size="1">
Web email has come of age. Don't settle for less than the <a rel="nofollow" target="_blank" href="http://us.rd.yahoo.com/mail/uk/taglines/gmail_com/nowyoucan/web_mail/*http://us.rd.yahoo.com/evt=40566/*http://uk.docs.yahoo.com/nowyoucan.html">
All New Yahoo! Mail</a>.</span></div></blockquote></div><br>
</div><br></div></div><br>
<hr size="1">
Yahoo! Mail is the world's favourite email. Don't settle for less, <a rel="nofollow" target="_blank" href="http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html">sign up for your free
account today</a>.</div><br></div></div><br>
                <hr size=1>
What kind of emailer are you? Find out today - get a free analysis of your email personality. Take the quiz at the <a href="http://uk.rd.yahoo.com/mail/uk/taglines/default/championships/quiz/*http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk/">Yahoo! Mail Championship</a>.</body></html>