[CF-Devel] speed issue - those crazy rats?

crossfire-devel-admin at archives.real-time.com crossfire-devel-admin at archives.real-time.com
Fri May 9 01:32:09 CDT 2003


     sszretter at hotmail.com
     
      wrote:

>
     
     
     >
     
      SO I looked at the code some more, and it seems the map1 command is sent
     
     >
     
      continuously for animation purposes - like the rats wagging their tails.  At
     
     >
     
      least I think that is right.
     
     >
     
     
     >
     
      Has anyone thought about this issue?
     
     >
     
      I think it would be nice maybe to incorporate an anim command or something
     
     >
     
      similar so that the client doesnt have to deal with tons of map1 commands
     
     >
     
      coming in, so it can respond to keydowns and send those commands to the
     
     >
     
      server as quick as possible, and get the new map1 commands because of
     
     >
     
      movement as quick as possible...
     
     >
     
     
     >
     
      make sense, or hopefully am I missing something?
     
     
  The sending of the map1 command is not likely a big issue.

  The number of bytes sent still isn't really large, and the packing and 
unpacking of the packet isn't much overhead at all (At least in C).  And unless 
you are on a very slow connectin, the bandwidth shouldn't be much an issue.

  My guess is that the real hit you are seeing is the cost to redraw the 
different rat images.  I've done timing in the C client, and the processing of 
the data from the server is trivial - drawing it all to the screen is what takes 
some measurable CPU cycle.

  Also, encoding animation information is tricky and may not save a lot of CPU 
time.  Unlike the players inventory, where not much changes the animation rate 
of the players object, there is a lot more that can change the rate of monsters 
(paralyze, slow, diseases, etc).  Also, keeping things synced up adds extra 
complication - if for example you are surrounded by rats which may be in 
different phases of their animation, if you kill a few and a whole bunch move 
some spaces, you'd still need to send all the information for those that moved 
to keep them with the right phase.

  But more to the point, the rat case is a simplest case scenario.  If there are 
performance problems, you need to look at the issue of things like spells, which 
hit a whole bunch of spaces, may kill a whole bunch of creatures and destroy a 
whole bunch of objects.  That is a case where once again you are needing to do a 
lot of redraws, and would not get optimized that much by having the client 
handle those animations, as it is a very temporary effect.



_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list