Page 1 of 1

Want to access variables from other program.

Posted: Tue Jun 06, 2017 10:52 am
by DementedPurple
Yeah, I'm trying to program an A.I that can play Pac-Man. However, to do that I would need to access the variables that the game is using. How would I do that? I also need to program software that can emulate a USB controller and have that control the A.I's input. Is what I'm doing impossible?

Re: Want to access variables from other program.

Posted: Tue Jun 06, 2017 11:18 am
by Zutano
A while ago, someone made an AI that learned to play Super Mario World.
https://www.youtube.com/watch?v=qv6UVOQ0F44

Looks like he used the BizHawk emulator, which can be scripted using Lua. The scripting engine probably provides access to the internal "RAM" of the emulated system, so you can get values for sprite positions and return controller inputs.

Re: Want to access variables from other program.

Posted: Tue Jun 06, 2017 12:20 pm
by tokumaru
Emulators with Lua scripting allow you to read and write to RAM. You'll have to reverse engineer the game (or read someone else's notes on it) to know where the variables you need are and how to interpret them. You can also manipulate joypad input using Lua.

Re: Want to access variables from other program.

Posted: Tue Jun 06, 2017 3:04 pm
by DementedPurple
Okay, I can't find documentation on the NES version of Pac-Man, so I switched to Donkey Kong. However, is there a physics analysis anywhere on Donkey Kong?

Re: Want to access variables from other program.

Posted: Tue Jun 06, 2017 5:00 pm
by dougeff
My first NES project was a graphics hack of PacMan. I also changed the maze. I can tell you anything you want to know about PacMan.

But, I don't think this is the right project for you.

A better idea would be to reverse engineer PacMan as a learning experience, to learn NES development. Not that PacMan uses the best practices for NES programming, but it would be a start.

Re: Want to access variables from other program.

Posted: Wed Jun 07, 2017 5:00 am
by OmegaMax