I’m new to Unreal, but have experience programming in various languages including C++, C#, VB.NET, etc.
I’m trying to re-implement/convert a multi-player game that I previously wrote in VB.NET. It’s a turn-based fantasy game that involves each player having a hand of cards and a common board with characters and objects on it that are affected by the cards.
In my original implementation, I had a number of game classes defined that implemented basic game objects and logic, so things like Cards, Items, Objects, Characters, Floor squares, Walls, etc. These objects were on the server and were also replicated to all clients where the rending logic was implemented.
If I were to do this in Unreal, how would you suggest to organize the code?
I’m nominally thinking that I can re-implement all my game classes in C++, have them derive from UObject and then use Blueprints to get information from these classes to render them (e.g. I would have a “Card” class that has all the properties and information of a card as well as the logic to execute the power of the card when its played, then I would have a “CardWidget” Widget implemented in Blueprints that would take information from “Card” and display it, as well as trigger the Card’s “OnPlayed” event, which would have been implemented in the “Card” definition.
If I do this, should my “Cards” and other game objects all be attached to the GameState to ensure they’re replicated to clients? Also, do I need the game objects to inherit from UActor rather than UObject in order to be replicatable?
I’ll appreciate any advice you can give me.
Thanks.