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

Best language for this?

Discussion in 'General Discussion' started by yoonitee, Jan 16, 2015.

  1. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,364
    I'm thinking of making a kind of simulation game. A kind of cross between Dwarf Fortress and the Sims. But a bit simpler.

    i.e. it will do things like simulate births over several generations to give the characters family history and relations.

    I'm trying to think what language to use. I want it to be downloadable on PC, because I imagine this is the kind of thing PC gamers like. But I would also like the option of having it portable to mobile or tablets.

    First I thought of C# and Unity or Xamarin. Since this would port to most mobile platforms. And using Unity I could get a standalone app. But C# is hard to port to anything else. There is C# native coming out soon and Visual Studio 2015 is good for mobile. C# keeps changing all the time and could end up a bloated language.

    Then I thought of Javascript as the most common language and not likely to die out any time soon. It also has the advantage that you can program in the cloud. You are not tied to Visual Studio. If Flash was still alive there is the other advantage that it is similar to Actionscript.

    C++ is not really enjoyable to write in anymore. And performance is not really critical for this game. Rather, I prefer a safe language.

    Python, I can't really see the advantage of using. Except that it is taught in schools, so if I made it open source lots of people would understand it.

    Which language to bet on? And not regret it a year down the road??
     
  2. thxfoo

    thxfoo

    Joined:
    Apr 4, 2014
    Posts:
    515
    Look at haxe and OpenFL. I think you can even use Flash Develop and other tools with it.
     
  3. thxfoo

    thxfoo

    Joined:
    Apr 4, 2014
    Posts:
    515
    Python is awesome. The more I use it awesomer it looks. If you combine it with PyQt you can dump out desktop gui-applications in notime.

    Ugly and bad example, Sieve of Eratosthenes on 1 line:
    Code (csharp):
    1. print sorted(set(range(2,n+1)).difference(set((p * f) for p in range(2,int(n**0.5) + 2) for f in range(2,(n/p)+1))))
     
  4. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Why should you regret it to use C# more than any other language? Every language changes over time, unless it is not anymore used. I also don't understand what C# native has to do with this decision. Unity is developing il2cpp which you may understand as native C# as well or even native .Net. Further, if you picked Unity, there is almost no need to think about porting your C# code, because the really hard work was already done by Unity.
    I have the impression that you are mixing up things regarding C# that are not relevant if you decide to go with a specific solution like Unity or Xamarin.
     
  5. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,364
    Well, the issue is that if I started in C sharp but then decided I don't want to use Unity then it's hard to port C sharp to a native application. e.g. if I wanted to use Flash instead or even Unreal. Also, if I make my games fairly modular, it would be nice to reuse my code in other environments.

    And if Windows dies off in 5 years because Windows 10 bombs, I'll be stuck with a lot of C sharp code with no .Net to run it on. OK, maybe not that likely...

    To me C sharp seems a very Microsoft centred product which only really works best with Microsoft tools like Visual Studio. But if I wanted to do some dev in the cloud or on a Mac I can't use visual studio(??) Whereas there are many Javascript and Python based IDEs sprouting up in the cloud. Also if you wanted to interface C sharp libraries with other languages you usually need .Net installed.

    A pity there is no option to use Python as a Unity language. As that is also used for scripting in things like Inkscape and Blender.

    What someone should invent is a Babel Fish that translates all languages into each other.

    I don't think there's an ideal solution at present. Just looking for the least painful.

    P.S.

    ilt2cpp looks interesting. So that will convert C sharp into C++ code? Could be useful outside of Unity too.
     
    Last edited: Jan 16, 2015
  6. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,071
    Isn't it fortunate then that we have Mono for other platforms? :p
     
  7. thxfoo

    thxfoo

    Joined:
    Apr 4, 2014
    Posts:
    515
    There is a Python .NET implementation. But never used it, no idea how good it is.
     
  8. thxfoo

    thxfoo

    Joined:
    Apr 4, 2014
    Posts:
    515
    Mono performance is even worse than that of .NET in the benchmarks I know off.

    E.g. in this you have to scroll a while to find the first .NET entry, and even longer for a Mono entry:
    https://www.techempower.com/benchmarks/#section=data-r9
    E.g. Python, Lua, Javascript, PHP, Ruby and of course Java and C++ handle many more requests per second than .NET.
     
  9. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    You'd best start off with one of dozens of open source genealogy software out there. It's a pre-designed database for you. Ignore the language and go for the one you think is designed with a nice API so you can hook into it & extend it.
     
  10. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    If you create code in an environment like Unity, there is going to be a lot of code that is not reusable anyways. E.g. all the UI code you write is not going to be reusable. That is the case for all the code that uses any Unity specific functionality which is usually the majority.
    It is usually not realistic to expect that you can write code that can be used in other environments.

    This kind of statement shows more than anything else a lack of experience. You are trying to find the ultimate, the best solution which does not exist. What matters is that you know how to use the environment and that you learn to code.
     
    Ryiah likes this.
  11. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,071
    An options menu, highscores menu, etc. I don't see why some couldn't be reused. At the very least as a starting point.
     
  12. BFGames

    BFGames

    Joined:
    Oct 2, 2012
    Posts:
    1,543
    1. Don't think this far ahead and start by actually making the game. If your game gets enough success such that you actually need to port it to something else in a few years time then go to 2.

    2. Pay someone to port it.
     
    Ryiah likes this.
  13. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    You can't reuse it because you don't develop a software that can be opened and recompiled in a C# ide or Unreal for example. It will simply not open. You develop a Unity game in Unity. Which is a closed source game engine.

    And in general you cannot transfer a Unity game to another game engine without a rewrite. Unity has a very special way to deal with the assets for example.
     
  14. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    As mentioned by @Tiles already, it will not work in any other environment. A menu is in general not that complex to build. If you think of something more complex like even an inventory that supports drag and drop from and into the game world and in the game world you also have the ability to use gestures to steer the camera. Theoretically, one could make this kind of code portable among different environments, but it is usually not worth the effort. But it will clearly not just work in any other environment.
    It will be possible however to reuse most implementation ideas, but that is definitely not true for the code.

    Edit: In the original example I meant code that relies on the Unity UI or OnGUI which can definitely not be reused at all.
     
  15. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,071
    It somehow totally slipped my mind we were talking about taking things between engines and not simply between Unity projects.