CS371p Spring 2021: Luca Chaves Rodrigues Noronha dos Santos

What did you do this past week?

This week I devoted a substantial amount of time to a personal project I have been developing in Unity. Since this has been my first foray into independent development I had to get used to a lot of the basics of 2D game making; two particular optimization concepts that I allocated a lot of time into were object pooling and game manager scripts. Once classes resumed on Wednesday I started to work a lot on the Voting project. I have been doing that ever since.

What’s in your way?

With midterms and career fairs coming up soon I would say that the biggest thing in my way at the moment is a lack of time.

What will you do next week?

Wrap up my Unity project and start on a new, simpler one.

If you read it, what did you think of the Single Responsibility Principle?

I have not read this week’s paper yet.

What was your experience of Voting and consts? (this question will vary, week to week)

Voting, particularly when it comes down to determining the winner (that is, after input has been correctly read), has shown itself to be fairly complex. I have been working on the project alone so I found myself having to do a significant amount of research in order to properly implement the behavior I had in mind. Some notions I had to get familiar with in C++ were bitmaps (from the bitset library), vectors, custom classes and assigning them unique operator behavior, iterators, and pointer/reference management.

I have not had much opportunity to experiment with consts.

How did you fare in the storm?

Fairly well actually, I was away from the epicenter.

What made you happy this week?

I have been extremely happy with the amount of work I have been able to get done with in this week.

What’s your pick-of-the-week or tip-of-the-week?

Unity object pooling! Whenever you are working on a game that includes sections where you intend for a large number of objects to be instantiated in quick succession, optimization may quickly become a concern. Consider something like a volcano constantly spewing out lava objects, or GameObjects with attached AudioSource components being created each time you need a sound effect. With object pooling you are able to create a pool of objects that serves particular object requests and gets reused whenever the number on the pool is empty. The main driving mechanism in a pool is something like a queue, where upon a given object request (say a lava object) we dequeue the pool and instantly enqueue the object back. Whenever the request is served, the object’s values (like its transform.position for instance) are set to whatever the requesting body wants, and then whenever the object “rotates” back to the beginning of the queue its values simply get modified again!

Pooling allows for much tighter control of object instantiation and optimization!

Here is a helpful reference :)

--

--