Need help with logic for Octagon tile spawning

anonymous_user_4f573106
Fri, 01 Mar 2019 16:46:37 +0000
Blueprint

Hi guys,

So I’ve got a puzzle that’s formed of tiles to make an octagon shape. I’m looking to get some perspective on the logic i should use when working with the blueprint system in UE4.

So to break down what i’m trying to do, i have a spawner spawning up to 8 tiles in an octagon shape, this means i can have up to 65 (if you include having no tiles spawn at all) variants of an octagon shape that can generate. My issue is i need logic to not make the puzzle impossible so that when the current piece moves out of the spawner, the next piece generates with certain logic (Depending on an, EASY, MEDIUM & HARD criteria) to not make it impossible.

So if we move out of the abstract & i try help visualize what i mean, if i’m on easy then a certain amount of pieces need to spawn (say between 8 & 5) to make a full octagon & that 0 pieces is spawned at a low rate.

Now my logic so far is to create an array with a range of 65, set all 65 values to all the different variants of the total “octagon” shape then create the modes for difficulty that (somehow, not sure how to do this part with blueprints) have rules for which pieces can be generated next based on the current mesh array that has been spawned.

Problem is i can see this becoming a huge series of if statements, checking values & making the whole thing more convoluted than it needs to be. So if anyone has any ideas on how to tackle this idea, i’d be grateful & like to chat!

8 posts - 1 participant