Author Topic: Touhou AI  (Read 11262 times)

Touhou AI
« on: April 12, 2010, 04:15:31 AM »
Well, I'm not sure if this is the right place to put this, but I've conned a professor of mine into letting me make an AI that plays Touhou for a final project in Image Processing. The goal is to make an AI that can at least complete Stage 1 of IN on Normal and does not access the virtual memory space of the game at all. It can only use the screen outputs from the game and a virtual keyboard. So far I've been able to get a simple algorithm working where I find the character's sprite, then the nearest bullet, and move directly away from it, but more work will hopefully produce better results than dying against Wriggle. I hope to record a video for YouTube soon, but I want to get something better working before I do.

Drake

  • *
Re: Touhou AI
« Reply #1 on: April 12, 2010, 04:29:22 AM »
So like 3 and 9, but for the main games and separate? Godspeed to you, sir.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Re: Touhou AI
« Reply #2 on: April 12, 2010, 04:30:52 AM »
Whaddaya mean "conned"? This seems like a perfectly legitimate use of your resources to me. ;)

That said, good luck! Hope you get an awesome grade!

ChaoStar

  • Dark History Boy
Re: Touhou AI
« Reply #3 on: April 12, 2010, 04:32:23 AM »
Danmaku and school mesh perfectly, don't they? (*does danmaku for school*)

Honestly, I feel this would be a bit easier to do this in danmakufu, because you can have a custom player script that helps you dodge bullets and stuff. Hey, an auto-pilot player would be pretty damn cool...

Ahahah. Anyway, I can't really help you here. I wish you best of luck, though.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Touhou AI
« Reply #4 on: April 12, 2010, 06:29:55 AM »
Sounds like an interesting project. Image processing only though? Wow, that'll probably be tough.

Honestly, I feel this would be a bit easier to do this in danmakufu, because you can have a custom player script that helps you dodge bullets and stuff. Hey, an auto-pilot player would be pretty damn cool...
Danmakufu doesn't do image processing... and an auto-pilot player in Danmakufu would be impossible to make (though fucking hilarious) because of the impossibility of detecting non-object shot positions. The best you can do is auto-bombing.
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Touhou AI
« Reply #5 on: April 12, 2010, 06:37:27 AM »
Moved thread to Project Section, as it is a mod / tool / dev for the original Touhou games.

Re: Touhou AI
« Reply #6 on: April 12, 2010, 05:32:02 PM »
But still awesome.

CK Crash

  • boozer
Re: Touhou AI
« Reply #7 on: April 12, 2010, 10:18:55 PM »
I would be especially impressed if you could make it stream stuff and figure out when focused/unfocused fire is best. Try and go beyond PoFV's "move away if it's x pixels away" type dodging.

Serela

  • Moon Tiara Magic
  • VIA PIZZA SLINGING
Re: Touhou AI
« Reply #8 on: April 12, 2010, 11:18:02 PM »
I would be especially impressed if you could make it stream stuff and figure out when focused/unfocused fire is best. Try and go beyond PoFV's "move away if it's x pixels away" type dodging.
Although I must admit, seeing PoFV AI go up against Lunatic and Extra/Phantasm stages would be pretty fun. Maze of Love hurrr

But yeah, I can't wait to see how this goes.
<mauvecow> see this is how evil works in reality, it just wears you down with bureaucracy until you don't care anymore

Re: Touhou AI
« Reply #9 on: April 26, 2010, 08:58:40 PM »
OK, it still sucks, but now it can reliably beat Wriggle. I'll make a vidya and upload it to youtube this weekend.

チソウ タイゼン

  • tarzan cheetos
  • you'll thank me for the cropping later
Re: Touhou AI
« Reply #10 on: April 27, 2010, 12:51:33 AM »
This sounds exciting.. That can be used to create a boss-player swapped version of the Touhou games..


Re: Touhou AI
« Reply #11 on: May 03, 2010, 03:50:20 AM »
Well, if there were to be a boss-player reversed version, it would probably not use an AI based on Image Processing and Computer Vision, those aren't reliable enough... You'd probably just give the AI the locations of all the bullets and the character so that it could do some kind of path planning without having to worry about whether it really saw a bullet or if it was just Yukari's hat.

In any case, I derp'd, and posted the video to youtube, but forgot to link it here. The AI fails pretty badly, but it passes Wriggle. this is not its best run, I probably should have done another run to see if it fared any better the second time around.

http://www.youtube.com/watch?v=4wKmtWpcHnA

Bitz

  • So Moe!
  • *heart attack*
Re: Touhou AI
« Reply #12 on: May 03, 2010, 03:54:35 AM »
I like how it bombs every ten seconds. :V

Serela

  • Moon Tiara Magic
  • VIA PIZZA SLINGING
Re: Touhou AI
« Reply #13 on: May 03, 2010, 04:43:33 AM »
Also, how when it DOES move, half the time it moves right into bullets that weren't going to come near it anyway :V
<mauvecow> see this is how evil works in reality, it just wears you down with bureaucracy until you don't care anymore

Re: Touhou AI
« Reply #14 on: May 03, 2010, 06:06:00 PM »
Yeah, it's pretty trashey at the moment. It has no tracking whatsoever. The next step would be to implement some kind of tracking so that it can see where bullets are moving and have some notion of safe and unsafe spots.

チソウ タイゼン

  • tarzan cheetos
  • you'll thank me for the cropping later
Re: Touhou AI
« Reply #15 on: May 05, 2010, 01:10:24 AM »
Not bad!
You should probably program it to
?See which side of the screen it's on and choose accordingly to avoid entrapment
?Shift out of focus mode to make last ditch dodges
?Move the X values towards that of the enemy highest on a priority heierarchy (sp?)
(IE The closest enemy vs the newest enemy vs the strongest enemy, whichever being the best choice)
?Collect power upgrades
?Forsee laser pointers and wedge self between bullets for maximum graze

But all that sounds so complicated..