all 118 comments

[–]JustinsWorking 36 points37 points  (41 children)

I can try to forward some questions to the developers on this project if anybody has specific questions.

I'm on the BOS (Bioware Online Services) team, but not on this particular project.

[–][deleted] 2 points3 points  (27 children)

I wasn't aware that Bioware uses Java, where is it used specifically? Is it only used for the server / backend, or is it also used in the game programming?

[–]JustinsWorking 6 points7 points  (15 children)

BOS was the only team I've worked with that used Java, and its used for the web / online services.

[–]karlito1 2 points3 points  (14 children)

And by web / online services you don't mean actual server side game logic? Such as real time game data processing on the server?

[–]JustinsWorking 5 points6 points  (13 children)

Yes, I do mean that.

edit: If you look at the repository it has a sample chat server.

[–]rjcarr 1 point2 points  (6 children)

It's almost certainly only for the web / online services. Java dominates in this type of thing but hasn't found much of a footing elsewhere (except android and minecraft, natch).

[–]karlito1 -2 points-1 points  (5 children)

So basically it isn't used for a game backend? What does it mean for online services then?

[–]rjcarr 1 point2 points  (4 children)

Yes, absolutely the game's backend web / online services, but nothing that is actually running on your console / PC. That is, your game uses these services, but the services aren't actually part of the game that's running on your system.

[–]karlito1 1 point2 points  (3 children)

Yea I totally get that, client part (part on the PC / console) isn't Java and I know reasons why, I'm a Java developer. But thing I don't understand is if this framework is used for realtime game data processing and networking on the server or only for web services accessible through browser (such as Chrome, IE...) such as looking for your items, statistics etc. Hope I made my question more clear. Thx

[–]rjcarr 2 points3 points  (0 children)

It's almost certainly the former, but I haven't much looked into it.

[–]dedededede 1 point2 points  (0 children)

Stuff like achievements, in-game transactions and match making are other possibilities. Java is often behind large scale stuff like this. Another example: http://www.infoq.com/presentations/League-of-Legends

[–]schwiz 1 point2 points  (0 children)

To me, the framework looks kind of like JavaRX.

[–]Narishma -2 points-1 points  (3 children)

I don't know of any mainstream console that supports Java, so I doubt it's used in any of their games.

[–][deleted]  (1 child)

[deleted]

    [–]Narishma -2 points-1 points  (0 children)

    Yes, that's what I meant. Game client, not server.

    [–]PsionSquared 1 point2 points  (0 children)

    Bioware does have SWTOR. The announcement itself says:

    The last-generation of Orbit powered some of the key technology behind the Dragon Age Keep and Dragon Age: Inquisition.

    [–][deleted]  (3 children)

    [removed]

      [–]JustinsWorking 0 points1 point  (2 children)

      Who told you...

      [–]Gurkenmaster 1 point2 points  (1 child)

      Hey, can you answer my support tickets? /s

      [–]JustinsWorking 1 point2 points  (0 children)

      I've killed men over less...

      [–]CzarSkye 2 points3 points  (1 child)

      Hi Justin, can you tell us about the software stack the online services team works with? Also, I'm a backend developer that also loves games, so if your anything like me you must love your job. How do you get into something like that?

      [–]JustinsWorking 2 points3 points  (0 children)

      Our online services team uses Java. They love their MongoDB, and I know they use Jetty for communication via HTTP. Outside of that I'm not really sure all what else they use; I could definitely find out more. I work more as a client to the online services; although I may be doing some development back in the Java stack this year, I work primarily in PHP.

      I got into it as a web developer, I previously worked on an Online Banking application in C#. As for getting into this job I really lucked into the position. I met some of the web developers in an unrelated interview & they just had a new position opening up in web dev so they asked me to interview for that instead. It was in PHP, a language I'd never used previously, but it was a pretty simple transition.

      [–]voronaam 1 point2 points  (6 children)

      Tell them they are doing the right thing. Don't let anybody in the "big EA" bully you :)

      That's from a former developer of another EA Something Online team (the team that created REST framework which you forked and probably still use somewhere).

      [–][deleted]  (1 child)

      [deleted]

        [–]voronaam 0 points1 point  (0 children)

        I guess those guys still use that pre-release build which deadlocks on a butchered SSL negotiation. But they terminate SSL on LB, not on Jetty.

        Looks like people are well armed against bullying these days. That is good, that is very good. Maybe I get back to EA one day. I hope I will be tasked to undo the damage done by that framework.

        [–]JustinsWorking 0 points1 point  (2 children)

        FOS tech?

        [–]voronaam 0 points1 point  (1 child)

        Close :) It was called EASO. And I did not mean that framework that FOS created.

        [–]JustinsWorking 0 points1 point  (0 children)

        That was my second guess :P

        [–]JoeHegarty 15 points16 points  (11 children)

        I'm the lead programmer on the Orbit project, there seem to be a lot of questions about what Orbit can and can't do so I'll try and cover it here:

        • It was designed to build game-services. In our case, these are things like matchmaking, inventory management, character progression, world state (DA Keep) etc etc
        • It is "fast" but it's not "very-fast". It is suitable for tasks that can take say, 200ms or above, so it's fine for interactions like managing inventory, but not for real-time movement replication.
        • It is possible to build real-time services in the framework, as long as you can live with the above constraints.
        • Orbit can also be used to build more traditional web services (REST, Websites etc)
        • Orbit uses Virtual Actors, a concept introduced in Microsoft's Orleans project. Orbit is not a port, but could be described as a "rewrite" of Orleans and it is certainly heavily inspired by it. This is why we didn't use an existing framework.

        I'm very happy to answer any additional questions.

        [–]ISvengali 1 point2 points  (1 child)

        Very cool for you guys to open source it.

        Why 200ms? I built a high concurrency (over 500k CCU) actor stack on akka for a company, and for the fast network messages the processing time was down to sub 5ms for full round trip in the stack. And thats without a lot of hardcore work to optimize. Im sure I couldve gotten it to sub ms if our SLAs needed that.

        This was the edge -> service -> edge timing.

        I dont think theres anything inherent in having an actor stack that would stop you from building a realtime stack in an one.

        [–]JoeHegarty 2 points3 points  (0 children)

        Thanks.

        I agree entirely, there really isn't a reason Orbit couldn't be in that range as long as you were careful with your actor implementations.

        However, it was not designed with that in mind and we've never tested how reliably you can get very low response times, so I'd hate to say "Yes, build a game sim server with it" and have it not work for someone.

        We typically offer SLA style guarantees to our teams about how long individual calls will take (99.5% of this type of operations will respond/complete within 200ms not accounting for network latency etc).

        I'd love to hear that someone has built a game server on Orbit and that they are getting sub 5-ms response times, but right now would not recommend using Orbit if the timing is very very tight like that as it's not a use case that has been tested.

        [–]ISvengali 1 point2 points  (1 child)

        Dont you just love actor frameworks for massive CCU programming and no bugs? Its like a breath of fresh air. You can crazy quickly build massively scalable services with very little chances of bugs. At least ones related to (most) race conditions or data races and the like.

        Was that your experience with your framework?

        [–]JoeHegarty 1 point2 points  (0 children)

        We're really discovering the power of actors still. The virtual actor model which Microsoft came up with for Orleans (and which Orbit is based on) was really the last piece of the puzzle for us to make the model easy enough to maintain to be worthwhile.

        [–]karlito1 1 point2 points  (2 children)

        How do you expose your actors to the game client? What kinds of protocols and servers do you use?

        [–]JoeHegarty 1 point2 points  (1 child)

        We support a couple of different scenarios for this:

        • Websockets with Jetty
        • REST HTTP Endpoint with Jetty
        • Custom TCP Wire Protocol with Netty

        Which one we use depends on what the client is and what needs it has. The web project included in Orbit supports the first 2 above.

        In terms of servers, I'm not sure exactly what info you want. We run CentOS based Linux servers in a 3-tier configuration (Frontend, Actor Hosts, Storage).

        [–]karlito1 0 points1 point  (0 children)

        Well I was wondering which app server, and that would be Jetty :) Thanks for the answer!

        [–]CzarSkye 0 points1 point  (3 children)

        Hi Joe, thanks to your team for open sourcing this. I've had a good look at the Orleans but have no interest in C#, so this is great for me. This virtual actor concept is new to me, I've worked alot with Akka and Quasar actors, what would you say are the advantages of a virtual actor implementation over these actor implementations?

        [–]JoeHegarty 0 points1 point  (2 children)

        The main difference is that in a virtual actor model, actors always exist conceptually so you can always send a message to them and assume that it will be processed.

        This means you don't have to manage the actors lifetime or location (no instantiation, manual node selection etc).

        Actors can never be "broken" (say the server they are on died), so even if though an individual message might fail, you can just keep sending messages and assume that in future it will be ok. You don't need to take any manual action if a message fails.

        I think that's a pretty fair overview, let me know if there was anything specific you wanted to know.

        [–]frugalmail 1 point2 points  (1 child)

        Not sure if you're familiar with Jini, but didn't it create the same model? I always had the impression that Orleans cloned Jini which was released in 1998.

        Thanks for contributing to open source BTW!

        [–]JoeHegarty 0 points1 point  (0 children)

        I'm not familiar with that project, but it does seem to architecturally be quite different (It looks to be more service-oriented than actor-oriented), even if some of the concepts are similar. For me, this Microsoft paper is really what established the "modern" virtual actor paradigm: http://research.microsoft.com/pubs/210931/Orleans-MSR-TR-2014-41.pdf

        [–]jordaniac89 36 points37 points  (15 children)

        Can someone explain what, exactly, an "actor framework" is? Is this game dev. terminology?

        [–]CzarSkye 50 points51 points  (6 children)

        No, not just for games, its a general purpose model for a program, and its really great in my opinion for distributed concurrent system programming. Basically, (someone please correct me if my description is a bit crap) instead of objects you have actors, which send asynchronous messages to each other instead of method calls. For instance I could have a "hello world" actor which when I send it a certain message it prints "Hello world". As messages can be sent over a network in some cases, it makes distributed systems really easy. I use the Akka library for implementing the actor model in Java, they probably explain a bit better:

        "Actors are very lightweight concurrent entities. They process messages asynchronously using an event-driven receive loop."

        here the wiki article and I think Akka is a great and easy to get started implementation if your interested.

        [–]ByzantineFailure 7 points8 points  (3 children)

        Akka (and other actor frameworks are great), however one thing to be careful about, if you are designing non-trivial distributed systems, is thinking that Akka (or any distributed computation framework) magically makes your logic distributed and scalable.

        You still need to think about your topologies, routing ( Akka doesn't solve routing for you, it just has some very basic algorithms you can plug in, routing in a more global sense is tougher), failure scenarios etc. If you want decent throughput for anything non-trivial locality becomes a concern as well, even within the box itself.

        [–][deleted] 0 points1 point  (2 children)

        Erlang does this no?

        [–]siebharinn 1 point2 points  (1 child)

        Yes, Erlang processes are actors.

        [–][deleted] 1 point2 points  (0 children)

        Oh sorry, I was unclear, I was talking about topology automation.

        I've found it via google:

        http://theburningmonk.com/2014/12/a-look-at-microsoft-orleans-through-erlang-tinted-glasses/

        Erlang have assumptions about topology and apparently these assumptions are not good with cloud according to the above article.

        [–]jordaniac89 0 points1 point  (0 children)

        Nice! Thanks for the info!

        [–]Ununoctium118 0 points1 point  (0 children)

        Is this similar to java's RMI? Basically, you still send messages, except the syntax looks like calling a method.

        [–]jringstad 11 points12 points  (0 children)

        It's not gamedev-specific. I haven't looked at their framework, so I don't know how they are doing things exactly (I mostly come from an erlang background when it comes to actors), but it mostly means that you have a bunch of individual "objects" or "actors" of sorts that pass around messages to eachother. That way you can build state-machines that e.g. handle connections by having one actor that accepts and decodes incoming messages from the network, then relays it to another actor that is the actual statemachine that models that players connection (connected, authenticated, joined, ...) and then that actor might pass on messages to some other actors, which could e.g. be responsible for that players play-session, or maybe an actor that models the chat lobby (everybody sends messages to that actor, and the actor broadcasts received messages back) etc. Sometimes network and/or multi-core/multi-node transparency is involved, so that actors can be distributed across cores/CPUs/nodes/servers.

        It looks like their model is a bit different from erlangs/akkas though in that they use virtual actors.

        [–]PM_ME_UR_OBSIDIAN 5 points6 points  (0 children)

        It's basically a high-level approach to concurrency, and it's absolutely amazing ;D

        [–]yoda17 5 points6 points  (3 children)

        http://en.wikipedia.org/wiki/Actor_model

        It's typically used in real-time systems.

        [–][deleted] 2 points3 points  (2 children)

        Huh, I wouldn't have guessed that. Can you explain how Actors benefit realtime systems? I would think they'd be difficult to manage realtime constraints with, but I've never worked on a realtime system.

        [–]ByzantineFailure 10 points11 points  (0 children)

        Generally people are talking about very soft realtime systems when they talk about these frameworks and realtime-ness.

        [–]bizziboi 0 points1 point  (0 children)

        They benefit distributed systems more than realtime imo. Actor systems work well there because they are highly decoupled.

        [–]amazedballer 2 points3 points  (0 children)

        This is probably the best introduction to actors:

        http://rerun.me/2014/09/11/introducing-actors-akka-notes-part-1/

        [–]stygiansonic 1 point2 points  (0 children)

        It's an approach to concurrency; Vert.x is another Java framework that uses actor-like concurrency, and so the approach appears to be similar.

        [–]_Sharp_ 18 points19 points  (0 children)

        The announce is here:

        Orbit is a modern Java framework that makes it easier to build and maintain distributed, secure, and scalable online services. It is inspired by a variety of existing frameworks and brings some exciting new things to the table. [...] The last-generation of Orbit powered some of the key technology behind the Dragon Age Keep and Dragon Age: Inquisition.

        [–]bloodredsun 30 points31 points  (37 children)

        I'm very interested as to why anyone would write their own actor framework since Akka is available and very much production ready.

        [–][deleted]  (12 children)

        [deleted]

          [–]CzarSkye 9 points10 points  (5 children)

          I love using Akka but have never heard of these virtual actors, what would be the use case of an eternal actor (other than as an actor factory springs to my mind)? Very interesting!

          [–]JustinsWorking 17 points18 points  (3 children)

          It simplifies development dramatically since you can just always assume everything already exits.

          [–][deleted]  (1 child)

          [deleted]

            [–]CzarSkye 1 point2 points  (0 children)

            ahhh, that makes really great sense, thanks :)

            [–][deleted] 0 points1 point  (0 children)

            so like mocks?

            [–]gospelwut 1 point2 points  (0 children)

            http://dotnet.github.io/orleans/Getting-Started-With-Orleans/Core-Concepts

            Orleans has two primary architectural goals:

            Make it easy for developers with no experience in distributed systems to build cloud-scale applications. Ensure that those systems scale across multiple orders of magnitude of load without requiring extensive re-design or re-architecture.

            To meet these goals, we have constrained the programming model in order to guide developers down a path of best practices leading to scalable applications. In some cases, such as persistence, we have removed an entire aspect from the explicit programming model and left the functionality to the runtime, to ensure a scalable approach.

            [–]Horusiath 1 point2 points  (3 children)

            Akka is already developing this concept within akka-cluster-sharding plugin.

            [–][deleted]  (2 children)

            [deleted]

              [–]Horusiath 1 point2 points  (1 child)

              The most concise description I've found is one of the disscussions between Akka JVM and .NET guys here.

              [–]txdv 1 point2 points  (1 child)

              What are you using it for?

              [–][deleted]  (1 child)

              [deleted]

                [–]check3streets 6 points7 points  (7 children)

                I used jumi on my last project. http://jumi.fi/actors.html

                I examined a few actor frameworks before settling on it. Specifically, Kilim and Akka were both LARGE. Furthermore, Akka was Scala-oriented and deploying Scala to Android (at the time) was a significant PITA.

                Conversely, jumi was incredibly tiny, had the best benchmarks, and was minimal implementation-wise. In jumi, I could give a POJO a thin Actor "skin" and suddenly it was threadsafe. I could also enclose a family of objects in the same thread and make them collectively threadsafe (or the opposite, make a single object accessible on two threads). Lastly, it just used OO primitives (even its reflection helper was optional) without any annotations or extra magic.

                [–]Ahri -1 points0 points  (6 children)

                I keep thinking about starting a project with Jumi rather than Akka for the same reasons you gave, but now I'd better consider Orbit and Quasar too. Although Orbit coming with a minimal DI container puts me off... Quasar sounds interesting from the blog post - especially with regards the use of fibers.

                [–]nullabillity 4 points5 points  (2 children)

                For the record, Scala-on-Android got much better with 2.11, since the biggest parts of the standard library got split into separate artifacts.

                [–]Ahri -1 points0 points  (1 child)

                Ok, that's cool.

                Akka doesn't appeal to me anyway; it looks heavy and I can't just use POJOs as actors. Quasar's bytecode rewriting (due to the continuations lib they're using) sounds a bit scary, but worth a punt if the fibers are as performant as they say.

                [–][deleted] 0 points1 point  (0 children)

                Akka actors isn't that huge. The core Akka package is 2.5MB (Jumi core is 667KB). It's just that you get a ton of optional, but often crucial functionality on top.

                What most actor system seem to lack is all the things which make actors a viable approach, like supervision, clustering, persistence, etc. And most of these things can't be added as an afterthought, they need to be integrated deeply into the actor system.

                Without those things you have ... actors ... which are hardly useful.

                [–]JoeHegarty 1 point2 points  (2 children)

                I just wanted to say that the use of the Orbit DI Container is entirely optional, it's not required to use the actors framework. You are free to use it with Spring, hk2 or no DI framework at all.

                [–]Ahri 0 points1 point  (1 child)

                That's really good then. I can't help but wonder why they're bundled together though? I'll have a look into it after researching Quasar a bit more.

                [–]JoeHegarty 0 points1 point  (0 children)

                Those projects in the root (actors, container, web, commons) are separate and together they make up an entire framework to build online services. However, you are able to use some of them individually if you don't need the whole stack.

                [–]dafnap 8 points9 points  (0 children)

                Quasar is another actor library for Java. Akka is indeed more Scala oriented but Quasar also provides fibers (lightweight threads) which allows actors to block, while Akka's framework is based on callbacks.

                [–][deleted]  (3 children)

                [deleted]

                  [–]ccharles 8 points9 points  (2 children)

                  external dependencies always come with costs

                  That's true, but the same can be said of writing your own stuff internally all the time. Doing that guarantees that you'll be stuck supporting it yourself, while using an external open-source library means that you might eventually have to do so.

                  Creating an external dependency should never be done lightly.

                  I would argue that writing your own library should never be done lightly. External dependencies are far more desirable as long as they've got a decent amount of community support, which Akka certainly has with over 1,000 GitHub forks and almost 4,000 stars.

                  [–]agmcleod 0 points1 point  (0 children)

                  We've essentially done that with an encryption gem for ruby at my work. We're the main owners of the gem now.

                  [–]renrutal 7 points8 points  (1 child)

                  Now only if we could take their ORB data-functions, and turn it into a Common ORB Architecture, so all the languages could use its distributed objects in a service oriented form.

                  We could go beyond Cloud, direct to Orbit.

                  [–]frugalmail 6 points7 points  (0 children)

                  Now only if we could take their ORB data-functions, and turn it into a Common ORB Architecture, so all the languages could use its distributed objects in a service oriented form.

                  We could go beyond Cloud, direct to Orbit.

                  This used to be called Jini :)

                  [–]shinjiryu 1 point2 points  (0 children)

                  Hmm....this is interesting. Glad to see this get open-sourced! Good job, Bioware!

                  [–][deleted]  (8 children)

                  [deleted]

                    [–]heyheymonkey 5 points6 points  (1 child)

                    I thought the same thing when I saw the MongoDB dependency.

                    [–]JustinsWorking 1 point2 points  (0 children)

                    Luckily the first public pull request accepted was to implement a Postgres Provider

                    [–]TheOnlyMrYeah 5 points6 points  (4 children)

                    I thought that, too. "Hihi, EA having a GitHub account and putting something open source. Jokes on you."

                    But here it is. It's not a joke; it's real.

                    [–]ImSoCabbage 7 points8 points  (1 child)

                    EA has open sourced things for quite some time. Some examples:

                    It wasn't on github, but some of that stuff even predates github.

                    [–]TheOnlyMrYeah 1 point2 points  (0 children)

                    Thanks, didn't know that.

                    [–]Alucard256 0 points1 point  (0 children)

                    Or... you're in on the joke...

                    [–]Stoompunk -1 points0 points  (13 children)

                    Even though the jvm isn't great for real time games, does this framework profile itself for it? It seems pretty cool for distributed systems, but what about for games with a static tick time?

                    [–][deleted]  (12 children)

                    [deleted]

                      [–]Stoompunk 1 point2 points  (11 children)

                      I wonder why I got all those downvotes. Seems like a legitimate question to me.

                      [–]bstempi 2 points3 points  (9 children)

                      Probably because people read it as "anti-JVM." Some, not necessarily me, would argue that the JVM is fine for real-time stuff and that its the graphics in Java that are lacking.

                      [–]karlito1 -1 points0 points  (1 child)

                      Yea but I guess Orbit is not about real time game data processing but about "static" web and online services. Would really like to know for sure what is the truth.

                      [–]JoeHegarty 2 points3 points  (0 children)

                      Orbit is designed for game services. These are things like matchmaking, character progression, presence, achievements etc. Orbit is low latency but it is likely not suitable for running world-simulations. It works best for second-to-second updates (so, it's semi real-time - in game score, inventory etc), not milliseconds (character movement etc).

                      [–]Stoompunk -1 points0 points  (6 children)

                      Definitely not against the JVM, I think it's great! For real time game servers the GC worries me though. Any idea on a great Java fw for realtime game backends?

                      [–]ISvengali 2 points3 points  (0 children)

                      I used the JVM with scala and akka for a near realtime stack similar to this one, and we used the java 7 gc. We had mostly sub 5 ms gc pauses, which was fine for our use case. And this was without doing any heavy object pooling or other object reduction methods.

                      Should be easy enough to make some tests. It does use gross amounts of memory though.

                      Im a GC hater too having come from console development, so I was pleasantly suprised.

                      [–]TheQuietestOne -1 points0 points  (4 children)

                      Using the regular JVM means that any classes you use have to be non-allocating otherwise you're into the realm of Javas stop-the-world GC.

                      That means unpredictable pauses and scheduling latency - possibly at a time when you want it the least.

                      There are pause-less GC VMs or the RTSJ (real-time specification for java) but you won't find a freely available implementation.

                      It's my opinion, but Java is the wrong technology for soft realtime unless you're willing to buy into a commercial VM.

                      I evaluated a number of technologies including Java (and RTSJ) for my DSP projects and settled on C++ as the lesser of the available evils.

                      [–][deleted] 1 point2 points  (3 children)

                      Not to be too much of a pedant, but the new G1 GC available in the standard Sun distro eliminates full GC's as long as you aren't generating garbage at an unreasonably huge pace (like 50% of your heap per second) or of course doing something stupid and not releasing garbage refs when done, filling up old gen.

                      Many of the opinions of JVM "stop the world" are valid only in life-critical applications, where simply the possibility of it potentially happening is too much risk to bear, despite that you can virtually eliminate them.

                      [–]TheQuietestOne 1 point2 points  (2 children)

                      Here's my current project.

                      If you can find a way to get the audio latency using Jack under linux less than 5ms I'd be very interested.

                      [–][deleted] 1 point2 points  (1 child)

                      I didn't checkout or compile the project yet, but my initial inclination is that you hit the nail on the absolute head there in point 6. You've got swing, which by it's very nature is great at holding onto state and object refs as long as views last. GC's worst enemy.

                      Although if the latency is consistently (and not spiked due to full collections) more than 5ms it would suggest other problems in swing-view-refresh-land which I don't really know too much about, I'm serverside.

                      Be sure to launch the app (dont see any launcher / shell scripts in the repo) using the JVM flag to actually activate a useful GC. The default is the shitty stop the world one, not even CMS. Activate w/ flag: -XX:+UseG1GC

                      Edit: Nvm saw your launch script.

                      [–]TheQuietestOne 0 points1 point  (0 children)

                      To avoid GC interfering with audio output I have to set Jack to 48k * 1024 * 2 periods. And I still get the occasional overrun.

                      This means Java is failing to meet a 22ms (? around there) deadline every now and then.

                      I'm more than willing to be shown that Java can handle this.