Topic: Touhou Input Display (thinput) - Release v2.1.0  (Read 10186 times)

0 Members and 1 Guest are viewing this topic.

Drake

  • *
  • LOOK AT ME
Touhou Input Display (thinput) - Release v2.1.0
« on: December 13, 2013, 03:07:27 am »


Download: https://mega.nz/#!5sNFHYAT!KFsHGu8ZQnZNiPEvCT_yG4JvlqTxOwb9OdEbrel9kgQ

A tiny tiny clever tool that reads the memory of Touhou games and gives a display of the game's inputs.
Auto-detects the running game based on its executable name.
Because it reads the game's memory, you can display the inputs of replays as well. It also isn't dependent on a specific key mapping or button config, or what input device you use at all. How fancy.

Currently supported games range from th06 to th165.


Instructions:
- Launch Touhou game, run thinput.


Configuration:
[Window]
- KeyUpImg: Path to the image used for the keys not pushed. Relative to the working directory.
- KeyDownImg: Path to the image used for the keys pushed down. Relative to the working directory.
- BGColor: Color value for the background. Just use hex color values (e.g. FFFFFF).

[Buttons]
- key = left, top, width, height
- left and top are x,y coordinates of where to position the key image; width and height specify the key image size (which can be resized). Window expands to fit.
- You can change these positions if you want a different button layout.
- To "remove" a button from view, just put it at some negative coordinates.

[AddressList]
- Each line lists a game's executable name, the address of its input bit vector, and the map of buttons to the corresponding bit flags.
- You can add or remove as many entries as you want, just make sure it works.
- Valid addresses start with 0x followed by 6~8 hex digits.
- The button map is 8 numbers, each one corresponding to a button. In order they represent Shot, Bomb, Slow, Up, Down, Left, Right, Skip.
    The number represents which bit flag in the vector that button activates. Look at the config file for examples.
- Using this config allows us to add new executable names (e.g. th11boss.exe) and to offer forward-compatibility for new games.


Known Bugs:
- None at the moment!



This was originally a small personal project for displaying my keyboard input that turned into something else.
« Last Edit: August 12, 2018, 04:18:43 am by Drake »

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by あかがし -

monhan

  • Yellow Member
  • *
  • LOOK AT ME
  • Nickname: Nael
Re: Touhou Input Display (thinput)
« Reply #1 on: December 13, 2013, 03:30:49 am »
Wow, thanks, Drake! This should help knowing what the hell happened during lucky dodges.
Re: Touhou Input Display (thinput)
« Reply #2 on: December 13, 2013, 08:16:38 am »
Thanks. Is it supposed to work in full screen or not?

Drake

  • *
  • LOOK AT ME
Re: Touhou Input Display (thinput)
« Reply #3 on: December 13, 2013, 08:59:55 am »
Not really, unfortunately. It seems exceedingly difficult and arcane to render other windows on top of fullscreen d3d applications, so I'm not going to bother wasting my time trying.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by あかがし -

  • Guest

Re: Touhou Input Display (thinput)
« Reply #4 on: December 13, 2013, 09:02:28 am »
It doesn't start for me (assuming It's because I'm on XP)

Drake

  • *
  • LOOK AT ME
Re: Touhou Input Display (thinput)
« Reply #5 on: December 13, 2013, 09:14:00 am »
Doesn't start as in doesn't even give you an error? Can any other XP users replicate this? EDIT: never mind replicated ok
« Last Edit: December 13, 2013, 09:23:57 am by Drake »

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by あかがし -

  • Guest

Re: Touhou Input Display (thinput)
« Reply #6 on: December 13, 2013, 09:18:17 am »

Drake

  • *
  • LOOK AT ME
Re: Touhou Input Display (thinput)
« Reply #7 on: December 13, 2013, 09:47:03 am »
Oooops my bad. I compiled it as an x64 application instead. New link, should work.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by あかがし -

  • Guest

Re: Touhou Input Display (thinput)
« Reply #8 on: December 13, 2013, 11:22:21 am »
Thank you, it works and I love it!

ark

  • みょん
  • LOOK AT ME
  • Nickname: Nereid
Re: Touhou Input Display (thinput)
« Reply #9 on: December 13, 2013, 11:27:52 am »
You should make it do a D3D hook thing so it works fullscreen.

chirpy13

  • Permabanned
  • LOOK AT ME
Re: Touhou Input Display (thinput)
« Reply #10 on: December 13, 2013, 01:12:07 pm »
I like this.  And the potential applications of it.
You should make it do a D3D hook thing so it works fullscreen.
Too myon and myon.

Kaze_Senshi

  • Ehhhhh...
  • Pale Apple
  • LOOK AT ME
  • Nickname: KazeSenshi
Re: Touhou Input Display (thinput)
« Reply #11 on: December 14, 2013, 09:55:03 pm »
Wow colored tetrominos, nice job.

You should make it do a D3D hook thing so it works fullscreen.
yeap yeap
My youtube channel with my creations: https://www.youtube.com/user/KazeSenshi2929
( ゆっくりしていってね)>
  • My youtube channel

Drake

  • *
  • LOOK AT ME
Re: Touhou Input Display (thinput)
« Reply #12 on: December 14, 2013, 11:12:21 pm »
Well you can replace the images and move them around so you really just have 8 of whatever button graphic.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by あかがし -

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
  • Nickname: Ozzy
  • Gender: Male
Re: Touhou Input Display (thinput)
« Reply #13 on: December 17, 2013, 06:51:50 am »
Well this seems interesting. Might as well try it out.
  • Ephemeral Entertainment

Pesco

  • Trickster Rabbit Tewi
  • *
  • Make a yukkuri and take it easy with me
  • Staff
  • LOOK AT ME
  • Nickname: Inaba Tewi
Re: Touhou Input Display (thinput)
« Reply #14 on: December 18, 2013, 08:35:20 pm »
Could it work out a player's APM and possibly identify cheating?

Ghaleon

  • Long twintail-o-holic
Re: Touhou Input Display (thinput)
« Reply #15 on: December 18, 2013, 10:50:30 pm »
I dont mean to sound jerkish or anything but why would someone want this? I mean you know the guy is pushing up if they're flying up? Im clearly missing something. Regardless thanks for continuing to work on these things!

Raekuul

  • Nickname: Pokota
Re: Touhou Input Display (thinput)
« Reply #16 on: December 18, 2013, 11:12:30 pm »
It could also be used to detect frame-perfect play.

I'm guessing PCB uses a different method of handling input?
The ultimate joke would be making Wriggle an EX Boss, but there being a game-breaking bug in her final spellcard that made it impossible to catch.

Think about it for a second...

Drake

  • *
  • LOOK AT ME
Re: Touhou Input Display (thinput)
« Reply #17 on: December 19, 2013, 01:53:20 am »
guys i didn't make this to detect cheating, even though it can incidentally help when identifying cheating
Could it work out a player's APM and possibly identify cheating?
Yes, but APM by itself isn't always an accurate indicator. I tap quickly and dance fairly sporadically while I play, and if you look at just how fast and randomly the buttons pop up you might watch me and think my weird play is cheating. I know for sure that it can help, but that adding a thing to track APM, or looking at quick inputs themselves, isn't necessarily a good measure, and I don't really want to encourage witchhunts.

I dont mean to sound jerkish or anything but why would someone want this? I mean you know the guy is pushing up if they're flying up? Im clearly missing something. Regardless thanks for continuing to work on these things!
I made it mainly so I could stream with it visible in the window. It was first supposed to just read keyboard input. I don't really have a solid application intended for it, but if you find that it's useful for whatever reason then that's good enough. Personally I would like to see streamers use it, I find watching player input adds to the experience.

I'm guessing PCB uses a different method of handling input?
PCB uses a convoluted system of storing velocities and doesn't seem to actually store the state of button inputs besides having like 1 2 3 4 mean up/down/left/right the frame after input (how the other buttons happen is mysterious). It's possible to add, isn't something I care enough to do. The rest of the games all use a similar structure that makes it really easy to read without having to adjust much for different inputs for each game. EoSD and PCB would require a lot more work I'm not really willing to put in without a good reason.
« Last Edit: December 19, 2013, 01:55:02 am by Drake »

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by あかがし -

SIRookie

  • I have no idea what I'm doing
Re: Touhou Input Display (thinput)
« Reply #18 on: December 19, 2013, 06:13:47 am »
I was actually about to start looking for something like this. There are some replays I wanted to rewatch for key movements

Space Flower

  • Nickname: Flo
Re: Touhou Input Display (thinput)
« Reply #19 on: December 22, 2013, 04:17:30 am »
This is actually very awesome. I can turn a lucky dodge into something reusable.

rsy_type1

  • Nickname: rainsky
Re: Touhou Input Display (thinput)
« Reply #20 on: February 23, 2015, 12:07:00 pm »
sorry for the necropost.
but we have found ways to support other games:
add this to thniput.ini [addresslist]


抢曽峠杺嫿.exe, 0x69D904  <=== for Japanese version  , 东方红魔郷.exe, 0x69D770 for Chinese verision.
th07.exe, 0x4B9E50 
th095.exe, 0x4BE244
th125.exe, 0x4D8FB8
alcostg.exe, 0x471620
---------------------------------

there are some bugs for DS, may be ZUN's fault.
th143.exe, 0x4E1BE8
[Buttons]
Shot = 25, 0
Bomb = 50, 0
Slow = 125, 0
Skip = 0, 25
Up = 125, 25
Left = 150, 25
Down = 100, 25
Right = 0, 0
------------------------

Drake

  • *
  • LOOK AT ME
Re: Touhou Input Display (thinput)
« Reply #21 on: February 24, 2015, 02:53:57 am »
Thanks a bunch, actually! Finding working addresses for th06/07 is very useful since I wasn't able to find them myself. I did originally exclude the photo games because of the buggy buttons, but I really shouldn't have since you can always swap around the button graphics or just ignore the bugs. I'll update the first post.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by あかがし -

rsy_type1

  • Nickname: rainsky
Re: Touhou Input Display (thinput)
« Reply #22 on: February 25, 2015, 01:25:15 am »
for th125,use cheatengine to see 0x4D8DA0

press  z, x, shift, ctrl, up, down, left, right , they have different output values.
but in thinput , different keys have the same react.
maybe there are some bugs in this program.

Drake

  • *
  • LOOK AT ME
Re: Touhou Input Display (thinput)
« Reply #23 on: February 25, 2015, 06:31:59 am »
No, it's more a matter of ZUN not being consistent in how he maps the buttons to the bit flags in the vector. In particular, before th11 it goes (shot, bomb, slow, [empty], up, down, left, right, skip, [empty]). Meanwhile in th11 and on, the 4-bit is reserved and the 8-bit is slow instead (and skip goes from the 256-bit to the 512-bit), so in the program I check both 4 and 8 for slow, and both 256 and 512 for skip. But in th125, he shifts the up button and onward right one bit, so the up button gets read as slow instead (the other mismatches follow similarly).

Code: [Select]
th06 ~ th10 (except th095):
    (shot, bomb, slow, [empty], up, down, left, right, skip, [empty])
th11 ~ th143 (except th125):
    (shot, bomb, [reserved], slow, up, down, left, right, [empty], skip)
th095:
    (bomb*, shot, slow*, [empty], up, down, left, right, skip, [empty])  *bomb and slow have the same behaviour, so bomb -> 1 and slow -> 4+1
th125:
    (shot, bomb, slow, up, down, left, right, skip, [empty], [empty])  <- why zun

The forward-compatibility of this relies on the input being consistent, basically. Since th095 and th125 aren't consistent, it doesn't work as intended. Does this clear things up?
« Last Edit: February 25, 2015, 07:04:06 am by Drake »

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by あかがし -

grayst

  • Nickname: grayst_
  • Gender: touhou
stop shitposting and go play some shmup

Drake

  • *
  • LOOK AT ME
Re: Touhou Input Display (thinput) ver. th15
« Reply #25 on: April 15, 2017, 04:26:15 am »
Uh, I don't know. That shouldn't happen. Can you make sure the button isn't set to some weird negative position in the config? Because that's how you would hide the buttons. PoFV should work fine from my testing.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by あかがし -

grayst

  • Nickname: grayst_
  • Gender: touhou
Re: Touhou Input Display (thinput) ver. th15
« Reply #26 on: April 15, 2017, 06:58:30 am »
i didn't change anything in files. and you misunderstood, i think. it's not permanent. It just looks like that on some frames. I was hoping that it has something to do with the problem that i encountered (was pointed at) in POFV http://www.youtube.com/watch?v=JwYGoJxomCc
stop shitposting and go play some shmup

Drake

  • *
  • LOOK AT ME
Re: Touhou Input Display (thinput) ver. th15
« Reply #27 on: April 15, 2017, 08:40:57 am »
Ok, that gave me the hint I needed. So the "actual" problem is that I'm dumb and didn't load the images in the correct way, so it seems to loads the image from disk every time it is needed rather than storing it in memory. You can confirm this by starting thinput, pushing a button, editing the image, then pushing a button again. Generally this will not cause any visible issues because it should be fast enough anyways, but if your framerate counter there is an actual representation of how slow your game runs, your computer might actually be bad enough that it can't load the images properly. I can't really say for sure though.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by あかがし -

grayst

  • Nickname: grayst_
  • Gender: touhou
Re: Touhou Input Display (thinput) ver. th15
« Reply #28 on: April 15, 2017, 01:29:34 pm »
ok
stop shitposting and go play some shmup

Enko

  • Spirit flying to anywhere
  • Nickname: Yanstime
  • Gender: Boy (I'm sure,hum.)
Re: Touhou Input Display (thinput) ver. th16
« Reply #29 on: May 02, 2018, 11:03:14 am »
Sorry for my reply,
is there a way to change the size of the buttons?
e.g. Slow Button shows not so long as it should be on the keyboard.
Need help with C# DX developing.
 

SMF 2.0.15 | SMF © 2017, Simple Machines
Theme based on ModernDark64 design by BlocWeb
Page created in 0.06 seconds with 22 queries.