 All right, so we passed out controllers to four guinea pigs. These are ordinary Xbox 360 controllers running through this lovely little wireless adapter And we're gonna fire up a game real quick here. Okay, so it's without further ado All right, so this is our little clone of death tank on Xbox live arcade and It's kind of like worms or Squorts or yes, thank you only real-time and You can see our guys duking it out here just in their shot power Yeah, we're actually using physics to do all of this we're not actually scooting the objects left and right the wheels turn Which provide torque and then when applied to friction they actually move along the ground That's all by our physics engine Oh, yeah Yellow player ain't looking very good Oh, yeah, and when our guys turn completely red they are dead, so Yeah, one of the strategies that arises over the course of the game is pinning your opponents down Apparently one of our participants has mastered this And I'm not going to describe what's going on on the left side of the screen That's not safe for work. Oh, we got somebody down and it looks like our tanks just violently repulsed there In an effort to separate themselves you make certain concessions to the physics engine You know how to keep the game going lose a dead man Yeah, yep one more hit. Oh Breathe on him. He's gone. Oh No, we've got another situation another car All right, I'm gonna call this one tie. What do you think Logan? Yeah, I can't watch any more of that Okay, so okay. Well, that's Gemini everybody That's a game development engine that uses Ruby. Okay boys Back to work One of the things you might wonder is like, why would you want to make games games are fun? This is like the ice cream taste at your job of programming. Everybody wants to do it, right? Only problem is is that if you want to become a game developer you have to give up some things like your wife your girlfriend spare time You're gonna work really long hours and you're gonna have to do crazy math You know things like doing a cross product on two matrices is pretty common as I understand I don't even know how to do those things Which I'm glad about The one thing about Two things about Jim and I I think that has going for it really strong is one that's using JRuby And JRuby was a really good choice for us for several reasons One is is that we actually got a real-time garbage collector out of this We used to be running our games every like 10 seconds or so the game would slow down as it started to collect all the garbage that had collected at a key leading With Java we could actually swap in our own Concurrent garbage collector that makes lots of really small collections Almost immediately so we don't feel the hit as a batch thing Another thing that really helped us to is that we get 2d and 3d and physics libraries for free We don't have to go and push Transform HSEs and that kind of stuff onto an open GL stack. That's already done. We're just wrapping some libraries And it doesn't even really require any findings at all Another thing too is it's cross-platform. I love OS 10, but not everybody uses it So it'd be really great if we can push that on the you know the Linux users Windows users as well and All of this is 100% Ruby even though it's in jruby no no redundant array of any expensive Java developers was necessary to Put this game together We can also embed our game inside of a GUI application which is a lot like We can make editors with that so you can actually drop things into like a real game and just see how it would look And tweak values without a right ever actually have an execute the game and then We're also eventually we're hoping to get our games embedded in a web browser so that we can have outputs The second thing that we have going for us. That's really strong. I think is we have a dependency injection Behavior system that we've set up that allows us to reuse a lot of done-the-death game mechanisms our eventual goal is to allow people to make games like Starcraft and Not have to write a mini map from scratch That stuff should all you be done for you and we're hoping to accomplish that with Gemini So I'm going to hand it over to Jay who's going to show what some of the code looks like All right, so here's a quick demo project that we put together to show off some of Gemini's Capabilities, I know better than to try to live code for something like this so we recorded a quick screencast Okay, so to start off a project. It's very rails like you type Gemini We install that command for you and then the name of the game you want to create and that will create a project folder for you So we've got that created. Let's CD into it and take a look at its contents So you got a bunch of scary looking libraries up there at the top including Jay Ruby itself our Gemini jar And you generally don't need to worry about anything that's in that directory You won't need to go in there what you will be interested in working with is the source directory in which we have Several sub directories for your various types of objects. You're going to create. We've got behaviors for shared behaviors Between your objects. We've got game objects, which are prefabricated object classes with behaviors applied inputs which map Xbox controllers keyboard actions mouse buttons Whatever other type of controller you care to apply Those it causes those to generate events that go to your game Main dot rb and main dot Java kick the whole thing off. You generally won't need to edit main dot Java and Then our states directory you see the sample. Hello world state that we create for you just give you a kick start And you'll create other states as your game progresses Okay, so let's take a look at those game states so we're gonna run our sample game here real quick and This was Logan's brilliant idea to create a cross between gauntlet and Gallagher So here we are at our menu state that's pretty simplistic at this point just has a little instruction to press space to start And we display this By the creation of a menu state, which you see the code for here and That resides in menu state that are be within the states directory our load method on that Specifies everything that should happen when the state is first loaded up And we create a background object Which is basically just a static image that gets displayed underneath all the others on screen That gauntiga symbol you see there causes it to load gauntiga ping from the data directory We also loop a quick song for the menu Which we won't play now since we don't want to juggle audio, but anybody who wants to demo in the hallway. Just let us know And that's loaded from menu.org And then we also set up an event handler to detect when the keyboards pressed It handles the event start that symbol start that you see on the right side of the screen And that causes it to switch to the play state which we will show here in a moment Here's our input mapper It says in order to start that is it generates the start event The input builder takes the method press and the symbol space space key starts So let's run that real quick and demonstrate what we just showed switching between the two states Menu state loads we press space and voila. Here's our play state Sure thing So an artist dies every time that graphics like that are made Yes, there we go Okay, so here is the code for our play state. This is loaded from playstate.rb within our states directory and All states inherit from Gemini game state So we create our back a new background object this one referring to the grass background image file within the Play data directory All right, and let's demo events in input a little bit. So you see our dwarf there at the bottom of the screen It's a little hard to see In this screencast, but he's animating walking as he moves back and forth And we do that by means of the animated image behavior We tell the dwarf he's going to animate as dwarf and that will load up all those dwarf image files that you see Within the play data directory We've got a default animation walk animations a shoot animation each with a couple frames to him obviously you can have more than that too We handle the events move left and move right by mapping them to the move left and move right methods on the dwarf object And you can see those methods here Move left takes a message which has a delta attribute and for those who haven't done game development before You don't know exactly how long it's been since your last screen update Which is what those deltas accomplish for you. They are the number of milliseconds Since your last update and if you're running on a slower system or a faster system than you expected That the deltas let you keep your animations running smoothly and your character is moving back and forth at a smooth pace So we take that number of milliseconds multiply it by our preset movement rate and then alter the dwarfs X position Left or plus or minus according to the message we got We also pass that delta to the animate pulse method, which gives him that little walking animation I've got a touch of the place so the water is to keep my voice going. Sorry folks Okay, here's the mapping for those move left and move right events very similar to The space bar to switch states in order to move left. I hold left in order to move right. I hold right and There you see us exiting the game by pressing the escape key Can't imagine why anybody would ever want to stop playing our game, but if they do we let them exit out And That's a similar mapping within the inputs We just map escape to the quit method or the quits event which switches state back to the menu state There's a similar mapping on the menu state, which exits the game altogether Okay axes no not axes axes We need to give our dwarf a means to defend himself so he can do this nasty looking attack here So he tosses those via the space button. We map the shoot event to the space bar and Then we map that shoot event in turn to the shoot X method on the dwarf object When we receive it we create an axe object within the game state Said its position equal to the dwarfs so that they appear at the same space at one point We had axes appearing in the upper left corner of the screen until we did that and then we give the move method to the axe Telling it to move at a degree of zero. That's straight up in the air At a speed of 0.5 Okay, so the axe itself has the drawable image behavior That's what causes the axe image to be loaded in from the data directory and it's got the behavior movable Which is what gives us that move method We specify how the axe should appear by setting its image attribute to that axe symbol again causing axe or The axe image file to be loaded up We do that cool rotation effects through this line of code right here We say on update pass it a delta as you saw before a number of milliseconds since our last screen update We multiply that times our rotation rate and then add that to the image rotation causing it to spin Okay, so look at the graphics. Yes, they are graphics So we there you saw collisions between axes and orcs we do that through the tangible behavior We set a tangible shape on it. We tell it. It's gonna be a box That's the area that will actually detect a collision and for the axe We set that equal to the axe's image width and its image height Similarly, we have to set the oh we also specify what the axe should do when it collides with something the untangible collision We detect if the other object it collided with has the tag enemy And if it does then we play the sound slice and remove self that is the axe removes itself from the game state causing it to disappear We do that only on enemies so that axes can't collide with each other or with the dwarf accidentally Okay, similarly on the orc. We set a tangible shape to a box of 48 by 48 And we specify that on tangible collision. We should call the orcs handle collision method It gets a similar message Which contains the object that it collided with When we receive that we call the die method and we'll get to how that's provided in just a minute We also play a sound of dying The orcs make a nice little grunt when they're hit with an axe as you might imagine okay so that Die behavior is provided by a custom behavior that's unique to our project So you see that when the axes hit the orcs they die, but when a rock hits the dwarf He dies too. So how do we share that behavior between the two? We do that via the custom killable behavior on both the orc and the dwarf We specify that they have behavior killable and that causes killable rb to be loaded up from our behaviors directory Here is that killable behavior definition and basically the main thing it does is to find that die method we mark on the object that it is in fact dead and Then we create a fading image which is just an image that becomes more transparent over time Which loads death or the death image file from the data directory We set its position equal to the orc or the dwarf that died And then we remove the orc or the dwarf from the game state causing it to disappear leaving only the skull managers Anything that manipulates multiple Objects at the same time in Gemini you're probably gonna want to create a manager for notice how our orcs are moving back and forth in Formation, they're also coordinating their attacks with the rocks We do that via a custom manager managers handle a lot of things in Gemini You've got sound manager, which is responsible for playing back wave files and dot org music files You've got a tangible manager which detects collisions and then here on the play state You see us setting our custom enemy manager Here is that manager. It has the behavior updates and on update It does both the attack and move Methods So here's the move on our enemy manager Basically, it says if we've been moving to the left for too long change our direction so we're moving right if we've been moving right too long change our direction, so we're moving left and We call the move left or move right methods on each of the enemies in turn as appropriate We also call the attack method on them at the appropriate time so they can throw rocks Okay, so that was our quick Simplistic collision demo, but we didn't really show off Jim and I's Physics engine capability. So this demo shows that real quick. We're going to show off the physical behavior This has Jim and I running embedded inside of a monkey bars application All right, so wherever we click the mouse we create a physical object We start by setting the physics manager to be a basic physics manager And we set up a handler such that whenever the mouse is pressed we This block you see is past a message With the mouse's position We create a physical game object Set its shape to be a box or a circle at random and then set its body position It's the position for the physical object to equal the mouse's screen position Let's turn on the gravity You'll see the object start to drop and then let's press the lock objects button which freezes them in place Turn the gravity all the way up and you'll see they're unaffected So we freeze them by setting static body on them You'd want to use set static body if you wanted a building that didn't move when something collided with it or something like that And we do that only if the object has the behavior physical and That basically freezes them in place Let's generate some new non-frozen objects and you'll see that though they collide with the other objects They don't move them Our gravity is controlled by the gravity attribute of the physics manager. That's universal it affects all physical game objects And we manipulate that when we move the gravity slider move the bounce slider and it makes our objects bouncy Yeah, I got a good kick on that one Okay, we change bounciness through this freaky word restitution That's the attribute on the physical object and whenever we manipulate the slight bounce slider We basically loop through all our physical game objects in turn and set their restitution So if we turn our bounce off, you'll see the objects just immediately come to rest Turn it back up and everything is bouncy again. I think that's all I got Is there any questions? We build native the question was one of the platforms that we support right now We can build native executables for both the Mac and Windows for Linux. It's a little bit more iffy. It's like it's just a SH file The question was are we going to support Xbox live? I would really like that, but that might be a little far away right now Always to embed the JVM part into an executable and then you could just ship that executable onto the Xbox And it wouldn't know that it was running some form software like that The question was what input mechanisms do we support right now? It's keyboard mouse and a USB Controller or joystick of some kind does not have to be Xbox. No, you could plug in your PS So long as it identifies itself as a USB device a USB joystick Specifically then we can see it and you can map the buttons and various accesses You can possibly get a we-mote working with it or maybe even like a USB piano If it maps that way You mentioned things like mini-maps and things like that. Do you guys already have modules made for those sorts of functionality or just sort of waiting for the community to pull up with that stuff? We're trying to the question was do we have things like pre-built mini-map widgets and other advanced features like that? We don't we don't have that yet But our goal is to add those and we're starting off pretty new still we're still trying to get You see everything that we have so far as 2D We're trying to really flesh that out first and add in things like Oh, if you want to make a platformer game like Mario or something that should be really really easy and we're trying to get that there And of course any community involvement build those is more than welcome, but say yeah, we're working on it I don't know anything about Android, but how hard would it be to get one of these games to run on an Android platform? The question was can you run some of these games on Android? I'm not entirely sure myself. I know these these games aren't exactly Enhanced for low-memory footprints and that kind of stuff It doesn't to say that we couldn't tailor something like that. I think it mostly depends on how JBB runs on Android, which is I understand is There's still some kinks to work out Yeah, so Jim and I does have the question was that we heard about Ruby game Jim and I does have some competitors Ruby game and go-soo are not Competing on the same level that Jim and I is because they're simply trying to wrap or abstract some common things that you'd want to do with open GL Jim and I Game box and chingo. However, we're all trying to do very similar things. We're we're trying to have a bunch of ready-made Game mechanisms that you can just glue together. Well, thanks for your time. I'm Logan Barnett. I'm the junior assistant coffee delivery engineer at intercom technologies And I'm Jane the Gavron co-maintainer of Gemini and general consultant Thanks, fellas