Home // Blog // Dev Update – Refactor to Components

Greetings Wardens

In this update I wanted to start showing off the new refactoring benefits since the demo. I know these have been slow to be shown off, but the target of having the Alpha release with Ship customization was always the goal, and why not also include the refactoring of all the logic to work properly in Multiplayer? In this specific update we shall take a look at the working Component refactor on the Turrets and Weapons.

Why all this work in refactoring?

Since the demo, a lot of work has gone into rebuilding the ShipPawn and Weapons because a few major drawbacks;

– Issues with initializing weapons/turrets for customization and/or Multiplayer replication (Child Actors are not good for this)
– Needed more control of WHEN variables were initialized – With Child Actors, those children usually initialized before the Parent ship which made it a headache to pass variables in code
– Pawns/Actors seem to talk better to their “owned” Components and thus don’t need a ton of “fixups” when after Begin play occurs (fixing things like “ownership” was a headache here)
– Self contained Components that handle their own logic made it much easier to parse issues, vastly improve performance, cut out hax to make things work, eliminate bloat logic on the Ship Pawn
– Making a streamlined approach to Multiplayer Replication and seeing only the necessary movement/shooting of another Player’s Ship.
– Performance. Actors on Actors on Actors (Guns–>Turret–>Ship) got pretty heavy pretty fast. There was already noticeable lag within the Demo on the final wave with only 15ish ships and similar Alien count + asteroids. I want the number of ships to be higher, closer to 100+.

As a result, we now have working Multiplayer for the basics of Client based Movement (smoothest movement for your own ship), Replicated turrets (aiming/shooting), and a rework on the core “Default Gun” setup allowing both projectile and beam style weapons to have different firemodes/shotmodes/chargemodes all with just some simple data changes. Want an Automatic Laser Shotgun with a charge up? That’s now possible!

Furthermore, the biggest issue I also ran into with the setup of the Turrets was all the manual setup I had to do with the Sockets–>Turrets + Guns. What I mean by this was from the Editor and the game, I never got consistent results on how the Editor displayed how the Child Actors of the turrets were initializing the weapons on “Construct” of the Pawn. Well after switching all these over to Components, the race conditions all went away and made it simple to have the Pawn first initialize, then the Child components afterward. This made it extremely easy to then setup and counter rotate any turret initial socket rotation (Upside-down under a wing, or rotated sideways for side turrets) and tell it to shoot directly at my crosshair.

As a result, I no longer need to worry about if the turret is correctly going to be attached anymore, or if it’ll be rotated correctly as well! This now opens the door to quickly define the socket’s Min/Max rotations between pitch/yaw and allows players to place whatever kinds of turrets (within space/size limits) and those weapons will then shoot where they want without hassle!

With all that said, now we have custom Components that can also be swapped in game and now will also update across Multiplayer!

Let’s see some LAZORS!

Since we now have a ton of firemodes and shot modes to play around with, all these are now available on all the beam weapons!

In no particular order, first up is the Auto laser!

Tweaking this with the “Burst Fire” setup, we now also have the Burst Fire Lasers!

And allowing for multiple shots to happen at the same time, we now also have the Scatter Laser (Shotgun style laser)!

Now with all this new setup, we have Lasers working in Multiplayer!

Target Based Lasers vs Distance Based Lasers

While I was setting up these lasers, I noticed that with Unreal’s beam tech that the typical way of setting up the beams is to define a “Target” end point for them. This is great and all for having a specific end location if you kinda want to keep the effect over time at that exact same spot. However with how fast our ships tend to turn, the laser effects look pretty terrible…

To fix this, I’ve changed all the beams to be a Distance based setup (defines a distance from aimed direction) instead of defining the target end point. And it looks much better.

Other Miscellaneous fixes

Initial Frame delay before Projectile effect shows

So I had a thought after looking at my desktop background and this bug of the VFX not spawning until a frame later or whatever on the guns leading to this weird gap between the muzzle and when the projectile VFX finally turn on…

I wondered if it might be a good idea to try and fix this by having the projectile fire, but start at Zero velocity for a frame, and then kick it up to full speed…

Well, it worked! I also had to do a quick fix up on the projectile to inherit the velocity of the Owner for one frame otherwise the projectile falls behind and looks weird, but all in all that frame wait is perfect for the VFX to spawn properly without doing weird Client side “Tracers” that make for silly doubling of the projectile effects you have to manage (like Crysis does).

Muzzle Flash Lights

One bit of the VFX that was missing for awhile was Muzzle Flash lights.

Now when firing your weapons, your ship hull will light up with dynamically with those muzzle flash lights to give more depth to your ship!

Multiple Muzzle Outs!

This was sort of there already in the Demo with Missiles, but with some naming conventions and bone look-ups, we now have every “muzzle_out” bone put into an array and sorted automatically and updating where the next shot is being shot from. That means this weapon like the Auto-Laser is built as 4 lasers stacked together and fired sequentially from each muzzle point!

(Strobe effect warning for those who are sensitive)

Ship HUD Reimplemented

Also reimplemented was the new Ship HUD seen previously. This HUD has also since been optimized quite a bit to reduce the number of OnTick calls to also improve CPU performance! Also seen in the above video is a bug fix that allows Players to keep their fire trigger held and while shooting in and out of the turret rotation range. If your weapon is set to NOT fire outside this defined rotation range, then the gun will stop firing. Once back into rotation range, it’ll begin firing again.

There was a bug in the Demo that required the player to re trigger firing of that weapon which made it kind of a pain when tracking enemies, so this quality of life fix will now be available for the Alpha.

Further plans are to allow the Player to choose which weapons they’d like to either keep firing in/out of rotation range. Weapons like on a fighter craft will likely be kept on for continued firing pressure during big rotation changes, while other larger vessels like Corvettes will likely want to have these to be disabled when out of range as to not waste power when outside of turret rotation.

Sound Fixes (For a later update)

There have been various sound fixes, but one we’re most proud of is making certain we cut down on “Constructive Interference” from multiples of the same weapons firing at the EXACT same time. You can hear this if you have multiples of the same weapons all firing at once. Much like with MWLL, we too will have multiple calls of the same weapon type being all fired at the same time and with their wave forms matching, this creates a Constructive Interference which makes the sounds much louder than what’s comfortable.

We solved this issue by creating some logic that checks the Play Time of the specific Sounds and if they are within X distance to the camera. We then filter those into an array and then change their output volume by a forced lesser % value depending how many are playing.

eg;
2 at the same time = 80% volume output
3 at the same time = 60% volume output
4 at the same time = 40% volume output

These aggressive values will be tweaked to not be so hard, but this proves how the setup counteracts the Constructive Interference for weapons fired at the same time.

More Sound related updates will be put into another post.

Conclusion

I know this update has taken awhile to come out, but I do promise these refactors are worth it as they are a much needed improvement to both workflow and development as well as game performance. Now with a lot of this ground work finally in for Multiplayer setups, expect to see more updates (even some already done that I didn’t post here).

God speed, Warden!

-Kami

0 Comments ON " Dev Update – Refactor to Components "

Subscribe to the Solar Warden Newsletter

Solar Warden on Social Media

Facebook

Twitter


YouTube


Reddit

Join Live Chat on Discord

Solar Warden on IndieDB

Solar Warden
  • Utility spacecraft
    June 14, 2018
    A tugboat like craft (maybe variant(s)s of the H.U.R.K. transport?) built for dedicated reclaiming of resources, destroyed Warden craft and Silicoid husks, pilots and API boxes that successfully eject from destroyed Warden craft, and moving satellites ...
  • Artificial Pilot Intelligences
    June 14, 2018
    APP or API - artificial pilot personality or artificial pilot intelligenceFielded after research into artificial intelligence nets the necessary breakthroughs, artificial pilot computer systems could be installed into Warden craft to function as human...
  • Shell company space-missions
    June 14, 2018
    The idea: using shell companies for deploying civilian cargo into space to make money on the side. Such missions could also use transport craft to get other, more important resources into space.  Thus with limited transporters the commander would have ...
  • Asteroid-based resources
    June 14, 2018
    The idea is that resources could be reclaimed from asteroids that Silicoid arrive in, are sent to distract fire in a Silicoid rush/damage Earth's surface, or end up on a course to just pass by.H.U.R.K. transports could be deployed to carry a mining la...
  • Re: Capital ships humans-aliens
    February 17, 2018
    OMG you just make me happy to hear that ty agent for the replay beautiful i can't wait to play your game 
  • Re: Weapons rarity alien containers and Bosses
    February 17, 2018
    ty for the replay is sounds good can't wait to see what the game hase to offer once it is realised
  • Re: Capital ships humans-aliens
    February 16, 2018
    Thanks for the support!To answer your first question. We do have ships that are larger than the fighters which are the "Corvettes". They are much slower in handling, but pack quite a punch with their multiple turret mounts as well as larger weapons yo...
  • Re: Weapons rarity alien containers and Bosses
    February 16, 2018
    No worries, your English is fine .We don't believe in an RNG loot drop system as we feel that it pulls Players out from the immersion factor and reinforces a more "gambling style" reward, rather than a hard work pay off. However there is still RNG, ...
  • Weapons rarity alien containers and Bosses
    February 13, 2018
    Hello all me again any plans for Weapons rarity and alien contaners for the game for as example alien contaners where you need to hack the container to get a RNG alien Weapon rarity ore armor parts from tier 1-5 Killing a alien boss to get the weapo...
  • Capital ships humans-aliens
    February 13, 2018
    Hello all first i will like to apologize for my bad english i help my self with google second amazing game 110% i will buy it now for the mane topic will the game have capital ships like cruisers battlecruisers battleships carriers dreadnoughts and log...

Polar Zenith Copyright © 2022 Polar Zenith, LLC. All Rights Reserved.