The “Hello” Operator

Also known as the “Null-Conditional Operator”. In other words, “operations based on whether an object is Null”, AKA Nothing in VB.Net.

Some like to think that ?. looks like two eyes and a lock of hair, and call it the “Elvis Operator”. I would prefer to call it the “Superman Operator”, except for the fact that it doesn’t resemble pair of eyes and hair at all. Not on my font, anyway. And I don’t want it to, I want to see code. Without hair getting in the way, …

[ Read More… ]

Exceptional Averages

Counting up numbers into an Average takes time, but recently I developed a method of doing this without using a loop. Essentially once the Pile of numbers is full, we need to remove the oldest number from the Pile and add the new one.

Also, if you’re tracking over a long period of time, you want it to be accurate from the beginning. The JEOZ.Average Structure solves those issues.

The Average.Smooth Field is a GoNumber that helps even out the Average Value. When displaying numbers on screen it’s …

[ Read More… ]

Every Program Is A New Language

Perhaps that’s going a bit far, but it proves a point. A less extreme comparison would be “every program has a dialect”. In any case, every app or game has a “glossary” of terms almost like any fantasy world has it’s own lexicon. To an outsider it’s almost a foreign language.

With coding, every Function becomes a word that can start a sentence. A Function’s Parameters become “words” of that sentence, especially when using Constants like Enumerators. These allow you to store a value as an Integer while treating …

[ Read More… ]

Interpolated $trings Were Worth The Long Wait

Let’s skip the “no pun intended” and get to “where has this been all my life?”. I don’t recall ever adapting to a new concept in coding so quickly. Right away I went through the whole engine and rewrote every single Log() message, using the repetition to try and force myself into a new habit.

Probably since VB3 I’ve been in the habit of using the old style of String Concatenation, which is done with Ampersands. It’s been an automatic behavior for me for a long time, so I …

[ Read More… ]

It’s GameTime

Naturally, my first OpenGL game was a 3-D version of Pong. I was using an old library called GLUT which included functions for generating primitives like spheres. You could generate them based on the number of lines of latitude and longitude, AKA “UV Spheres”.

More polygons would make the game run slower, so I cranked that number up until the framerate stabilized. This is a highly sophisticated programming technique often referred to as a “cheap hack”. Sure enough, almost 18 years later, it still runs just fine. Which …

[ Read More… ]

Filmed Live, Before A Visual Studio Audience

Or “Why are video tutorials typed out live and not pre-written?” Perhaps this is obvious, but I feel that I needed to hear it sooner, so I should probably cover it. If you’ve watched any video tutorials on coding, you’ve had to watch someone type out the code as they explain it. Even if it involves lots of typos and retyping, somehow this makes more sense and feels better to watch than having everything written beforehand.

Gradually I have realized that if I merely copy and paste code from …

[ Read More… ]

The Real M.V.P. Is Trinity

It’s ironic that Trinity makes Neo ask “What Is The Matrix?”, because it takes three Matrices to position every vertex of a model in 3-D space. It’s so appropriate that one of the first things Trinity does is float in space as the camera rotates on the Y-Axis. The M.V.P. Matrix, or Model-View-Projection, is a Model Matrix for the object’s location, times the View Matrix of the camera, times the Projection Matrix of the screen.

I don’t know much about how it works on the inside, because the …

[ Read More… ]

Just How Many Lines Of Code Are There?

Oh, I don’t know. Three. Wait, four. Five maybe. Literally speaking, JEOZ is around 16,000 lines of code so far. It could use another cleanup I suppose, but not that much, I regularly go back and tidy up loose ends.

But I’m also serious about 4 or 5 “lines” of code, I’m just referring to categories. Several times in the past I’ve tried to think of as few categories for every type of possible Code Statement, and there doesn’t seem to be that many.

Calculations and Assignments – Algebraic Statements …

[ Read More… ]

If Only I Had Switched To Branch-less Coding Sooner

One of the first lines of code you ever learn is a conditional statement, such as an “If Then” or “Switch” (aka “Select Case” in VB). But I didn’t find out that they can be expensive to use until I got into Shader code. A GPU has numerous cores to handle millions of pixels, so one branch statement is exponentially costly. In any case, the pitfall you want to avoid is branching inside a loop.

I experimented a bit with some ideas and benchmarked them to find out how …

[ Read More… ]

Now It’s Time To Go, Numbers

There’s only one place for me to begin with writing articles about coding. The most fundamental parts of the JEOZ Engine are GoNumbers, GoVectors, and GoColors. Games require smooth movement, and building these objects into the core of the JEOZ Engine makes that effortless and automatic.

Simply put, you move from one point to another at X Percent each frame of animation. Instead of a constant motion which looks robotic, it starts very fast and slides to a stop. If you apply this to Arrow Key (WASD) inputs, it …

[ Read More… ]