Spamocalypse updates: pathfinding, weapon script changes

It’s about time I had a new update. There’s been quite a few changes since the last one, so here goes:

First level redone
For starters, I revamped the starting level, so it no longer uses default shapes and textures. Here’s a screenshot:
SoundTest 30-1-2016 cropped

Added the second level
While I was at it, I added the second level in, and started adding some more detail to it – including some of the buildings I put together for the first level. That one is still a work in progress, and I haven’t tested it entirely. However, I found that I had to disable some of the NPCs, as they were causing performance drops. So, I added in a portal that enables or disables specific moving objects depending on where you are. It’s trigger based, so it occurs once, but there’s probably still going to be some performance issues I haven’t noticed yet.

Pathfinding updates

The pathfinding system now takes directional and area lights into account when calculating light intensity. As before, it involves raycasts while I’m building the mesh, so I split the mesh building into separate tasks for calculating positions, calculating illumination and saving to the mesh. However, I am considering rewriting it so that the navigation mesh I built is stored as a ScriptableObject instead of being serialised to the disk. This would allow me to drag-and-drop the mesh into the pathfinding script, and therefore have it preloaded by Unity.

Refactored the weapon script
I originally had one weapon type, which was hitscan-based. That weapon script is now the base class for all weapon types, and the others simply override the attack method, as follows:

  • Projectile weapons retrieve a piece of ammo from a shared pool, and launch it in a particular direction with a specific velocity
  • Melee weapons are collider-based, and are triggered by an animation for the attacker.
  • Hitscan weapons cast a sphere with a particular radius in a particular direction

Maps
The levels now have maps. Each looks like a sheath of parchment, like in Thief. The second level has two maps, because I just couldn’t fit it onto one. Most of these are screenshots of the level from Unity or Blender, with the edges found using a Sobel filter in GIMP.

Changes to Interaction system
I simplified the player interaction system a bit. It was previously build around checking if the player was looking at one specific object. It’s now set to check if the player is looking at any child object, which should give the player a bit more room to use them.

32-bit Linux is no longer supported
From now on, I am assuming a 64-bit operating system. I was previously creating both 32-bit and 64-bit Linux builds, as Unity does give an option to create a universal build. However, that creates two separate executables at the same time. To do this in the Windows build, I’d have to change the platform to 32-bit Windows, build it, then switch to 64-bit Windows and build it again. Frankly, I don’t think it’s worth it.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.