Peter Eldredge PPJ #1

Set up the Unity Project and GitHub, adding some of my useful Scripts - 1 Hour
Group meeting about the project and tasks - 2 Hours
Conceptualized and implemented a modular enemy framework - 3 Hours
Helped Jake with programming the player controller (primarily the physics) - 3 Hours
Final setup for the demo/build - 1 Hour

Enemy Example

Enemy Framework Example

The behavior above was made just by tweaking some values on prefabs and scriptable objects. The idea is that this will be expanded throughout the course and we can have an easy way to create new enemies. The behavior system can also be expanded to movement patters and a health system/weak points. Here are some inspector tabs to demonstrate how the behavior was achieved.


The scriptable object is the attack behavior. It controls the conditions for the attack to fire as well as the prefab which handles the attack itself. In this case, it simply instantiates the FastLaser prefab. The condition that must be met are that the player is 1000-2000 units away from the enemy. The attack has a cooldown of 1 second, which is the minimum time it will take the enemy to attack again.

The FastLaser prefab has complete control over itself once spawned in. In this case, there is no intelligence to the laser other than it launches itself at the player at a set speed (5 in this case). In the future, we could use this same basic set up to use homing rockets or shoot multiple lasers, just by updating this prefab with new logic.


To compare here is the slow attack. It's cooldown is much faster than the FastLaser, and its condition to be fired is that the player is 0-1000 units away from the enemy. In addition, it uses the SlowLaser prefab which has a much slower speed.

Keep in mind new conditions can be added on an Attack Behavior basis, such as the player must be a certain speed, the player health must be within a certain range, the enemy must be in a certain position, etc...

Player Physics

The aspect I helped Jake with the most was trying to create a momentum system that is robust, as we are going to need to be constantly tweaking it until it feels like we want. This was accomplished by directly setting the velocity of the rigidbody each frame, then applying an acceleration depending on the angle between the player's forward vector and the worldspace -Y vector. This was then normalized, and then used to calculate an acceleration on an animation curve (to be easily tweakable without changing numbers/code). The value from the animation curve is then mapped to the range of accelerations we have set in the inspector.

Using the system this way, the player now maintains momentum on the terms that we set, instead of using Unity's build in physics and hoping for the best. At this stage I would say it works, but needs some value tweaking and also needs some other key features which I will get into later.

Positives

Everyone in the group seems to have different and useful interests, which means we wont be stepping on each other's toes. It seems like everything has come together pretty well, which is better than I was expecting at first because this seemed like a challenging project to get off the ground. Obviously we have a lot more work to do but I am happy with the basis we have built, and think we have set ourselves up well for the future.

Negatives

I think we met a bit late this week, which didn't give everyone a ton of time to get their respective parts done. This meant that we are working on the game Thursday morning before class, something I'm not a huge fan of. Fortunately everyone got their parts done and we should still be ready for the class presentation.

Upcoming

The Enemy Framework is going to get Movement Behaviors just like the Attack Behaviors, and this will function primarily as the game's AI. Additionally other types of attacks will need to be added as well as a damaging/destruction system for when the player destroys them. Overall a lot of components are missing, but they depend on what we decide for the design of the game and we have a good base to build from.

The Player Physics needs more tweaking but also some additional features. This includes a bit more automatic rotation, so when you go straight up the game will be pushing you towards a more flat/downwards angle. Additionally, the ignition system needs to be added as that is the key way to gain speed. Everything is going to need to be rebalanced around this mechanic. Hopefully we can get the plane functioning in all of its primary capacities by next week.


Comments

Popular posts from this blog

Getting Started: In the Cloud(s) Sean McFadden Summary (PPJ #01)