Rabu, 18 Juli 2012

Minecraft Joypad Mod v0.11.3





Hello,

After quite some time I've decided to port my Joypad Mod to the newest version of Minecraft - 1.3.2. I'm happy to announce that the work is done, and the version 0.11.3 - released. Read more for some back story.

This was the first time I updated the mod to the different version of Minecraft. Thanks to the awesome work the MCP team is doing in decompiling the original jar file it was not too hard to do.

But since I had some long standing issues with the mod functionality I wanted to tackle, I took some time to figure things out, and not just simply port the old code.

This first and maybe the most important problem was the inability to map all of the game features to all kinds of input events. Some actions like jumping and attacking had to be assigned to buttons, while moving the player and camera required using analog sticks. This made attacking with analog triggers as well as moving with a directional pad impossible. Since some people don't have two analog sticks on their controllers, and the XBox 360 gamepad has analog triggers (instead of shoulder buttons) this was quite an issue.

The problem lied in the way the Minecraft and lwjgl together handle the input. Lwjgl provides the Controller object which can give the state of all its inputs, but each kind of input is accessed by different methods with different signatures. Reading button's state gives you a boolean, reading a pov leaves you with an integer, while an axis returns a float. This forced the programmer to make certain assumptions about input handling, and either duplicate a lot of code, or stick to known input combinations.

In order to handle this kind of variety I added a bunch of abstraction. ControllerInputEvent interface which provides access to methods like isPressed() and getAnalogReading(), and a specific implementations for each kind of input event which do the work. This, together with the new format of the settings file string made possible to bind any action to any event.

Changing the controls by editing the settings file was complicated for many users, and an additional level of complexity was not making it any easier, so in order to take an advantage of the new architecture and still be accessible to the users I decided to implement the controller settings right into the game options screen.



While doing so I improved the way buttons are selected by the controller using all four directional buttons, so navigating the menus is now much easier. One thing that is still left to be finished is navigation through the lists, for example the "Select world" screen.

At the end I took some time for fun features, so I decided to implement visual in-game hints for the controls. Those can be disabled from the menu.



I also kinda reintroduced the "interact" feature, which currently acts as a way to open doors and switch levers without a risk of accidentally placing a block in hand.

Toggle-sneak is also now an option which you can turn off, going back to the standard Minecraft way of sneaking.


Changelog for version 0.11.3:

  • [update] updated the mod to the Minecraft 1.3.2
  • [add] added ability to map any mod feature to any input action. It's now possible for example to map the movement to D-Pad or jump to an axis. This was added mostly to support controllers with unsufficient amount of analog axes (i.e. pure digital controllers) and controllers which have an analog triggers in place of shoulder buttons (all XInput-compatible controlles, including an XBox360 controller)
  • [add] added possibility to change the most of the mod settings (including controls) via in-game settings screen.
  • [add] displaying on-screen controls hints (can be disabled in the settings)
  • [add] XInput-compatible controllers (XBox360, Logitech Chillstream) will have friendly button names displayed (A,X,LB,LT etc)
  • [add] option to switch off toggle-able sneak
  • [update] improved menu and inventory navigation
  • [update] made the default controls vaguely reassabmle the controls on the XBox360
  • [add] separated the gui left and right movement from the changing held item controls
  • [fix] fixed interact action in multiplayer
  • [fix] fixed game crash at startup when the controls refer to non-existing controllers, axis or buttons.

IMPORTANT: If upgrading from the previous version, backup and delete your old options.txt in order for the new options to generate properly.


Download from here: Minecraft Joypad Mod v0.11.3.

Senin, 30 April 2012

Minecraft Joypad Mod v0.10

Minecraft Joypad Mod v0.10
Hello,

Last couple of days I've been working on improving the Joypad Mod. I'm happy to announce that the version 0.10 is ready for testing.



I've tackled the problem of menu navigation. The first working solution is included in 0.10 - up and down buttons on the D-pad allow you to navigate through the list of all buttons on the screen. Nothing fancy, but allows you to make your way out of the main menu, bed and death screens. Still have some work to do to make the list navigation functional - so that singleplayer and multiplayer screens function properly.

I've fixed the inventory in the Creative mode. It's not super handy, but usable at least.

I've also included the shift-click functionality (button number configurable in options.txt) which should make the navigation in container screens a bit faster.

Quite some time was spent to make the Enchantment table behave acceptably. Since it includes a grid of slots and custom controls for crafting, I applied a considerable amount of conditional 'glue' to make everything appear remotely consistent.

The people which had the problem of uneven camera sensitivity tied to the varying FPS might be interested in the new experimental option which can be turned on in the options file to make the camera controls independent of the FPS. It's turned off by default as it sometimes require you to enter the world twice in order for the controls to work (WTF).

Last but not least, I've added the configuration utility which can be used to figure out the joypad and button id's. Might be handy for the people struggling with the configuration. In the future I can turn it into a config file generator if such need arises. For now it only displays the id's of the controls you press.

I have still not worked on the solution for the triggers on the XBox 360 controller. Have to leave something for the next release ;).



Full changelog ahead:


  • [add] added "shift-click" functionality (mapped to a button)
  • [add] added navigation map for Enchatnment Table. Player should be able to operate it now.
  • [add] added possibility to open the main menu
  • [add] added a menu navigation (works on buttons, still doesn't work on lists though) - this makes a main menu, death screen, bed screen usable now. Only up/down d-pad button are used, so it sometimes looks funky, but works.
  • [add] added experimental constant-camera-movement mode. It makes the camera movement independent of FPS. It should help the people for whom the camera sensitivity skyrckets after the world fully loads. Turned off by default, as it sometimes requires you to enter the world twice for it to work correctly. The config file option is named "useConstantCameraMovement"
  • [add] added a small utility program which shows joypad id's, as well as id's of buttons and axes. The aim is to help people to properly configure the mod
  • [improvement] tooltip and icon follows the item instead of the mouse curosr while using the container gui's
  • [fix] fixed error preventing Creative gui screen from working correctly

IMPORTANT: If upgrading from the previous version, backup and delete your old options.txt in order for the new options to generate properly.


Download from here: Minecraft Joypad Mod v0.10.

Rabu, 11 April 2012

Minecraft Joypad Mod v0.9

Hi,

I've released an update to the Minecraft Joypad Mod. Here's the changelog:


[add] added fully analog movement
[fix] fixed sneaking at walk speed (oops)
[fix] fixed OutOfBounds exception when using a joypad with less than 4 axes
[fix] fixed large chest navigation (you can reach all items now)
[fix] improved navigation in dispenser and brewing stand (you can't exit the boudaries anymore)
[fix] tweaked navigation in other screens (mostly wrapping in corner cases)


It's compatibile with the Minecraft 1.2.5. Get it here.
You can leave feedback in the comments, or in the thread on the Minecraft forums.

Next on my TODO list are:

  • possibility to use axes as button inputs (usable for Xbox 360 controller's triggers - LT, RT)
  • smoother camera rotation
  • graphical settings
Till next time!