Phase 1 - 21st December & Procedural Worlds


The Big Announcement

It's nearly done. The big tasks are out of the way, and it's now down to a few smaller tasks, some tweaks, bugfixing and playtesting. As of now, it is about 0030 on the 13th December. I am hoping to get Phase 1 wrapped up today, compiling overnight and out to Patreon on Wednesday 14th Dec.

It will then be uploaded here on the 21st, assuming there's no major upsets or issues arise. I'll go into more detail about what's in Phase 1 when it gets released. 

And Next?

Phase 2 will start as soon as I clear my other work. I've got some outstanding work to complete, some animations to do and possible commissions. Also, after the whole of Phase 1, I need a little downtime before cracking on into Phase 2. Being honest though, there's a decent chance the downtime will involve some tweaking and figuring stuff out in UE, so development won't grind to a halt completely.

Phase 2 doesn't feel as intensive as Phase 1. A lot of it is using base systems put in already and expanding or improving on them. The key features are:

  • New struggle system (hopefully using mouse movements to control struggling)
  • Combat/fighting
  • Swimming
  • Integrating hotbar and clothing inventory into a unified inventory system
  • Currency
  • Interactive sex scenes - again, using mouse movements to control the animation and character movement
  • Wolves generated at start of the game and retaining stats throughout
  • Support for switching canid types - for example, GSD, fox, coyote, etc through use of body morphs
  • Takedowns for female enemies
  • Better ai
  • Better enemy and player movement - climbing to ledges, sliding down slopes, etc
  • 2 new enemy types
  • Female enemy animations
  • Shops
  • better detail in dungeons and more cover & points of interest in open levels
  • Male player character
  • Forest Boss

That'll be over another 9 weeks of development. That list is, of course, open to change. In a few points during Phase 1, a feature has been moved forwards from a later phase because it turns out it's either required now, or easier to build at this stage than bodging it and doing a full job later.

Procedural Levels...

It turns out Procedural levels are really difficult.

I spent a few weeks just trying to work out how these levels would work, how they would generate and everything. I went through various ideas and processes, but it boiled down to a few things.

  1. It needs outdoor levels
  2. The levels can't be pre-built
  3. Variation required

The first point is obvious. The second one though, a bit less. So I'll explain - The WorldMap has 21 map nodes. Each node is randomised, so it could be 1 of 4 things, though it is heavily weighted towards open levels and dungeons. But with the worst case scenario, you'd need 21 designed levels. But then the game should have replayability, so 21 levels per world means you'll get a lot of repeats, which means more designed levels. Each level is a lot of time.

But the game is designed around Blueprints. There's tutorials for world generation, but it needs c# programming, which isn't really compatible with what I've done so far, at my current skill level. I tried some terrain generation, I managed to get a noise generator working in the game to create a perlin noisemap to build height in a pre-existing landscape, but UE landscapes don't seem to like updating their heightmaps. There are pre-built solutions available, but they are really expensive.

So, the first idea that stuck was just building the biggest size landscape UE allows without turning off safety features. 32x32 tiles. A decent sized map is about 8 tiles long, so I could fit 40 levels on a single map if you built them 8x3. Then you just build a few different landscapes, randomise which one you get each load and you have 40 built levels with sufficient variation!

So I started doing that.

But then the next point is that you have to randomise spawn points inside each level cell, then you need to have some way to divide each level from each other meaning invisible walls. So I changed the plan from 40 levels to technically infinite.

First, you have your 32x32 landscape. Increase the individual level size to roughly 4x8 tiles. Next, a cube is placed near each corner of the map and the coordinates added into the new ForestSpawner. Each cube is brought in slightly so they're not right next to the edges. The coordinates are then lined up so they are in an exact square. This gives us a maximum limit on the x and y axis for playable area.

Next, you get the player spawn point and give it some of its own limits. The player spawn point is always in the center rear of the level area, so you get a random value for both X and Y from the playable area, minus the level area size so the player can only be spawned somewhere on the map that the level boundaries can spawn without going off the edge of the map.

This is then backed up by spawning in invisible blocking walls around the player at the correct distances to form the sides of the level area. But you don't want to just walk into an invisible wall, so a forest wall was built to go along the ground. First though, this means adding a spline into the level for each edge and adding a point to the spline everywhere you want a wall section.

Then you use a linetrace to find exactly where the ground is and add your spline point there. This means that whatever the height of the landscape at that point, the splines will conform to it. Then you just add in a bit more code, throw in the wall mesh and you get a wall that goes along the full edge.

Next, the landscape has rivers and a lake in it. You don't want a wall running through water, so you need to switch the wall mesh for a grate if the linetrace meets something other than ground.

It doesn't always work properly though...

Anyway, with one wall working, that then gets reconfigured to do the other 3 walls around the level. While this was happening, another issue popped up. The player spawn would sometimes happen in water, killing you. The linetrace worked it's magic here as well, so now before the playerspawn is place, it will find the random location and put a line straight down. If it hits water or anything other than ground, it tries with another random location. If it finds ground, it gets the z-height and places the spawn. Until it turned out the exact hit location has a little bit of variance. This meant that sometimes it placed you slightly above the ground and sometimes slightly below it. Above is fine, below drops you out of the world. This was solved by telling it to add 25 to the z-height.

From this point, the rest wasn't actually that bad. The main thing was to make sure that every spawned object got it's location first, then did the z-height checks to put it in the correct location or to move it if it was a bad location.

The level finds out how many wolves should be on the level and spawns that number in. then it randomises the number of other enemies, spawns plant traps, bushes and other cover, and items. Then it places a house somewhere along the furthest edge as the level goal. Eventually this will be a landmark. Ruined church, rock spire, big old tree, whatever. For now it's a house.

Once everything was happily spawning on their landscape, I added hills, bridges and trees. They got a navigation mesh and I had to do fixes to items to get them to work right. The standard item spawner has a 75% chance to not spawn anything, to aid randomisation, but in this case it needs to spawn every time, so tweaks were made to toggle that.

Finally, reaching the Goal transfers you back to the World Map and going to an RNG node on the worldmap loads you into the forest map.

Conclusion

It's certainly not the procedural level I wanted to build, but it's a step in the right direction. Every component in this is reusable for the eventual procedural level. In the meantime, we have a semi-procedural, placed into an existing landscape. It's been a pretty tough few days getting this working, and it still has some tweaks to be made. Some of the maths in this were horrific. I'm not the best at maths, so it was a lot of trial and error, and quite a lot of avenues I went down to find a component didn't support what I was trying to get it to do. In the end, it's playable and works. It's laggy as fuck, but I'm looking at ways to improve that before release.

As always, thank you all so much for the support and for downloading the game. Hopefully this first phase will give the game a bit more value and a lot more actual game.

Get The Running of the Wolves Demo

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.