Giter Site home page Giter Site logo

Comments (25)

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by BraedonWooding
Tuesday Oct 18, 2016 at 22:37 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


Fist is we want multiple KeyCodes per action, and well we need to display them nicely so maybe have a category as well? Something like:

"MoveCameraEast": 0, 68, 39: Camera
"MoveCameraWest": 0, 68, 39: Camera

"OpenMyMenu": 1, 76: MyCategory

The only problem with text files is slow speed, but if we just doing an initial loading, then its probably fine? But wouldn't something like a .ini file be better?

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by frankitox16
Tuesday Oct 18, 2016 at 22:43 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


I wouldn't go for .ini files, they're prehistorical 😄 Adding categories seems nice, but I'd put a character followed by the category name, this way is less repetitive...

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by koosemose
Tuesday Oct 18, 2016 at 23:19 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


I'm not sure but I think the current keyboard manager can handle multiple keybinds to a single action, or at least it could easily be added.

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by koosemose
Tuesday Oct 18, 2016 at 23:20 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


And as an aside, it has been decided on JSON, however, by the time a decision was reached, the amount of xml and the combined loading has made it a massive headache to actually do the switchover.

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by BraedonWooding
Tuesday Oct 18, 2016 at 23:22 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


Yeh love JSON, multiple keybinds is kind necessary though its just something that exists? I mean it would take time to implement but it would be worth it?

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by koosemose
Tuesday Oct 18, 2016 at 23:46 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


Like I said, I'm reasonably certain our keyboard manager can already do this, it just needs to load them from settings (or perhaps a special controls only settings), and have in game gui to set them.

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by BraedonWooding
Tuesday Oct 18, 2016 at 23:52 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


Yep, well I could do that next after my current PR

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by frankitox16
Wednesday Oct 19, 2016 at 01:11 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


The keyboard manager does handle multiple key bindings. @koosemose could you please give a link to where the json was decided? and by saying that, you refer that we should go for json instead of the list of strings?

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by koosemose
Wednesday Oct 19, 2016 at 01:45 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


#1034

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by BraedonWooding
Wednesday Oct 19, 2016 at 04:28 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


Possible Example JSON Document (random values):

[ 
  {
    "Input_Name": "Move East",
    "Input_Category": "Camera",
    "Input_Keys": 
    [ 
      {
        "Modifier": "0",
        "Key": "68"
      },
      {
        "Modfier": "1",
        "Key": "54"
      }
    ],
    "Input_Call": 
      {
        "Type": "C#",
        "Name": "CameraMoveEast",
        "Location": "Camera.Move"  //Specify NameSpace
      }
  },
  {
    "Input_Name": "Move West",
    "Input_Category": "Camera",
    "Input_Keys": 
    [ 
      {
        "Modifier": "2",
        "Key": "24"
      },
      {
        "Modfier": "0",
        "Key": "99"
      }
    ],
    "Input_Call": 
      {
        "Type": "LUA",
        "Name": "CameraMoveEast",
        "Location": "CameraMove.LUA" //File Location
      }
  }
]

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by koosemose
Wednesday Oct 19, 2016 at 04:51 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


It shouldn't need to store the function called, only the inputeName and the key info ( I suppose IntputCategory would be something for organizational purposes for GUI?), the inputAction is registered from code from wherever implements the function called.

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by BraedonWooding
Wednesday Oct 19, 2016 at 04:53 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


Okay yeh the category was so we can section them up. I'm thinking of implementing this but I see a bunch of customDialogBox changes so should I hold off till those are done

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by dusho
Wednesday Oct 19, 2016 at 06:22 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


the format @frankitox16 proposed in opening post looks more compact and actually more readable than stretched JSON..

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by koosemose
Wednesday Oct 19, 2016 at 06:27 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


We shouldn't have multiple data languages, the UI is for showing a user a compact and readable format.

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by Tranberry
Wednesday Oct 19, 2016 at 13:27 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


@SpaceKrakens please advice? 😉

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by frankitox16
Wednesday Oct 19, 2016 at 13:56 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


I decided to go that way (even if it's not a language as is) because of it's ease for reading the file. We wouldn't need to use external libraries, nor include any other than System.IO, and as the loading will be done once, won't be exactly that much of a pain for the CPU.
I'm watching this from the side of a modder: let's say I'm making a mod for PP and I'd like to make a custom binding to a certain action, all I'd have to do would be adding a line at the end of the file with the function call, the modifier, and the keys that I'd want to be pressed for this. If we go for JSON it's a bit more messy and harder to read (vissually).

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by dusho
Wednesday Oct 19, 2016 at 14:27 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


if modding is to be taken into account here, then modders won't (and shouldn't) modify same file
every modder will have their own content in their own folder, game will read multiple folders (compatible mods) and should combine things possibly without conflict
so.. have format and formatting where you can detect conflicts easily and resolve them (alternative key, ...)

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by frankitox16
Wednesday Oct 19, 2016 at 14:31 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


Ok, so, it would be same deal, different files 😅

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by Geoffrotism
Wednesday Oct 19, 2016 at 18:33 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


@dusho if we are worried about modders changing files, why are we even putting our files into streaming assets in the first place.

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by frankitox16
Wednesday Oct 19, 2016 at 23:14 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


Should we go for a strawpoll between my way and Json?

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by BraedonWooding
Wednesday Oct 19, 2016 at 23:46 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


Yes straw poll

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by frankitox16
Wednesday Oct 19, 2016 at 23:51 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


Here it is: the Strawpoll

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by dusho
Thursday Oct 20, 2016 at 04:44 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


@frankitox16 usually having core things available shows modders what modding can achieve and how.. and then when they want to introduce something new to game, they will create new modding folder where their things are located
this way different mods from different people can be used and don't conflict
also, not sure that anonymous strawpoll will hold up.. some guys were doing something that should integrate with github..

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by TomMalbran
Thursday Oct 20, 2016 at 05:36 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


One suggestion: Instead of using keycodes and modifiers I want the keyboard shortcuts to look like readable strings, like: Ctrl-Shift-S. Is easy to then split the string by -, map Ctrl and Shift as the modifiers and get the keycode forS.

The JSON that stores the user keybindings can be similar to:

{
    "CameraMoveEast": [ "Ctrl-Right", "Ctrl-Numpad6", "Shift-D" ]
}

Where CameraMoveEast is a the key of keyboard action, Right will be mapped to the arrow, and Numpad6 is the number 6 in the Numpad. There will be another file with the rest of the information in Streaming Assets for each Mod, which can have the default keybindings. Those default keybindings will be overwritten by the user ones.

We can also store different keybindings depending on the OS, and map Ctrl to Cmd in macOS.

I was also thinking on "modes", so that certain keybindings are active on different modes. On The construction menu I will have bindings to build certain things, and the same key could be used in the options menu since it is in a different mode.

from projectporcupine.

BraedonWooding avatar BraedonWooding commented on September 15, 2024

Comment by NogginBops
Thursday Oct 20, 2016 at 19:31 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


What about SKON? :D
The deadline for v1 is comming up this saturday (Oct 23)!

I mean it's kind of made for this (PP). :P

from projectporcupine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.