2
\$\begingroup\$

I play an indie flight simulation game in Windows. I want to add a specific feature by means of creating a third-party add-on.

This apps will "link" and gather current altitude and position data from the game. My program will play sounds during certain altitude and airplane configurations (it's called GPWS).

I have seen the same thing done in an online RPG game where an external program counts damage dealt in the game (which requires peeking at the game's variables), so I think this is very possible.

My question is:

  1. What is this data-gathering called? I googled many terms like hijacking or linking but the result is not what I meant.
  2. How do i create program like this? I don't mind if its in other languages like Java or Visual Basic, but my main experience is in C++.
\$\endgroup\$

closed as off-topic by Gnemlock, Kromster, MrCranky, Alexandre Vaillancourt Dec 2 '17 at 0:55

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Programming questions that aren't specific to game development are off-topic here, but can be asked on Stack Overflow. A good rule of thumb is to ask yourself "would a professional game developer give me a better/different/more specific answer to this question than other programmers?"" – Kromster, Alexandre Vaillancourt
If this question can be reworded to fit the rules in the help center, please edit the question.

0
\$\begingroup\$

The least brittle strategy, as mentioned in Ilja's answer, is to use the game's own modding interface.

As to the question in the title, there are OS-specific APIs to read another processes memory like ReadProcessMemory and ptrace. C++ is one of the better suited languages for interfacing with native OS APIs, so you're in luck with language choice.

Without knowing the specifics, It's hard to tell what the other programs you mention are doing exactly -- I imagine an easy way to get damage values in an RPG is to sniff network packets instead of trying to locate memory locations, but that probably wouldn't work for a single player flight simulator.

Keep in mind that the address of a particular variable in the memory space of a process is not always fixed and can change from run to run. You can use strategies like scanning for known values to help locate the exact address, but it may help to take a look at how players use tools like CheatEngine to scan for the correct addresses.

\$\endgroup\$
  • 1
    \$\begingroup\$ One note to be aware of is that programs that snoop another process's memory can trigger anti-cheat mechanisms in some games or game services, so proceed with caution. If the game requires an account, do your testing with a dedicated account so you don't get your main player account banned. ;) \$\endgroup\$ – DMGregory Nov 14 '17 at 21:12
0
\$\begingroup\$

One of the easiest way to access 'in-game-variables' is through some public API (Application programming interface) which this game provides. Not every game provides a public API: the bigger the game is, the more likely this will provide a (good documented) API and vice versa.

The game could also be simply not-modifiable, if game developers don't like user to manipulate in-game data. Or on the contrary, developers could offer some modification toolkit for the game, that allows you to create in-game-content in more simple way.

So in your example with indie-game I wouldn't expect that there is some documented public API or modification toolkit available. But if you know that it's possible to modify your indie-game in some way, then I would search for some additional information about it (i.e. at game forums, search Google/YouTube for tutorials etc.).

The other way to access all game variables is through memory modification, which you can achieve with some third-party programs, that can interpret memory one or another way (i.e. ArtMoney). But this is more like hacking, not modification that you wanted to achieve.

\$\endgroup\$
  • \$\begingroup\$ They don't want to modify the game, they only want to sniff information from it. How could they do that? \$\endgroup\$ – Alexandre Vaillancourt Nov 14 '17 at 14:39
  • 1
    \$\begingroup\$ @AlexandreVaillancourt Then they should learn, how to read and interpret memory, that their game use :) \$\endgroup\$ – Ilja Nov 14 '17 at 15:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.