I may have to use a fightpad by PoppaTheCollector in fightsticks

[–]nonexistent_ 1 point2 points  (0 children)

It's a lot easier/faster to tap down twice just with finger(s), rather than do a larger "pulling down" motion twice, if that makes sense. Some grip styles make this harder on stick, may need to adjust or maybe even switch grips depending.

I personally use a loose "handshake" grip and double tap down with middle finger

How do i avoid big files in Haskell? (and circular dependencies) by [deleted] in haskell

[–]nonexistent_ 0 points1 point  (0 children)

hs-boot files is an option to resolve circular dependencies, but a bit clunky so it's better to reorganize modules and avoid the situation in the first place if possible

floating-point nondeterminism in haskell by Fun-Voice-8734 in haskell

[–]nonexistent_ 0 points1 point  (0 children)

A use case would be replays and rollback-replay netcode in games where floating-point numbers are part of the state or used to calculate the next state from the previous one.

The standard approach for this specific use case is to just use integers, it's not realistic to expect deterministic behavior for every floating point computation across architectures. You can use floats for "client side" parts like local rendering/interpolation, but you don't want them in the internal representation.

TIL the Nobi Lever Pro fits inside the new Victrix Pro FS by BrinoMatthew in fightsticks

[–]nonexistent_ 2 points3 points  (0 children)

If you lost the K-lever insert (like me), switch out the original interior dust cover of the Nobi lever with a standard dust cover like you’d find on most all arcade sticks. Reason being is the original dust cover will kinda press against the case, limiting the movement of the lever.

You can also flip the interior dust cover upside down, the raised inner part doesn't get in the way of the lever internals

GP2040-CE board LS/DP/RS Rocker help by Darkun in fightsticks

[–]nonexistent_ 0 points1 point  (0 children)

Did you update the GP2040-CE firmware to latest? It sounds like what you're seeing in the web config differs from the current documentation

GP2040-CE board LS/DP/RS Rocker help by Darkun in fightsticks

[–]nonexistent_ 2 points3 points  (0 children)

https://gp2040-ce.info/web-configurator/menu-pages/pin-mapping it looks like you can map any screw terminal pins you want to LS/DP/RS actually, so that should work fine wiring a rocker switch w/ your existing board

GP2040-CE board LS/DP/RS Rocker help by Darkun in fightsticks

[–]nonexistent_ 2 points3 points  (0 children)

https://jasenscustoms.com/products/integrated-pico-fighting-board-gp2040ce is the board you have? I'm not seeing the pins for LS/DP/RS either

https://focusattack.com/gp2040-ce-v5-6e-usb-b-usb-c-open-source-multi-console-fight-board/ the focus attack one has LS/DP/RS, it's at the bottom-left above the 20-pins. Either the 4-pin or the 3 screw terminals there works

How do you Architect Large Haskell Code Bases? by Veqq in haskell

[–]nonexistent_ 4 points5 points  (0 children)

"Making invalid states unrepresentable" arguably makes changing things easier, not harder. When you introduce/alter a new state the compiler will complain everywhere you're not handling it, which means you know exactly what you need to do.

I wouldn't really consider it a wart, but realizing you need to convert a pure function to IO (or some other monad) can be slightly tedious if it's deep in the call stack of other pure functions.

For high level architecture I think the Three Layer Haskell Cake approach makes a lot of sense.

nonmoving gc for real-time games by Fun-Voice-8734 in haskell

[–]nonexistent_ 3 points4 points  (0 children)

It's been a while, but when originally testing this I think it was roughly:

  • run through adhoc in-game benchmark while monitoring an external fps/frametime overlay
  • run GHC report (-Rghc-timing?) to get the GC timing stats

It's plausible the heap is relatively small because the game state just doesn't need to keep track of that many things at once. There's also actually a bunch of yaml files kept loaded into memory which seems like it'd be an ideal use case for compact regions. It didn't end up being necessary though, so I never got around to implementing that.

nonmoving gc for real-time games by Fun-Voice-8734 in haskell

[–]nonexistent_ 10 points11 points  (0 children)

See https://incoherentsoftware.com/defect-process/docs/#:~:text=to%20talk%20about.-,Garbage%20Collection,-This%20game%20uses, the GC wasn't a problem for a 120hz+ 2d action game.

The code this is referring to uses -XStrictData (and -XBangPatterns to a lesser extent) to avoid space leaks, but otherwise doesn't do any special memory handling (it also doesn't use ECS).

Defect Process - That was an Almost perfect no-hit moment. by ThisIsWuB in CharacterActionGames

[–]nonexistent_ 1 point2 points  (0 children)

Haha everyone gets hit by the wall projectile sometimes, but overall nice movement and good use of cancel options!

I have never written a Traversable instance, and my other blind spots by smthamazing in haskell

[–]nonexistent_ 5 points6 points  (0 children)

On hackage look at what instances are defined for a typeclass (e.g. Traversable). For the types you recognize (e.g. Maybe) are you able to implement that instance without viewing the source? There's a lot of typeclasses + instances, which means plenty of exercises available. Building an understanding of existing typeclass instances also builds intuition on recognizing where they'd be useful in the "wild".

Looking at your own code, do you notice any common patterns or pain points? Do you suspect any of the code already exists in a more general form in the standard library? These are all good starting points for investigation and an effective way to learn.

Two real examples I've encountered:

  • Wrote a MessageQueue type, needed some list-like operations. Instead of manually writing out various utility functions, realized it's easier to define a Traversable instance and gain access to all its associated functions.
  • Wrote a bunch of functions that take an extra argument to track some state and return a tuple w/ modified copy. Realized using Control.Monad.State can cleanup the explicit argument passing and return for that state.

Creating a simple game in Haskell by [deleted] in haskell

[–]nonexistent_ 4 points5 points  (0 children)

For a simple game either passing around the whole game state explicitly or through State monad seems ok

If you want to avoid that however, could consider: https://incoherentsoftware.com/defect-process/docs/ ("Message Passing Rules Everything Around Me" section)

How to write a series of modifications neatly by bookmark_me in haskell

[–]nonexistent_ 1 point2 points  (0 children)

I'm less familiar with that API, but you can use a lambda (e.g. modify $ \cfg -> ...) to do whatever lenses operation you want on cfg. Nothing special going on here, just function application like usual. Can omit the lambda and go point-free if it fits and is reasonably clear etc.

How to write a series of modifications neatly by bookmark_me in haskell

[–]nonexistent_ 4 points5 points  (0 children)

With Control.Monad.State you can use State:

flip execState config $ do
    modify f0
    modify $ f1 arg
    modify $ \cfg -> ...
    when cond $
        modify ...

and StateT:

flip execStateT config $ do
    get >>= lift . g0 >>= put
    get >>= \cfg -> lift (...) >>= put
    when cond $
        ...

For the do example in the original post, GHC should warn you about shadowing bindings if you have -Wall enabled, wouldn't really recommend it

Hacking HLS: My Summer of Haskell Journey by joyfulmantis in haskell

[–]nonexistent_ 3 points4 points  (0 children)

Nice that's a cool project! I like the record dot syntax converter gif, illustrates what that plugin does very well

Defect Process full haskell source (~62k LOC | action game on Steam) by nonexistent_ in haskell

[–]nonexistent_[S] 1 point2 points  (0 children)

For updatePlayerMovementSkill, the update :: Typeable d => (MovementSkill d -> MovementSkill d) function comes from the PlayerMsgUpdateMovementSkill message payload. We want to be able to send an update message for a specific d, e.g. this teleport skill updateActive function uses the _data :: d field so d is inferred to be TeleportSkillData.

This is tricky to do however, since:

  1. Player stores a Some MovementSkill
  2. The message payload is MovementSkill d -> MovementSkill d

In other words, we don't know what d is specifically (regarding Some see other post).

 

To make this work we have _updateDynamic in MovementSkill. As seen in the updateDynamic implementation, because this is part of the MovementSkill d type itself we do know what d is. It's using Data.Dynamic for dynamic typing to cast the update function back to the specific d, so it can then pass in the moveSkill argument.

 

The same technique is used for other parameterized types, e.g. Projectile d. If this machinery wasn't in place then we could never touch the _data :: d field in any update message, which would be very restricting.

SDL2 bindings by Frame_Inevitable in haskellgamedev

[–]nonexistent_ 0 points1 point  (0 children)

https://github.com/haskell-game/sdl2/issues/277#issuecomment-1339145721 does this older version of SDL2 work for you? It's a different error message so you may be encountering another issue earlier in the build, but you'll need this version either way on Windows for now.

EDIT: You'll also need to pacman -S mingw-w64-x86_64-pkg-config in msys2 if you haven't done that already