3D Platform Level Design Question

Hello,

I’ve been looking into Unity and have been playing around with creating a simple 3D platform type game to learn how to use the engine. I have some physics and game elements down which I am happy with, however, I’ve hit a bit of a wall with the level design. I have had a bit of a search around online, and initial suggestions talk about using height maps and importing them to work with them within Unity. However, I would quite like to be able to create things such as platforms that appear over other platforms, and moving platforms (nothing realistic looking), which I don’t think height maps would be very good for.

My second thought was to create lots of .obj files, and then import these into unity and use these along with the preset shapes. Doing this would be a lot of effort for me (mostly as I’m not great with various 3D modelling software, and would have to learn), but I am happy to invest the time if this isn’t the wrong approach.

I wanted to check on here before I started though if this would be the correct way to do this.
Is this a good approach to doing something like this, or might this cause performance issues having lots of (fairly simple) objects (Probably under 100 objects at a guess) in a scene? If this is bad, is there a better approach to something like this?

What’s your target platform? I wouldn’t worry about 100 objects unless you’re on mobile (worry about everything if you’re on mobile).

What kind of control mechanics do you have? I still think of Mario 64 when I hear “3D platformer”, so I think of things like wall jumps, double jumps, cliffhangers, etc. If you have some similar mechanics, you could stick with mostly box colliders, maybe the occasional sphere or cylinder. Experiment with compound colliders made from primitives before you start to model complex obstacles, and see how your physics system unfolds when it interacts with different simple situations.

When you say level design, are you mostly referring to what resources to use to get all the pieces ready, or are you also asking about how to actually make levels flow well? The latter is harder, of course.

Mobile was my target unfortunately, should have mentioned that as I did mention the performance stuff. In terms of control mechanics, it’s just a tilt-to-move type thing and tap to jump - I’m trying to keep things simple in terms of controls.

Box and cylinder colliders would probably be sufficient for the types of obstacles I had in mind, and I hadn’t thought about that, so they would be much better than using the mesh colliders I have currently.

By compound colliders, are these just objects that use combinations of colliders together (such as two box colliders to create an object with an inner edge say)?

In terms of level design, in the question I was asking about the technical side of things, like what is a good approach to creating a level in Unity, and if I’ve missed something obvious before jumping to importing lots of objects where there may be a simpler way. The making the levels flow is something I hope should come with experience and time and was not really the focus of the question.

Thank you for your answer, I shall have to try and be careful with the size of the levels to keep the object count down, and will play around with simpler colliders to try keep the complexity down.

Thank you :slight_smile:

Thank you for the clarification.

100 objects or so can still be managed on a mobile platform given that care is taken to optimize. Low-res or no textures, simple lighting (baked-in as much as possible), high sleep thresholds for Rigidbody’s, and manual deactivation or unloading of objects/assets that are not in use are good places to start, I would think. The Profiler will be very useful to you.

You are correct about compound colliders. Check near the bottom of the Rigidbody Manual page for some reading.

I don’t think there’s anything specific concerning the technical side of implementing assets into a scene that you will need to be ready for, other than being familiar with the Scene view controls for the Scene Camera and object manipulation. It might be worth mentioning in case you haven’t come across this yet that there are ways to write scripts that allow them to execute without pressing play, which is often useful for creating developer macros to place objects into scenes. Often, this is useful for tiling objects, or just snapping them to an imaginary grid for easier spacing. All or none of these might be helpful to you depending on what your game is like.

Would also generally recommend learning about object pooling here if you’re not already familiar with it.

That looks great, thank you very much. I shall have a look through those pages and see if I can create something cool.

Thank you very much for the help you have given me :slight_smile:

I think one useful workflow that solves a lot of problems is designing the entire level on one screen, then adding another camera as the player’s view, so the player only sees the area around their character.

You can check out this game Spelunky Entire Level, as an example.

For mobile, performance is critical because of low memory. If you can load the entire level in the project view and have it all run well in one screen then you’d be better at managing the memory requirements. This also seems like an easier way to design a level because you can see the beginning, middle and end all in your project view.

It would also avoid having to load and unload assets (and potentially run out of memory) as the player moves around.

What do you mean by this? Do you mean 2D Parallax Scrolling? If so, that is very easy to implement by creating a relationship with player position gameObject and the midGround sprite, or backGround sprite.