x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

need help with logic for Octagon tile spawning

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!

Product Version: Not Selected
Tags:
more ▼

asked Mar 01 '19 at 04:46 PM in Blueprint Scripting

avatar image

Drakmon
1 1 2 1

avatar image Nebula Games Inc Mar 01 '19 at 05:33 PM

This is still WAY too abstract for help creating logic. Perhaps a hand drawn or computer generated image of your "game play" would help. Additionally, what are the basic mechanics? How does the player move? What makes a tile "hard" vs "easy"? You say there are 65 ways to spawn an octagon shape....well, not really, there is "one" octagon shape. Did you mean 65 different ways the tiles could spawn and "form" this shape? What do you mean by "say between 8 and 5" pieces could form a full octagon? How do you make an 8 sided shape with 5 tiles?? What makes the puzzle "impossible"? What would spawning "0" tiles actually mean in game play? Your question of how to create "logic" raises many more questions that need to be answered first before anyone will be able to take a crack at the "logic" side of things.

avatar image Drakmon Mar 01 '19 at 07:25 PM

You're right pictures would have helped, I've included some here. I guess i should have pointed out i'm using 8 blocks to form a full "octagon shape".

alt text

When i say 65, what i mean is that there are 8 edges to an octagon so squaring 8 gave me 64 which is 64 variants to a "full octagon" then the 65th would be an "empty octagon"

Gameplay is they are moving at the camera, away from the spawner. Easy gameplay would have more tiles as beams of light will be shining in from behind that need avoiding.

I could make all the levels pre-made but i like the idea of having an almost endless mode as well & for that i'd have to create something somewhat procedural that can generate terrain.

y.jpg (74.9 kB)
avatar image IndieGameCove Mar 01 '19 at 07:45 PM

could you clarify how the player would interact with the puzzle as well as how to clear the puzzle? my guess is that you're thinking of having something like a third person character walking across the bottom and then rotating the platforms in front of the player to allow it to walk across. is that the case?

avatar image Drakmon Mar 01 '19 at 08:44 PM

Yeah something like that, i'd like to get something done with blueprints where i can spawn certain terrain logic so that the spawns don't become randomly impossible for people to complete. its why i first thought of the approach of an array containing every possible instance of all the different 8 sides that could or couldn't be filled. thinking now maybe having an array with just 8 to 0 where 8 has all 8 sides & 0 has none then weighting the randomness to higher numbers on easier settings.

avatar image Nebula Games Inc Mar 01 '19 at 09:59 PM

Still need more explanation on how the player is going to interact with the octagon. It looks like there are ways to move forward/backward and only occasionally bridges to move left and right. How does this all work? What does the player do? What is the goal? You keep talking about an "impossible" puzzle....I still don't know what a "possible" puzzle is let alone the rare instance of creating something "too hard". How does this all fit together? The pic helped a bit, I was thinking a flat thing not a rat wheel, so we are getting somewhere but I still don't understand the "core game mechanic".

avatar image IndieGameCove Mar 02 '19 at 12:51 AM

yes, I think an array of tile structures from 0 to 7 would be easier to work with. each number representing a location. 0 being the top tile, 2 being the tile on the right, 4 being the bottom location, ect.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You need to be very clear about what you're trying to do before you try and code it.

I understand what you're talking about and the possibilities are not 64. It's 'ways of choosing x from y':

How many ways to choose 0 from 8 ( written 8C0 ) = 1 + How many ways to choose 1 from 8 ( written 8C1 ) = 8 + 8C2 = 28 + 8C3 = 56 + ... = 256

You could do it easily in concept with an array of 0 or 1. Just set the array with a loop and random int in range. Then shuffle it. Then just draw the tiles.

Or, you could make a blueprint tile which is randomly on or off. Then to make the next chunk of the corridor, just put 8 tiles there. It will always be different.

Then you can start thinking about difficulty settings. I already see a problem, I think, in that the walker will not be able to get from one corridor section to the next. But I could be misunderstanding your game mechanics...

Hope that helps...

more ▼

answered Mar 02 '19 at 10:07 PM

avatar image

ClockworkOcean
220 3 4 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question