CS_

Member
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

236 Neutral

About CS_

  • Rank
    Newbie
  1. DFS in a collection of computers.

    The reason I mentioned OSPF as a starting point is that it is a routing protocol, which to me seems to be exactly what the OP's problem describes: independent entities requiring their own idea of their network's topology. As I said, the article might serve as inspiration. *shrug*
  2. DFS in a collection of computers.

    I don't think this is so much an (game) AI related problem. A bit of wikipedia delving starting at [url="http://en.wikipedia.org/wiki/Open_Shortest_Path_First"]OSPF [/url]might give you some ideas though?
  3. [quote name='SiCrane' timestamp='1354759002' post='5007599'] It's basically inherited from C, which was developed in a time when computers were sufficiently low on memory that they literally couldn't fit all the symbols necessary for a complex program in memory all at the same time and still have room for actual code. Programmers would be able to identify which symbols were really needed and include only those headers.[/quote] Thank you, though I should have been more clear in indicating that I do understand the reason, but simply cannot stand the additional handling complexity. Of course it has its raison d'etre even today (embedded systems come to mind), but I might see the language in a more positive light if the .h/.c(pp) separation wasn't all but mandatory when targeting systems with plenty of resources. My apologies.
  4. My pet peeve: that whole header file / code file separation. Why does C(++) want me to juggle those two when every other language I've ever been exposed to conveniently uses one file for both? That's why I decided to make C# my primary language. I just try to design my projects around the supposed ~5% loss of overall speed.
  5. [quote name='crancran' timestamp='1354305123' post='5005809'] Using boost asio with an io service worker thread, I can have the service event loop continually respond to read/write operations as fast as possible and update an internal queue of message packets received from the server. During the main game loop I can simply lock the queue, make a clone, clear, and unlock then process the cloned list. [/quote] Double buffer your queue. Add two of them, one for receiving events, one for processing. When the processing queue is, well, processed, throw your lock on the manager and switch the two queues around. Much shorter lock time, I expect.
  6. Lazyworm, I would try a different approach. Instead of checking netstate for every guildmate every time a player requests their guild roster, you could have a "roster" object - basically a table of all guild members, with one field reserved for online status. If a member logs in or out, the netstate change sends an update event to the guild roster they are associated with. If someone requests to see the guild roster, just send the whole thing*, register the netstate with some "open connections" list associated with the roster object, deregister when the client reports the player closed the guild list locally, and send a state update to all clients on the "open connections" list whenever a log-in/off event reaches the roster object. * = compressed, but I really don't see many game guilds that would require a table of more than three or four KB, so even though data economy should still be a priority for every networker, even slow connections shouldn't be overly taxed. Pseudo code: [code]struct MemberInfo Name, level, ...(stuff), online status, reference to actual player data end class GuildRoster { Roster = list of MemberInfo elements in whatever format you prefer Listeners = list of netstates currently looking at roster info void RegisterListener() // these two should be self explaining void DeregisterListener() void UpdateMemberInfo(memberid, info element to update, new state) update table for each entry in Listeners send update end ... end [/code] Hope it helps!