Blog Entry: RPG Explosive Projectile: Network Replication and Destruction bug
Author: William DeMayo
3/28/2024
RPG Explosive Projectile: Network Replication and Destruction bug
Part 1: The Problem
Hey guys, it’s me Will again writing about guess what another projectile that I had problems with during the development cycle this week. After getting the weapon logic of shooting and reloading over to the player, my team and I thought it was a great idea to start on the RPG launcher. This is the first projectile-based weapon that we have in the game (the rest are hit-scan (Line traces)). Because we are planning to have a dual-firing special weapon, one shot being a projectile and the other a line trace, it was a promising idea to figure out how we were going to do it. Because I had experience with the projectile building the Mini-Boss AI I jumped straight into the task and got to work. Soon enough I had constructed an RPG weapon and an explosive projectile. At first, we noticed that there was no collision on the object, it was just flying infinitely through space and time never damaging any zombies or destroying itself on impact. We realized that with some of the walls in our test map, the generate overlap events were off which was such a stupid bug but an easy fix. The next problem was that the explosive was killing the mini-boss but not the zombie itself even though it was derived from it. Right after this, we realized after putting the destroy actor on that it was hitting the spawn zones and never spawning. After fixing these problems I will go over how it was fixed, there were two more issues that I ran into with the projectile before finishing it. The first problem was a quite simple one. The projectile was being seen on the server and client when the server shot it but when the client shot it, you could not see the projectile, but you could see the explosion animation. The other problem was the server could do damage, but the client could not, both problems stemmed together from one thing: replication.
Part 2: The Solution
The first problem that we had that Bjorn and I solved was why the explosive projectile was destroying without being spawned; When the projectile was being spawned it was destroying itself in a singular frame. Bjorn had started looking at the collision presets and told me something that I had not seen, the collision was hitting the spawning zones for choosing where to spawn the zombies. This was because the collision did not have a special collision object trace to only affect the zombies and walls, but it does not collide with the spawn colliders. Bjorn quickly made it as he had it checked out and handed it back in so I could finish the RPG. After Bjorn added the special collision object trace it fixed the projectile immediately destroying after spawning in, as well as the projectile not doing any damage. When I got the blueprint back, I went straight to tweaking it, due to building a multiplayer game we need to take network replication into account. The problems that I was facing were the projectile not displaying to the server from the client, as well as the client not being able to deal damage. This was due to replication, when you are building a networking game if you are the server all the events must happen on your game to be displayed to everyone else in the game. Say you’re playing a shooter with a friend, when your friend fires you see their bullets right? This is because it is replicated on the server for every connected client so that they can see it happen. So how I fixed the problem was setting up events for calling a server function of applying damage, and to make sure that the projectile could be seen I made sure to mark the replicated Boolean so that the server and other clients could now see everyone else fire the projectile. For now, I hope this is the last of the projectile problems that I write about to make it more interesting for you readers.
Until Next Time,
LGUAPO JR
Get Deadlands Duel: Time Rift Rumble
Deadlands Duel: Time Rift Rumble
A hot-blooded, feel good, zombie wave defense shooter.
Status | Prototype |
Authors | Willy Games, Ghost Of Reddus1, Mystic, LGUAPOJR, StevenCodes, Bjornoid, Johncarlos Lillo |
Genre | Shooter |
Tags | Arcade, Atmospheric, FPS, Horror, Multiplayer, rogue, Sci-fi, Unreal Engine, Zombies |
Languages | English |
More posts
- Perk System SetupMar 31, 2024
- Blog Entry Title: Morale and B featuresMar 29, 2024
- Class Ability ImplementationMar 29, 2024
- Blog Entry: Powerup UIMar 29, 2024
- Spectating SystemMar 27, 2024
- Blog Entry Title: User Interface and Under hood with Unreal AudioMar 23, 2024
- Blog Post: The Miniboss ProjectileMar 23, 2024
- Unique but modular class abilitiesMar 23, 2024
- Blog Entry: Instant Kill PowerupMar 23, 2024
Leave a comment
Log in with itch.io to leave a comment.