Looking for Programmable Controllers

reference materials and general how-to information
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

I'm going to say that the first controller is up and running at this point. At least for this generation, scripts look something like:
This is a script to do a fireball from the left side. Anything after a '#' is ignored. The first column is timing information - relative ones have a '+'. The trailing 'f' indicates time is in frames. The second column indicates what things to toggle UDLR is obvious, and 01234567 will move the buttons.

Code: Select all

#Fireball
 1f    D  #down
+1f   R  #down/forward
+1f   D0 #forward + punch.  (The 'D' toggles down off.)
+1f   R0 #fully neutral - this returns the 'controller' to a neutral state by toggling button 0 and right.
P.S. For whatever reason, it seems that the fixed width/code tag is ignoring a single space at the start of the line, which is a little annoying.
CPS2
Posts: 842
Joined: Mon Nov 09, 2009 11:53 pm

Re: Looking for Programmable Controllers

Post by CPS2 »

Sounds good!

So just checking, you've got this rigged up with a microcontroller connected to a PC on one side and a PS3 on the other right? Is it attached to any other kind of controller like an arcade stick?
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

CPS2 wrote: So just checking, you've got this rigged up with a microcontroller connected to a PC on one side and a PS3 on the other right? Is it attached to any other kind of controller like an arcade stick?
The set-up right now is:
PC-{USB/Serial cable}-> Microcontroller -{16 wire ribbon cable}-> SE stick (still working) -> Xbox 360

I'm lazy, and that was the easy way to do it. It should be easy to adapt it to user any other common-ground controllers, and I've got the IO pins to drive a second one provided they can handle having their grounds tied together (likely)
CPS2
Posts: 842
Joined: Mon Nov 09, 2009 11:53 pm

Re: Looking for Programmable Controllers

Post by CPS2 »

Should I just buy a microcontroller and rig it up to my Hori EX2 (basically a spare stick I have) with some instructions, or are you thinking of shipping stuff out? Not sure if you're thinking that far ahead yet, I'm just excited :).
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

CPS2 wrote:Should I just buy a microcontroller and rig it up to my Hori EX2 (basically a spare stick I have) with some instructions, or are you thinking of shipping stuff out? Not sure if you're thinking that far ahead yet, I'm just excited.
This was primarily intended to be a project for my own use. It definitely wants more testing. Considering my 'skill level' with a soldering iron, I'm not sure you want to have me doing assembly. Right now the controlling software is written in Perl, and running in linux. It should be easy to get it working in windows-land, but that's definitely something I want to check on before you buy components.

FWIW, I'm running on one of these:
http://www.c-stamp.com/CS110000.htm
I used one of their starter kits (since I had it from another project) and some loose parts, but it should work with the stamp plus $10-15 in components and a $10 USB/serial cable.
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

I'm probably going to rework stuff, but proof of concept code is here:
http://www.pedantic.org/~nate/HDR/controller/
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

Regarding Progress:
Wednesday I redid the wiring on my solderless breadboard since I'd been getting issues with some exposed wires shorting.
Yesterday I bought a second SE stick, soldered in a drive cable, and tested it. I now have two working controllers. With luck I'll have both sides running later today.

It also occurred to me that frame skip synchronization would be a nice feature to have. I mean something where you run a test like the ones described here: http://combovid.com/forums/viewtopic.php?f=7&t=143 and then use that to have the driver start at an appropriate time in the frame skip cycle.
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

Now running two controllers. I guess the next step is getting it working under windows...
CPS2
Posts: 842
Joined: Mon Nov 09, 2009 11:53 pm

Re: Looking for Programmable Controllers

Post by CPS2 »

Sweet as :)

How have you been going as far as using these, like what is your consistency with 1 frame links, and can you get things to trade pretty easily by adjusting what the dummy character does? I know that with some programmable controllers and scripts they need to be redone several times to get things to work, is it like that? Or is it usually pretty consistent once you have a script?
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

CPS2 wrote: How have you been going as far as using these, like what is your consistency with 1 frame links, and can you get things to trade pretty easily by adjusting what the dummy character does? I know that with some programmable controllers and scripts they need to be redone several times to get things to work, is it like that? Or is it usually pretty consistent once you have a script?
I get sub-frame precision on timing. Things are relatively consistent in that sense. However, the games will do wierd things on their own. For example, I've been tinkering with the walk-forward sonic boom stuff, and the projectile slowdown is just a big headache in terms of actually getting stuff to come out.

If you have an example of a 1-frame link you'd like me to test, I'm sure I can.
CPS2
Posts: 842
Joined: Mon Nov 09, 2009 11:53 pm

Re: Looking for Programmable Controllers

Post by CPS2 »

Hm have you got SF4? Akuma's far LP into far HK is a 1 frame link, and it loops back into LP. I think you'd probably get the most reps on Sagat or Zangief...

Not too sure about Super Turbo or HDR, just tried a few things out, there seems to be a lot of 2 frame links but it might take me a while to find a 1 frame...
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

CPS2 wrote:Hm have you got SF4? Akuma's far LP into far HK is a 1 frame link, and it loops back into LP. I think you'd probably get the most reps on Sagat or Zangief...

Not too sure about Super Turbo or HDR, just tried a few things out, there seems to be a lot of 2 frame links but it might take me a while to find a 1 frame...
I haven't unlocked Akuma, I guess I can try the Fei long infinite... Edit: apparently that was nerfed out of existence, or something...
Seems like it's missing about 1 in 10 single frame links. Not quite sure why yet.
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

So, I did some more testing, and I'm starting to want to blame the game.

I ran a test of just hitting Fierce wait 1 second hit strong wait 1 second hit fierce.... for about 8000 frames, and got every punch to show up on the correct frame. (This is with Fei in SFIV.) For a little perspective: to get this result, I had to make sure to use the correct value of 59.94 frames per second instead of 60.

When I run the SFIV 'infinite' of close FP xx ex flying kick with fei, I seem to end up with the occasional random frame drop. I'm not sure why, it may have to do with some kind of spacing/hit freeze issue.

Also, the combo counter in SFIV stops at 99 and I really don't want to bother counting iterations so I can't tell you how many consecutive links there were in the 'good' runs.
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

So, it was my fault after all. The problem is that my debugging stuff was throwing it off.

After that correction I did testing, and got 77 iterations of the Fei Long infinite loop before my script ran out. (more really, but there was a dizzy). Each iteration has 7 single-frame entered commands, so that's 539 correct over the course of those 77, and a total time of about 2 minutes without dropping a single-frame link.
onReload
Posts: 1716
Joined: Wed Apr 22, 2009 7:00 am
Location: NJ, USA

Re: Looking for Programmable Controllers

Post by onReload »

Awesome! So is now when you consider it a total success, or do you have more stuff to test?
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

onReload wrote:Awesome! So is now when you consider it a total success, or do you have more stuff to test?
I'd call it a qualified success. It's still a little flaky.
It appears that SFIV runs at 60 fps when it's on my computer display, but 59.94 when it's on the TV/recorder setup...

Also put up some pics (not much to look at, really)
http://www.pedantic.org/~nate/HDR/controller/
error1
Posts: 2298
Joined: Sat Apr 18, 2009 12:15 am

Re: Looking for Programmable Controllers

Post by error1 »

59.94 is the standard NTSC frame rate and your not going to get better then that from a TV. Monitors on the other hand can display any fps, it wouldn't think the .06% would be enough to throw you off
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

error1 wrote:59.94 is the standard NTSC frame rate and your not going to get better then that from a TV. Monitors on the other hand can display any fps, it wouldn't think the .06% would be enough to throw you off
Well, it's one frame in a 1000 - so you lose/gain a frame every 17 seconds or so, which is an issue if you're doing just frame linking.
CPS2
Posts: 842
Joined: Mon Nov 09, 2009 11:53 pm

Re: Looking for Programmable Controllers

Post by CPS2 »

Rufus wrote:Well, it's one frame in a 1000 - so you lose/gain a frame every 17 seconds or so, which is an issue if you're doing just frame linking.
But wouldn't that just possible throw off visual confirmation of hits? The monitor wouldn't change the speed that the game or controller are running at would they?
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

CPS2 wrote: But wouldn't that just possible throw off visual confirmation of hits? The monitor wouldn't change the speed that the game or controller are running at would they?
It *shouldn't*. That doesn't mean it doesn't.

What I can tell you is that 59.94 frames per second works well on the TV - I can basically start the Fei infinite and walk away, but on the monitor, it dumps out in 4-8 loops. Similarly, 0.16626 spf (about 60.015 fps) let it run through 124 loops without any hickups on teh monitor.
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

Magnetro wrote: ジャンク
I don't read Japanese. Is that an indication the auction is cancelled or something?
onReload
Posts: 1716
Joined: Wed Apr 22, 2009 7:00 am
Location: NJ, USA

Re: Looking for Programmable Controllers

Post by onReload »

says JUNK
Magnetro
Posts: 1126
Joined: Fri Dec 15, 2006 5:51 am
Location: CA
Contact:

Re: Looking for Programmable Controllers

Post by Magnetro »

The ppad can only be used for parts. I'm guessing the LED isn't one of them.
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

CPS2 wrote:Should I just buy a microcontroller and rig it up to my Hori EX2 (basically a spare stick I have) with some instructions, or are you thinking of shipping stuff out? Not sure if you're thinking that far ahead yet, I'm just excited :).
It looks like the Hori EX2 is not common ground, so doing a programming retrofit using my approach would, at minimum, require some extra work.

Since CPS2 was asking about it:
How much interest is there for computer-driven controller retrofits at a price point of ~$60, and on what systems?
CPS2
Posts: 842
Joined: Mon Nov 09, 2009 11:53 pm

Re: Looking for Programmable Controllers

Post by CPS2 »

The thing about retrofitting a controller, it would get expensive with shipping because I'm in Australia. I should be able to build the controller myself without any problems, at this point I think what I'm looking for is just being able to use the controller with windows instead of linux. Also some instructions would really be helpful because I haven't purchased or used a microcontroller before.
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

So I tested this morning. Couldn't get the SerialPort module installed in perl, but the controller works just fine via HyperTerminal, also made a couple of small additions to the controller driver to make it easier to manually control via hyperterminal.
Also some instructions would really be helpful because I haven't purchased or used a microcontroller before.
How you do things is going to depend on what controller & programmer you get. If you use an arduino like the others who've built programmable controllers, then my stuff isn't going to be that useful for you...
Have you done any soldering?
Does this diagram make sense to you?
http://www.pedantic.org/~nate/HDR/contr ... ircuit.png
Dammit
Posts: 359
Joined: Thu Nov 05, 2009 1:50 am
Contact:

Re: Looking for Programmable Controllers

Post by Dammit »

Some general questions:

How do you know what grade of microcontroller to buy, which ones will meet your needs? C-stamp and arduino are just brand names right?

These home projects always use the serial port or at least start out with it. Is USB much more complicated to work with?

Something I thought of the other day: You know those USB console-PC controller adapters? They are cheap and available everywhere. What if you use one of those things as starting material and tweaked it to operate in reverse. Instead of converting gamepad to work on the PC make it go the other way. All the necessary hardware is in there, right?
Rufus
Posts: 647
Joined: Thu Apr 01, 2010 3:12 am

Re: Looking for Programmable Controllers

Post by Rufus »

Dammit wrote: How do you know what grade of microcontroller to buy, which ones will meet your needs? C-stamp and arduino are just brand names right?
I had the C-stamp laying around from another project that didn't get completed. In principle, it's possible to build a serial port driven controller driver out of electronic components (i.e. no microcontroller at all), using a UART 16550 or something similar.

For one-off projects - especially ones where you don't care that much about size - you'll probably want something that comes on a testing or project board. Those are usually integrated with some kind of progamming interface. Beyond that, it's probably a question of power consumption, and I/O capabilities - like the number of I/O pins
These home projects always use the serial port or at least start out with it. Is USB much more complicated to work with?
USB is more complicated. In practice, you usually just buy a $10 USB / serial adapter and move on.
Something I thought of the other day: You know those USB console-PC controller adapters? .... All the necessary hardware is in there, right?
Sounds interesting, want to show me how? In practice, you could probably scavenge the connectors, but the rest of the stuff is probably easier and cheaper to get somewhere else.
Doopliss
Posts: 3210
Joined: Mon Nov 09, 2009 10:18 pm
Location: Sweden

Re: Looking for Programmable Controllers

Post by Doopliss »

Dunno why I didn't post this here, but:

Image

+

Image

=

Image

Used this bad boy to take some annoying achievments in perfect dark zero. It's kind of limited though, only two buttons.
Maybe Doopliss isn't kicking ass, but he's taking names.

http://www.youtube.com/user/DaDoppen
Post Reply