XIM Community

[XIM2] Controller - XIM GUI  (Read 32363 times)

Offline NateS

  • Member
  • *
  • Posts: 86
    • View Profile
Re: Controller - XIM GUI
« Reply #30 on: 06:00 AM - 01/02/10 »
Not sure what you are seeing with the deadzone. A left stick config deadzone of 0.5 means that when you set the left stick to the tiniest bit above zero, it will actually set it to 0.5 (which is half deflection). If you are passing through an xbox controller, you don't want a deadzone at all (unless you want to change the size of the game's deadzone). If you are using a mouse, you should set the config deadzone for the game you are playing. This way, if you move the mouse the tiniest amount, the game will respond. A deadzone of 0.5 is probably way too much for any game. Eg, if your XIM deadzone is 6210, then you should use ~0.1895 with my app (6210 / 32767).

I'm not sure about the update rate. I need to get my PG3B working and play with it. I can use the XIM mouse algorithm with the PG3B. I have a feeling there should never be a reason to set the update rate manually. Internally, an update rate should be used that is faster than the input hardware can provide updates. There should be no problem calling the algorithm at this speed. The algorithm should be time based and should provide roughly the same results whether it is called at short or fast intervals. Once I get some hardware working, I'll straighten this out. I also intend to write my own mouse translation algorithm.

Good point on the example config. :)

Offline slayersteve

  • MVP
  • *
  • Posts: 2151
    • View Profile
  • Gamertag: x SLAYER Steve
Re: Controller - XIM GUI
« Reply #31 on: 12:08 PM - 01/02/10 »
OK,
I'm seeing input deadzones and device deadzones.

is input as you refer to earlier "inbound" e.g. allows me to put a deadzone on my input device (joystick) and device deadzone is the deadzone we're all used to (i.e. the game deadzone)?

so I want zero on my input deadzones and then whatever the game calls for my device deadzone, yes?

Offline slayersteve

  • MVP
  • *
  • Posts: 2151
    • View Profile
  • Gamertag: x SLAYER Steve
Re: Controller - XIM GUI
« Reply #32 on: 12:19 PM - 01/02/10 »
another question... it's possible I'm being dense, but I'm not seeing a secondary sensitivity setting...
do you have one? or would you set a key to switch configs to do that?
if so, is it a situation where you can hold the button, load the other config, let off the button and the original settings reload? i.e. a modifier as opposed to a toggle?
I ask because in general the right mouse button is generally tied to secondary sensitivity to aim down scope...

Offline NateS

  • Member
  • *
  • Posts: 86
    • View Profile
Re: Controller - XIM GUI
« Reply #33 on: 09:18 PM - 01/02/10 »
is input as you refer to earlier "inbound" e.g. allows me to put a deadzone on my input device (joystick) and device deadzone is the deadzone we're all used to (i.e. the game deadzone)?

Exactly correct.

Quote
so I want zero on my input deadzones and then whatever the game calls for my device deadzone, yes?

If you did that, you would effectively be removing the game's deadzone by using a device deadzone. By not using an input deadzone, your joystick or whatever won't have a deadzone at all. If you are using a mouse, this is fine (you can't set a deadzone on a mouse axis anyway).

There is currently no explicit secondary mouse sensitivity setting. One way to do it would be to have two configs, yes, but that duplicates all other settings and would be a pain to keep two configs in sync. You can do it with a script:

Code: [Select]
config.mouseTranslation.sensitivity = 2000

function activate ()
config.mouseTranslation.sensitivity = 3000

function deactivate ()
config.mouseTranslation.sensitivity = 2000

The whole script is run when the config is activated, so we set the initial sensitivity and declare two functions. The function named "activate" is called when the button goes down and "deactivate" is called when the button goes up. If you would rather use a toggle:

Code: [Select]
config.mouseTranslation.sensitivity = 2000

function activate () {
value = beep(toggle("sensitivity")) ? 3000 : 2000
//println(value)
config.mouseTranslation.sensitivity = value
}

Here the "toggle" function switches the value of the variable "sensitivity" and returns the value. If it was true it becomes false, if was false or never set it becomes true. The beep function plays a MIDI tone, a high pitch beep if passed true and a lower pitch beep if false. This way you can hear if your setting is on or off. Uncomment the "println" call to see the value printed to the log.

Note there was a bug with the beep function, so the above won't work until I upload 0.1.17. Remove the beep call and it will work in 0.1.16.

However, setting mouse sensitivity is a very commonly used feature. I will add something to the GUI so you can do it without writing a script. Are there other commonly used (or commonly needed/asked for) features you would rather not have to write a script for?

Offline NateS

  • Member
  • *
  • Posts: 86
    • View Profile
Re: Controller - XIM GUI
« Reply #34 on: 03:05 AM - 01/03/10 »
Updated to 0.1.17.

I fixed some bugs with mouse translation, various bugs throughout the app, and added some more polish.

I added a mouse settings action. When assigned to a button, it will change the mouse settings while the button is down. If you want a toggle you'll have to use a script. The new action allows you to change ALL the mouse settings, not just sensitivity.

I added a new feature. There is now a "Targets" button that allows you to give names for each Xbox controller button and triggers. The names are used in the GUI. This means you can map spacebar to "Jump" instead of "X". Once you map the names, you no longer have to care that "X" means jump for your particular game! Further, you can use the names in scripts. The following two lines of script do the same thing (assuming "X" is named "Jump"):

Code: [Select]
device.set("x", true)
device.set("Jump", true)

Please bring up any issues you find, or any new features you would like. If you want features, you'll want to bring them up soon. Like all my projects, I lose interest and move on. :) I'm pretty happy with the app so far (considering I don't have a damned device I can use to really test it...), so if I feel up to it I'll write some documentation. Otherwise I'm done until my PG3B works.

Offline NateS

  • Member
  • *
  • Posts: 86
    • View Profile
Re: Controller - XIM GUI
« Reply #35 on: 06:36 AM - 01/03/10 »
Added some documentation. Overall how to use the app:
http://code.google.com/p/pg3b/wiki/ControllerSoftware

How the scripting works:
http://code.google.com/p/pg3b/wiki/ControllerScripting

0.1.18 uploaded to fix the bugs I found while writing documentation. 8)

Offline toysrme

  • 14 National Championships
  • MVP
  • *
  • Posts: 8290
  • FannyPAX, best avatar EVAAAR!
    • View Profile
Re: Controller - XIM GUI
« Reply #36 on: 02:57 PM - 01/05/10 »
vertical axis needs to be flipped.

here's my problem. what system rescources does this thing take to run? ive tried multiple PC's and it just takes whatever cpu/core its running on, pins it to 100% and the program's responce is laggy as all getout (both in translating movements and just moving around the menu)
1.18 got new bugs or this thing not like win7 or something???
Somebody didn't read the rules before posting. You need a post count of 100 500 to talk directly to toys.
XIM Induced RAGE Video

^Global Win Rate = 46%

Offline NateS

  • Member
  • *
  • Posts: 86
    • View Profile
Re: Controller - XIM GUI
« Reply #37 on: 03:24 PM - 01/05/10 »
When you create a trigger, if your input is an axis, there is a checkbox to flip the axis if you need to. Were you trying to pass thru an Xbox controller when you found the axis needs to be flipped? I see this too, but swifteh sees the opposite for some reason.

When a config is activated it continuously polls the triggers. It will yield to other apps if needed, but otherwise will take 100% CPU. On a single core machine this could cause the GUI to not be very responsive. I'll try to find a single core machine and see about fixing this. It doesn't really need to eat so much CPU, but I figured the PC wasn't doing much else anyway. Funny that I didn't think about a single core machine. People still use those? ;) If you see the behavior described on a multi core machine, then I'm confused.

While currently the GUI may not be responsive on a single core machine, the communication with the XIM should not be laggy. The updating of the controller image in the app is separate from the actual XIM communication. The controller image tries to update every 64ms, but there are no limits to how fast the XIM communication occurs. Eg, if you press a button and release it after 50ms, it is possible that the GUI never shows the button as pressed, even though the trigger activated and the XIM was manipulated to press and release the button. On a single core, the GUI probably doesn't get a chance to update very often since the config thread is taking so much CPU.

It should have no problems on Win7, since I do my development on that OS.

Offline toysrme

  • 14 National Championships
  • MVP
  • *
  • Posts: 8290
  • FannyPAX, best avatar EVAAAR!
    • View Profile
Re: Controller - XIM GUI
« Reply #38 on: 10:36 PM - 01/05/10 »
doesn't appear to be a multi-threaded application, so whatever core it runs on is what it runs on.
pegs my 2ghz celeron laptop (same core as a 2ghz c2d) win7 32b
pegs my 3ghz athlonx2, win7 64b
pegs a 2.75ghz 4 core athlon, win7 32b
whatever core it runs on, on any system i run it on pegs 100% and it becomes very unresponsive.

java is updated
flash is updated. the athlon x2 is using the new flash that uses gpu accelleration
.net 3.5 installed

not sure whats going on
Somebody didn't read the rules before posting. You need a post count of 100 500 to talk directly to toys.
XIM Induced RAGE Video

^Global Win Rate = 46%

Offline NateS

  • Member
  • *
  • Posts: 86
    • View Profile
Re: Controller - XIM GUI
« Reply #39 on: 02:51 AM - 01/08/10 »
toysrme, that is strange. The app definitely uses multiple threads. You will see a core get pegged, but that doesn't mean the app isn't using the other cores. Pegging one core shouldn't cause the UI to become unresponsive -- that is the strange part. Can you detail exactly what you do to cause the unresponsiveness? Eg, you open the app, then what? Activate a config? Which config? Try creating a new, blank config and activate that. Still becomes unresponsive?

Updated to 0.1.20. This adds a "text mode" that allows you to use the keyboard to type on the Xbox on-screen keyboard. This is similar to XOD's XimTranslator application, except mine supports all 3 pages of symbols and uses the wrapping behavior of the cursor to input characters faster. Buttons are also pressed in the most efficient way (eg, up and right will be pressed at the same time rather than sequentially). In addition to the keys corresponding to the on-screen keyboard characters, the following keys are supported:

  • left and right arrows
  • home and end
  • backspace and delete
  • enter (finishes entering any text, then presses start and exits text mode)
  • escape (aborts entering any text and exits text mode)

Accented characters should work just fine with foreign keyboards. You can also enter accented characters using the standard alt codes.

Of course, once I have a device, then I can test it. :) But it *should* work now. Text mode blocks the config thread, meaning that when in text mode other input triggers won't happen.

You can also use TextMode from script:
Code: [Select]
TextMode.send("Some message.\n")
Yes, this means you could write an Xbox message bomber. No, you should not do that!

I haven't changed the threading in 0.1.20 because I'm not yet sure what is going on.
« Last Edit: 03:01 AM - 01/08/10 by NateS »

Offline toysrme

  • 14 National Championships
  • MVP
  • *
  • Posts: 8290
  • FannyPAX, best avatar EVAAAR!
    • View Profile
Re: Controller - XIM GUI
« Reply #40 on: 04:34 PM - 01/10/10 »
okay then, let me rephrase.
you've written a java program with 28-32 threads. this is NOT a simultaniously threaded program, nor does windows choose to run any of your threads on different processor cores on any system Ive run it on.
there-hence-forth, the number of cores to the computer in your case should be meaningless, as it is everything runs on 1 core on a single core win7 32b, a dual core win7 64bit, a quad core win7 64bit and a dual core xp sp2.
the app itself is quite resource intensive doing anything it does. from sitting idle to XIM connected, navigating menus to activated. seems to poll for information & pass that to the xim at a very low rate. simple movement keys back & forth dont register much faster than 1nce every 1/2-1/2 a second mouse translation, obviously, is out of the question in such a state.




like that you added the text keyboard feature. XBL message bomber would be meaningless anyway. there are limits set to how many messages you can send per xxx seconds, how many users you can send too at a time & how many mass messages you can send per 24hour period. i know. i sign into xbox.com and mass message ppl i play NCAA with :P
« Last Edit: 04:39 PM - 01/10/10 by toysrme »
Somebody didn't read the rules before posting. You need a post count of 100 500 to talk directly to toys.
XIM Induced RAGE Video

^Global Win Rate = 46%

Offline toysrme

  • 14 National Championships
  • MVP
  • *
  • Posts: 8290
  • FannyPAX, best avatar EVAAAR!
    • View Profile
Re: Controller - XIM GUI
« Reply #41 on: 04:39 PM - 01/10/10 »
blank cfg no different
Somebody didn't read the rules before posting. You need a post count of 100 500 to talk directly to toys.
XIM Induced RAGE Video

^Global Win Rate = 46%

Offline NateS

  • Member
  • *
  • Posts: 86
    • View Profile
Re: Controller - XIM GUI
« Reply #42 on: 02:12 AM - 01/16/10 »
If my program uses multiple concurrent threads (which it does), then it is multithreaded. There is no reason Windows would run it on only one thread. You see one core get pegged because (typically) only one thread in my app runs flat out. That said, I don't yet know why the app runs sluggish for you. I imagine once I get a device working, I can fix it.

It has been 3+ weeks of being unable to use my PG3B due to some problem I can't figure out. Rick has been busy and hasn't been able to help. At this point I'm willing purchase a XIM2. If anyone has one available, please let me know. Once I have a XIM2, I can make the app work perfectly. :)

Offline toysrme

  • 14 National Championships
  • MVP
  • *
  • Posts: 8290
  • FannyPAX, best avatar EVAAAR!
    • View Profile
Re: Controller - XIM GUI
« Reply #43 on: 10:30 AM - 01/18/10 »
i think you misses the point i was trying to make. the number of processors is meaningless to your application. 1 processor, 2 processors, 1 core, 4 cores.
no pre windows 7 version of windows will jumble threads around BY ITSELF and your application seemingly isn't written in support of SMP by way of flagging different threads for different processors, or moving in between them as load changes. windows 7... is said to be able to change affinity of threads running by itself, yet it doesn't in practice so, go figure. too bad it doesnt. :\


meaning you can write as many threads as you want, they're all gunna be dumped on the same processor.
Somebody didn't read the rules before posting. You need a post count of 100 500 to talk directly to toys.
XIM Induced RAGE Video

^Global Win Rate = 46%

Offline NateS

  • Member
  • *
  • Posts: 86
    • View Profile
Re: Controller - XIM GUI
« Reply #44 on: 01:28 PM - 01/18/10 »
Windows XP and 7 have no problems automatically making use of multiple CPUs. No extra work is needed by the programmer. If an application runs multiple threads on a single CPU machine, Windows will provide each thread time on the single CPU. If an application runs multiple threads on a multi CPU machine, Windows will provide each thread time on any CPU that is available. Even if you wanted to, it is unlikely the Windows scheduling algorithm would allow you to lock all of a program's threads on a single CPU when another CPU is sitting idle.