Started making a procedural building generator, starting with rooms. So far it can make a room of any x/y dimensions (z to come) out of existing wall/floor/ceiling meshes while keeping scaling consistent (if not always uniform). If a room’s length or width isn’t a multiple of the length/width of the mesh being scaled, all meshes on that wall/ceiling/floor are scaled to compensate which means they’re often stretched slightly but never more than like 10%, which is fine because modular mesh based level design routinely requires level designers to stretch meshes more than that anyway. Also this uses instanced meshes and can use random meshes if required. You can also elect to use a single scaled mesh for floor/ceiling rather than gridding them like this

Light/shadow stealth in UE4 with Blueprint

Here’s a new video of the stealth game thing:

A few people have asked me how I got the light/shadow stealth thing working, so I wrote this out real quick:

I struggled a bit with the light/shadow system and doubt I have the most efficient solution but it does work and it goes basically like this: I get a list of all the light actors in the world on game start, and update it very rarely, like every 30 seconds (number of actual light actors rarely if ever changes). For any lights where lightdistancefromplayer < attenuationradiusofthelight, I do a trace from the player to the light’s location, and if the trace hits anything (meaning something visible lies between the light and the player – maybe you’re right near a light but on the other side of a wall) I disregard that light.

For the remaining lights (so all lights which are within their attenuation radius from the player and aren’t occluded) and also the directional light if a trace determines it’s unoccluded, I do some math based on the light intensities/attenuation radii/falloff exponents to end up with a LitAmount value for the player between 0 and 1 where 0 is completely dark, 1 fully illuminated, which is the light gem value printed in white at the top of the screen. I also have a var to scale the contribution of the directional light for situations where the intensity doesn’t map super well to the actual desired canonical visibility, like strong moonlight. In the video above, standing in unoccluded moonlight alone makes you just slightly less lit up than is required for the AI to see you at a distance.

This approach doesn’t completely work for times when I’m being illuminated by lightcomponents rather than lightactors, which is often, because I have a lot of blueprints with lightcomponents – the torches and windows in that video mostly – and you can’t get a list of every lightcomponent in the world the way you can every lightactor, and that wouldn’t be super efficient anyway if I had to update that list a lot. So I have a custom component called DummyLightComponent which gets placed on every blueprint that has a lightcomponent, and automatically inherits that lightcomponent’s values for intensity, falloff and attenuation.

Every so often if the DummyLightComponent is within its attenuationdistance from the player it adds itself to an array of dummylightcomponents on the player (this is the usually-0-or-1 value being constantly printed in the video in blue), and removes itself when it becomes irrelevant for distance/whatever reason. The array of dummylightcomponents gets the same math done to it at the playercharacter’s end as described above with the pointlightactors, and contributes to the LitAmount in the same way.

So the downside to this is there’s some amount of overhead for every light source in the game even when it’s not in range, but it’s only to the tune of, every so often (not every tick), checking the light’s distance from the player to see if it’s become relevant to stealth, and going no further if it’s out of range. I have no idea how much overhead that is but I wouldn’t imagine much, particularly if I’m not doing it every tick. However obviously it’s going to grow with how many lights are in the level, which isn’t going to be a negligible amount.

Anyway, I try to mitigate it by having an “irrelevant to stealth” bool on my light-containing actors that I can check if the light is out of player range/not near a situation where stealth is relevant/whatever, in which case the dummylightcomponent is actually removed and doesn’t tick.

Also, if the last time a light checked the player’s distance, it was above a certain amount, it will check less often, tuned more or less so that the time it takes for a light that thinks it’s far from the player to update is slightly less than the time it would normally take for the player to cover the distance to stand near it.

So theoretically, you never get a situation where a light isn’t updating the player’s LitAmount when they’re standing near it and it’s unoccluded, and most lights in the scene aren’t going to have a significant performance hit.

Hope this helps some googlers.

A First-Person Movement System, A Thiefy Game, And Also Some Handrails

I’ve done the following cool stuff in the last couple weeks:

A First-Person Movement System

I wanted to make movement that felt like Mirror’s Edge. Here’s most of what I came up with. You build up momentum as you run, and you can vault low obstacles, do a running slide and still look around (very much like Dishonored), jump and mantle onto high ledges/catch ledges as you fall, all that good stuff. It actually feels pretty great and only took me a day. I have another early branch of this where you can actually see your body animate, but I ripped the animations out of Mirror’s Edge so I figure posting that’s kind of a bad look.

A Thiefy Game Prototype

I took that movement system and built up a quick prototype of some kind of cross between Thief and Mirror’s Edge. Imagine Thief if you were really good at running away. This was also my first foray into AI in UE4, or really pretty much at all. I’m pretty happy with it! I also rolled my fire propagation system into it, so you can slide along a rooftop and whip out your bow and shoot a fire arrow at some guys and the whole building catches fire. Sick.


A Procedural Handrail System

Lastly, today I started doing a similar thing for handrails to what I did for ladders a month ago. Handrails can be annoying for level designers in a lot of the same ways. With my system you just drag out a handrail. Sick. Hopefully I’ll get some art from Donhonk again and throw this on the UE4 Marketplace too.

Oh yeah, I also started some kind of procedural escalator blueprint.

The Ladders Are On The Marketplace

Today we released our second item on the Unreal Engine 4 Marketplace. It’s a procedural ladder generator. Ever need to add ladders to your level only it’s a pain because you don’t have a ladder mesh of the dimensions you need? Use this sweet procedural ladder generator that just went up on the marketplace. Never again.

laddersonmarketplace

 

Just open the Unreal launcher and go to the marketplace to buy the ladders. Here’s a demonstration:

Thanks for your support, and let us know if you need any from us.

Procedural Ladders in UE4

today I’ve been doing a procedural ladder blueprint. you just give it the meshes you want to use (or use mine), a little bit of info, and pull a bunch of sliders around to change basically everything about the ladder. donhonk is doing some art and we’re gonna see if the ue4 marketplace wants it


this is a particularly useful thing for level designers because the alternatives are:
-bullshit some ladders with brushes
-make bespoke ladder meshes for the particular spot where you need one
-have a few ladder meshes of various lengths and throw them together end-to-end hoping for the best (actually works better than you’d think when you’re able to put part of the bottom section underground)

anyway, this is better