GSoC Week 9: Flag Particles and Synced Scoring
Posted on July 18th, 2018
It's 9 weeks into Google Summer of Code and things are progressing!
This week I worked on some different additions to the Capture the Flag gameplay. First off, I fixed the problem I was having last week with held items not having the right components for checks--specifically, not being able to search for if a flag has a BlackFlagComponent, for instance, if I am trying to see if it is a black flag. I found out that adding
@AddToBlockBasedItem
to a given component would allow that component to be detected, even if being held. Secondly, I worked on adding the Score HUD to the client when there is a game being hosted on the server and a client joins in. Now the server updates the server's score, then sends an event to all clients to update their HUD's score to what the server's scores are. The client HUD itself is created and bound in a separate system, ClientScoreSystem.java, which has
@RegisterSystem(RegisterMode.CLIENT)and thus displays in multiplayer.
Thirdly, I worked on adding a particle emitter to the player when they're holding a flag. I created new particle sprites to fit in with the theme of Light and Shadow (using red hearts and black spades) and have the builder build a new prefab (ex. BlackFlagParticleEffect.prefab) with the LocationComponent of the player so the emitter moves when the player moves. I have discovered that this might be too complicated a way to handle this, so I want to look into just adding a ParticleEmitterComponent to the player instead.
Heart particles streaming out behind player
Finally, I worked on (and am continuing to work on) handling all cases of the flag being taken and dropped, making sure I properly handle adding and removing the flags at the proper time. For instance, now the flags should be removed from any players holding flags when a player scores. But right now the case where the player places the flag in the world is not handled. This might be used by players to transfer the flag to other players, for instance.
In the meeting last week we talked about some other possible ways to go once these things are taken care of. Some possibilities: character skinning for red/black teams, creating a maze or other environmental factors to make the Capture the Flag gameplay more fun, or attractor/repulsor rays for players. Once I sort out some of these issues I think character skinning is next, as this will help add more visual interest and help players distinguish teammates from enemies.
PRs for this week:
Adding Client HUD and Score System: https://github.com/Terasology/LightAndShadow/pull/70
Adds particle effects and textures for when flag is held: https://github.com/Terasology/LightAndShadowResources/pull/29