Rough live playfield capture program - Useful?

Thread in 'Research & Development' started by Jayce, 30 May 2016.

  1. Hi,

    Partially inspired by this thread : http://tetrisconcept.net/threads/ctwc-stream-transparency-cropping-effect.2659/ I had a crack at knocking up a script to sample the playfield area (as a few others have done) and dump the output as text; essentially just to see how fast certain areas of the Windows GDI could cope.

    It worked reasonably quickly, so I thought I'd play around some more and do the same thing with some live input. Long iterative story short, I've been playing around with a writing a program that "may" be useful/interesting to people. There's a lot of tidying up and features that I'm interested in implementing for fun, but I thought I'd see if anyone had any use for it in it's current state.

    Rather than attempt to explain it with pictures, I did some quick messing around here:


    Essentially it's just sampling an area of the screen, dividing it into a grid and taking one or more pixels from each grid square. The detection/rendering parts are swappable, the idea being you can dump custom logic into the detection and subsequent rendering/output (e.g. dump it to a window, encode to a gif, output Fumen - I haven't written those yet).

    There are a number of shortcomings/refactorings, and optimisations to be made (e.g. Note the greatly improved capture speed when disabling Windows Aero), but if it's currently useful to anyone, I'm happy to throw up the source.
     
  2. Let's just say that I'm very very interested for CTEC purposes :)
    edit: Especially if it's really liberal with what input it'll eat, as many different systems will usually use different programs to capture, depending on what hardware we have available.

    Was talkin with Muf about this stuff just yesterday.
     
    Last edited: 30 May 2016
  3. 1) Does it only do TGM1?
    2) Can you ONLY get the playfield?
    If the answer to both of those is no, then this would be really useful for certain things similar to what Jago and I think it was Mary have done in the past.
    Right now however, it still looks promising. I have no idea if it's any better than the thing Steadshot made for the Fumeniser but it has the potential to do some very nice things.
     
  4. Hey,

    It's currently just nomming a screen display, which is reasonably swappable.

    There's nothing really specific to TGM1 in there (except I was trying to naively filter some of the colours out in one of the detectors), it'll display anything (the more grid-like the better)

    You aren't restricted to capturing the playfield, but that's the only thing I've looked at so far. It currently only captures one area of the screen per instance; you'd have to run a few to capture the different parts you were interested in (and write detectors/renderers for them). Also, they'd render to different instances, that's my next little area to refactor (I've got some choices to make about how I want that to work).

    Hopefully, I'll make the core program flexible enough to allow people to write their own detection/renderer bits to suit their needs.
     
  5. I would love to play around with this. Do you plan to open source your code? What language is this written in?
     
    Tomek likes this.
  6. Sure thing, it's not the in the neatest state, but I'll clean up some of the rougher edges and try and link in the next few days. It's written in C#.
     
    Last edited: 2 Jun 2016
  7. Nice! While I'm fairly decent in most popular programming languages, I do C# pretty much every day for a living. I also imagine C# code inherently makes it a lot more maneagable and easier to expand. I would really love to see how you're making it :) Does it have any kind of score recognition at present? The CTWC thing did a neat thing where it compared the score of the two players to show the lead between them, very nice idea.
     
  8. No, it currently really only does the basics you can see up there (and in a fairly naive way at that). I will make the source available, I'd like to re-jig a couple of things, but I may just link it before then, for general messing about.
     

Share This Page