In a previous post, I was speaking about a design problem I had with replication of the hexagonal coordinates of a token. My problem was that I was using a Tick event in Blueprint to compute the target position. Doing this computation each frame was not really efficient and it was not a really good design either. UE4 provides a way to implement a callback in C++ when replication happens, but at first it wasn’t working from me because the callback was never executed on the server. Well… Turned out it was normal because the replication was only happening on the non-authorities, duh !
In this post, I will explain how the skybox in Hexode was made. I used an open source tool called Spacescape, developed by Alex Peterson. This tool can generate procedural space skyboxes, using noise functions. The nice thing about it is that you can achieve a pretty good result in a limited amount of time.
The Unreal Engine features its own model of network communication. Hexode is a multiplayer game by essence and I will try to explain in this post how it has been implemented so far.
To understand the network replication model, one has to first grasp the object model of UE and the notion of authority. Comming from Unity3D, the object model of UE was completely alien to me as there is no such thing in Unity3D. In the latter, everything is a gameobject and you may attach any component (with some restrictions and dependencies between certain components) and any script. It also means that you may organize the code as you so desire and define how each object is being (or not) replicated.
This is not the philosophy of the Unreal Engine.
The Unreal Engine differentiates between Actors (Something that is part of the level like a character or a skysphere or the hexagonal board of a previous post), Pawns (Actors that can be “possessed” by a Controller, a human or an AI), GameMode, GameState, PlayerState, etc. (more…)
When it comes to hexagonal boards, the choice of a coordinate system is primordial. From that choice derives the complexity of the underlying algorithms, like pathfinding for example.
Hexode uses a system of axial coordinates. Each hexagon has its position defined by two integers (U,V). This naming convention may be a bit misleading as those are the same letters used for describing texture coordinates. But I think the code itself is not ambiguous as I have defined a custom Unreal structure “HexCoordinate”, which is really handy when it comes to using it with Blueprints.
I am strongly considering to switch the project from Unity to Unreal. Since the Unreal Engine is now completely free and because I think that the PBR shaders in Unity are giving bad results, it is really likely that I make the change. Light reflection is just plain wrong and it is a known bug. I am not making that up. I know Unity plans in its road map to solve the problems I have encountered, but I think that Unreal, in this aspect, is much more mature. Unity is a great tool for beginners and to make fast prototypes. There is no question about it. But I feel like I am hitting a wall here… (more…)