View Single Post
  #7  
Old 11-15-2009, 11:38 PM
prickle
Hill Giant
 
Join Date: Sep 2009
Posts: 147
Default

Ok, a little update on this issue I had...

The changes listd above worked great on my server with my SoF client UNTIL I recompiled with bots. Once I added -DBOTS to world/makefile and zone/makefile and added bot.o to zone/makefile.common, my server started rejecting SoF clients again, AND the bots weren't zoning with Titanium clients....

SO, to make bot zoning, and SoF play nice with bots enabled I did the following:

edited world/makefile:

removed -O and -march=athlon64 from the COPTS line. So my current COPTS= line looks like:
Code:
COPTS=$(WFLAGS) -g -pthread -pipe -I../common/SocketLib \
 -DFX -D_GNU_SOURCE -DINVERSEXY -DWORLD $(DFLAGS) $(MYSQL_FLAGS) $(PERL_FLAGS)
Edited my zone/makefile:

Again edited my COPTS= line to remove ALL optimizations. This is the COPTS= line from my zone/makefile:
Code:
COPTS=$(WFLAGS) -g -pthread -pipe -D_GNU_SOURCE -DINVERSEXY -DFX -DZONE $(DFLAGS) $(MYSQL_FLAGS) $(PERL_FLAGS)
I tried it with just the changes suggested above, but with bots it didn't work for me. I then tried it with the optimizations stripped out of the zone/makefile, but it still wouldn't play nice with SoF. I had to strip optimizations out of bot the world and the zone makefile to make it play nice with SoF while bots are enabled.

Incidentally, this also fixed a bot zoning problem I'd been having. With the optimizations turned on the bot zoning code would get to line 3638 of the bot.cpp file and then bomb out. After turning the optimizations off it works fine for me.

In case it interests anyone this is the line in the bots.cpp that bombs out with Titanium clients and optimizations turned on for my server:
Code:
std::list<uint32> ActiveBots = Bot::GetGroupedBotsByGroupId(botOwner->GetGroup()->GetID(), &errorMessage);
I know environment plays as much of a role as anything else when it comes to compiling code. So, if it helps anyone else, the following are my server's stats:

Ubuntu 9.10 AMD64 Desktop
AMD Anthlon64 x2
4GB DDR2 RAM
AMD AM780G Chipset

GCC:
Code:
home:~$ gcc --version
gcc (GCC) 4.1.3 20080704 (prerelease) (Ubuntu 4.1.2-27ubuntu1)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Prior to upgrading to Ubuntu 9.10, I was compiling with gcc-4.3.3. The builds with default optimizations (well, I had to change -march=i686 to -march=athlon64 to compile) on that version seemed to be ok on Ubuntu 9.04. Once I upgraded to Ubuntu 9.10, the bots stopped zoning (with the binaries that I made on 9.04), and SoF clients wouldn't get into the world (never got to try SoF while I was on 9.04 so I don't know if that worked).

-O optimizations are usually considered "the safe" optimization, and I've seen most people recommend using -O2. However, I'm not sure why, but they have an adverse effect on EqEmu on my particular system (or maybe limited to AMD hardware?).

Incidentally, when the -march= optimization is removed the compiler automatically selects -mtune=generic for the CPU optimization.

ANYWAY! Thanks for tgetting me pointed in the right direction!
Reply With Quote