How to create an an ai to play tetris attack

General area for talk about ZSNES. The best place to ask for related questions as well as troubleshooting.

Moderator: ZSNES Mods

Post Reply
northkid

How to create an an ai to play tetris attack

Post by northkid »

Hi!

Celebrating my first post with a dumb question. How can I create an ai for playing tetris attack?

The problem is getting the location of the current blocks.

I thought about reading the screen by using winapi's like getpixel, but that turned out to be kinda slow in a game with alot of screen action. My next idea was trying to read the location of the blocks by reading zsnes memory but i cant find the memory locations(using tsearch). If I did find the location would these change the next time zsnes is started (dynamic memory allocation) ?

The next problem came when trying to send keyboard input to zsnes. I tried using sendkeys and sendinput apis but no luck. Im using c# to develop this thing.

Anyone ever tried anything like this?
Rashidi
Trooper
Posts: 515
Joined: Fri Aug 18, 2006 2:45 pm

Post by Rashidi »

afaik, current ZSnes, doesn't do DMA for memory chunk that allocated to SNES RAM emulation.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

... what ?
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
whicker
Trooper
Posts: 479
Joined: Sat Nov 27, 2004 4:33 am

Post by whicker »

It's not the DMA you're looking for.

I got caught up thinking DMA = Direct Memory Access as well.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

ZSNES's memory is dynamically allocated for stuff like that.

Your best bet may just be finding the start of the ZSNES window, and reading the pixel data.

The usual APIs for faking input won't work though, most apps can't talk to ZSNES because we handle input a bit different.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
funkyass
"God"
Posts: 1128
Joined: Tue Jul 27, 2004 11:24 pm

Post by funkyass »

it be easier to develop the AI using the myriad of tetris clones for windows.
Does [Kevin] Smith masturbate with steel wool too?

- Yes, but don’t change the subject.
Gil_Hamilton
Buzzkill Gil
Posts: 4294
Joined: Wed Jan 12, 2005 7:14 pm

Post by Gil_Hamilton »

funkyass wrote:it be easier to develop the AI using the myriad of tetris clones for windows.
Except that Tetris Attack isn't Tetris.
Post Reply