drpsyko
(drpsyko)
February 27, 2018, 2:42am
1815
@drpsyko : Depends a bit on exactly what you want to achieve. There ar quick and hacky ways to achieve some of this stuff, but depending on what you want you may need to make larger changes. I plan to add the option to have multiple grid managers in the future, but until then there are some other things you can do.
So if I understand your question correctly, you’re not asking how to preserve say the heatlh and other attributes of units across maps, but rather having something like a basement in a level where combat can go on simultaneously while it is also happening on the floor above, with unit turns hopping back and forth between the levels as they are activated. Is this a correct interpretation?
If so, here is a quick hack you can try. Set Heightmap to multilevel in the Grid Manager. Set Max Grid Height to something really high (say 10000). Then create your various levels on top of one another, making sure that the distance between them is higher than the maximum zoom distance set up in your grid camera.
Already all of these layers should function as separate grids, though you can always add edges to allow movement between them. Now what you need to do is make sure layers below cannot be seen when on levels above. You can do this simply by having a landscape/plane mesh between them or you can use cull distance volumes, object hierarchies with visibility set through blueprints or whatever.
Last thing you need to do is prevent the camera from moving smoothly when switching between units on different layers and instead jump instantly. Look in the event graph of grid camera in the comment box “Follow the current active unit unless the player is currently panning the camera”. Here you can see I use lerps for smooth movements. Promote the lerp alpha to a variable and set it to 1 whenever you switch between units on different levels (you can do this by comparing the height of the previous and the next unit in the ChooseNextPawn event in ATBTT_GameMode).
https://i.imgur.com/SZ1ViW7.png
Seems to work pretty well for Divinity-style instant switching between multiple grids. A bit hacky, sure, but looks good in game.
Yes, that is exactly what I meant! I was thinking that maybe I could make the bp_manager ref unique to each stream level. But really need to unload most of the stuff from ATTBTT gamemode to level, and add arrays for each pawn per map. Haven’t tried it yet though, as I’m guessing it would break a lot of pawn turns
For now I’ll use both method - load/save state and multi-level to compensate big map. Thanks, and really looking forward for the multi-grid manager!