C.W.I.S Devlog #8 | Prototype Release

Summary

Its been a long time coming but I have finally gotten a build out for C.I.W.S. I will pre-face this as the build is just an early prototype and has a few bugs in it, but I hit burnout on the project again and didn’t want to just abandon it as it was in a good enough place to release something. If there are really game breaking bugs then I’ll give them a fix if reported, but otherwise the game will remain in this state unless there is mass interest in it. There is definetly more that could be done on this project but I needed to move for now.

Where can I get the build?

The prototype build is free to all and can be downloaded from the following pages:

What now?

With the release done, I’ll be moving to the A plan I mentioned here, working on some major updates to some of the tools/systems I’ve released. Both major releases are massive improvements over their older versions and bring them up to standard with what I’d use in a project these days. From there I have a few smaller projects I’d like to do, plus actually playing a few games as well for a bit of fun xD

Audio Manager 2.6.1 Live

Audio Manager (2.6.1) Update

In a way to keep this page more active I will be posting update blog posts for each update so you can get additional context for the changes to any product. The changelog will always have the changes listed but sometimes its good to go into a little bit more detail on what these changes actually mean. So here’s the first of these posts.

🎨 Asset Changes


  • Added button on the library tab of the audio manager file asset to allow the user to perform a manual scan in the editor to refresh a file. Previously it was a rather tedious process.

This was the main change is this update that meant it came out more of less the day after it was reported. A user in the discord server reported that they had changed a clip name & wanted to update the library so they could use the new name as the key instead of the old name. This is something that is easy to fix in the upcoming 3.x as the library management is a lot better. But it 2.x it had quite a tedious workflow for it. This update adds a button to let you refresh the library manually with ease.

You can manually update the librarty via the “Force Update Library” button on any audio manager file. This will update the file in question. Once pressed you’ll get a dialouge appearing once it has finished the refresh to confirm it was successful.

The other more minor changes in this update are more just updating some scripts to match the new standards for 2023 a little. So every script now has a header comment. I also updated the asset accessor script to use a dictionary so it’ll be more performant when you use it than the old Linq setup I had before.

🔧 Bug Fixes


  • Fixed a bug where the editor would throw an error on the first instance of the audio manager being added to a game object.

While doing some quick testing I found that there was an error coming up on the first added the audio manager script to a gameobject. This has been corrected so there are some extra checks to avoid this error coming up.

  • (Community Fix) – A fix added in #1 pull request to fix a null ref with the audio pooling system.

This was a fix that went out silently just on Github without a release until now, as it was a minor issue that not many had come accross. This fix is in this release, if you find and issue and can fix it I do accept & process pull requests on the Github repositories for the projects.

🗓️ Where can I get 2.6.1?


Below is the current status of the update on all platforms:

  • Unity Asset Store: Under Review (Expected Mon (9th) – Wed (11th))
  • Itch.io: Live
  • Github: Live

Thats all for this update. 3.x is still in development but awaiting the completion of C.W.I.S before I can focus on it fully. Hopfully it’ll be within the next 2-3 weeks, as there isn’t too much more to do on it other than balacing & a tutorial. More on this soon.

~ J

C.W.I.S Devlog #7 | State of the game

So it’s been a little while since my last post and I’ve been meaning to make an update post for a few weeks now, so here it is. In my last post I went over some of the menu work and missile launcher improvements, since then I’ve been working out what is left to-do and trying to work out what I’d need to change in order to get build out, a thing that has been a goal for quite a few month’s at this point. Sadly, life has meant I’ve been rather busy in the evenings and weekends so I’ve struggled to get the time to work on the project, at least as much as I would’ve liked. Due to how near we are to 2023 and the fact that I have lost the motivation for this project that I once had, I’ll be moving on next year to new things once the first public build is done. I am committing to atleast release the arcade game mode that I planned to and to fixing any bugs that get reported for this project, but I don’t plan to continue it onwards unless it suddenly kicks off.

Some of the last three months I have been working on some of the assets, updating audio manager to 2.6.0 and releasing a much needed update to multi scene in the 0.2.1/2 updates. This took up a fair chunk of the time I would’ve had for C.W.I.S. But I have got some significant stuff done since the last update so here are the main changes:

Game settings system

One of the systems I wanted to get right from the grt go was the settings, as I wanted to be able to use it inother projects inthe future with, little to no changes needed. Atleast that was the plan, it took a bit longer than I planned as all things seem to with setting the resolution & full screen state. I did manage to figure out the resolution problem eventually but the full screen mode still proves to be an issue as of writing, I have left this bug for now to focus on the more pressing gameplay bits that I need to get working soon.

A view of the game settings screen for the video settings in the game so far.

Game save system

The old system I was using was the same slightly modified setup I used in Project Tilly. This in turn being a modified version of the public save manager asset. While this will work just fine it is really hard to debug issues with it. The new setup takes a totally new and modular approach, giving me an inspector view of the save state when needed as well as the option to add or remove values without having to reset the entire save. It works by saving the data in objects instead of the actual type & loading & saving the state from scriptable objects instead of data in code. This will likely become the framework for the next version of the save manager next year once I work out the kinks a little more, but for C.W.I.S it’ll work just fine.

The game settings in the new save setup.

Upgrades layout

The upgrades layout has changed a lot over the lifetime of the project. The new view aims to minimise the on screen space it takes up and make the systema little easier to follow. The new setup has a panel like layout with some of the upgrade types mixed together to lock some upgrades behind others of a different type. All the upgrades do now have icons that somewhat match their purpose as well. This ui is final at this point minus the weird bug when purchasing upgrades that causes the system to reset the display of purchased upgrades to appear not purchased and some of the upgrade implementations not quite working as intended. All of which will be addressed in the coming weeks.

New mechanic (system damage)

A recent development has been the turret damage mechanic. The idea being that turrets that are in sections that get hit by a missile have a change of damaging a nearby system, temporarily knocking it out of action. Damaged turret will not function fully or at all in some cases but will self repair if not hit again. If hit while damaged there is a chance the system is totally destroyed. In the event that a system is destroyed the user can still select it but none of the options will function for the rest of the game. The outline of the system will change colour and there is a UI indicator to signal the change of state to the user.

The UI showing the radar being damaged & repaired.

Radar knockout and lookouts

A new system that works into this setup is the radar lookouts. As having the radar system go down completely would be a little unfair on the user, I’ve added a close range warning system that acts like lookouts on the ship. When a missile is close by there is now some additional UI that appears to give the user some warning when a missile is close to impact. This system will work when the radar is working or not to help with aiming the C.W.I.S when at close range.

Minor bits

Some other minor bits include:

  • Some backend changes to remove the multilayer code I had as it was adding complexity I didn’t need.
  • Some clean up of some of the code to make it easier to manage and work with.
  • Added an upgrade button to the comms array to allow the user to reduce the cooldown for supply drops.

Release date

As I’ve hinted to in this develog I am aiming to release the build before the end of the year. But understand that this may overrun in the Jan 2023. If I don’t manage to get something out by the end of Jan 2023 then I will be leaving it there as I have other projects that do need my attention that are live products. So that is the plan, but I will be pushing for the release as I would like to get a new build out if possible xD

C.W.I.S Devlog #6 | WATER!

Welcome to C.W.I.S, a tactical shooter where you controls the weapons systems of a destroyer that was constantly under missile attack. Previously the devlog for this game have been in a video format on my personal YouTube channel. If you want to see these early devlogs they can be viewed below:

I have since made a blog post for each with a little text and the video that came out with that devlog. I also transferred the Project Tilly devlogs from IndieDB to here as well so there is just a lot more content on the blog to give it some footprint on the site, so feel free to check those out as I do play to go back to that project in the future.

What’s new!

Water shader

By far one of the worst bits of the last few months has been choosing a good water shader. Now I’m no artist so I couldn’t make my own & I have 0 budget so I couldn’t just buy one. So I had to go off the free options on the asset store & GitHub to find something to use for this project. While a lot of the shaders would be great of other games where the player is at the level or more or less the level of the water. However in a top-down view there is the common problem with the tiling texture or effects with the shaders that the user can easily notice.

After trying upwards of 50 shaders and/or effects I finally decided to stick with one of the more customisable, that being the stylized water for URP:

https://assetstore.unity.com/packages/vfx/shaders/stylized-water-for-urp-162025

https://carter.games/storage/2022/09/image-6.png

A screenshot of the arcade scene in C.W.I.S with the new water shader

The shader still isn’t perfect and I would certainly prefer a more random tiling one, but it is better than the old shader I used in the jam version of the game which was much worse than this option in my opinion.

Missile Launchers

I’ve spent a fair bit of time on these launchers and still have more time to spend on them before they are completely working as intended. I did however spend a fair bit of time getting them up to scratch with fixed to the actual prefabs so they can be correctly reset when reaching their target.

Previously the missiles would throw an error on their reset due to a coroutine still running on them when the object is disabled. The routine was the one that managed the missiles pathing lifetime and would not quite reach the end due to the physics collision detecting the hit between both the player missile & the incoming missile.

On top of this I’ve added the actual launch sequence of the missile so when you fire a missile it takes a little longer to get into the air. This is done by having the hatch of the missile tube actually open before the missile fires. Once it has opened an event fires that tells the missile to spawn as it did beforehand so the rest is just as it was before. Though I did fix an issue where only 3-4 tubes were been used to launch missiles due to a little mistake on my part with a boolean value not updating correctly.

Below is a little video of the new launcher in action:

No more five-inch gun?

For the purposes of the arcade build I’ve decided to turn off the five-inch gun as its usage is not needed in the basic missile defence scenario. All the code is still there and all, its just had its script disabled in the scene so the player can’t select it when playing. Instead the player start on the forward C.I.W.S instead which is more practical. Down the line the five inch or the main gun would be used to target surface target at a defined range which will have more use in the campaign, missions or PVP/PVE combat.

Supply Drops

In the arcade build supply drops where just crates that came by every now and then, when they hit the mid point of the ship you would get some ammo and a chance to get some health back. I do plan to add a ship health regen setup to the game, but it won’t be through supply crates. Its more likely the ship will heal over time if its not been hit for x amount of seconds with some UI to help indicate the change of state. The new setup has you calling in a supply drop via the communications array which starts a timer in the top left. When that timer completes a supply drop drops down onto the heli-pad section of the ship and when it reaches the ship the user gets ammo for their weapons systems at random amounts.

The visuals for this still needs a little work as they are currently just primitives and it shows. So more on that soon. I’m also considering possibly adding a few upgrades to the communications array to speed up the time it takes for a drop to arrive & the quantity of the ammo provided. But these are yet to be implemented.

Controls Menu

Another minor change since the last update is a new panel & button in the game menu showing the controls for the game. There is controller support planned as its super easy to add that in the future, but that’ll be after the arcade build. These controls are also shown on the pause menu of the game for convivence.

Closing notes

That wraps up this devlog/update, these written logs will be the main form of updates from here on out instead of videos. Its a lot quicker for me to type stuff out as the videos took almost a day and a half to make so its a much better use of my time. The next written log will be around a month from now or sooner if there is a lot to show off. Feel free to comment below this post if you have an questions or feedback to give and I’ll speak to y’all again soon!

C# Actions

So, you’ve probably done this at-least once as a developer, you’ve got a value or element of your game that needs regularly checking and updating, like; player health, score or if a level has ended. Now you can just check for these in update which in small games is fine, but you’ll find you are calling this code way more than you really need to, if only there was a way to eliminate that xD.

Introducing Actions

This is where actions come into play. They work like events such as the OnClick on a Unity UI button. When you invoke them they run, otherwise to stay as disabled. What makes them handy, like how you can have multiple methods run at once of a button is that you can add and remove methods or delegations on the fly as well as listen for actions being invoked from other scripts. Here’s the four main steps to using actions in you code:

  • Initialise the action, you can pass varied parameters into the action to pass through information you may need to use in the actions subscribers.
// Its recommended to make the action null be default, 
// as you can check for this when you call the action. 
public Action<float, float> OnHealthChange = null;
  • Subscribe our method or delegate our code to run at this point. Methods are easier to manage and are generally recommended, but if you just need to do a quick value change a delegate will work too. Its normally best to do this when the action has no parameters though. It is important to note that your method or delegation must have the same parameters defined in the initialisation.
// Subscribing to the action 
OnHealthChange += UpdateHealthBar;

// The method setup, note the parameters are the same as the action init
private void UpdateHealthBar(float health, float maxHealth)
  • Invoke the action, doing this will call all the methods subscribed to the action.
// Invoking the action... (NOTE: that we call with a null check ("?.") 
// So it doesn't invoke if nothing is subscribed to it. 
OnHealthChange?.Invoke();
  • Un-Subscribe from the action to avoid null exception errors. Recommended to run this on OnDisable or similar to avoid errors.
// Un-subscribes from the action 
OnHealthChange -= UpdateHealthBar;

Usage Example

Here’s an example which is what I used to learn how to use actions.

Health.cs (on a player)

using System;
using UnityEngine;

public class Health : MonoBehaviuor
{
	[SerialzeField] private float maxHealth = 10f;
	private float currentHealth = 10f;

	// init actions
	public Action <float, float> OnHealthChange = null;
	public Action OnNoHealth = null;

	
	public void TakeDamage(float dmg)
	{
		currentHealth -= dmg;
		// Invoking action....
		OnHealthChange?.Invoke(currentHealth, maxHealth);

		if (currentHealth <= 0)
			OnNoHealth?.Invoke();
	}
}

Healthbar.cs (on the health bar UI for the player)

using System;
using UnityEngine;

public class HealthBar : Monobehaviour
{
	[SerialzeField] private Image hpImage;
	
	private Health health;

	private void OnDisable()
	{
		// Un-subscribing from action...
		health.OnHealthChange -= UpdateHPBar;
	}

	private void Start()
	{
		// subscribing to action
		health.OnHealthChange += UpdateHPBar;
		hpSlider = GetComponent<Slider>();
	}

	// Method that has subscribed to the OnHealthChange method
       // Note: It has the same parameters!
	private void UpdateHPBar(float currentHealth, float maxHealth)
	{
		hpSlider.fillAmount = currentHealth / maxHealth;
	}
}