Weekly Devlog #4 - Week 11


Josh's Scripting updates - Week 11

Week 11 has been another very good week of progress on the scripting side of the game. At this point, the majority of the planned features are at least rudimentarily implemented. Though as level design and planning progress to a further stage more fine-tuning or new features will probably be needed.

Ranged Enemies – The Guard and the Dalek

Previous work on the scrapper behavior gave a good starting point for working on the scripts for our ranged units.

Bullet scripts and prefabs were made for the enemy units, which behave similarly to the player bullets, but with variations in color and size and their ability to hit the player. The bullets will also hit and damage other enemies unlucky to get in the way.

Similarly to the “sight-cone” implemented for seeing the player, the ranged enemies can only fire within a certain number of degrees of their forward orientation, making their turning speed a relevant variable, while other variables were made for fire rate and shooting range.

The shooting function also uses the predicted future position from the chasing function to estimate the players future position and make bullets difficult to dodge. After some testing I settled on each shot having a random chance of shooting either directly at the players current position, or at some percentage or their future position. This makes their bullet direction extremely difficult to predict, and there doesn’t appear to be any movement pattern that can guarantee a successful dodge of even a moderately slow-moving bullet.

The Guard is a ranged unit modelled by Jon, which I’ve given a high fire-rate, quite fast movement speed and a large range of sight, making it a challenging opponent. Its bullets move at a slow enough speed that a practiced player can probably dodge most shots if they are alone, but multiple guards quickly create a bullet-hell shooter type scenario that can overwhelm the player. It’s turning speed is a slight weakness in tight-quarters.

The player manages to dodge most of the guards bullets, but takes 2 hits for 10 energy damage before killing him.

The Dalek is also a ranged unit, modelled by myself using scripts. It has a much slower fire rate than the guard, but it’s bullets move a little faster and pack a heavy punch if they land. With slightly slower movement and less range than the guard, the Dalek would rely on surprise placement, tight quarters or attacking with support to present a challenge to the player. The Dalek bullet also grows in length as it travels through the air.

This unlucky player walks straight into 2 Dalek bullets, taking 40 damage to his energy.

Upgrade and Battery Pickups

Added prefabs for the Upgrade and Battery expansion pickups, which are currently the object spinning on a round base. Some more work was required on the scripting side to handle adding collected upgrades to the appropriate upgrade slots, and to save collected battery expansions and enable their affect in increasing player health.

When the player finishes a level, any upgrades and/or batteries collected will be saved that difficulty level, and won’t reappear in the level if it is replayed. Any missed upgrades/batteries will still be present for collection when replaying a level.

The gun upgrade awaits collection

Main Menu with Level Unlocks and Saving/Loading Progress

The final major component to implement was the games main menu. As it is only a single player game with 3 levels I thought it would be best to make almost everything in only 1 screen with 2 alternating panels, the first panel allows selecting level and difficulty and starting the game, and a second panel will provide options such as volume, look sensitivity and maybe axis inversion and control remapping.

Completing a level unlocks both the next difficulty in that level and the next level in that difficulty. For example: completing Level 1 on easy would unlock level 1 on medium and level 2 on easy. I also added a developer mode button which unlocks all levels and will also enable developer mode in-game in which they can turn invisible, place new enemies and refill their health, for easy testing of enemy placement. Spawn points and level-finish prefabs were also added, making the menu and level loading/progression complete and functional.

Upon first load, the player can only choose level 1 on easy

Finally, saving and loading functions were added to the Game Settings scripts to save and load progress between play sessions using Unity’s built in playerprefs. 

Plans for the coming week include:  - making some destructible enemy spawner objects  - updating the GUI with icons indicating currently selected upgrades + a more visible crosshair  - some more improvements on AI movement  - discussion of additional upgrade options with the team  - beginning level creation

Get Junked

Leave a comment

Log in with itch.io to leave a comment.