Download

Best place for game logic on a simple puzzle game

Hi everybody, I’m new here and new to Unreal Engine.
I have watched a few tutorials and examined some of the demo games so I feel I know the basics of the engine, but I wanted to start getting my hands dirty and I wanted to start with something simple.
So I was thinking about taking the puzzle template and create a simple puzzle game like a slide puzzle of some sort.
I looked at both the BP and C++ version and I think I want to go with the c++ example, I also looked at how the memory game from the market works.
What I noticed was that the template has two actor types, the tiles and the grid, the grid is in charge of spawning the tiles and handling game logic, in our case add score.
When I opened the memory game I saw that the game logic was implemented in the GameMode blueprint, which is I guess equivalent to the GameMode class in the c++ template.
So I was wondering, where is the best place to put the game logic in a small puzzle game, in my case I need to hold 8 tiles that can be place on a 3x3 grid, one spot is empty and my game logic should determine if clicking on a tile can move it to the empty space and determine when the puzzle is completed if all the tiles are in their right place.
So what do you people suggest?
The other issue is that when spawning a tile it has a pointer to the grid, in my case I need the grid to know the tiles in order to see where they are placed and where the empty space is.
What is the best way to have this kind of dependency? keep pointers to the tiles on a two dimensional array of some sort? what is the best way to do this in UE? TArray?

I would really appreciate your help,

Amit

Anyone? I can really use some help here…

Since you’re just getting your hands dirty, I’m not sure why you aren’t just getting started by following the lead of the memory game puzzle since you’re already looking at it. It does sound like you don’t quite really understand even the basics yet. There are a plethora of docs, tutorials, answerhub questions, and examples/demos to get you past basic questions like this, and you’re probably going to have a rough time of it if you have to constantly go to the forums to ask for answers. Here are some docs that may be helpful to you regarding the game mode: https://docs.unrealengine.com/latest/INT/Gameplay/Framework/QuickReference/index.html. Also I would make extensive use of this search: https://docs.unrealengine.com/latest/INT/. Best of luck dude!