Daily Post Image from Upsplash

February: 12

Notes

2024

Unity

After finishing up my morning work session, I am going to continue working on my the unity game! Ugh character selection and the character handler, oh boy.

This is how our Engine Initalizer looks right now:


using KBVE.Services;
using UnityEngine;

namespace KBVE.Engine
{
  public class EngineInitializer : MonoBehaviour
  {
    void Awake()
    {
      InitializeServices();
    }

    private void InitializeServices()
    {
      DontDestroyOnLoad(gameObject);

      var servicesInstance = KBVE.Services.Services.Instance;

      //  Register AuthenticationService
      var authService = gameObject.AddComponent<AuthenticationService>();
      servicesInstance.RegisterService<IAuthenticationService>(authService);

      //  Register SceneLoaderService
      var sceneLoaderService = gameObject.AddComponent<SceneLoaderService>();
      servicesInstance.RegisterService<ISceneLoaderService>(sceneLoaderService);

      //  Register UserDataService
      var userDataService = gameObject.AddComponent<UserDataService>();
      servicesInstance.RegisterService<IUserDataService>(userDataService);

      //  Register APIRequestService
      var apiService = gameObject.AddComponent<APIRequestService>();
      servicesInstance.RegisterService<IAPIRequestService>(apiService);

      //  Register CameraService
      var cameraService = gameObject.AddComponent<CameraService>();
      servicesInstance.RegisterService<ICameraService>(cameraService);

      //  Register Weather
      var weatherService = gameObject.AddComponent<WeatherService>();
      servicesInstance.RegisterService<IWeatherService>(weatherService);
    }
  }
}

The current design plan is a hybrid of service oriented architecture and event driven architecture. We split the two types into different namespaces, KBVE.Services and KBVE.Events, SOA vs EDA!

To add a service on the Initalizer, we just throw in these two lines, for example adding the Entity Service.


  //  Register EntityService
  var entityService = gameObject.AddComponent<EntityService>();
  servicesInstance.RegisterService<IEntityService>(entityService);

Next we need to register the clock service, which will represent the global tick.


  //  Register ClockService
  var clockService = gameObject.AddComponent<ClockService>();
  servicesInstance.RegisterService<IClockService>(clockService);

I believe we have enough of the base services to move forward with the StartZone!

Before I get started on the next update, I want to make sure everything builds and that the rolling updates via the cicd pipeline works. We will move everything up from the alpha branch to the beta branch, after it builds, we can then shift it up to main for a release.

Over the weekend, I was trying to test case multi agents working on the repo, there were some minor issues regarding them not isolating the changes and throwing a ton of git diffs. Uhh, long story short, either I need to find a way to resolve the git cherry picks OR really isolate the agents on where they can work, which needs to be done automatically as well.

I am thinking that we we could also move the KBVE namespace into its own nuget package and then call it within our application, but that will be for a later time.

The character section could be split into a couple different components, hmm, thinking it through, it might make more sense

AutoReview

During the pipeline roll out, it seems that the auto review passed on 3 of the test cases but faild on the remaining 7.

I actually think the failure in the test case was on my end, I need to adjust the test casing again, which will be easier with finish products to test against.