Lucas Haley

frustration

Time to change again. Goodbye old posts.
#Frustration

So once again I need to migrate this site, as Forestry.io is closing down.

I'm trying SiteLeaf right now.

A personal note to remind myself
#Unity #Frustration #Programming

I'm a big fan of Unity. I've been using it since version 2. I've seen it go from small upstart, Mac-only, working with other small Mac apps like Cheetah3d, to a behemoth owning a huge chunk of the game dev base, and more. I still use it every day, and teach it in my courses.

Over the last couple of years, however, I can't help but find the name of the company to be just, well… ironic. They're shooting in all sorts of directions, trying to be everything to everyone. More power to them, I guess — except that the different tentacles of the company don't seem to be talking to each other very well. The new packages don't work well with each other. There's no unity of interface, or programmatic approach. It's really sad to me. And makes teaching it so much more difficult.

Anyways, I've been trying to pull apart the new Unity Input System. It's a catch-all system for collecting user input, from console controllers to touchscreen devices. As such, it's really abstracted out. Dredging through the demo samples, the code is inconsistent and leverages some pretty obtuse C# techniques, which of course makes it that much more difficult to grok and teach. Anyways. THE FUTURE

Some notes for my own purposes

PointerManager collects raw input. GestureController determines swipes and taps. It assigns its own OnPressed to PointerManager's Pressed method. SwipingController parses gestures for functionality. It assigns its own OnSwiped to GestureController's Swiped method.

Code with your brain, not your fingers
#Frustration #Programming

Sometimes I find myself beating my head against a particular programming problem, trying to force the code, and inevitably it means I'm not thinking in the right way about it. It's like the Blaise Pascal quote:

I have made this longer than usual because I have not had time to make it shorter.

In this most recent incident, I've been trying to code seasonal cycles into a game, in which the various variables could be manipulated per-object, per-season, with custom seasons per-object. Don't ask. Anyways — here I was, beating my head against modulos and switch cases for a day and a half. Then, on a rare run, I got far enough away from the computer to remember that Unity has AnimationCurves, which basically tick all the boxes could want. It took about 14 lines of code to get to work.

It's just a nice reminder that sometimes the best coding is done with your brain, not your fingers, away from the computer.