Download

Structure of chess project

I’m new to Unreal Engine development, and I’m currently working on a simple chess game to teach myself the scripting side of the engine. But I’m currently stuck because I’m really not sure how my game’s code should be structured. So I have just a few simple questions for the more experienced developers here:

  1. Should the pieces be Actors themselves, or components of a ChessBoard actor? I want them to to have individual animations and stuff.
    [LIST=a]
  2. If they should be Actors, should they be Pawns?

Where should the state of the board be stored? In a GameState object? If so, how should I reference the individual pieces?
How can I trigger events like setting a piece on a specific square of my ChessBoard object?
[/LIST]

There’s a really good chess tutorial on youtube, check it out and expand on it

I looked through that but it’s really not what I’m looking for. He dynamically generates the chess board with static meshes; I don’t want to do that because I want my board to be a single mesh. And he just has the pieces move instantly, without any animations. (He made all the pieces components.) I want to go beyond that but I’m not quite sure how.

I am probably not much help here but you can use UE4 Itween for on the fly animations of your chess pieces

[Open Beta] Procedural On-the-Fly Animation in UE4: iTween! - Blueprint Visual Scripting - Unreal Engine Forums!

For your chess pieces i would think them being an actor would be better. I would think they would be better controlled and you can store them in an array in the level blueprint.

Oh man, I had forgotten about the level blueprint. That will probably make a huge difference for me - I am used to Unity where I can just create empty objects with script components to handle game state.

You can do the same thing with UE4, just create a actor with nothing in it but you have to get a reference to everything you want but with the level blueprint everything in the level already is referenced in it.

So do you think I should even bother to use a GameState? This almost certainly won’t be multiplayer anyway.

I haven’t messed with gamestate yet in my progress with ue4 but to my understanding gamestate is where you manage what part of the game your in. so your in a menu and when you press play the gamestate switches to the board level. If you pause the gamestate will handle that, but i could be terribly wrong with that, i just have not used/messed with it yet.