Post subject: Space Invaders
moth
He/Him
Joined: 4/8/2018
Posts: 3
Hey guys I am new to TAS and having been working on BizHawk for about two weeks now. So we are trying to make a Neural Network play Space Invaders(NES), something like MarI/O by SethBling, we have got the memory location of almost all of the entities except for the aliens and bunkers. If someone with experience in combing through RAM can help us that would be great. Here is our GitHub link where we have documented the memory map: (For Projectiles): https://github.com/BhayanakMoth2/AI-nvader/wiki (For Player and UFO position): https://github.com/CryoScythe/AI-nvader/wiki Many thanks if you are gonna chip some time and efforts.
MESHUGGAH
Other
Skilled player (1917)
Joined: 11/14/2009
Posts: 1353
Location: 𝔐𝔞𝔤𝑦𝔞𝔯
Only read the source code. Please read it as someone trying to help. 1. The two repository has different code, CryoScythe seems to be a bit newer. You should link the latest code aswell to OP. 2. function GetPlayerY() playerX = mainmemory.readbyte(0x070F)? maybe it's correct, but this kind of "inconsistency" (two different functions but one function does the same as the previous function without any mention) can distract potential users/devs. I mean you should have some comments about why does it structured like this 3. Do you know neural networking already or just learning it for the first time? (As I couldn't find the required things like weighting actions, iteration counting, learning rate etc). I only see a generic AI using the memory and then doing the same thing over and over again. Is it really neural network is what you are trying to build? edit: I mean that Space Invaders is already easy enough to solve it without relying on the memory.
PhD in TASing 🎓 speedrun enthusiast ❤🚷🔥 white hat hacker ▓ black box tester ░ censorships and rules...
moth
He/Him
Joined: 4/8/2018
Posts: 3
Repos have been synced and the code has been corrected, it should have been playerY instead of playerX, thanks for pointing it out. I have not worked with neural networks but after reading the code for MarI/O , I figured its NEAT Neural Network code can be used make a similar AI program for Space Invaders with some changes. Right now we are trying to load the the positions of entities into the cells array of size 100x100 and displaying it. Then we will pass it as an input into the neural network. Also, what's the other approach apart from mapping memory, are you talking about taking screenshots every 5-6 frames and processing them for inputs?
MESHUGGAH
Other
Skilled player (1917)
Joined: 11/14/2009
Posts: 1353
Location: 𝔐𝔞𝔤𝑦𝔞𝔯
On CryoScythe line 56 playerX, line 56 playeY at yours. Yes, I mean that the game is already simple enough to avoid relying on the memory (so the AI could capture and process the image every frame), but it's not a problem if this is what you want. And obviously image processing would have a larger impact on performance. Regarding displaying, do you mean like old games minimap? (Warcraft, Stracraft etc). And what is the question / problem?
PhD in TASing 🎓 speedrun enthusiast ❤🚷🔥 white hat hacker ▓ black box tester ░ censorships and rules...
moth
He/Him
Joined: 4/8/2018
Posts: 3
A display like this, where green is an enemy pulse, red is the player pulse and blue is the player. The whole thing is 100 x 100 cell array and it will be passed into the neural network as input nodes. Obtaining position of enemies from memory is not straightforward as there is none, but we figured out a solution which will be posted on github once it is polished.
DrD2k9
He/Him
Editor, Judge, Expert player (2212)
Joined: 8/21/2016
Posts: 1086
Location: US
What ROM version are you using? EDIT: In the Japanese version I have, the UFO's Horizontal position has RAM values 0x072B and 0x072F for the left and right sides respectively. I can't figure out how to identify individual aliens, but here are some RAM values regarding them. 0x0032 is enemies remaining 0x0033 and 0x005c have to do with their movement 0x0029 is lives remaining (if you care)
MESHUGGAH
Other
Skilled player (1917)
Joined: 11/14/2009
Posts: 1353
Location: 𝔐𝔞𝔤𝑦𝔞𝔯
If you already know some addresses, you can use the debugger to break on accessing these values, so you can easily figure out how is it stored and how is it displayed. Relevant subroutine starts around $93DC after checking it fast.
PhD in TASing 🎓 speedrun enthusiast ❤🚷🔥 white hat hacker ▓ black box tester ░ censorships and rules...