Hi James, <br> <br> I've seen this problem too. It's an AI problem and not a coding problem per se. So as long as people don't move them planets around during a pickup game, I think we are okay. <br> <br> Many years ago, I used to run <br> <br> gdb robot -h localhost<br> <br> And wait for a segmentation fault. Found quite a few "bugs" (about 5) that got plugged up. Since this code is really different from what I worked with. Not sure if I should do that again. <br> <br> I'm going to take the Microsoft approach, and add all the features into the robotd directory in first before I go into de-bugging...<br> <br> Jimmy<br> <br><br><b><i>James Cameron <quozl@us.netrek.org></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> The following patch (from my repository) builds on Jimmy's work and<br>takes into account home planets that may have been moved as part of
a<br>scenario, or where new home planets are nominated by the PLANETS setting<br>in etc/sysdef.<br><br>I've tested this to my satisfaction, by running a game with the robots<br>and using xsg to move things around.<br><br>One thing I did notice, which I'm calling for help on from anyone who<br>knows the code better ... is that the robots would stop concentrating on<br>the enemy planets in favour of the third space planets, if those third<br>space planets were within range of them.<br><br>Move a few Orion planets to the front between Romulan and Federation,<br>and the robots just orbit them with shields down, presumably trying to<br>bomb, and dying.<br><br>I think I've seen this in situations with unmodified planet positions.<br><br>-- <br>James Cameron mailto:quozl@us.netrek.org http://quozl.netrek.org/<br>Wed May 10 17:31:41 EST 2006 quozl@us.netrek.org<br> * robots to cloak near any home planet<br> Factorised the decision of what makes a res death risk, and
included a<br> check for proximity to any home planet. Used ntserv/enter.c and max<br> phaser distance to determine a rectangular area of risk.<br>diff -rN -u old-netrek-server/Vanilla/NEWS new-netrek-server/Vanilla/NEWS<br>--- old-netrek-server/Vanilla/NEWS 2006-05-10 22:16:31.000000000 +1000<br>+++ new-netrek-server/Vanilla/NEWS 2006-05-10 22:16:31.000000000 +1000<br>@@ -1,3 +1,4 @@<br>+- fix practice robots to cloak when bombing near home planet [Huang]<br> - fix INL confine to knock ships out of orbit [Cameron]<br> - describe a local unnamed server as "server on this computer" [Cameron]<br> - fix cambot regression [Cameron]<br>diff -rN -u old-netrek-server/Vanilla/robotd/assault.c new-netrek-server/Vanilla/robotd/assault.c<br>--- old-netrek-server/Vanilla/robotd/assault.c 2006-05-10 22:16:31.000000000 +1000<br>+++ new-netrek-server/Vanilla/robotd/assault.c 2006-05-10 22:16:31.000000000 +1000<br>@@ -43,6 +43,30 @@<br> }<br> }<br> <br>+/* determine if there is risk
of death due to res of opponent */<br>+static int risk_res_death(struct planet *pl)<br>+{<br>+ if (pl == NULL) return 0;<br>+ /* One of the home planets identified by server etc/sysdef PLANETS */<br>+ if (pl->pl_flags & PLHOME) return 1;<br>+ /* Altair in standard position */<br>+ if (pl->pl_no == 7 && pl->pl_x == 11000 && pl->pl_y == 75000) return 1;<br>+ /* Draconis in standard position */<br>+ if (pl->pl_no == 16 && pl->pl_x == 28000 && pl->pl_y == 23000) return 1;<br>+ /* Scorpii in standard position */<br>+ if (pl->pl_no == 26 && pl->pl_x == 70720 && pl->pl_y == 26320) return 1;<br>+ /* Within rectangular phaser distance of any home planet res point */<br>+ int i;<br>+ for (i=0,pl=planets;i<MAXPLANETS ;i++,pl="" {=""><br>+ if (pl->pl_flags & PLHOME) {<br>+ if(ABS(pl->pl_x - me->p_x) < 12000 && ABS(pl->pl_y - me->p_y) < 12000) {<br>+
return 1;<br>+ }<br>+ }<br>+ }<br>+ return 0;<br>+}<br>+<br> goto_assault_planet()<br> {<br> Player *e = _state.closest_e;<br>@@ -79,17 +103,7 @@<br> /* cloak bomb near enemy core, so you don't get res-killed */<br> <br> if (pdist < 7000) {<br>- if (pl && pl->pl_flags&PLHOME)<br>- cloak=1;<br>-<br>- if (pl && pl->pl_no == 7) /* Altair */<br>- cloak=1;<br>-<br>- if (pl && pl->pl_no == 16) /* Draconis */<br>- cloak=1;<br>-<br>- if (pl && pl->pl_no == 26) /* Scorpii */<br>- cloak=1;<br>+ if (risk_res_death(pl)) cloak = 1;<br> }<br> <br> if(pdist < 10000 && edist < 18000)<br>@@ -174,17 +188,7 @@<br> }<br> <br> /* cloak bomb near enemy core, so you don't get res-killed */<br>- if (pl && pl->pl_flags&PLHOME)<br>- cloak=1;<br>-<br>- if (pl && pl->pl_no == 7) /* Altair */<br>- cloak=1;<br>-<br>- if (pl
&& pl->pl_no == 16) /* Draconis */<br>- cloak=1;<br>-<br>- if (pl && pl->pl_no == 26) /* Scorpii */<br>- cloak=1;<br>+ if (risk_res_death(pl)) cloak = 1;<br> <br> if(cloak)<br> req_cloak_on();<br><br>_______________________________________________<br>netrek-dev mailing list<br>netrek-dev@us.netrek.org<br>http://mailman.us.netrek.org/listinfo/netrek-dev<br></MAXPLANETS></blockquote><br>