DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: Game help. Sort of.

  1. #1
    Join Date
    Nov 2004

    Game help. Sort of.


    First a little background. I play an online game called EverQuest (i'm sure some of you have heard of it) In it, groups of people, like myself get together to raid monsters and dragons and such. Generally, people are in guilds and it is the guilds that get together as a 'family' and take targets out. As a reward for service, points are awarded to members for being on time and being present at the killing of the targets and such. These points can then, in turn, be used to bid on items to upgrade your character.

    What I am trying to do is develope a program that can read a log saved to a .txt file and compair names so see who was present at the on time log, present for killing of monster X Y and Z, the end of raid log ect. And then for it to compile a daily list of those so that someone can look and see that person_x was here on 3/4/05 for some mobs, and not there the next day.

    ___________|on time| target x | target y.....| end of raid
    PlayerName1 |    X    |     X      |    0           |   0
    Player 2       |    0    |     0      |    X            |  X
    player3        |    X    |     X      |    X            |  X
    Where player 1 was on time but left early, player 2 cme late but stayed until the end and player 3 was present the entire time. Being that there are anywhere from 40-70+ players per raid, 3 time logs and anywhere from 3-15 raid targets, this is more then a pain-in-the-*** to do by hand.

    My problem is I am newish to C++, in class we are just touching on strings/pointers and strcmp level stuff. I am wondering if this is possible for me to make something like this with just having that knowledge and IF SO....can someone just give me a pointer or 2 on just where to start (not do it for me, i want to do it) but like a basic guide of what would be needed. Thanks for any help. :WAVE:
    Last edited by Carcophan; 04-13-2005 at 03:21 PM.

  2. #2
    Join Date
    Nov 2004
    Should probably put an example in heh.

    [Wed Apr 13 15:33:17 2005] Players on EverQuest:
    [Wed Apr 13 15:33:17 2005] ---------------------------
    [Wed Apr 13 15:33:17 2005] [51 Brawler (Berserker)] Ugrr (Ogre) <Draco Invictus> LFG
    [Wed Apr 13 15:33:17 2005] [65 Arch Lich (Necromancer)] Grihm (Unknown) <Discordia Concord>
    [Wed Apr 13 15:33:17 2005] [64 Grandmaster (Monk)] Thecrazedgong (Iksar) <Discordia Concord>
    [Wed Apr 13 15:33:17 2005] [ANONYMOUS] Melarune  LFG
    [Wed Apr 13 15:33:17 2005] [70 Wraith (Necromancer)] Carcophan (Unknown) <Machin Shin>
    [Wed Apr 13 15:33:17 2005] There are 5 players in Nobles' Causeway.
    This is just some random zone I happened to be in just now, thats me on the bottom.

    I would want it to check for "Carcophan" and "Nobles' Causeway" and the "Wed Apr 13 " from the log i think. Unless there is a better way to do it. Maybe compare all names in zone vs a list of all the current <machin shin> guild members from our site ( ) and if zone and name match add them to the list to get points? maybe? Sometimes, people have the option to have the guild tag off and just be displayed as Melarune is above in the log, so checking for all MS in the zone could exclude people possible.

  3. #3
    Join Date
    Dec 2003
    Start smaller. (can you do just part of the problem, then build it up as you learn?) This is going to be too hard without a bit more background. Check out std::string, and even the mfc string, they all have much more toys than the string.h functions.

    Once you learn and absorb the tools you need, which may take 1-2 weeks, you should be able to build most of the program inside a day or a weekend at the most.

  4. #4
    Join Date
    Dec 2003
    Oh and you can probably use existing tools to do this, for example a fancy grep (use a batch file) could probably make a single, small text file full of the 'answers' you seek.

  5. #5
    Join Date
    Nov 2004
    Cool, will check that out.

    On a side note, i was thinking that I could declair each permanent players name in an array and then compair the days logs manually to that array and have it return true/false or X/O for attendence.

    You said start maybe just have an array with some names as elements and have a cin>>player_name which will ++ a counter each time the name that matches an element is entered?
    blah blah
    const char *names[] = {"Tom","****","Harry"}; 
    cout << "Enter name of character in attendence: ";
    cin >> playerName;
    check if name is in list
    then increment and loop ect
    cout << attendence
    Sort of an overly rough example, if you can try to use your imagination heh :SICK:

    I know I can do that with the knowledge I have or arrays and strings ect, just gotta figure out how to get it to work (when I write it)

    LATER after I have the std::string and mfc info can i then go on to add the 'log reading' function that would automaticly ++ for each of the taken logs?

  6. #6
    Join Date
    Dec 2003
    That all sounds ok. You still have to loop, even with the standard class iterators. (I really don't see the point of iterators most of the time, once in a while its handy). I would, instead of keeping a count, put the whole line of text into a stack or list or the like and dump that whole structure to a new file on the first go, because later on you will want to process those strings.

  7. #7
    Join Date
    Nov 2004
    Sadly, at my level, I cant make new files or dump stacks and whatever else you said =-). I dunno how close, if at all I am to learning that either, but i'll look that up also.

  8. #8
    Join Date
    Dec 2003
    Files can be pretty simple, esp. text files that just write a few lines and exit.

    ofstream ofs;"filename");

    for(.....) //all the saved strings
    ofs << string << endl; //or the string can contain the end of line. up to you


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center