Chess-Challenge icon indicating copy to clipboard operation
Chess-Challenge copied to clipboard

Split UI and engine logic

Open eduherminio opened this issue 11 months ago • 2 comments

First of all, doing this now might would be a breaking change, so this might be disregarded short-term but brought back once the challenge is over, but: Please consider splitting engine and ui logic in two different projects.

That could bring multiple benefits:

  • You could create a nuget package out of the engine part and you would have a chess-engine programming framework for everyone to use without having to use the whole project.
  • People could create cross platform and UCI compliant engines using that nuget package without having to include raylib dependency (and its limitations/size) and all the UI part.
  • AOT compilation: When doing AOT compilation of the previously mentioned potential engine, executable bundle size is cut by half. If you do it now (creating a separated console project to support UCI that references Chess-Challenge and publishing with AOT enabled), the final binary still works but the result of the publish command is a bit of a mess due to all the UI files, raylib.dll, Chess-Challenge executable, etc and, as stated, the size of the executable we're interested on is twice the one we'd get having the UI and engine logic split into 2 separated projects.
  • Even if the nuget package isn't created yet, it gets easier for people that customize their UI runner to merge back any framework changes by spotting where the conflict is: keeping their changes in the UI project and getting yours in the engine one.

I've done the code split part myself in this branch (more specifically, in this commit), and it's pretty much straight-forward to do thanks to your existing design/architecture.

eduherminio avatar Jul 27 '23 09:07 eduherminio