GSoC Week 10: Multiplayer and Character Skinning
Posted on July 19th, 2018
It's in the last couple of weeks for Google Summer of Code!
This week I worked on improvements for adding and removing particles, and character skinning for players.
For the particle system, I now handle cases where the player drops the flag through placing it into the world, by checking for it in the onInventorySlotChanged event:
// Checks if player puts down flag
item = event.getOldItem();
if (itemIsFlag(item)) {
removeParticleEmitterFromPlayer(player);
player.removeComponent(HasFlagComponent.class);
}
I also worked on getting the particle emitters working correctly both in single player and multiplayer instances. I decided to go with the method of creating an entity based on a particle prefab so I could keep the multiple components needed to generate the particle effect I wanted, so whenever the player obtains a flag a particle effect entity is also created, and is removed from the player when the flag is put down. I got some good advice (https://gist.github.com/jellysnake/2a18b1670fe26b59cbdae7c686356cde) about how to better handle how particle effects are added and removed from the player through changing the LocationComponent, and will look into it this week.
I also worked on character skinning this week, adding an entity to the world that matched the LocationComponent of the player so that it would move and rotate along with the player, using the RedPawn and BlackPawn models on teleport depending on which team the player chooses. Right now the player's default cube body is also displayed alongside it, so I need to look into how to best deal with that, for instance if I can safely remove the instance of this entity without accidentally removing components that are important for the player.
A player approaches!
A couple of outstanding multiplayer issues:
+ Particles are added, but not removed properly in client/multiplayer session (works on server/host, but not client)
+ There are still issues with certain things not rendering in multiplayer, such as the player model for the black pawn character. I'm not sure why that is, but going to dig around more to see what it could be.
The big additional features I definitely want done before the end of GSoC are adding in an environment (one great suggestion was a maze) to make the Capture the Flag gameplay more challenging, and handling the overall game reset after one team reaches their goal number of points. So it'll be a race to the finish to get everything in, make fixes, test, and continue to assess what I can get done in the time remaining.
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