Genetic Algorithms?

 
Post new topic   Reply to topic    mudlab.org Forum Index -> Design
View previous topic :: View next topic  
Author Message
raz



Joined: 13 May 2005
Posts: 11

PostPosted: Sun May 15, 2005 10:56 pm    Post subject: Genetic Algorithms? Reply with quote

I'm just curious if anyone has gotten far enough to try using genetic algorithms in their codbases. Basically, I'm looking for to someday implement a few within my event subsystem in order to improve performance as the game goes on.

I know that recent Linux kernels are using (albeit small) genetic algorithms in order to reduce CPU use by 1-3%. Does anyone think that MUDs might enjoy a simliar benefit, or are they too small to do much effectiveness?
Back to top
View user's profile Send private message MSN Messenger
Author Message
eiz



Joined: 11 May 2005
Posts: 152
Location: Florida

PostPosted: Mon May 16, 2005 5:57 am    Post subject: Re: Genetic Algorithms? Reply with quote

raz wrote:
I'm just curious if anyone has gotten far enough to try using genetic algorithms in their codbases. Basically, I'm looking for to someday implement a few within my event subsystem in order to improve performance as the game goes on.


What exactly would you tune using this? In my experience a MUD spends the vast majority of its time waiting on IO anyway.

raz wrote:

I know that recent Linux kernels are using (albeit small) genetic algorithms in order to reduce CPU use by 1-3%. Does anyone think that MUDs might enjoy a simliar benefit, or are they too small to do much effectiveness?


Actually, it's a patch. I'm pretty sure it's not included in the official kernel releases. 1-3% doesn't sound like it's worth it, honestly.
Back to top
View user's profile Send private message Visit poster's website
Author Message
raz



Joined: 13 May 2005
Posts: 11

PostPosted: Mon May 16, 2005 12:27 pm    Post subject: Re: Genetic Algorithms? Reply with quote

eiz wrote:
What exactly would you tune using this?


I would think it would be effective in tuning the game flow mechanism (updating the game, handling events, etc.). Although, I think it would only really benefit if the game was an iterative server.

Quote:
In my experience a MUD spends the vast majority of its time waiting on IO anyway.


Sure. I guess a disclaimer would need to be that I'm assuming there is a signifigant amount of time spent elsewhere in the MUD that could be tuned.

Quote:
Actually, it's a patch. I'm pretty sure it's not included in the official kernel releases. 1-3% doesn't sound like it's worth it, honestly.


Opps... You're right. I misread that Slashdot article.
Back to top
View user's profile Send private message MSN Messenger
Author Message
eiz



Joined: 11 May 2005
Posts: 152
Location: Florida

PostPosted: Mon May 16, 2005 12:52 pm    Post subject: Reply with quote

raz wrote:

I would think it would be effective in tuning the game flow mechanism (updating the game, handling events, etc.). Although, I think it would only really benefit if the game was an iterative server.


Well our main loop looks like this:

Code:

Game.cs:
         while (_state == GameState.Running) {
            int waitUs = world.Update();
            world.FlushAvatarOutput();
            world.FlushDirty(5);
            _networkApplication.Monitor(waitUs);
         }

World.cs:
      private PriorityQueue _events = new PriorityQueue(PriorityQueue.Order.Ascending);

      public int Update () {
         DateTime now = DateTime.Now;
         while (_events.Count > 0 && ((Timer)_events.Top).Time <= now) {
            Timer timer = (Timer) _events.Pop();
            if (timer.Fire())
               AddTimer(timer);
         }
         
         if (_events.Count > 0)
            return (int)((((Timer)_events.Top).Time.Ticks - now.Ticks) / 1000);
         else
            return 10 * 1000 * 1000;
      }


This pretty much constitutes our 'game flow mechanism' in its entirety. Try as I might, there are only two performance-related concerns I can think of with this code: we need a heuristic to determine how many objects we should actually be flushing on each iteration (suggestions welcome; I'm just going to put waitUs/someConstant otherwise), and we should probably coalesce events that occur very close together to cut down on polling frequency. I can't think of how GAs would help us here. But, I have never actually used GAs myself, and only have a vague understanding of the concept, so perhaps I'm missing something important. Smile Or perhaps our design just doesn't qualify, or perhaps I'm looking at the wrong thing here.

We do just about everything in one thread as you can see (which is more or less fine, because our server has one CPU, albeit with HT). I don't know if this is relevant to your question or not.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    mudlab.org Forum Index -> Design All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
BBTech Template by © 2003-04 MDesign