Progress Report: 2019, Week 4


#1

After a very long week of decision making, I’ve settled again on PUN 2 for our networking solution. While I was thrilled to find Mirror, a Unet replacement which would have meant nearly free server costs for our early releases, it is simply not ready for production use. While the code itself is functional, it results in compile collisions which prevent the debug information being generated for use by the editor. This makes debugging more difficult without constant restarts and this is, naturally, a huge drag on attention and is simply not worth the benefit.

At the same time, a complete revamp and restructure is in progress since if I’m reworking the networking, I may as well take the time to clean up the code that goes with it as well! This process is actually going far faster than I expected and while the end result will be a graphical downgrade, the goal is to permit the same build to also work on Android and WebGL. Once this is complete I believe we will be ready to begin private alpha testing with select groups. This is less for exclusivity and more because of limited network resources currently and I hope to get us into public alpha as soon as possible.


#2

Little bit sparse on updates this week. Ohio is currently at the tail of some really quite bitter cold weather, as in arctic cold, which has left me running for blankets and a hot drink. Thankfully it seems things are returning to our regularly scheduled winter horror and I’ll be able to focus once again. Having said that, I’ve not been entirely negligent and have some decent updates to report.

To begin, Photon’s PUN 2 has been implemented yet again and while organization leaves something to be desired, it does work.

Additionally the game map has been added, but not without difficulty. See, currently I’m using canvas image components residing in world space for everything. This makes sense as I’m not using colliders or anything that requires physical interactions and Image components are the most efficient way to display the large number of images a tabletop game needs. Like most things however, nothing is as simple as it appears and scaling assets to be of matching sizes despite resolution differences is a difficult task which I’m still struggling with. In the end it might require a custom map system, no longer officially allowing imported maps, but I’d like to have a system that was at least ad-hoc capable for groups that don’t want to port their entire map to BiosHub.

Noting the current map you might notice I took great care to align the tokens to the map grid. This was painstaking but…Nah, I’m just kidding, We have Snap to Grid support now! And dang does it feel smooth. For anyone also needing a snap to grid system, BenZed provided some excellent code on Reddit which is what I’m currently using.

Vector3 SnapPosition(Vector3 input, float factor = 1f)
{
    if (factor <= 0f)
        throw new UnityException("factor argument must be above 0");

    float x = Mathf.Round(input.x / factor) * factor;
    float y = Mathf.Round(input.y / factor) * factor;
    float z = Mathf.Round(input.z / factor) * factor;

    return new Vector3(x,y,z);
}

For our future WebGL users, I added a bypass to fix browsers being unable to work with our caching system. Browser security forbids using local storage, but for a browser it’s obvious you have internet and so it shouldn’t be a huge issue.

Max Camera Zoom was added to prevent the world flipping when the camera went into negative zoom.

I need to investigate a regression where the Esc toggle for our Control Panel is not working, probably just broke the game object reference.

Upcoming tasks are reviewing the token/map scale so I can guarantee it works with any map size and also support varying token sizes. Additionally adding a room selection to the main menu is a priority. From there, save/load and ideally a token browser will be all that is needed for alpha support! I look forward to getting feedback and finding what direction the community wants this to go.


#3

Additionally, I forgot to mention this but there’s a great talk on Unity UI and Optimization from Unity 2016 I’d totally recommend.