Kekouan

What about a nice shade of blue?

2024-07-21

I got the notion that I should see how to handle a situation in which there would be multiple teams. So the first thing I needed was a variation on a theme.

A blue Marten model, in Blender

I opted to just change the "body colour" and the "eye colour" of the models. So I ended up with a blue/yellow, red/yellow, and the original green/red combos.

a scene showing off many coloured Martens attacking and shooting weapons at each other

I ran into an issue pretty quickly though, and which took me quite a while to figure out a solution to. I was originally removing/deleting any object that "died". A little showy explosion effect and then removed from the scene. This caused issues with the particles they had interacted with, and the targeting system. This would often also result in a crash due to attempting to perform an operation on a null object.

I tried to mark things as deleted and clean them up in a future iteration of the game processing loop. This didn't work as it typically wasn't just the current update that was at issue. Then I finally just marked them as "deleted", stopped processing them, and hide their models.

This is one of the things that is generally handled by a game engine, and I couldn't implement a great solution at the time.

a scene showing a team deathmatch between teams of Martens

a scene showing a team deathmatch between teams of Martens

a scene showing a team deathmatch between teams of Martens

Problem 2, spacing

The weapons on the Marten model are just attached to the side. They point directly forward. This wasn't an issue when they were attacking me, as the player ship was a very large rectangle. However, if they were now attacking a model that was the same shape as them, they would fire past the central body.

The solution to this was a bit easier, since I had created each "pod" as it's own object. I'd just have them rotate to face whatever it is they are firing at.

Martens firing at other Martens, and missing

Once they could rotate their weapon pods, it worked quite well.

Martens with rotatable weapon pods

Martens fighting other Martens, now successfully ignored by the scene when destroyed

Martens fighting other Martens, now successfully ignored by the scene when destroyed

the final result, Martens exploding

The large map I had created for this had 4 sections, so I added the player as an additional team.

Player ship getting attacked by the Green team, while the Red and Blue teams attack each other

I had successfully created some enemies that would seek out and attack the player (or another entity on a different team). Next up, putting this all into a single player level.