Hey guys, I recently picked up Unreal about a month ago and have been going through a couple of courses on Udemy to get a better understanding of the engine. I just finished the Pinball project and was wanting to see if I could start something on my own before jumping into bigger stuff.
I originally used Leadwerks then took time out from learning game development to focus more on modeling, but figured I’d jump into Unreal to continue where I left off with LE which was a chess game. The problem I’m having is that LE had entity scripts that I could just drag and drop onto pieces and some basic boxes with an invisible material that were placed on top of the texture on the board. I’m struggling a bit in finding a way to replicate this in UE4 and was wondering how other people would start off setting up chess or other tile based board games. Is the best way here to have all the pieces and the board in one blueprint or are there better ways to go about this?
Thanks in advance and sorry if I posted this in the wrong section.
I havent used LE or made any board games yet, but I would probably use inheritance for the chess pieces. Create a parent class (call it ChessPiece) for the pieces that holds common functionality (can be selected, changes color when selected, etc) and then create Child Blueprints from this class for each piece. Say the Rook is a Child of ChessPiece and it has additional functions / event. One event could determine the allowed moves for that specific piece, etc.
This way, you keep your structure simple, yet extensible.
That has definitely helped a lot for setting up the pieces.
I was a bit thrown off with the variables being local to the blueprints and figured that when every piece type had its own individual “iswhite” boolean I was probably doing something wrong.
Now I think of it there’s something else I can’t quite figure out.
I’ve got the parent blueprint for the pieces with the variables for their colour and their type. I’ve also made a blueprint for the tiles with a cube mesh, placed it over every tile on the board and made xLoc and yLoc variables for each one. So A1 is x 1 y 1, B5 is x2 y 5 ect.
I was playing around with it and just can’t figure out how to bind individual pieces to them for their starting positions. Should the pieces also share the tiles variables so I just set their begining locations in the editor or is there a way with blueprints to set that up?