What I Planned
For this week, my main goal is to get an overall idea of the main components that structure a multi-player game and find my position within the team. I quickly invested my interest in creating the main architecture. Our plan is to design a class structure that is object-oriented and capture the basic functionalities for things like units, cities, planets, and so on. We also want to make a separate class for player that handle gamer activities, such as claiming slots on planets and establishing cities.
What I Have Accomplished
Ethan and I formed a team of two on the task of architecture implementation. It includes an abstract class called GameObject that serves as the base for other derived classes. The four main classes are units, planets, cities and slots (I wrote the latter three as well as the superclass). Furthermore, we decide to extend units and cities from another class called Attackable, based on their similar qualities such as attack, armor and health.
For the player class, I decide to maintain all owned assets by making a vector that stores GameObjects. A lot of decisions were made to ensure that our design is as polymorphic and object-oriented as possible.
I wrote some test cases for the basic functionalities of all the classes. By creating pull requests, I was able to get some concrete feedback from my teammates on how to write code more efficiently and cautiously. I also learnt to maintain good coding style and to push frequently so that everyone is closely updated.
The Unexpected Factors
Originally, I planned to work on whatever the team is lacking the most on. However, I quickly came to the realization that networking is an unknown topic for me, and thus I could hardly offer help on the subject. When I read someone else’s pull requests, it was hard for me to offer constructive and useful feedback because I don’t immediately see catastrophic drawbacks. From reading other people’s comments on my code, I realize that suggestions can be subtle and purely for the reason of efficiency. Therefore, in the following weeks, I’d like to try harder to offer my opinions on pull requests and be up-to-date with the team’s codes overall.
On the other hand, designing an object-oriented class architecture can get very complicated. I quickly realize that many design decisions were yet to be made for functions that involve multiple class objects. I wasn’t able to make any destrcutor or consider memory leak issues.
For the Future…
We still yet to discuss our new team goal during the next weekly meeting. However, I envisioned some as below:
- Think about the complication of a chain reaction, how are other objects affected during a player’s action? This will require more complex architecture that keeps track of a series of objects, as well as linking object fields with one another.
- Write destructors for classes, which is what I’m afraid of the most (memory leaks). In order to better manage the memory, I must de-allocate objects properly and in order.
- Add other neccessary derived classes for individual units, such as a spaceship, trading cargos, and so on.
- Consider how the server process data and readjust the class functions as appropriate.
What I Gained
I’ve learnt that my teammates are also my teachers. During the past week, I received a lot of surprising and useful feedback from every member on the team, because each of them specializes in a different area. Interacting with team members during the meeting was also fun, because everyone has their own input and inspire the rest.
In terms of coding, I realize that designing any architecture starts out easy but can get incredibly complicated and confusing. It is also good to discuss with teammates before any sort of implementation, because all components will eventually be linked. None of the designs is permanent, because there will always be edge cases that have not been considered and require further revision of the structure. By writing test cases and scenarios for players, I was able to find loopholes in my architecture.
How I Felt
I am very happy with our team’s progress in the first week and also the results (in the form of pull requests) even though it has not been visualized much yet. It is always exciting to imagine when the architecture fully works with the graphics and networking (putting aside all potential errors that could occur). Team meetings pump me up when I know that there are people out there who are as passionate about games and graphics as me (or even more!). This factor really drives me to work as hard as I can. It is also satisfying to know that your teammates can back you up when you run into serious implementation issues. I hope to keep this enthusiasm up during the following seven weeks.