Mouse enabled interfaces, anyone?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Mouse enabled interfaces, anyone?
Okay, so I've tried looking around at other people's code (Guncaster, Isle's Keypad Demo, Doom Cards, etcetera) and I can not make heads or tails of anything! Is there anyone with the knowledge who can give me a hand here?
Re: Mouse enabled interfaces, anyone?
They are using ACS and tracking player input. They aren't mouse enabled, but rather emulating a mouse.
It is, however, discouraged as some users play using an inverted mouse look, which cannot be transparently tracked (some people have an all to annoying way of doing it in a way that breaks netgames or demo playback), and it's not even remotely gamepad/joystick friendly.
It is, however, discouraged as some users play using an inverted mouse look, which cannot be transparently tracked (some people have an all to annoying way of doing it in a way that breaks netgames or demo playback), and it's not even remotely gamepad/joystick friendly.
Last edited by edward850 on Thu Oct 30, 2014 7:56 pm, edited 1 time in total.
- TheBadHustlex
- Posts: 1914
- Joined: Thu Oct 03, 2013 12:50 am
- Location: 'stria
Re: Mouse enabled interfaces, anyone?
If you don't have very complex menus, I think it's not really worth the effort.
Guncaster feels like buying a bicycle that is made out of platinum, diamonds, high carat gold and lots of other jewelry. Not that it is a bad thing, not at all, but it's weird that the highlight of Guncaster is a menu-screen.
Guncaster feels like buying a bicycle that is made out of platinum, diamonds, high carat gold and lots of other jewelry. Not that it is a bad thing, not at all, but it's weird that the highlight of Guncaster is a menu-screen.
Re: Mouse enabled interfaces, anyone?
Here's a bare bones, ultra basic example, lifted from one of my bigger projects. Hope you learn something from it.
PS I didn't include code to clamp the mouse cursor to the screen (so that it doesn't go beyond the screen borders) as that portion of the code in my project is a little complicated for the scope of this example (I wanted to keep it simple so you understand what's going on). It's easy for you to add your own checks to clamp the mouse to the borders though.
Re gamepad/joystick compatibility; I solve that problem in my project by modularizing the input methods so if the user plays with a gamepad, the controls will switch to a "console style" control scheme for the UI where you move through the menus using the directions instead of a cursor... just like in Skyrim (although arguably cursor interfaces in console gaming is kind of making a comeback with Destiny; there exists an interesting study on Destiny's UI on the internet)
PS I didn't include code to clamp the mouse cursor to the screen (so that it doesn't go beyond the screen borders) as that portion of the code in my project is a little complicated for the scope of this example (I wanted to keep it simple so you understand what's going on). It's easy for you to add your own checks to clamp the mouse to the borders though.
Re gamepad/joystick compatibility; I solve that problem in my project by modularizing the input methods so if the user plays with a gamepad, the controls will switch to a "console style" control scheme for the UI where you move through the menus using the directions instead of a cursor... just like in Skyrim (although arguably cursor interfaces in console gaming is kind of making a comeback with Destiny; there exists an interesting study on Destiny's UI on the internet)
- Attachments
-
mouse.zip
- (2.9 KiB) Downloaded 192 times
- Caligari87
- Admin
- Posts: 6233
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: Mouse enabled interfaces, anyone?
For the inverted mouselook, if that's set in the ZDoom options couldn't the CVAR be checked to reverse the mouse movement when in the ACS menu? If the user inverts their mouse via some other method then that's on them.


Re: Mouse enabled interfaces, anyone?
Caligari_87 wrote:For the inverted mouselook, if that's set in the ZDoom options couldn't the CVAR be checked to reverse the mouse movement when in the ACS menu?
edward850 wrote:(some people have an all to annoying way of doing it in a way that breaks netgames or demo playback)
Seeing as analog stick input and mouse input are identical values, I'm not sure how that's possible.Nash wrote:Re gamepad/joystick compatibility; I solve that problem in my project by modularizing the input methods so if the user plays with a gamepad, the controls will switch to a "console style" control scheme for the UI where you move through the menus using the directions instead of a cursor...
Re: Mouse enabled interfaces, anyone?
Cali: I already covered inverted mouselook checking in my example... despite Edward not liking it one bit. >:D
Edward: custom CVAR and menu option to enable "console style" UI. Special coding is ensured when on "console style" mode so that using the analog movement inputs don't produce uncontrollable, repeated tics for the menu movement.
[I once tried to make it detect if controllers are enabled but I didn't quite like how I was doing it and settled for a user option. I put the option item at the top level of the Options menu so it's easy for users to find]
Edward: custom CVAR and menu option to enable "console style" UI. Special coding is ensured when on "console style" mode so that using the analog movement inputs don't produce uncontrollable, repeated tics for the menu movement.
[I once tried to make it detect if controllers are enabled but I didn't quite like how I was doing it and settled for a user option. I put the option item at the top level of the Options menu so it's easy for users to find]
Re: Mouse enabled interfaces, anyone?
I'm sorry for telling you that what you're doing isn't supported one bit by the engine you're using, then.Nash wrote:Cali: I already covered inverted mouselook checking in my example... despite Edward not liking it one bit. >:D

Re: Mouse enabled interfaces, anyone?
Ed, make a demo that desyncs using my mouse example above (there's a reason I put 4 player starts in there... I did that on purpose hah) and post it. I'd gladly acknowledge that using the invert CVAR in a UI context is forbidden, if you do.
Re: Mouse enabled interfaces, anyone?
For one, Nash, you of all people should know that of course I know what network and player input is doing.
However, aside from your demo having nothing to actually click and thus effect, it's pretty difficult to show anything wrong. But if you insist: If mouse inversion as no effect on demo playback, then the left and right screens should be identical.
They aren't.
Also, as an added note, Screen resolution has an effect as well, assuming you don't make the border static regardless of resolution.
However, aside from your demo having nothing to actually click and thus effect, it's pretty difficult to show anything wrong. But if you insist: If mouse inversion as no effect on demo playback, then the left and right screens should be identical.
They aren't.
Also, as an added note, Screen resolution has an effect as well, assuming you don't make the border static regardless of resolution.
Re: Mouse enabled interfaces, anyone?
Wow that looks like shit. So that wold mean demos will break anyway, regardless of ACS?
Let's say someone made a simple demo where they ran around killing stuff in MAP01. Now play back the demo, then halfway through, turn on mouse invert. Wouldn't the demo be thrown off to hell from that point onwards?
If that is the case, then it should definitely be fixed. Mouse invert status should be saved and sent through the network.
Let's say someone made a simple demo where they ran around killing stuff in MAP01. Now play back the demo, then halfway through, turn on mouse invert. Wouldn't the demo be thrown off to hell from that point onwards?
If that is the case, then it should definitely be fixed. Mouse invert status should be saved and sent through the network.
Re: Mouse enabled interfaces, anyone?
Absolutely not. Especially over the network, there is no reason why interface settings should ever be tied to network data. The network stream has an unidentifiable amount of latency tied to it, which means changing the setting will take an unidentifiable amount of time (it cannot be changed locally if it's tied to the network). It gets worse with Master/Slave, where user messages can vanish, which means flipping the setting runs the risk of having no effect. For something directly related to user input, that is completely undesirable.
Imagine if we did that to screen resolution as well, just so demos can do that as well. And if we keep doing that to arbitrary config values, this would have increased bandwidth requirements for settings that only have a very specific situation. This would only ever have any meaning for your kludge mouse interface, and otherwise has no purpose for anything else. That's a complete waste.
As you were never supposed to retrieve the status of invertmouse in the first place, it's not broken, and is staying as is.
Imagine if we did that to screen resolution as well, just so demos can do that as well. And if we keep doing that to arbitrary config values, this would have increased bandwidth requirements for settings that only have a very specific situation. This would only ever have any meaning for your kludge mouse interface, and otherwise has no purpose for anything else. That's a complete waste.
As you were never supposed to retrieve the status of invertmouse in the first place, it's not broken, and is staying as is.
Re: Mouse enabled interfaces, anyone?
I just tested it with multiplayer in my project's inventory screen - indeed it desyncs horribly when I attempt to drop an item from the inventory menu if one of the players has invertmouse while the other doesn't... dropping an item will spawn an actor into the game world, but it never happens for the other non-invertmouse player.
lol i still think it's broken and can be fixed engine-side if one cares enough to do it
I know you know more about the inner workings and it's not as easy as "just" adding the invertmouse CVAR into the list of net-safe/demo-safe/critical CVARs but blah I still think it's broken.
lol i still think it's broken and can be fixed engine-side if one cares enough to do it
I know you know more about the inner workings and it's not as easy as "just" adding the invertmouse CVAR into the list of net-safe/demo-safe/critical CVARs but blah I still think it's broken.
Re: Mouse enabled interfaces, anyone?
You think it's broken. However, what you're using isn't fit for purpose for what you're doing. You need an actual custom dialogue screen, not a level script. Yes, ZDoom doesn't have that yet, but that doesn't suddenly make a kludge make sense.
I'm not breaking user level functionality and design philosophy for your kludges, Nash. Somebody actually needs to play your mod, you know. I'm sure they'll be expecting zdoom to run properly.
I'm not breaking user level functionality and design philosophy for your kludges, Nash. Somebody actually needs to play your mod, you know. I'm sure they'll be expecting zdoom to run properly.
- wildweasel
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
- Contact:
Re: Mouse enabled interfaces, anyone?
For all you're saying here, you sure haven't offered up any real solutions. What do you propose he does?edward850 wrote:You think it's broken. However, what you're using isn't fit for purpose for what you're doing. You need an actual custom dialogue screen, not a level script. Yes, ZDoom doesn't have that yet, but that doesn't suddenly make a kludge make sense.
I'm not breaking user level functionality and design philosophy for your kludges, Nash. Somebody actually needs to play your mod, you know. I'm sure they'll be expecting zdoom to run properly.