Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Moving XNA (C#) project to Unity

Discussion in 'General Discussion' started by caio1985, Apr 30, 2014.

  1. caio1985

    caio1985

    Joined:
    Apr 25, 2014
    Posts:
    3
    Hi everyone,

    I have a game developed some years ago on Visual Studio using XNA which can benefit from Unity's features now that I know more about its features.

    I'm still reading the docs and watching tutorials so I'm not very sharp at it.

    I'm wondering about the effort I will need to put to migrate this.
    For instance, in my XNA project I have some classes which are used/referred by others (e.g. a CubeArray class is an array of Cube classes) but I don't see this kind of things happening in Unity - at least not in the games/tutorials I've followed - it seems that Unity paradigm is a bit different.

    My questions are:
    - How usually games are migrated from traditional projects to Unity?
    - Is there good documentation describing that process?

    Thanks,
    Caio
     
  2. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    Most cases of porting I've ever heard of usually go that they tossed/put aside whatever they originally had and rebuilt the code base. I have to imagine libraries (that don't have many dependencies and are more modular) will have more likelihood of actually being useful without too much work. I would generally assume most of it will require enough reworking that you will be better off just putting it aside and remaking it from scratch.
     
  3. arvzg

    arvzg

    Joined:
    Jun 28, 2009
    Posts:
    619
    Though this does not mean you necessarily have to start 100% from scratch. I would assume at least some of your code/algorithm is generic enough that you could simply translate them to Unity

    Your general game logic shouldn't be thrown out completely and can most likely apply in Unity, just written slightly differently
     
    Last edited: Apr 30, 2014
  4. RvBGames

    RvBGames

    Joined:
    Oct 22, 2013
    Posts:
    141
    I've used both, started with XNA when it was first released but left once it became phone-centric. Been using Unity on/off for a few years, with a heavy dose of recent development. . .but. . .just look at your shaders. That'll give you a benchmark :(
     
  5. TheRaider

    TheRaider

    Joined:
    Dec 5, 2010
    Posts:
    2,245
    You can obviously reuse all your assets :)

    Also all the logic etc would translate easily even if you had to recode it, the logic is fine.
     
  6. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    My mindset is that the designed logic is probably fine, but I would be skeptical that the lines of code are usable or efficient. The less dependent on XNA libraries it is, the less worried about it I would be.

    I'm the wary type though. Even if all I had to do to get something to compile and run was change Vector3d to Vector3, I would still be paranoid that some part is not running like what it used to.
     
  7. arvzg

    arvzg

    Joined:
    Jun 28, 2009
    Posts:
    619
    I totally understand what you mean - Another situation where I feel just like this is upgrading an OS (Mac 10.8 to 10.9, for example), which is why I almost always completely reformat my computer and installing fresh OS instead of doing an upgrade :D

    In addition to that, you'll find that rewriting your game in Unity from scratch to be an excellent way to learn and get used to Unity!
     
    Dreamaster likes this.
  8. caio1985

    caio1985

    Joined:
    Apr 25, 2014
    Posts:
    3
    Thanks everyone for the support.

    In the end it was easy to migrate everything, I had few conflicts between classes but I managed to solve it easy.
     
    GarBenjamin and superpig like this.
  9. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
  10. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,613
  11. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Thanks for the reply. :cool: