Server Help

Bot Questions - twcore issues.

wiredfreak - Thu Apr 14, 2005 2:56 pm
Post subject: twcore issues.
Hey guys. I've got the latest twcore distro, and I'm having a serious issue that I can't figure out....

I'm rather new to Java, so bear with me on my obvious newbishness.

Here's the problem... I can have a bot log in, accept and respond to PM's and whatever else I want it to do... but... It's losing the death messages. Sometimes the kill tracking works, most of the time it doesn't. Seems to be completely random...

I've put tracers in the code where I can, and it seems like the death messages just disappear. I've got reliable kills turned on, but to no avail.

I'm using j2sdk1.4.2_07. What am I missing? Why isn't this working? It doesn't seem to lose PM's or any other type of message... just the kill messages. It's very frustrating. new_let_it_all_out.gif

-wf
wiredfreak - Thu Apr 14, 2005 3:16 pm
Post subject:
I just tried j2sdk1.4.2_08 with no success either.

-wf
Mr Ekted - Thu Apr 14, 2005 4:13 pm
Post subject:
Check the settings for Routing:DeathDistance. This the maximum distance away from the location of a death that a packet will even get queued. Even with this set very large, I still get missing death packets with PowerBot.
wiredfreak - Thu Apr 14, 2005 4:28 pm
Post subject:
Dude. You rule. biggrin.gif

I set it to 16384 and now receive the kill messages in the bot every time!

-wf
D1st0rt - Thu Apr 14, 2005 7:40 pm
Post subject:
Ew, thats a bit of overkill IMO. Instead, what I would do is turn on reliable kills so that the bot is the only one that gets all the death packets. Most players don't need all of them when they're 16000 pixels away. This can be achieved using a call to
Code: Show/Hide
m_botAction.setReliableKills(1);

What this does is send a chat message containing "*relkills 1" which according to shanky.com, "If sent # of 1, you will always get reliable kills."
Mr Ekted - Thu Apr 14, 2005 8:12 pm
Post subject:
Doesn't work. All that does is makes the kills the server DOES send reliable. It still only sends based on the arena setting. Also, even with reliable kills AND a maxed setting, they can still be dropped.
wiredfreak - Thu Apr 14, 2005 8:39 pm
Post subject:
As I said in the original post... reliable kills IS enabled. But still doesn't receive them if outside the range specified...

-wf
Anonymous - Thu Apr 14, 2005 9:36 pm
Post subject:
ekted owns you all, good luck with the bot wired

(off topic) just wondering ekted, what zone do you play? tongue.gif
Mr Ekted - Thu Apr 14, 2005 9:52 pm
Post subject:
Powerball
Cerium - Thu Apr 14, 2005 10:02 pm
Post subject:
Play???

Thats a bit of an understatement.
D1st0rt - Thu Apr 14, 2005 10:43 pm
Post subject:
Hmmm... learn something new every day biggrin.gif
Cyan~Fire - Fri Apr 15, 2005 6:07 pm
Post subject:
Yes, sending every death packet to every player is a bit of an overkill, but remember death packets are rather small, so it doesn't matter that much.
wiredfreak - Fri Apr 15, 2005 9:52 pm
Post subject:
More issues....

Ok, I'm trying to create a method to announce the current location of a player... I've gotten the bot to spec on the player....

But how the hell do I get his current location?

I've tried PlayerPosition.getXLocation() and PlayerPosition.getYLocation()... I've also tried Player.getXLocation() and Player.getYLocation()...

I get X as being very high, looks like pixels... but Y always comes back as 0. I can't seem to just use %coord in any way or fashion....

So how the hell do I do this?!

-wf
wiredfreak - Fri Apr 15, 2005 11:13 pm
Post subject:
Ok. Got it. A very itty bitty typo is what hung me up... Heh. Gotta love the little things... Here's the code I came up with, I'm sure there's a more efficient way, but I'm still a newb, so ... forgive me. icon_smile.gif

Code: Show/Hide

   public String getCoords(Player p) {
      int x=0;
      int y=0;
      
      x = (((p.getXLocation()/16) * 20) / 1024) ;
      y = (((p.getYLocation()/16) * 20) / 1024) + 1;

      String xc[]={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};

      return xc[x]+y;
   }

Mr Ekted - Fri Apr 15, 2005 11:24 pm
Post subject:
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA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AHAHA
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
Purge - Fri Apr 15, 2005 11:25 pm
Post subject:
Holy hell...
wiredfreak - Fri Apr 15, 2005 11:59 pm
Post subject:
Ok, I'm assuming by those two comments I either did this the REALLY HARD way... or I did something ingenious... I'm opting for the first of the two possibilities...

What's the better way of doing this?

-wf
wiredfreak - Sat Apr 16, 2005 12:28 am
Post subject:
Alright. Since I was LAUGHED at for my first try, here's a refined attempt!

Code: Show/Hide

public String getCoords(Player p) {
   String c[]={"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T"};
   int x=p.getXLocation()/819;
   int y=p.getYLocation()/819)+1;
   return xc[x]+y;
}


Better? I've only been doing this for a whole four days... Ya can cut the newbie some slack! Last time I coded was back in Dos 6.22 in Borland C 3.1!

-wf
SamHughes - Sat Apr 16, 2005 2:00 am
Post subject:
wiredfreak wrote:
Code: Show/Hide

   public String getCoords(Player p) {
      int x=0;
      int y=0;
      
      x = (((p.getXLocation()/16) * 20) / 1024) ;
      y = (((p.getYLocation()/16) * 20) / 1024) + 1;

      String xc[]={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O",
"P","Q","R","S","T","U","V","W","X","Y","Z"};

      return xc[x]+y
   }


Okay. First of all, dividing by 16, multiplying by 20, and dividing by 1024 is inefficient. Though it is the least of your worries. I would not divide by 819, as the mathematical result is not the same.

First, the fraction 20/16 could be simplified to 5/4. So you could have the two equivalent lines,

Code: Show/Hide
      x = (((p.getXLocation()/4) * 5) / 1024) ;
      y = (((p.getYLocation()/4) * 5) / 1024) + 1;


But there is no need to use two division operations, when one would suffice. So the lines could be replaced with

Code: Show/Hide
      x = ((p.getXLocation() * 5) / 4096) ;
      y = ((p.getYLocation() * 5) / 4096) + 1;


However, division is expensive. Instead of dividing by 4096, you could simply shift the bits 14 positions over. Division is slow; bit-shift operations are zippy. 4096 = 2**12, so that would be written as,

Code: Show/Hide
      x = ((p.getXLocation() * 5) >> 12) ;
      y = ((p.getYLocation() * 5) >> 12) + 1;


These lines are a distraction, though. The real source of inefficiency is

Code: Show/Hide
      String xc[]={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O",
"P","Q","R","S","T","U","V","W","X","Y","Z"};


This code will end up calling the String object's constructor 26 times. First of all, the possible coordinate letters run up to "T" and no further; the "U".."Z" are a waste. Second, there is no reason for this array to exist at all.

In order to get a character from A..T out of an integer in the range 0..19, all you have to do is add 65 to the integer. So you could use the lines,

Code: Show/Hide

char k[];
k[0] = x + 65;
k[1] = 0;

return String(k) + y;


instead of that humongous array garbage.

Maybe that could be written more concisely. Is

Code: Show/Hide
char k[] = {x+65,0};


valid C(++)? (Or must only constants lie in those brackets?)
wiredfreak - Sat Apr 16, 2005 2:39 am
Post subject:
Sam,

Thank you for the help. I've changed the mathematic lines... but, since this is Java, I don't know how to make the other portion of your code work...

I attempted to use it as-is to no avail, I get errors. I tried modifying to what I thought might work... still didn't work... so, I'm still stuck using the humongous string array. heh.

Any other ideas? icon_smile.gif

-wf
Solo Ace - Sat Apr 16, 2005 6:17 am
Post subject:
Haha, this
Code: Show/Hide
String xc[]={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};

reminds me of my "31337" code to convert "1337 5p34k" to normal language:

Quote:
return strreplace(strreplace(strreplace(strreplace(strreplace
(strreplace(strreplace(strreplace(strreplace(strreplace(
line, '1', 'i'),'2', 'z'), '3', 'e'), '4', 'a'), '5', 's')
,'6', 'g'), '7', 't'), '8', 'b'), '9', 'g'), '0', 'o');


Still can't use a second code block in my posts. icon_sad.gif
I wrote it like that to get a really ugly function call and, well, as you can see, it's bad ^ 10. sa_tongue.gif
Mr Ekted - Sat Apr 16, 2005 7:57 am
Post subject:
Be careful trying to simplify integer math.

Code: Show/Hide
a = b / 4 * 5;


is not the same as

Code: Show/Hide
a = b * 5 / 4;


Also, most compilers are very good at detecting simplifications in arithmetic--even ones that humans would not see. In this case, it's best to write code that makes sense and is readable, and let the optimizier do its job.

I am 100% against the String class no matter how simply it is used. Consider this code:

Code: Show/Hide
String function ()
{
String a;

// blah blah

return a + "wins the game!";
}


Whenever "a" is assigned a non-null value, memory is allocated. The return value is a string that needs to be created (allocated)--twice! And when the return value is assign back in the calling function, another allocation takes place. This is retarded. Maybe the use of this function is limited, but once you get used to using Strings, you will use them everywhere, and the above code could easily be 50x faster. No commercial app that handles large amounts of text (Notepad, Wordpad, Word, Excel, VisualStudio, IE, Netscape, Firefox, OpenOffice Write, etc) would be caught dead using String.
Cyan~Fire - Sat Apr 16, 2005 10:14 am
Post subject:
Ekted wrote:
Whenever "a" is assigned a non-null value, memory is allocated.

Code: Show/Hide
String::String()
{
   len = 0;
   msg = new char[1];
   *msg = '\0';
}

icon_cry.gif

Edit: Oh wait... this is TWCore, not MERV... oh well, Java Strings, even more inefficient. icon_razz.gif
wiredfreak - Sat Apr 16, 2005 11:36 am
Post subject:
Well, until I'm shown a better way to do things, it's going to be difficult for me to improve my coding abilities... Simply laughing at me or criticizing me without offering solutions to the problems doesn't do much other than show immaturaty and perhaps insecurity. But I'm not going to sling hash here... I came here for help, and the only ones that have really offered it are Mr. Ekted and Sam, granted that the former is the biggest offender of being offensive right now.

I'm new to this. I've said it more than once, and it should be quite obvious. It's similar to what I used to do many years ago, but I've forgotten quite a bit and am relearning everything... and then some. So, any future problems I have, I'll refrain from posting my spaghetti and simply ask for someone elses solution and see how close I came to being efficient with my own solution (if mine even works).

Regardless of how inefficient my code may be, it still functions the way it was designed and gives the desired results. That in itself should speak volumes when considering that when I posted that code, I'd only been working with Java and twcore for a whopping 4 days, without ever having looked at it before. Not to mention I haven't coded since the DOS 6.22 days in anything other than Tribes/1 gamecode (which was a disaster anyway).

And as to my simplification of the math I used, it actually simplified down to 819.2, but to keep it simple, I dropped the .2. It still gave me reliable coordinates, so it wasn't something I was too concerned with. I've decided to use Sam's solution to that problem, as it's just as effective, and I like how it looks. And he showed it to me without being snyde...

Cheers.

-wf
Solo Ace - Sat Apr 16, 2005 12:11 pm
Post subject:
Sam was the only one who actually gave you a solution. sa_tongue.gif

Anyway, I think you should look in the MERVBot source on how to do such things.

I think this is catid's C++ version on what you're trying to do (MERVBot v38, map.h (line 14 - 15) and map.cpp (line 32 - 54)):
Code: Show/Hide
// Code from map.h, line 14 - 15:

#define TILE_MAX_X 0x400
#define TILE_MAX_Y 0x400

//Code from map.cpp, line 32 - 54:

Sint32 getNumeric(Sint32 y)
{
   return (y * 20 / TILE_MAX_Y) + 1;
}

char getAlpha(Sint32 x)
{
   return char('A' + x * 20 / TILE_MAX_X);
}

String getCoords(Sint32 x, Sint32 y)
{
   String s;

   char alpha[2];
   alpha[0] = getAlpha(x);
   alpha[1] = '\0';

   s += alpha;
   s += getNumeric(y);

   return s;
}


This, would burn Ek's eyes again, though.

We were taught (and forced at tests) to use the String class in Java, and well, I'm sure the code I always have to use in my applets sucks.
Although, I'm the only one who actually knows how to get my applets to work, not even the teacher could teach me how to write better code.
Ah well, I don't like Java anyway.
SamHughes - Sat Apr 16, 2005 2:08 pm
Post subject:
Oh right, this is Java. Didn't notice that little "public" at the top of the function.

At any rate, in this case, the efficiency of Strings doesn't matter, since putting a player's location into human-readable letter-number coordinates is the sort of task that happens only once per user interaction.

Mr. Ekted wrote:
Whenever "a" is assigned a non-null value, memory is allocated. The return value is a string that needs to be created (allocated)--twice! And when the return value is assign back in the calling function, another allocation takes place. This is retarded.


I would call the programmer retarded, not the class. (Then again, looking at the way MERVbot's String class handles growing strings, I might reconsider calling the class retarded anyway.)

[Edit: Never mind. I just looked at the MERVbot String class's source code, and I would have to agree that it is something to be avoided. The class is indeed moronic. The standard library string class is much better.]
wiredfreak - Sat Apr 16, 2005 3:21 pm
Post subject:
Ok. How about this...

Code: Show/Hide

public String getCoords(Player p) {
   return =""+
      ((char)(65+((p.getXLocation() * 5 ) >> 12)))+
      (((p.getYLocation() * 5 ) >> 12) + 1);
}


Is THIS efficient enough?

-wf
SamHughes - Sat Apr 16, 2005 3:46 pm
Post subject:
Does it compile? There is an equals sign there. I don't know Java very well. The example I gave you was me thinking in C++ code for the MERVbot.

If it works, it would be efficient enough. The efficiency is not too important.
Cerium - Sat Apr 16, 2005 4:35 pm
Post subject:
Using "" to cast that statement into a string is what ekted was talking about. If youre really hellbent on making that efficient, use StringBuffer.

Oh yeah, and that equals sign will break it =)

Code: Show/Hide

public String getCoords(Player p) {
   return new StringBuffer(3).append( ((char)(65+((p.getXLocation() * 5 ) >> 12))) ).append( (((p.getYLocation() * 5 ) >> 12) + 1) ).toString();
}


That is assuming, of course, that the blocks inside the append( ... ) are correct.

-C
Mr Ekted - Sat Apr 16, 2005 4:52 pm
Post subject:
wiredfreak wrote:
Is THIS efficient enough?

-wf


Not even close.
SamHughes - Sat Apr 16, 2005 6:24 pm
Post subject:
This conversation is getting absurd.

"Efficient enough" means that the program works fast enough for the user not to notice. Outputting coordinates in string form is a rarely executed task, and a few milliseconds aren't going to hurt anybody.
wiredfreak - Sat Apr 16, 2005 6:51 pm
Post subject:
Sam & Cerium... doh. Yea, the equals wasn't supposed to be there. icon_smile.gif Me and my typos. heh.

Sam... Hehe... Yea, well, I'm trying to learn a little more about this... even if it doesn't get executed often enough to matter... it helps me.

There's more than one way to do anything... But you're right, Sam. icon_smile.gif

-wf
Underlord - Sun Apr 17, 2005 8:48 am
Post subject:
Code: Show/Hide

char str[4];

sprintf(str,"%c%d%c",char('A' + x * 20 / 0x400),(y * 20 / 0x400) + 1,0);

Mr Ekted - Sun Apr 17, 2005 9:53 am
Post subject:
Much better, but I would even go further. Sprintf is overkill.

Code: Show/Hide

char str[3];

str[0] = 'A' + x * 20 / 0x400;
str[1] = y * 20 / 0x400 + 1;
str[2] = 0;

Cyan~Fire - Sun Apr 17, 2005 10:50 am
Post subject:
Remember, Ek, this is Java. No char arrays for strings.

Also, I think Ekted talked earlier about the right shift. Please, don't do multiplication like that. The compiler will optimize that for you, and it just makes the code less readable.
Mr Ekted - Sun Apr 17, 2005 12:59 pm
Post subject:
Yes, but even in Java you could return the coords as two integral values and let any code that wants to display human-readable location format it how it likes.
wiredfreak - Tue Jun 07, 2005 9:19 pm
Post subject: TWCore crashes when logged in as SMod
Alright. More TWcore issues. I'm using the latest... TWCore 0.89

I'm just getting back into coding the bot I was working on way back when this topic was created.... So... it's still related.

Here's the issue.... If the bot is logged in as Sysop, there's no problem... HOWEVER.... if I log the bot in as an SMod... The whole thing comes crashing down if ?cheater or any similar command is used which displays a ?cheater type message.

When turning verbose on, I get the following thread of messages:

Tue 05-07-2005 08:07:51 slavebot is logging in.
slavebot logged in: 60 ms.
[Loaded java.lang.IndexOutOfBoundsException from C:\j2sdk1.4.2_07\jre\lib\rt.jar]
[Loaded java.lang.StringIndexOutOfBoundsException from C:\j2sdk1.4.2_07\jre\lib\rt.jar]
Tue 05-07-2005 08:07:54 slavebot is disconnecting...
Tue 05-07-2005 08:07:54 masterbot is disconnecting...
[Loaded java.lang.Shutdown from C:\j2sdk1.4.2_07\jre\lib\rt.jar]
[Loaded java.lang.Shutdown$Lock from C:\j2sdk1.4.2_07\jre\lib\rt.jar]


How do I fix the core so that it can be logged in as SMod instead of Sysop?

-wf
D1st0rt - Tue Jun 07, 2005 10:51 pm
Post subject:
I'm going through this right now along with some other dev team people, would you happen to have any specific information such as line numbers from the stack trace?

AFAIK, the bot has to be sysop anyways for most stuff to work in the current setup

EDIT: probably has something to do with this:
Code: Show/Hide
if( m_messageType == Message.ARENA_MESSAGE && m_message.startsWith( "misc:alertcommand:" )){
    alertCommands = m_message.substring( 18 ).split( "," );

wiredfreak - Tue Jun 07, 2005 11:59 pm
Post subject:
Unfortunately, this is the only information returned at the point of failure....

However... After mussing with the runbots.bat file and just generally screwing with things.... I tried the following batch command:

java -cp twcore.jar;twcore/misc/googleapi.jar;twcore/misc/mysql-connector-java-3.0.6-stable-bin.jar -verbose -Xdebug twcore.core.Start

What EXACTLY this did to my core execution... I do not know.... However... I know that I STILL get the messages *on the first reception* of the ?cheater type messages... but not again after... and the bot no longer craters.

I can't tell you why this works for me, but it's what I did. Also, since I'm *ONLY* using this to *TEST* and develop my bot before giving it to the owner of the zone to run on his own core bot... I do not need the additional functionality that sysop access grants. That's the primary reason I need this to run as SMod, since I'm only a writer for another zone.

I still have a lot to learn... I'm not an expert at all... but I like to believe I can at least stumble my way through a problem when I need to. icon_smile.gif

-wf
SamHughes - Fri Jun 10, 2005 4:35 pm
Post subject:
Mr Ekted wrote:
No commercial app that handles large amounts of text (Notepad, Wordpad, Word, Excel, VisualStudio, IE, Netscape, Firefox, OpenOffice Write, etc) would be caught dead using String.


Firefox uses string classes. There are a few string-related classes in there. But they don't use Mervbot's String class icon_smile.gif
D1st0rt - Sat Jun 11, 2005 3:56 pm
Post subject:
I figured out why the alert command thing doesn't work and I should have it fixed when we get our next release out (whevener that is sa_tongue.gif). What happens is it uses *g* to get the alert commands and since it returns nothing if you're smod it goes out of bounds when looking up by index. If its gonna be too long before an official release, I'll put up a patch on my site.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group