Best practice for building an environment outside castle

I’m building a FPS that takes place inside a castle that is in a forest. On occasion, the player can see outside through a gate or a window, but they will never be walking around outside. For example, right when they begin, they will be just inside a portcullis, and outside the gate, there is a path flanked by trees. Once they leave this initial room, they would only see outside on rare occasions through a window.

What is the best way to create this scene? I am guessing it would need to be built using a small-ish Terrain object with trees? I’m wondering how this is typically accomplished. Thanks in advance for any ideas!

1 Like

You could just throw some crates, trees and maybe some fence prefabs outside the areas with the window. Make the illusion of a forest. The player’s imagination will fill in what they can’t see.

Generally you would just decorate what they the player can see. If the player does not see it, there is no point for it to be there. The same concept applies to traditional film and tv sets/stages. You only build a set scenery for the shot that is required, ie what is visable becuase it would otherwise be wasted work hours for stuff that’s not needed for the final result.

Additionally, if the player can’t see it, then you can just go ahead and “turn it off” and cull non visable game objects numerous different ways to make your level run faster. Hope this helps.

2 Likes

Thanks for marking the question as solved. Also, regarding castle environments, I made this recently:

It just released it today if anybody is interested in what kind of castle environments I’ve built. SP Castle 01 | 3D Fantasy | Unity Asset Store

This is fantastic advice for gamedev AND for life…

There’s even a term for it… Potemkin Village!

1 Like

Thanks Kirk, that was an interesting read and a very insightful addition to the topic! I’m not 100% sure about the life advice aspect, particularly if taken literally for every situation haha. I could see where some analogous concepts might apply though.

If I’d like the area that is visible outside the window to just be a veritable wall of trees, would it be better to use a very small terrain (the size of a house) and put trees on it, or would it be better to just put a small undulating mesh I make in Blender there with some trees? Or, does it not matter for performance?

I would just make a “bunch-o-trees” prefab and instance it outside the window and move on.

If you need to improve it, improve it. Otherwise, you’re done. Move forward.

EVERYTHING matters for performance.

Humans cannot tell what is better / worse, generally, no matter how confidently they think they can.

For all performance and optimization issues, ALWAYS start by using the Profiler window:

Window → Analysis → Profiler

DO NOT OPTIMIZE “JUST BECAUSE…” If you don’t have a problem, DO NOT OPTIMIZE!

1 Like

Ok, great, thanks for the advice!

I agree, it does. And what you’re building depends on how much optimization needs to be considered from the start. sometimes this can nothing and sometimes you really need to have a plan. The later only really matters if you know what to plan for, and most users don’t know so it’s relatively futile for many people to build real-time levels with any kind of performance. I think it’s a big reason why people give up half-way through projects because they get to a certain point and realize that they are going to have to redo everything to get the result they were aiming for.

That really depends. I build my own atlased kits, and when I’m building a level, I know pretty accurately how my levels are going to perform due to consistency of the way my models are built. This is of course after thousands of hours of studying profiler results over the years and building my own environment assets, shaders and such. I basically know what my stats are going to be on average down to square meter with a guestimate sliding scale for nature shaders, overdraw and microtriangles. My system actually follows traditional construction estimating processes used for materials on real world buildings. It’s sort of the same thing. If you were creating a building brick and mortar, you’re going to know your cost upfront within a 10% threshold before you start. It can work the exact same way with performance overhead when creating the same building in digital format. Your price for square meter (or square foot as we do in the states) is basically like your average m/s delay for square meter. It’s absolutely doable and can even be easy when you are able to make your unknown variables into reliable constants before you start.

I use the plain old stats window in play-mode first as it’s usually sufficient to pinpoint most bright burning fires, set-pass calls, shadow casters, & batches are by far the most common and biggest bottlenecks people tend to hit first. The main thing the stats window doesn’t give me is VRAM usage, but I already know what my texture budget is before I start building a level…ie usually the bulk of vram allotment. Profiler in development build is the most accurate and useful for pinpointing further if necessary. I don’t need to the profiler for building static environments, dynamic objects and scripts though absolutely useful to me.

For very small desktop levels are strictly prototyping I agree, and if you’re doing that it’s usually best to do basic blocking at that point. For mobile, VR, or open worlds that’s a recipe for failure optimization-wise because you know going in that you gotta do optimization pedal to metal style no matter what. If you build a level kit bash style combining the typical run of the mill average environment assets (with a thousand different materials), that’s going to be an optimization problem no matter what platform you’re targeting. It’s a huge time sink if you are certainly going to have to replace every single mesh. As you know, this approach also takes precision discipline for file naming and can be a lot. I think we might of had a conversation related to this many years ago…can’t remember for sure.

But yeah, large open world levels or even moderately sized maps of a couple square kilometers can benefit greatly from knowing what you’re getting into first.

You can wing it and go optimize after the fact and use something like mesh baker to create atlases and merge meshes, but without planning around an initial texture budget, you’re going to to get either a much higher VRAM usage and loading time than necessary or sacrifice texture quality.

Other notes…
@Jinxology mentioned using a small terrain for background outside the window. That’s a performance hog with no visual benefit. Use meshes if possible and place your trees like you would any other regular prefab. Thank me later.

The right answers for static level optimization (eg the environment) really comes down to how big of level you are building and what platform(s) are targeted blah blah blah. If you’re building a small or linear level for desktop, or an interior where you have lots of obstructions to make opportunity of various culling practices, then yeah kitbash away and shoot from the hip building the level because some types of environments are inherently 100x easier to optimize after the fact than others due to not having vistas and long ranges of sight dense with game objects.

Assumptions of today lead infactual premise of tomorrow. ie “don’t always believe what you immediately see.” Probably, no definitely, rewording something that has already been said with perpetual certainty.

That’s the life lesson maybe or I still don’t get it.

I’d love to remaster some of your older games with the OWA and SP series. They can translate directy to old school mobile with texture compression and LOD’s. Everything is already atlased so fudge the busy work that’s already done. Take a mobile game to HDRP?

A 2 commit alpha would be dope, just sayin. My side is already done aside from tuning LOD’s depending on what calculator you want it to run on. it’s just drag and drop. Boom. Cut. Publish. Apologies if this is too forward it just seems like a cool way to spend a tuesday EDIT: lol it’s wednesday…but yeah i’m going to go play guitar on my porch and enjoy the upcoming fall season. It’s been a loooong day.