Help

This is a discussion on Help within the C++ Programming forums, part of the General Programming Boards category; I'm trying to make a program that simulates human interaction with a game. The program will need to be able ...

  1. #1
    es3
    es3 is offline
    Registered User
    Join Date
    Apr 2005
    Posts
    3

    Help

    I'm trying to make a program that simulates human interaction with a game. The program will need to be able to tell if something is on the ground, what is on the ground, where it is, and so on. Ofcourse this would totally depend on the game, but overall I was wondering what the best way to do this would be. Perhaps packets? I don't know. I'm at a loss.

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Ofcourse this would totally depend on the game
    Yes!
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    What?

    Maybe the "something" is an object????? Maybe the position is a structure??????



    Assuming that you are totally new to C++ :

    1 - If you're talking about an existing commercial game... Making the computer play the game... forget it! That's advanced artificial intelligence, not to mention the low level (driver level) stuff to read the pixels and "see" what's presented on the screen.

    2- If you're talking about a program you're going to write. Start by working through the cprogramming.com tutorials.

    After that, if you're still interested, get a beginning C++ book and work through that.

    Now, if your program isn't going to have graphics, you are ready to start planning your program, and you will have a good background to research the stuff you don't know how to do.

    If your programs will have graphics, you need to work-through a graphics book (and/or Window or GUI book) before getting started.

  4. #4
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    my answer: make a big array of characters, and put characters in certain places on the grid, standing for certain thigns... as example, make your grid like this:
    Code:
    EEEEREEEE
    EEERRREEE
    EEEEREEEE
    EEEEPEEEE
    where the 'E' is empty ground and the 'R' is a rock (mountain) that the player can't go on... and the 'P' is a poison Ivy patch that if the player walks over, will catch ivynuts+2, which will slow his movement down to 1/3.

    and the player woudl be a class, wherein he'd have some array of items... every time he picked up an item, it would be added to the array, and every time he dropped/used/gave an item, it would be removed. the bounds of the array serve as the amount he/she can carry.

    in the above example, you're going to want to have another method of keeping track of his ivynuts, and probably put some kind of timeout on that... as in the amount of turns he takes before his ivynuts are cleared and he can walk like a real man again.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  5. #5
    es3
    es3 is offline
    Registered User
    Join Date
    Apr 2005
    Posts
    3
    I'm not totally new to C++. I just need to find a way to draw information from the game and with that information, then act on the game. It's been done before with a game called Diablo 2. www.d2jsp.org
    This guy did it. I e-mailed him and asked him and he sent me a site. It's something I've never heard of before. I'll post the e-mail/site. when I get home and have access to my e-mail.

  6. #6
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    that most definately depends on the specific game... and it doesn't look to me like he created a computer-player, but rather a set of scripts that would help a human player gain an advantage.

    in most games people just call these hacks and they usually get you kicked/banned from servers...
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  7. #7
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    how you get info from the game i don't know......

    but you can send messages to the windows queue directed at the instance of the game and trick it into thinking that you're the one making those mouse clicks
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  8. #8
    Registered User
    Join Date
    Jan 2003
    Posts
    361
    You need to write a program to read what data the game is sending to memory and then interpret it from there. Such as if you press W to move forward...what message does that send? You then would need to have your program send that same code so the game won't know the difference.

    That however is indeed hard to make and sounds a bit shady.

    EDIT: Re reading the posts it sounds as though you want to make a program to quickly pick items up from the ground. Well you would want to read what the game is sending such as

    Item_Drop(gold.50000, x, y)

    and then have the mouse move to x,y and click, or have it interpret if the item is worth picking up...you don't want those crappy grey items.
    Last edited by Glirk Dient; 04-29-2005 at 10:47 AM.

  9. #9
    es3
    es3 is offline
    Registered User
    Join Date
    Apr 2005
    Posts
    3
    Glirk Dient, you have a good idea of what I'd like to do. This is something that would be increadibly hard to do, but I would learn so much by doing it. I e-mailed the creater of d2jsp and he said this :

    "Check out this site:

    http://ffxi.archbell.com/

    He has some docs on how to do wrapping and hooking. I haven't read them
    thoroughly, but it should get you started."

    So it revolves around wrapping and hooking. Any1 have any idea what that is? I checked out the site. The guides aren't complete. Tried looking for another one and i didnt get much luck.

    Edit : Also, Dirk. How would I know the variable that that game reads or sends to see where the gold is. How would I find out this information. Is their like a process sniffer or something that moniters all the input and output of the processor?

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21