Code Monkey home page Code Monkey logo

apbrc's Introduction

Gopher it! ๐Ÿš€

Welcome to my GitHub profile! I am Mario, a technology enthusiast with great passion for Golang, Linux and DevOps. In this page, you can find a quick summary of myself, the stack I use and my latest metrics.

I enjoy writing software to address issues or complement features in services, that I see myself or others coming across; with special joy in command-line utilities and web services. Although the UX/UI world is fascinating, the backend logic is the most interesting for me.

With my previous roles in Technical Support, and in Systems Monitoring, I became very fond of automation and infrastructure-as-code -- always pushing forward ways to avoid doing the same task more than once. Now, as a Software Engineer, I put this enthusiasm into action by building software to make our lives easier, as developers, DevOps and users!


Special thanks

A very heartwarming thank you to JetBrains for their support with their Open Source Support program on my zalgonoise/x repository!! Building these libraries, apps, solutions with GoLand makes it such a great developer experience, from the debugger to the tests, coverage and profiling โค๏ธ


Contact information: [email protected]






Github Metrics

GitHub Streak

apbrc's People

Contributors

zalgonoise avatar

Watchers

 avatar  avatar

apbrc's Issues

observability: Decouple Logger from the app's logic

Placeholder issue to decouple the logger from the individual components (Processor, Modifiers) and add it as a wrapper.

In future iterations, if more telemetry is added (metrics, traces), this change ensures that any of that logic is separate from the application's actual calls


Implementation details

  • Refactor types to remove the logger element
  • Create telemetry middleware containing the logger's initialization
  • Wrap logged components through their returns and errors, whenever possible

Acceptance criteria

  • logging is kept as it currently is, logging each relevant step, but is implemented as middleware.
  • logging should be declared as an interface that gets injected on the component's creation (to allow implementation changes)
  • consider changing the logger to exp/x/slog as it should go into the standard library soon

docs: Improve README documentation

Placeholder issue to improve documentation on the application. This is user-facing documentation with room for improvements:

  • better description (in steps) of what happens when executed
  • installation steps:
    • add links and references
    • add step-by-step installation guide (with images)
  • runtime / execution steps:
    • add better description on how to execute the app; how to pass arguments to it.
  • development section:
    • short description on how the app works on a technical level, for developers to submit new features
  • add FAQ (if reasonable)
  • add CONTRIBUTING (if not separately on a different issue)

mods: Add support for `lock-sprint` and `hold-crouch`

This is a placeholder issue to add a feature introducing an input modifier, that allows sprint lock (not having to hold the key to run) and crouch toggle on key release, making crouch a press-and-hold action.

Config file: \APB Reloaded\APBGame\Config\DefaultInput.ini

Lock sprint diff:

< +Bindings=(Name="Sprint",Command="InputSprinting | OnRelease InputStopSprinting")
> +Bindings=(Name="Sprint",Command="InputstopSprinting | OnRelease InputSprinting")

Hold crouch diff:

< +Bindings=(Name="Duck",Command="Button m_bDuckButton | InputToggleDuck")
> +Bindings=(Name="Duck",Command="Button m_bDuckButton | InputToggleDuck | OnRelease InputToggleDuck")

Implementation notes:

  • It can still leverage the KeyValueModifier type if the key is set as +Bindings=(Name="Sprint" and +Bindings=(Name="Duck". Can be refactored to be its own BindingsModifier type in the future.

This feature must:

  • add a modifier for changing these settings individually
  • support to rollback configuration to its original settings
  • avoid making any changes by default (must be set by the caller, as a flag or environment variable)
  • add command-line flags for -lock-sprint and -hold-crouch

mods: Add a dedicated Modifier type for Input Bindings

For the moment, the input bindings modifiers (sprint lock and crouch lock, see #2 and #3) are using a KeyValueModifier type to apply the changes in the input bindings configuration.

However, these elements are not regular key-value pairs as we find in other configuration files like the frame rate modifier (that as a format of KEY=VALUE).

While this works (in a sloppy way) to add a modifier for sprint lock and crouch lock, it can become way more convoluted when adding changes to other, more complex input bindings configurations.


Implementation details

The input bindings are actually a data structure, with a mode token at the beginning of the string. Here is an example of a few:

.Bindings=(Name="LeftMouseButton",Command="Fire",Group="Combat",OnFootOnly=true)
+Bindings=(Name="LeftMouseButton",Command="StartVehicleHorn | OnRelease StopVehicleHorn",Group="Vehicle",DrivingVehicleOnly=true)
-Bindings=(Name="LeftMouseButton",Command="Fire")

The prefix "mode" indicates (as far as my understanding and not based on any real evidence besides the file):

  • -: a disabled setting (either deprecated, invalid platform, or unassigned)
  • +: an enabled setting, is the last entry for this config element's namespace
  • .: an enabled setting, is supposed to be cached alongside other instances of the same key so they're all loaded together

The example above is for the left mouse button which has two behaviors, firing and honking the car horn (differing on the Group category the player is in (such as in combat, or in a vehicle). Both are used and clearly loaded so both . and + seem to point to enabled settings.

The - prefix seems to disable a setting. As the configuration elements are changed, the old elements are kept in the file in a disabled mode. See the escape key action being changed, some XBox key mappings that are disabled on PC:

-Bindings=(Name="Escape",Command="CloseEditorViewport | onrelease ShowMenu")
+Bindings=(Name="Escape",Command="OpenMainMenu | SkipGameflowStateSwitch")
// ...
-Bindings=(Name="XboxTypeS_DPad_Up",Command="MoveForward")
-Bindings=(Name="XboxTypeS_DPad_Down",Command="MoveBackward")

Below is a sketch of the elements of an input bindings data structure (omitting headers)

// InputBindings defines a DefaultInput's Bindings data structure
type InputBindings struct {
  Mode int // -1 disabled, 0 imported, 1 enabled
  Name string
  AdditionalName *string // `AdditionalName1` when applicable
  Command []string // separated by " | "
  Group string
  Attributes map[string]any // for additional attributes like `OnFootOnly=true`
}

Identifying an input binding configuration element can be done with a regular expression like: ^(.)Bindings=\(Name="(.+?)".+?\). It extracts both the mode and the name so that the caller can match with their modifier.

The data structure should expose an implementation of the fmt.Stringer interface to emit the modified values. It should also expose a method to evaluate the input data if it matches the modifier.


Acceptance criteria

  • sprint lock and crouch lock features must still work (as input bindings modifiers)
  • implementation must support changes to all the fields in an input bindings configuration element (except for the key, or name).

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.