How to make a system with multiple floors like XCOM or Phoenix Point

I want to adapt the system from this course to make an isometric style game with multiple floors and where you can change what floors are visible using the scroll wheel.

It just not clear to me how to achieve this properly since there isn’t really “height” anymore when using an isometric camera, or at least not in my implementation of if.

Are the different floors handled with layers to alter the visibility? How would this affect the MouseWorld class from this course? These are some of the questions I have regarding this.

In short: does anyone have any insight in how to implement verticality in an XCOM-style isometric game using grid movement?

2 Likes

I did my best to find an explanation for you and here’s what I found

Implementing verticality in an isometric game can be a bit tricky since there isn’t a natural “up” and “down” axis in the same way that there is in a 3D game. One common approach to creating a multi-floor isometric game is to use layers to handle the different levels of the environment.

Each level can be rendered on a separate layer, and the visibility of each layer can be controlled independently to simulate changes in elevation. For example, you could use a scrolling mechanism to change which layers are visible to the player.

Regarding the MouseWorld class, you may need to modify it to account for the different layers and their respective heights. One approach is to create a separate class to handle the logic for selecting and interacting with objects on different levels, and integrate it with the existing MouseWorld class.

In terms of grid movement, you can use a similar approach as with the layers, where each tile on a different level is rendered on a separate layer. You can then use a system of stairs, elevators, or other objects to allow the player to move between levels.

Overall, implementing verticality in an isometric game can be challenging, but with careful planning and implementation, it is definitely possible.

Hope this helps!

2 Likes

Thank you for the quick reply!! There is something that I need some clarification on: when you say “layer”, you mean the Unity Layer system for 3D objects (Like the MouseLayer and UnitLayer from this course) and not sprite layer sorting for 2D games?
And to then use the Culling Mask property (or that’s what I think it’s called) to determine what elements are allowed to be visible on what floor/layer?

Because I’m not sure if I made it clear that this would be a 3D game but with isometric view.

Thanks again for the quick response!!

1 Like

Anytime!
Yes, when I say “layer,” I am referring to the Unity layer system for 3D objects, which is used to control rendering and collision detection.

To implement the multi-floor system you described, you can assign each level of your environment to a different layer, and then use the Culling Mask property to control which layers are visible in the camera’s view. The Culling Mask is a bitmask that allows you to specify which layers are included or excluded from the camera’s view.

For example, if you have three levels in your environment, you could assign Level 1 to Layer 1, Level 2 to Layer 2, and Level 3 to Layer 3. Then, you could set the Culling Mask for your camera to include only Layer 1, so that only Level 1 is visible. To show Level 2, you would change the Culling Mask to include both Layer 1 and Layer 2, and so on.

You can also use layer masks to control what objects can interact with each other, based on their assigned layers. For example, you might want to prevent objects on different levels from colliding with each other, or allow them to interact in specific ways.

In summary, using layers and layer masks is a powerful way to control the visibility and interaction of objects in a multi-floor isometric game, and can help you achieve the effect you’re looking for.

Hope this helps you out some more!

2 Likes

Ok, that does clear it up a bit. Now I am wondering how it would work, for example, to let a sniper shoot someone a couple of floors lower.

Guess I’ll start working on a prototype first.

1 Like

Shooting between different levels in an isometric game can be a bit tricky to implement, but here’s some ideas to maybe help you out,

Line of sight: One approach is to use a line of sight system to determine if the sniper has a clear shot to the target on a lower level. This could involve casting a ray from the sniper’s position to the target’s position, and checking if any obstacles are in the way. If the ray doesn’t hit any obstacles, the shot is considered successful.

Height-based targeting: Another approach is to use a height-based targeting system, where the player can select which level they want to target when shooting. For example, the player could use a mouse scroll wheel to cycle through available levels, or use a UI element to select a specific level. Once the target level is selected, the sniper would automatically aim at the nearest enemy on that level.

3D aiming: If you want to create a more realistic system, you could use a 3D aiming mechanic that takes into account the height of the sniper and the target. This could involve allowing the player to adjust the angle of the shot to compensate for the distance and height between the two points. This approach can be more challenging to implement, but it can add a lot of depth and realism to the gameplay.

Whichever approach you choose, it’s important to make sure that the player understands the mechanics of shooting between levels, and that the system feels intuitive and consistent. You may also need to consider how other game mechanics, such as cover and movement, interact with the multi-level environment.

Hope this helps some more!

2 Likes

OK, thank you for your input! I’ll post something once I have a working prototype.

1 Like

Sounds great!

It’s worth mentioning that CM said doing something with multiple levels was his next plan for this course:

and

2 Likes

Was there any date announced regarding the updating of the course?

1 Like

Not that I’ve seen. Those were posted in Feb, so “next month” would have been March.

Considering this is only like 1/3 of the way through the course, maybe we will see it by the time we hit the end.

Hugo has been quite busy with his free course over on youtube so I doubt he’s going to be updating this course soon

1 Like

No problem, I’ve found someone on Youtube who was showcasing a game that was very much in the direction where I want to go to and he told me what tutorials he used as a basis.
Not sure if I’m allowed to link to other paid creators here (dude has a patreon for his more elaborate videos)?

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms