• Advertisement
Sign in to follow this  

Unity Next language for game development?

This topic is 2998 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

(Mods: not sure this is the right forum for this, but it doesn't seem to fit any better anywhere else...) At this point in time, I feel that I am extremely fluent in both C++ and Python, fluent in plain-old-C, Java and PHP, and have a passing familiarity with Scheme and D. Lately I have been doing most of my development in Python, but the performance is a definite bottleneck, so I am forced to implement a fair amount of the functionality in C++ (via ctypes and/or boost::python), which kills many of the advantages of using Python in the first place. That has caused me to fallback to my default of C++, but truth be told, I am tired of using C++ on a daily basis, and want to move on to something a little higher-level, and more productive. While I am at it, I would like to find something that makes a number of my requirements a little easier, and it wouldn't hurt to learn/tackle some new programming concepts at the same time.
I am looking to develop both clients and servers in the same language, and at the moment the target is fast-paced, multiplayer (not MMO), 3D games. Absolute requirements: high-level (i.e. functional aspects, introspection, etc.), cross-platform (Windows, Mac and Linux), access to OpenGL/DirectX, close-to-native performance. Bonus points: existing libraries for various game-development-related tasks (networking, physics/math, GUI), strong concurrency support. I not particularly worried about the marketability/popularity of the chosen language - I have solid C++, Python and Java skills to fall back on when it comes time to job hunt, and I don't have immediate plans to collaborate with other programmers on my own projects. There are a few languages that have caught my attention/interest lately: • C# - Large game development community, plenty of gamedev tools/libraries, solid track record, high-level. On the flip-side, somewhat dodgy cross-platform support (particularly Mac/OpenGL), not that many new concepts after C++ and Java. • Scala - Excellent concurrency and networking support, huge amount of software available on the JVM, excellent cross-platform support, new concepts. Unfortunately, language is relatively new and still developing rapidly, java support for OpenGL not as solid as I would like, no game development community. • D - Already somewhat familiar, strong concurrency, access to C libraries. Cons: language in flux, perennially a 'dead end' language, limited amount of software to date, very little game development, few new concepts, still suffering from a forked standard library. • And lastly (though completely out there in left field), Google go - Excellent concurrency, access to C libraries, looks like a python/C crossover, many new concepts. Cons: brand new, no support for Windows yet, no software, no game development community, not quiet 'high-level' in the way I was thinking about.
I am *not* looking to start a language war here, rather I would like to gain insight from anyone who may have used/attempted to use one of these languages in a game development setting, about benefits/pitfalls they have encountered. I welcome any general (as long as insightful/thoughtful) comments you may have on the use of these languages for game development, and I am also open to adding other languages to the list, if you know of an interesting choice that I have failed to consider. And (just in case [smile]) to forestall the cries of 'just use engine X' (where X is one of Unity3D, UDK, Ogre, etc.), I am not considering an existing engine because: a) I am not planning to go to market in the near future, and b) I am working on areas these are not explicitly designed to handle (universe scale rendering, voxel terrain, etc.).

Share this post


Link to post
Share on other sites
Advertisement
I think your critiques of your options are pretty accurate.

If you've not looked at C# after 2.0, there's some things (extension methods, co/contra variance generics, proper closures to name a few) that are "new" compared to the C++/Java world. And functional style programming has gotten a boost recently even if functions are still second class citizens. But if cross-platform is a dead-on show-stopper, that might be a problem. I've not looked at mono recently, so you'll probably need to do that evaluation yourself. That said, C# is still the language that I find provides me the least impediments to getting stuff done.

From what I've seen of Scala, it's not developing that rapidly, and should have fairly stable IDE support. I like a number of its features, but not necessarily how they're implemented syntactically (ymmv). I'm also skeptical that you'll get close to native performance due to the smallish Java open source gamedev community. If cross platform is a showstopper, I'd consider this strongly.


Though I might also throw Python into the mix (again). If performance is your only concern, some research into some of the alternative compilers might help. Perhaps even doing some development on high performance libs to replace poor performers?

Share this post


Link to post
Share on other sites
Quote:
Original post by Telastyn
But if cross-platform is a dead-on show-stopper, that might be a problem. I've not looked at mono recently, so you'll probably need to do that evaluation yourself.
Mono itself seems to work pretty fantastically, but libraries are another matter. After 8 hours I had a sort-of-working openTK, and no luck at all with Tao.* on my Mac. Cross-platform GUI toolkits (particularly with OpenGL embedding) also seemed to be an issue.

Quote:
I'm also skeptical that you'll get close to native performance due to the smallish Java open source gamedev community.
More on this under python, but basically it isn't the game-development specific portions that are slowing me down, and raw Scala performance seems solidly above Python.
Quote:
If cross platform is a showstopper, I'd consider this strongly.
Yes, and this is the reason that Scala is currently near the top of my list. I don't particularly like the syntax of scala, but the JVM still sports the best portability around, and with the recent Java2D/JoGL/Swing integration, the best GUI options as well.

Quote:
Though I might also throw Python into the mix (again). If performance is your only concern, some research into some of the alternative compilers might help.
This might help, and I haven't really looked into them. As I understand it, the primary contenders are the (very beta, last I looked) compiler from google, or the (ever unfinished) compiler based on LLVM?
Quote:
Perhaps even doing some development on high performance libs to replace poor performers?
Would that this were the problem - unfortunately, it is my experience that it isn't the libs that cause the performance issues. My rendering code is GPU-bound anyway, and all the other computationally-heavy stuff has already been bridged to C++.

Now I have things like list traversal and dictionary lookups showing up at the top of my profiler output, which is a royal pain. For instance, my scene-graph traversal (without the math and rendering, which is implemented in C++), and my entity update loop (i.e. message dispatch) are both at the top of my profiler output. I have had to employ a number of completely stupid tricks (like replacing my component/entity classes with ctypes structs) to get around basic language overhead, and it is starting to make python feel as painful as the C++.

Share this post


Link to post
Share on other sites
Quote:
Original post by swiftcoder


• And lastly (though completely out there in left field), Google go - Excellent concurrency, access to C libraries, looks like a python/C crossover, many new concepts. Cons: brand new, no support for Windows yet, no software, no game development community, not quiet 'high-level' in the way I was thinking about.



I would very much hesitate to say google go has many new concepts (welcome to 1968?). Two new at best.

Anyways I thought OpenTk was good. maybe just linux. That leaves the JVM having enough tool support to be worth its cost. Whose only two usable modern languages with good concurrency support are Scala and Clojure. Since static typing seems to be implicit in your requirements, That leaves just scala. you could try ocaml i guess, although comparatively it is lacking in tooling but has multiplatform gl support.

Share this post


Link to post
Share on other sites
Quote:
Original post by Daerax
I would very much hesitate to say google go has many new concepts (welcome to 1968?). Two new at best.
Fair enough, but some of them are definitely new to me (the lightweight-fiber concurrency model, for instance).
Quote:
Since static typing seems to be implicit in your requirements, That leaves just scala.
Static typing is not a requirement (especially coming from a python background), however, I have played around enough with Scheme/LISP to doubt my productivity with Clojure.

Share this post


Link to post
Share on other sites
I agree with all of your assessments and general inclinations. I don't really do any python development (can't stand the syntax) so I don't have enough experience to recommend compilers beyond knowing there's a (relative) bunch. And that they tend to be more varied than other languages with fairly different performance characteristics. IIRC Eve has an odd python setup that allows for good performance and scalability.

Perhaps some prototyping in scala to see how well it suits your needs then?

Share this post


Link to post
Share on other sites
I don't know about the *next* game development language, but I think that certain aspects of games will soon be written in purely functional languages. A lot of research is currently being put into automatic parallelization of functional languages, particularly Haskell. Furthermore, Haskell has a fiercely loyal community and is being funded by Microsoft, who has lots of money to throw at things. It's a difficult language, but I feel it has potential to be very useful in the right hands in the years to come.

Share this post


Link to post
Share on other sites
Quote:
Original post by swiftcoder
• Scala - Excellent concurrency and networking support, huge amount of software available on the JVM, excellent cross-platform support, new concepts. Unfortunately, language is relatively new and still developing rapidly, java support for OpenGL not as solid as I would like, no game development community.

Can't Scala seamlessly call regular Java classes? In which case what's wrong with LWJGL?

Share this post


Link to post
Share on other sites
Quote:
Original post by Daerax
you could try ocaml i guess, although comparatively it is lacking in tooling but has multiplatform gl support.
OCaml comes up on a regular basis, and it probably should be on my list. I don't know that much about it, but the opengl support looks solid, and the performance looks solid. On the flip side, the syntax quite frankly scares me, and the game development resources are not huge.
Quote:
Original post by cache_hit
A lot of research is currently being put into automatic parallelization of functional languages, particularly Haskell.
I appreciate this sentiment, but I have my doubts. Pure-functional languages have been the 'next big thing' since god knows when, and they just keep missing the mark by a little. They are great for writing parsers/compilers, transactional servers, etc. but game development I am not sure on.
Quote:
Original post by OrangyTang
Can't Scala seamlessly call regular Java classes? In which case what's wrong with LWJGL?
Good question, and I had pretty much tossed out LWJGL after the last time I looked at gamedev in Java. At the time it felt like a dead-end option compared to 'official' opengl support, and with the recent JoGL/Java2D/SWT/JavaFX integration, that opinion is only reinforced.
Quote:
Original post by Telastyn
IIRC Eve has an odd python setup that allows for good performance and scalability.
Stackless Python, ja. As I understand it, basically Python with lightweight fibers, and some related libraries. However, most of the client seems to be written in C++ - quite possibly for the same reasons I cited.

Share this post


Link to post
Share on other sites
As far as Eve goes the only thing they use C++ for is the rendering engine with a python wrapper around it. Similar to what Panda3D did. Everything else is pritty much Python. At least that is what I gathered from the CEO's speech.

As of late Mono has come a very long way. It is very solid to work in IMHO. But I am not positive about the the Game Development Library support out there. To my knowledge a lot of C# game dev libs should just work with it.

But you might want to take a look into PyPy. Python is such a fantastic language it should not leave your development without a fight.

Share this post


Link to post
Share on other sites
I know this is pretty obvious, but why not just use C++0x? Sure it's not finished, but it should be good enough for any small projects. It's a much needed C++ face-lift.

Share this post


Link to post
Share on other sites
Quote:
Original post by swiftcoder
Quote:
Original post by OrangyTang
Can't Scala seamlessly call regular Java classes? In which case what's wrong with LWJGL?
Good question, and I had pretty much tossed out LWJGL after the last time I looked at gamedev in Java. At the time it felt like a dead-end option compared to 'official' opengl support, and with the recent JoGL/Java2D/SWT/JavaFX integration, that opinion is only reinforced.

I think you're a little behind - Sun dropped Jogl recently and all of the developers have either been laid off or quit, so it's now no longer any more official than LWJGL. And of the two LWJGL is the one with the most released commercial games using it.

Add to that that JavaFX is using it's own private fork of Jogl, and that Jogl is in an awkward position in terms of support (Jogl 1 is unsupported with many long-standing bugs, whereas Jogl 2 is not backwards compatible, unfinished and alpha-quality at the moment). With AWT and Applet support LWJGL has the same amount of integration into existing apis as Jogl as well.

I think you should probably give LWJGL another try (and I should probably get around to trying Scala at some point. [grin] ).

Share this post


Link to post
Share on other sites
Quote:
Original post by blewisjr
But you might want to take a look into PyPy. Python is such a fantastic language it should not leave your development without a fight.
PyPy and Unladen Swallow are both very interesting, and both close to prime time, but I am not sure they are quite there. Each has fantastic performance in some key areas (math and string operations come to mind), and less than stellar performance in most others.
Quote:
Original post by Dae
I know this is pretty obvious, but why not just use C++0x? Sure it's not finished, but it should be good enough for any small projects. It's a much needed C++ face-lift.
Much needed, but i am not sure they take it nearly far enough. C++0x feels like a badly fitting set of bandages to cover C++'s deficiencies, and the necessity to keep backwards compatibility pretty much makes sure it will stay that way - C++0x doesn't really bring anything to the table that hasn't been available in D for some years...
Quote:
Original post by OrangyTang
I think you're a little behind - Sun dropped Jogl recently and all of the developers have either been laid off or quit, so it's now no longer any more official than LWJGL. And of the two LWJGL is the one with the most released commercial games using it.
Well, shucks. I wasn't aware that the status of Java openGl had changed yet again - what in hell is Java2D running on then?
Quote:
With AWT and Applet support LWJGL has the same amount of integration into existing apis as Jogl as well.
The primary advantage of JoGL to my mind, was the ability to embed Swing *within* OpenGL (i.e. render a full Swing GUI to an FBO), as well as the reverse. As I understand it, LWJGL supports the latter but not the former, although I would be happy to be corrected...

Edit: There are however workarounds, which might make it workable for me - Although it looks like Swing has to be un-accelerated in this case, so the performance penalty is likely to be pretty high.

[Edited by - swiftcoder on December 5, 2009 10:08:38 AM]

Share this post


Link to post
Share on other sites
Have you considered OOC? http://ooc-lang.org

I don't know much of it, but it seems to be a nice mixture between low-level and high-level languages.

Share this post


Link to post
Share on other sites
Quote:
Original post by swiftcoder
I appreciate this sentiment, but I have my doubts. Pure-functional languages have been the 'next big thing' since god knows when, and they just keep missing the mark by a little. They are great for writing parsers/compilers, transactional servers, etc. but game development I am not sure on.


Oh don't get me wrong, I have my doubts too. It's one of those things that looks great on paper, and it *could* materialize if all the stars line up right, and for that matter it should materialize. But just like Duke Nukem Forever, who really knows?

Tim Sweeney has recently started pushing functional programming languages pretty hard. The main thing holding it back is that there's nobody willing to take the leap and just jump in heads first and try to do anything serious on a game with it. Hopefully Tim changes that, as he certainly has the backing to make it happen, even if it doesn't work out.

http://www.google.com/url?sa=t&source=web&ct=res&cd=4&ved=0CBEQFjAD&url=http%3A%2F%2Fwww.cs.princeton.edu%2F~dpw%2Fpopl%2F06%2FTim-POPL.ppt&rct=j&q=tim+sweeney+functional&ei=b6QaS9efJovgMYy38OoC&usg=AFQjCNH1lYwuSG7QJy3ShTC6uRB2biG-ag


There has to be collaboration from the industry if it's going to evolve into a language useful for game development. It looks like he's the right person to make that happen, although if it ultimately doesn't end up materializing, I wouldn't be that surprised.


But you know, Moore's Law is only going to take us so far. Eventually all this additional levels of abstraction (see, for example, LINQ) are going to catch up to us and developers will have to look at alternate ways of writing fast code. Parallelization is the future, even if it means an entirely different computer architecture that allows developers to more easily write parallel code. In that respect, imperative languages are practically at a dead-end with nowhere to go. You will never, ever be able to take full advantage of a highly parallel machine using an imperative language. And once Moore's Law catches up to us, parallel is going to be the only place to turn to for more performance.


So basically what I'm saying is, eventually game developers will be using a language that can be automatically parallelized. Currently the most likely candidate for that is a purely functional language, and among purely functional languages, Haskell is the most likely candidate. But we could be talking about 20 years from now, which is plenty of time for a brand new language to come along.

Share this post


Link to post
Share on other sites
Quote:
Original post by swiftcoder
Well, shucks. I wasn't aware that the status of Java openGl had changed yet again - what in hell is Java2D running on then?

J2D has always had it's own backends, unrelated to Jogl. IIRC these days they've got both a D3D and OpenGL backend, although which one will be used depends on your OS and hardware config.

Quote:
The primary advantage of JoGL to my mind, was the ability to embed Swing *within* OpenGL (i.e. render a full Swing GUI to an FBO), as well as the reverse. As I understand it, LWJGL supports the latter but not the former, although I would be happy to be corrected...

Edit: There are however workarounds, which might make it workable for me - Although it looks like Swing has to be un-accelerated in this case, so the performance penalty is likely to be pretty high.

I believe performance is actually not bad, but personally I'd use a proper OpenGL gui toolkit rather than trying to crowbar Swing into somewhere it's not designed. Off the top of my head there's TWL and Nifty GUI, both under active development.

Share this post


Link to post
Share on other sites
Quote:
Original post by bronxbomber92
Have you considered OOC? http://ooc-lang.org I don't know much of it, but it seems to be a nice mixture between low-level and high-level languages.
That one looks to fall in roughly the same category as Google Go: systems programming with high-level features, and similarly new and as-yet not adopted widely. Still worth keeping an eye on though, so thanks for the link!
Quote:
Original post by cache_hit
So basically what I'm saying is, eventually game developers will be using a language that can be automatically parallelized.
I basically agree, but I am not so sure that pure functional languages are the most likely route. Definitely the future needs different languages, but I have a gut feeling that we are going to end up with some ungodly hybrid of Google Go attached to OpenCL/CUDA [smile]
Quote:
Original post by OrangyTang
I believe performance is actually not bad, but personally I'd use a proper OpenGL gui toolkit rather than trying to crowbar Swing into somewhere it's not designed.
For the (generally light) in-game GUI needs I agree with you. However, for tool development I am fond of the concept of heavy-weight GUI toolkits pulled into the 3D world (as with Qt or Awesomium in C++). Among other things, access to the standard GUI design tools and plugin systems makes larger tasks vastly easier.

Share this post


Link to post
Share on other sites
My perfect setup:

Client: Python/Python Stackless with Ogre3d bindings for the client. Then all graphics execute in C++ speed and the client logic in short and easy understandable Python code.

Servers: Erlang, brings concurrency, fault-tolerance and distribution.

Share this post


Link to post
Share on other sites
Quote:
Original post by flodihn
Client: Python/Python Stackless with Ogre3d bindings for the client. Then all graphics execute in C++ speed and the client logic in short and easy understandable Python code.
Unfortunately, if I bring a C++ rendering engine in, then a lot of my code has to be C++ as well, as I am implementing a lot of (essential) graphics features. This is roughly the setup I am using now, and I would like to move away from the C++.
Quote:
Servers: Erlang, brings concurrency, fault-tolerance and distribution.
I don't want different languages on the client and server. I know it is a common route to take (probably inspired by web architectures), but with languages like Scala and C#, there really isn't a need to do this, and my opinion is that using one language throughout reduces maintenance by a good deal.

Share this post


Link to post
Share on other sites
Quote:
Original post by swiftcoder
Quote:
Original post by Daerax
you could try ocaml i guess, although comparatively it is lacking in tooling but has multiplatform gl support.
OCaml comes up on a regular basis, and it probably should be on my list. I don't know that much about it, but the opengl support looks solid, and the performance looks solid. On the flip side, the syntax quite frankly scares me, and the game development resources are not huge.


I'm surprised this hasn't been mentioned already but have you considered F#? i don't know if you know anything about it yet but it's an OCaml derivative targeting .NET. It's type system isn't as expressive as haskell's (but neither is many others) and it does not support some of the more advance features of OCaml but it has deviated from OCaml with features it has that OCaml doesn't it also has an alternative syntax (which is the default now) that is clean, more pleasant and is indentation based (like Haskell and Pyhton), it's becoming a very stable language. It's an official MS backed .NET language and is part of the visual studio family starting from 2010, you have IDE integration (with interactive script support) for both 2010 & 2008. it targets .NET so you have a wealth of libraries and information.

You have bindings for directx 9, 10, and 11 with SlimDX.
You have bindings for OpenGL, SDL and various other useful C libraries for game dev with the Tao framework. It's quite easy to write C/C++ bindings for .NET using P/invoke or C++/CLI. F# with XNA and works on the xbox360. F# has support for mono.

The only thing you need to be concerned about with game dev using F# & .NET in general is careful use of the garbage collector. Check out this

[Edited by - snk_kid on December 6, 2009 4:17:03 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by snk_kid
I'm surprised this hasn't been mentioned already but have you considered F#?
I hadn't, actually. Having spent a little time browsing popular CLR languages, it looks like a pretty good choice.
Quote:
You have bindings for OpenGL and various other useful C libraries for game dev with the Tao framework. It's quite easy to write C/C++ bindings for .NET using P/invoke or C++/CLI.
This is my largest sticking point for all CLR languages. Unfortunately, the Mac distributions of both Tao and OpenTK are in a miserable state (at least as of a few weeks ago, when I gave them both the old college try).

I know that I could bring one or both of those libraries up to speed on the Mac in a couple of weeks, or implement my own alternative in a couple of days, but the fact that nobody has done so to date is a major issue in my mind.
Quote:
The only thing you need to be concerned about with game dev using F# & .NET in general is careful use of the garbage collector. Check out this
I am a tad concerned about this article, but I am guessing that his advice applies primarily to the XBox - whereas I am targeting exclusively PC platforms. After some years of work in Java, I have never seen the garbage collector pose a significant performance problem, and i doubt that .NET is that much less efficient.



If I can get hold of a working CLR platform abstraction library, I should probably add Boo to the list as well - statically typed python-clone on the CLR, with suitably improved performance, plus niceties such as method overloading. The only downside I can see is that it is relatively new.



After some experimentation with Scala, I am still very ambivalent about the language. I love JoGL, Swing and their integration together, which is a big plus for the JVM in general. I like some aspects of the language (static duck typing, the dubiously-useful pass by name, traits, singleton objects, etc.) but the syntax feels very forced in places, the type inference is terrible, and the 'ten ways to skin a cat' approach to just about everything leaves one a little confused.

Share this post


Link to post
Share on other sites
The only real problem with F# in terms of its garbage collector is that it's still in its infancy. As the .NET Framework becomes more advanced, and as the language itself goes through a few iterations, you will see substantial performance improvements. I used F# extensively during the CTP but haven't used it much since. I like it a lot, but performance was always a concern. It was usually at least twice as slow as optimized C# code. It's great for expressing difficult algorithms, but I'd use C# for anything performance critical. Well, really I'd use C++ for anything performance critical, but I assume you want a single platform.

Share this post


Link to post
Share on other sites
Quote:
Original post by cache_hit
The only real problem with F# in terms of its garbage collector is that it's still in its infancy. As the .NET Framework becomes more advanced, and as the language itself goes through a few iterations, you will see substantial performance improvements. I used F# extensively during the CTP but haven't used it much since. I like it a lot, but performance was always a concern. It was usually at least twice as slow as optimized C# code. It's great for expressing difficult algorithms, but I'd use C# for anything performance critical. Well, really I'd use C++ for anything performance critical, but I assume you want a single platform.


Which CTP are you talking about? there are few of them from quite a while back and one released quite recently. It will also depend on the problem and how you write your solution compared to the C# version, compiler flags, etc. I've also seen benchmarks that show F# programs to be virtually the same performance as C# programs like this recent blog.

Share this post


Link to post
Share on other sites
Quote:
Original post by snk_kid
Quote:
Original post by cache_hit
The only real problem with F# in terms of its garbage collector is that it's still in its infancy. As the .NET Framework becomes more advanced, and as the language itself goes through a few iterations, you will see substantial performance improvements. I used F# extensively during the CTP but haven't used it much since. I like it a lot, but performance was always a concern. It was usually at least twice as slow as optimized C# code. It's great for expressing difficult algorithms, but I'd use C# for anything performance critical. Well, really I'd use C++ for anything performance critical, but I assume you want a single platform.


Which CTP are you talking about? there are few of them from quite a while back and one released quite recently. It will also depend on the problem and how you write your solution compared to the C# version, etc. I've also seen benchmarks that show F# programs to be virtually the same performance as C# programs like this recent blog.


It was the most recent CTP. It wasn't slower for everything, but there were certain things (I don't remember what specifically anymore) that were just always very slow, and the dev team acknowledged them on a number of occasions. It might have been fixed for the final release though, I haven't used it in a while. For certain types of applications you could get comparable performance, but you had to be really careful, and it was harder to profile than C# code to figure out where the problems were due to the fact that more was going on behind the scenes.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Tags

  • Advertisement
  • Popular Now

  • Similar Content

    • By Florencia Sylvester Anelli
      Hi everyone! I've developed a game called The Last Dog (ZOMBIES + DOGS) and was wondering if you could give it a try in order for me to analyse your behaviour in analytics. Give it a shot! Please download it here: https://florsyl.wixsite.com/thelastdog2 and let me know if you detect any bugs. VIDEO.3gp
       

       
       
    • By Manuel Berger
      Hello fellow devs!
      Once again I started working on an 2D adventure game and right now I'm doing the character-movement/animation. I'm not a big math guy and I was happy about my solution, but soon I realized that it's flawed.
      My player has 5 walking-animations, mirrored for the left side: up, upright, right, downright, down. With the atan2 function I get the angle between player and destination. To get an index from 0 to 4, I divide PI by 5 and see how many times it goes into the player-destination angle.

      In Pseudo-Code:
      angle = atan2(destination.x - player.x, destination.y - player.y) //swapped y and x to get mirrored angle around the y axis
      index = (int) (angle / (PI / 5));
      PlayAnimation(index); //0 = up, 1 = up_right, 2 = right, 3 = down_right, 4 = down

      Besides the fact that when angle is equal to PI it produces an index of 5, this works like a charm. Or at least I thought so at first. When I tested it, I realized that the up and down animation is playing more often than the others, which is pretty logical, since they have double the angle.

      What I'm trying to achieve is something like this, but with equal angles, so that up and down has the same range as all other directions.

      I can't get my head around it. Any suggestions? Is the whole approach doomed?

      Thank you in advance for any input!
       
    • By devbyskc
      Hi Everyone,
      Like most here, I'm a newbie but have been dabbling with game development for a few years. I am currently working full-time overseas and learning the craft in my spare time. It's been a long but highly rewarding adventure. Much of my time has been spent working through tutorials. In all of them, as well as my own attempts at development, I used the audio files supplied by the tutorial author, or obtained from one of the numerous sites online. I am working solo, and will be for a while, so I don't want to get too wrapped up with any one skill set. Regarding audio, the files I've found and used are good for what I was doing at the time. However I would now like to try my hand at customizing the audio more. My game engine of choice is Unity and it has an audio mixer built in that I have experimented with following their tutorials. I have obtained a great book called Game Audio Development with Unity 5.x that I am working through. Half way through the book it introduces using FMOD to supplement the Unity Audio Mixer. Later in the book, the author introduces Reaper (a very popular DAW) as an external program to compose and mix music to be integrated with Unity. I did some research on DAWs and quickly became overwhelmed. Much of what I found was geared toward professional sound engineers and sound designers. I am in no way trying or even thinking about getting to that level. All I want to be able to do is take a music file, and tweak it some to get the sound I want for my game. I've played with Audacity as well, but it didn't seem to fit the bill. So that is why I am looking at a better quality DAW. Since being solo, I am also under a budget contraint. So of all the DAW software out there, I am considering Reaper or Presonus Studio One due to their pricing. My question is, is investing the time to learn about using a DAW to tweak a sound file worth it? Are there any solo developers currently using a DAW as part of their overall workflow? If so, which one? I've also come across Fabric which is a Unity plug-in that enhances the built-in audio mixer. Would that be a better alternative?
      I know this is long, and maybe I haven't communicated well in trying to be brief. But any advice from the gurus/vets would be greatly appreciated. I've leaned so much and had a lot of fun in the process. BTW, I am also a senior citizen (I cut my programming teeth back using punch cards and Structured Basic when it first came out). If anyone needs more clarification of what I am trying to accomplish please let me know.  Thanks in advance for any assistance/advice.
    • By Yosef BenSadon
      Hi , I was considering this start up http://adshir.com/, for investment and i would like a little bit of feedback on what the developers community think about the technology.
      So far what they have is a demo that runs in real time on a Tablet at over 60FPS, it runs locally on the  integrated GPU of the i7 . They have a 20 000 triangles  dinosaur that looks impressive,  better than anything i saw on a mobile device, with reflections and shadows looking very close to what they would look in the real world. They achieved this thanks to a  new algorithm of a rendering technique called Path tracing/Ray tracing, that  is very demanding and so far it is done mostly for static images.
      From what i checked around there is no real option for real time ray tracing (60 FPS on consumer devices). There was imagination technologies that were supposed to release a chip that supports real time ray tracing, but i did not found they had a product in the market or even if the technology is finished as their last demo  i found was with a PC.  The other one is OTOY with their brigade engine that is still not released and if i understand well is more a cloud solution than in hardware solution .
      Would there  be a sizable  interest in the developers community in having such a product as a plug-in for existing game engines?  How important  is Ray tracing to the  future of high end real time graphics?
    • By bryandalo
      Good day,

      I just wanted to share our casual game that is available for android.

      Description: Fight your way from the ravenous plant monster for survival through flips. The rules are simple, drag and release your phone screen. Improve your skills and show it to your friends with the games quirky ranks. Select an array of characters using the orb you acquire throughout the game.

      Download: https://play.google.com/store/apps/details?id=com.HellmodeGames.FlipEscape&hl=en
       
      Trailer: 
       
  • Advertisement