Fundamentals of Combinatorics

Why I’m Writing This This semester I took a role tutoring MATH14998 (Computer Math) at Sheridan College. I originally felt a little out of water given how long it’s been since last studied math. Throughout the term, I’ve learned a lot about what it takes to teach and some of my short comings and strengths. One of them being, I have a sense of what concepts are particularly difficult grasp and finding ways to explain them so that the students can actually understand the concepts rather than memorize formulas. Now my delivery of the explanations could use some work but I’ve put together some explanations that I’m quite proud of, one of them being combinatorics. And so, I’ve included a compilation of those notes here. ...

April 19, 2024

Cyberpunk 2077 Thoughts

Stealth Gameplay My favourite way to play has definitely been stealth with the mixture of hacking and tech being incredibly satisfying and fits a unique power fantasy I haven’t experienced elsewhere. Being able control the battlefield by hacking things like door and explosives, or just zapping enemies on command, adds an almost sandbox like environment for the player to interact with. There’s also the satisfying choice of weaponry from silenced pistols and rifles to melee weapons ...

February 1, 2024

Slime Hunter Pitch

First semester finished! With all the final assignments, I completely forgot about this blog. Whoops! In any case, I wanted to do a little retrospective on our final pitch assignment. Final Pitch The idea of this assignment is simple, we create a game idea and we pitch to the class with a short, 5 minute, prerecorded presentation. The presentation should be informative and succinct and give the viewers a clear idea of the game. ...

December 19, 2023

C++ Test Review

Just some scattered notes for test review. Object Composition Object memory is stored contiguously. If an object has pointers, those pointers are still stored contiguously but point to wherever the data is. Object Ownership One simple approach is to say that whatever creates the object becomes the owner of the object Thus, it becomes responsible for deleting it Inheritance Polymorphism Zombie* bob = new Zombie("Bob"); Zombie* sally = new ZombieSoldier("Sally", 100); bob->attack(); // prints "Bob throws a punch" sally->attack(); // prints "Sally throws a punch" // wait... // ...............?! Objects have static binding by default in cpp. For dynamic binding, methods must have the virtual keyword. static binding by default does offer better performance. ...

October 16, 2023

Satisfying 2D Movement

I’m in the middle of working on my first mainline c++ project at school. We’re tasked with making a simple vertical spaceship shooter using c++ with SDL and some pre-made assets to form the game. At the moment, I’ve set up most of the classes I will need and have a simple ship that renders onto the screen. Naive Movement My first iteration of ship movement does have some forward thinking but allowing ship movement to continue by holding down keys. Using SDL polling, it’s easy to want to bind movement directly to each game iteration and triggering of the SDL keydown event. The problem is, standard keyboards when held have a delay on the first press before sending keyevents on every frame. What that looks like is the shape making a quick jerk, then pause, then start gliding across the screen. ...

October 13, 2023

Portrait Action Mobile Games

As I was looking for games to play during my bus rides, I realized the convenience of being able to play phone games one-handed, or just simply in portrait mode. It’s a lot more comfortable to hold, especially in tighter environments like a bus. There’s lot’s of options for this but they mostly amount to puzzle games and such. Instead, I wanted something more actiony and rpg-like I could play in that format. Most action games are played in landscape as they tend to require more complex controls that aren’t condusive to the portrait play area. That’s fine and all but I just never was able to fully enjoy action games to that depth on a mobile format. Trying to fit complex inputs onto a touchscreen just isn’t that great of an experience so I tend to avoid playing them. Instead, what I want is an in-depth action, portrait-mode, mobile game with simple controls yet engaging gameplay. A big ask huh? ...

October 11, 2023

C++ A Personal Guide

A compilation of various features and gotchas I’ve encountered while studying C++. Instantiating Object Member Variables When to Use Initializer Lists Intializer lists offer a secondary method of initializer member variables for a class. A question comes up of why would we use this method as opposed to initializing the variables on declaration of just in the constructor. Below are a few core purposes. Initialize Const Members You could initialize these on declaration but what if you we want to pass in their values as arguments to the constructor. Okay, then we can move it to the constructor. Nope, it’s a const variable so it can’t be modified. ...

October 4, 2023

Pianotypes Devlog 5

Not many code changes as of late but I’ve been more active on one of the packages I’m using to play sound, smplr. It’s such an amazing package for playing instrument sounds with an incredibly simple and powerful api. Kudos to danigb. A bunch of new changes were made recently that have added some awesome features as well as some bugs I found while using them. Note Scheduling Throughput The first change was a tweak to note scheduling that fixes an issue of the web audio getting overloaded and introducing lot’s of static. ...

October 1, 2023

Stack and Heap

Declaring Data Structures on the Heap https://stackoverflow.com/questions/8036474/when-vectors-are-allocated-do-they-use-memory-on-the-heap-or-the-stack vector<Type> vect; will allocate the vector, i.e. the header info, on the stack, but the elements on the free store (“heap”). vector<Type> *vect = new vector<Type>; allocates everything on the free store (except vect pointer, which is on the stack). vector<Type*> vect; will allocate the vector on the stack and a bunch of pointers on the free store, but where these point is determined by how you use them (you could point element 0 to the free store and element 1 to the stack, say). ...

September 27, 2023

Useful Linear Algebra

Dot Product Find the interior angle between two vectors $$ A\cdot B = |A||B|cos\theta $$ $$ \theta = \arccos(\dfrac{A\cdot B}{|A||B|}) $$ $$ where\ A\cdot B = A_x \times A_y + B_x \times B_y $$ Cross Product Get perpendicular vector from two vectors Find area created by two vectors (for 2D, parallelogram area, for 3D, parallelepiped area) This is the magnitude of perpendicular vector Matrix Multiplication There is a formula for calculating the resultant matrix from a matrix multiplication. ...

September 25, 2023