Chimerror Productions

Paras Work Thread, 2024-10-31 - 2024-10-31 02:12

Tags: blog gamedev paras programming unreal engine

Happy Halloween! I’ve been a bit distracted from keeping this website up-to-date but I’ve also been working on a sort of minor side project that I don’t intend to become a full project but am preparing for an upcoming game jam that I’ve given the codename Paras. Let me get y’all up to speed.

Essentially, I was asked to take some time to learn Unreal Engine and get some practice in on AI programming. I watched a few initial tutorials to get up to speed with it, and stared off into space and came up with something that seemed tractable for getting my paws wet in about two weeks. Basically the phrase “star-crossed country” came to mind and I felt a game where the player is a cross-country runner who has stumbled across the fey-controlled part of the woods and is being attacked by fairies defending it would be a fun idea.

I actually started trying to do this as a stream on my twitch channel and did one stream to realize that my computer does not seem beefy enough to stream and run UE at the same time. There are probably settings I could change, but I don’t really feel like doing that right now. Either way, that first stream was basically following a tutorial and then realizing that I was not really understanding at all how to put things together.

That began another stint of watching tutorials that focused more on programming with Blueprints instead of the C++ tutorials I started watching. After that, I had the confidence to make a copy of the third-person template character that comes with UE and add some features around locomotion specific to my game.

Since this is a cross-country race, I figured the real challenge of the player is stamina conservation more than raw speed. So I decided that while there was your “normal” medium speed, you could also choose to sprint or “stroll”. Sprinting would increase your speed but would also increase the stamina drain. Strolling would do the exact opposite, though still overall draining your stamina. The only way right now to regain stamina is to stop running all together. If you run out of stamina, your character will be forced to move very slowly, and I think eventually would take some type of damage that may lead to them not being able to finish the race if it happens enough times.

Either way, I did indeed implement this behavior! After implementing that, I turned to having inclines further impact the player. Running up and down inclines sucks. You might think running down an incline would be nice, but the reality is that if it is enough of an incline, you need to take extra effort to keep control of yourself even given the fact that your ground speed is a bit faster than a flat plane. At least, that’s always been my experience running up and down hills, lol. What that means in game terms is that running uphill decreases the PC’s velocity while running downhill increases it. In either case, stamina drain also increases (in the case of downhill, my logic is this represents the extra effort to control yourself). I may need to change this a bit because there are a few issues with this as I have currently implemented it.

First, jumping (which the PC will need to do to avoid attacks) does not actually stop applying the incline effects based on the ground the PC is over. On my testing map, this means that by jumping in-between the ramps, which are not flush and have flat ground between them, the player can get a bit of a relief from the incline effects. I don’t think this will be a problem on a real map because I intend it to be more realistic and continuous, so there shouldn’t be sharp changes in elevation like that.

Second, running downhill is actually the most draining thing because in addition to the incline stamina penalty, there is the stamina penalty for just going faster, because that’s how I implemented the stamina effects of sprinting and strolling. Right now I don’t think it’ll be a big enough problem that I want to tweak it or add special-case code, but I probably will fix it at some point to keep the total increase about the same as running uphill.

After implementing all of that, I then searched about for free 3D model of a running track and after a lot of flailing with one that was in an odd format and even once I got it in didn’t look right, I found a much simpler one that isn’t completely to scale (I measured the inside track as 320m rather than 400m). But that’s good enough for what’s meant to be a toy project that I’m not planning on releasing any time soon.

Actually I think I may follow up this post with another one kind of talking about my general thoughts so far on using Blueprints in UE, because that’s been very interesting, but I’m pretty happy with my progress, and I’ll try to keep making updates on this site!

Jaycie “chimerror” Mitchell