More Tree For Thee

I made a better tree, not perfect (it still has the weird branch in the upper left) but its more passable than the other tree I made.

I also found in unreal the “Foliage” system ( see https://dev.epicgames.com/documentation/en-us/unreal-engine/procedural-foliage-tool-in-unreal-engine ) which is the opposite of the “Landscape” system used for grass. Essentially it lets you spawn hundreds of a single actor and handles it externally from the normal actors.

The trees now have collisions!

The first thing I wanted to try getting working was having bits break off of the tree.

This can be done using unreal’s chaos destruction but I’m still messing around with the parameters. I tried the current tree and it just kinda falls apart really quick:

My hope is that when your running through the woods getting shot at a bunch of splinters will be flying through the air as bullets hit trees.

When applied to the whole forest you get a cool view of all of the tree’s falling apart slowly.

Maybe that would be cool for a menu or something, but really I need to make the chunks smaller and fix the split apart trigger so it doesnt just magically explode.

THE WOODS!

Jumped back into unreal but I’m heavily procrastinating the game parts so I started messing with some of the environment tools in unreal. Specifically I’ve been poking at the grass setup tools (https://dev.epicgames.com/documentation/en-us/unreal-engine/grass-quick-start-in-unreal-engine). Not too complicated essentially, your environment drives a few inputs and outputs in your landscape material.

So I whipped up a quick ground texture in gimp:

Where each layer is a bit more grass ontop of the dirt:

Then I whipped up two quick grass and tree models in blender.

Then once you import both into unreal you can tie everything together using a “LandscapeGrassType” which is just a data holder for what you consider grass:

Then throw it into your material

The final result was surprisingly good. Obviously I could add more grass, touch up the ground texture, make a tree that doesn’t look like a plastic pylon. But I’m dumbfounded how far this stuff has come along from unreal 4.

I have a strong feeling you’re straight up not supposed to use this system to add trees (You can see in the video above that the bullets don’t collide with the trees). But I’m still happy at least that the workflow is quite simple.

Drawing onto the landscape is very easy also, If I wanted to make a path I can just draw the rock layer in a quick line like in the video above.

Now to the actual game stuff I’m thinking my next change into game-play will be moving things closer to kind of a pseudo helldivers mission where:
1.) Players spawn on a big map
2.) Enemies spawn a wave to attack the central spawn and players fight to survive/save the base
3.) Once the enemy wave is over players will leave the base to try to destroy spawners
4.) The next wave starts, the players run back to base and restock
5.) Rinse and repeat for all spawners
5.) Once the players destroy all the spawners a boss wave starts
6.)Players defeat the boss and the game ends.

Seems like a reasonable goal, it also sounds like a multiplayer game but honestly I dont wanna go down that rabbit hole yet. I have half of a multiplayer game made from awhile ago which seems like a good idea but it requires you to modify the engine build to pull in steamworks. My goal here is still to avoid using c/c++ so I can focus on just assets until I REALLY need to optimize. In addition making 3rd person models will probably require me to re-make a bunch of the blueprints which sounds horrible at this stage.

Grenade and stealing music to make more music

I have a few cassettes of older music that I wanna sample and put into something in Abelton. Why use cassettes? They’re cheap as hell, this one was $4 from my local record store.

I also made this guy:

Simple enough, getting it in game went smoothly. I don’t think I want to make this a first person model I’ll probably just attach it onto the front of one of the bots to make a kamikaze bot that rushes the player.

I also spun up a quick “use” system, which is just a ray-trace off the front of the player’s camera to whatever is in front of them. Then I made a generic “usableObject” interface which receives use commands that anything can implement.

This will be the first usable thing:

Idk what it will do but my hope is to make quick chat logs when you press use, or even a buy menu.

Game Stuff: New Hud and Angry Gimp usage

I swapped out the health numbers and ammo numbers for the game. Still frame looks alright now but personally I think the ammo count size needs more work. Also the whole thing is sliding off the screen which makes me think I need to recreate the whole UI widget from scratch. The biggest accomplishment here is getting the hex pattern for that health bar. For my 2d art I primarily use GIMP (https://www.gimp.org/) and gimp is usually good about having a pathway to do whatever you need. I would say around 80% of the time you can google “how to blah in GIMP” and you have 20+ years of history to rely on to get some kind of idea on how to do things. For that last 20% the solution is usually involves ripping an image from somewhere else to use as a stencil or as a basis for a built-in filter. In this case it was the latter. Gimp has filters for making a square checkerboard and diamonds but nothing for hex’s except for a “mozaic” filter. Which looks fine on paper but if you’re messing with the alpha you need very exact lines and the mozaic filter makes a pattern that includes a simulated light which annoyingly blurs the edges. However, the edges aren’t blurred by a gradient color (which can be easily fixed) but is blurred by adding a gradient to the alpha.

From here it looks fine.
Zoomed in is where troubled can be seen.

I tried everything to get rid of these edges but failed miserably: edge detection, thresholding, median blurs, contrast and color selection all seemed to maintain the gradient off the edge lines. I eventually gave up and used the suggestion from “chaz_prinz” here: https://www.reddit.com/r/GIMP/comments/rg5wt4/creating_a_borderless_hexagon_gridpattern/ and ripped a hex pattern from the internet to generate a black/white image which I was able to use for the pattern.
I ended up with a pretty nice pattern here:

Which I threw into a filled green rectangle to get the health bar above (plus some trimming/filling around the edges). I think the result is quite nice and fits the whole old-er school vibe that I’m going for. I might make it red just to fit the obvious ascetics from every other game in existence but I figure I’d fix up the ammo up first.

Lean With it

Added Leaning to the game and did some work on the reactions to different kinds of physical materials.

Gun still clips a bunch but it’s better than it was. The leaning needs more work but I figure to do that properly would require some kind of timer setup which I really don’t want to do at the moment (will add further layers to my not amazing blueprints).

Progress?

Been doing more with the game and got to the point where levels are starting to feel like levels and my “assetImports” folder is blowing up.

More work still needed but I’m starting to get a warehouse vibe that I think I’m going to roll with until it gets stale.

I pretty much gave up on the hit reactions for now. If I come back to that I think I’ll need to make a human-style character, then look through some unreal tutorials before I can move back to the bot.

Clean Ups

Messing with particle effects today. Above is the result of setting muzzle flash brightness WAAAY to high.

Once I played around with settings I got a good feel for things:

In addition I worked bullet holes so they look a little less “clean”. I still want to get some random going on there but honestly they’re good enough, especially when zoomed out really far.

I’ve also done some work on the physics body of the patrol bot. Now when they die they don’t fly into a million pieces. This stages some of the work needed to make proper impact hit points, however I’ll probably need to scale back the number of collision boxes used on the mesh.

Build #1 (v0.0.0)

Still using the fake name “BlackLace” I sprinted over the weekend and made a first build of the game.

Features:

  • Survival game mode
  • Two weapons!
  • Some horribly mixed audio
  • A settings button that doesn’t work!
  • NO WAY TO QUIT AFTER CLICKING START FORCING THE USER TO ALT+F4!!!

Yeah it’s very early but I got paranoid after seeing my GPU memory jump up to 14.9 gb so I wanted to try to send builds to people with less powerful graphics cards (I got a 4090 with 24gb of vram which is overkill for the mat textures I’m using everywhere so I’m not sure where the 14.9 came from…) UPDATE: It wasnt taking 14.9gb it was only taking 3gb

In addition I added in a bunch of quality of life UI elements in spaghetti blueprints that I will definitely forget next week

One of the most aggravating things about unreal is the half way gameplay framework. The GameMode is a weird half way point between arbiter and useless interface that you need to re-implement. Putting things in the game mode is the “Right” way to do things that are dictating the flow of the game but is isn’t needed. For example, in this case I have the game mode handling spawning of patrol bots and the transition from spectator to player in the game. However, something the gamemode failed to do is to 1.) Have a running list of all pawns (you need to make that yourself) 2.) Transition the player back to spectator upon being killed. I have the player pawn spawning and calling the “possess” function on the baseline controller which is crazy silly (I can probably fix that with ordering but still…).

Here’s some gameplay from the exported build.

(I wont use the snipping tool to record videos anymore…)

Big annoyances:

1.) When you shoot a wall it looks like snow (Need to spend more time making some 2d assets)
2.) Enemies collide with corpses (Not sure how that’s happening…)
3.) Reloading/weapon switching isn’t great (I really dont want to make reload animations but I think I need to now)
4.) The pistol I guess i have doing no damage? (Variable value change.)
5.) Enemies get stale fast. (I have a plan for this)
6.) I don’t turn off footsteps after the player dies so they keep going (Have an idea of whats happening here)
7.) The guns poke through the wall (I’ll probably make the gun model turn up or just make holder animations)
8.) Hud looks terrible

Minor nit picks:
1.) The AR Muzzle flash doesn’t stick to the gun always (Seems to be a niagra mesh renderer problem?)
2.) Some of the sounds are bad (I can spend more time here)
3.) Some of the grouping of Enemies (I think that will be fixed with the corpse collision part)
4.) No crouching (Just need to setup a input action)
5.) No hit reactions from the bots (i think I can fix this with a proper physics asset made)
6.) No fired shells

Things that will test my patience:
1.) I need to make a computer settings menu…
2.) I need to compensate for different resolutions
3.) I need to make a proper physics asset for the patrol bot

Oh also I made some junk to fill in the levels with:

Last one I had from an older project but I put new materials on it.

Less Project More Game

Today I decided I needed to start making this an actual “game” rather than just focusing on the asset side of things. To start I made a simple arena:

Essentially a bunch of walk-able pathways and two towers in the center. The goal was to essentially stress out the AI by putting a bunch of stuff in the way. This succeeded and I had to re-write a bunch of the AI tasks (luckily not the base ai tree too much).

Now the ai flow is:

1.) Check if it needs to reload
2.) Start fighting
3.) If it has ammo, try to move to a “strafeTarget” (i.e. a tactically relevant position) , if it doesn’t have one or can’t move to said target just generally move towards the target.
4.) Wait a few seconds to let some bulletsfly(firing timing happens in the patrol bot logic, not the ai logic)
5.) If you have ammo find a new tactically relevant position to stand in

In addition I have the AI and the patrol bots doing line traces from either the intended target position to the character to see if it can hit the shots it’s aiming for, or if it needs to move.

The big struggle today was setting up the AI settings for unreal, which in general are a real pain. I’m worried I made it basically unplayable on cheaper PC’s but I’ll need to get a build together for testers before I start optimizing. The way unreal’s AI works (and I think uniity is pretty similar) is by setting up a grid of points, then using an “navigation agent” to handle how pathfinding works. This navigation agent is a primitive object (I assume a cube but I’m not 100% sure) that is placed along projected paths to check if it’s possible to move to the target location. If unreal/unity Didn’t have this concept you’d hit a bunch of issues with the AI trying to navigate it’s body through a bunch of pinhole sized paths. So to handle cornering a bit better I started messing with the AI agent size: (Nav agent height near the bottom)

However, I quickly found out that A.) You need to change it int he “navigation Mesh” settings:

also, AND that if you don’t have dynamic re-generation on Unreal just starts saying that the nav mesh needs to be rebuild (and I wasn’t sure how to do that…). So I had to check the “FORCE REBUILD” guy and set the “runtime generation” to dynamic.

This biggest hit here will be performance but again I’d rather rush a build, have it run like crap then optimize as needed.

The bots are doing most of the main things that I think baseline quality AI does:
1.)Don’t shoot at you if it doesn’t see you
2.)Don’t get stuck on corners
3.)Play an animation when turning

The three things it still needs:
1.) Coordination between bots
2.) Less bumping into other bots.
3.) Some form of IK

But In my opinion those things are secondary at the moment. The next thing I want to jump on is a basic health + hud+weapon system so there’s a “game” part of this.

Also this needs to be fixed, but I’ll probably write up a whole thing about how Unreal’s deferred rendering kinda sucks for First person view models (even though the originally “Unreal” games were all first person shooters….)