Sign in to follow this  
CySoftDev

Unity Getting my game logic away from XNA

Recommended Posts

CySoftDev    129

What are the advantages/disadvantages of completely modularizing my game model code into its own DLL, and creating an XNA Game Component to, essentially, function as an adapter between XNA and the game model?  All I want XNA to do is draw stuff and capture user input.

  • One advantage I like is the ability to unit test the game model itself.
  • I also like that it keeps solution files better organized (that's one thing that has driven me MAD with the books I have on XNA game development; there is little to no organization of the solution files...)
  • I like the clean separation of responsibilities, and the portability it affords the actual game logic (it could later be hooked up to Unity, SFML, etc.)

I am aware that it takes more effort, having to develop an interface for the game model; am I overly in love with separation of concerns?

Edited by CySoftDev

Share this post


Link to post
Share on other sites
tharealjohn    453

Sounds similar to other design patterns like MVVM, MVC, MVP, etc. 

 

In my experience it, the big disadvantages are mainly the complexity it adds to a project. It has its time and place, and for simple things is probably not worth it. I think you have already grasped the main advantages - you can decouple the pieces and change/update/upgrade them independently. 

Share this post


Link to post
Share on other sites
Paragon123    620

The question in this case is, How much portability is it really buying you?

If you're writing in XNA, your game model is most likely C#, which is still going to lock you into Windows... 

The ability to swap Frameworks is interesting, but I doubt it would really be worth it, esp since again, if you write the game model in C#, swap to a frame work that is cross platform your game model is still locking you into windows... 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this