Monday, January 22, 2018

I was told there would be be days like this....

Last week during my excursion into art I decided to move let my circadian rhythm slip to something like 3rd shift. This is a horrifically bad habit of mine and I always forget the consequences of this action when I have to stay up all day. I just wind up a big lump of feeling awful for hours with little, if any, productivity.

I got nothing done today.

Well, I'm kind of lying. I fixed up the mouse so that it works in both windowed and fullscreen mode. So input is working in HD which is nice I guess. It was munging about 20 lines of code to get the offsets and scale correct. I'm pretty sure a "real" programmer probably would of knocked out the issue in about 2 minutes. I'm using "real" in heavy air quotes, mind you. I have code to work, and my goal is to have a functional application. Sounds like I'm filling the shoes of a programmer to me...

One upon a time, many moons ago I was a database programmer for the local municipalitiy's police force. I lasted about 6 months before I realized that database architecture was not my bag. My job was to take flat form data from a VAX machine, and then write parsers that would convert them into an rational "insert" statement for PostgreSQL. My weapon was Ruby. At the time it was a rather unknown language from Japan that had aspiration to unseat Perl as the object orientated scripting language for the world.  (This was before "Rails" was a thing.)

The problems I had was few-fold. The biggest one was I didn't know any object orientated paradigms at all. When I did research on it, I eschewed the whole philosophy. I remember reading an introduction to OO, which listed 10 things to never do while writing a program.

"1) No Globals."

Upon reading that, I pretty much thought OO was garbage and didn't want to do anything with it. I saw it as corrupting simple programming, making it unnecessarily complex and assigning silly names for stuff that was already invented. It was a "method" now, not a "function". Oh that's called a "member field" and not a "variable". Even something as simple was "what is a class" was answered in terms of  "it's whatever you want it to be". It seemed like new-age trash.

I'm a little wiser now.

I like working with ROE because it calls back to my old programming habits. It's control flow is awful. The game literally doesn't have a "main loop", just a bunch of state machines handled by globals that switch the program pointer to different parts of code like a track switcher steering a train down a path of multiple tracks. It's complicated to follow and it's hard.

After dolling up my mouse code, it works good enough, but not really how I want to see it function. When the mouse goes "out of bounds" it hides in strange corners of the screen. But, really, I'm not interested in out of bounds mouse locations anyway. (At least not right now)

My new issue is that when the screen updates it doing it about a frame every five seconds. So when I pushed the game to 4x the resolution, there is something just eating CPU cycles now and I didn't want to tear anything apart to fix it today. I'm pretty sure it's my new timer code but.... ehhhhhh.

Obviously, it's going to need to get done, or else I simply will not have a game and this whole endeavor would be a huge waste of time and money.. Here's hoping tomorrow will be better.

(It most likely will be after I get an actual 8 hours of sleep)

No comments:

Post a Comment