Alright I’m usually an Angular / Go developer. I did some C++ with and without Qt in the past and lots of PHP, also Delphi/Pascal before that and even BASIC and ASM on the C64, lately also flutter and react and some Java. But I’ve never done anything with C#.
As life progresses you learn different ways to create stuff. Different patterns, different concepts.
I’ve glimpsed a few tutorials. One guy liked to use the MVC pattern, aka having his data models, his controllers and treated the scenes as views.
Having worked with PHP/Symfony and now also Angular they have components, also data models, services, but also reactive data stores (which one could also call a service) and when you add ngrx to it there are also side effects.
Right now Unity is still one big forest. I know there are 2d games and 3d games. I’m not sure if you can mix them.
I’d like to create something simple. The game “Game of Thrones - Winter is Coming” inspired me and I saw they use/d Unity to create this game, which is also available for the desktop browser weird enough.
Anyhow a kingdom building game is what I’d like to create.
The main screen is your town and lands where you can build and upgrade various things like barracks, stables and resource buildings like farms or iron mines.
And then there’s the main game map screen where your town is located and various other things, bandits, lairs, resource objects etc.
The town screen, I guess can be a tilemap or maybe a 3d scene?
It needs to have a background and various animations on the background, as well as the mentioned castle, barracks etc, also animated. If that’s doable (easier) in 2d all the better.
The game map, I see a 2d hexagonal map can be created. That is awesome. I hope there are also functions in Unity to find a path from tile A to tile B. Or should I use Geo3D calculations to determine the distance between 2 points. I want it to be as simple and easy as possible. The land is flat, there are no obstacles.
For communication between client and server I’m thinking grpc. It’s a good way to define the communications protocol and also supports streams in both directions as well as unary calls. I’ve worked with grpc before, but not Unity.
There’s a medium post about it, but I had trouble with 1 step in the unity editor,
“Once we’ve added the code we should see a field in the Inspector to add the Material. Let’s add the CubeMat to that field”. I have no clue what he’s talking about.
But ok. The concept is clear.
The client will just be used as a thin client with a copy of the game state that gets updated when something changes.
How would I start with a scene that should be scrollable and zoomable, that can have animated “background” objects aka not clickable but also clickable animated foreground objects?
I also probably need a global game state. What does state management look like in Unity? Are all changes observed? Could I have 1 class that holds the game’s state and references to data model collections?
Are there any best practice documents I can read?
I saw the video about ElementsUI, that’s a really nice way to create an UI with ml and stylesheets.
Anyhow for starters I believe it’s best to begin with a 2d scene with 1 game object and and some kind of global game state.
Step 2 add grpc to that.
Step 3 when I click the game object it should talk to the server to increment a counter and the server should send the new counter value to the client and that should be stored in the game’s state.
Step 4 transition from town scene to map scene and back
and see where I go from there.