Game Programming with Groovy. James Williams @ecspike Sr. Software Engineer, BT/Ribbit



Similar documents
Java game programming. Game engines. Fayolle Pierre-Alain

LibGDX játék fejlesztése és publikálása Google Play-en. Vörös Viktor, NNG

JavaFX Session Agenda

JobScheduler and Script Languages

ANDROID INTRODUCTION TO ANDROID

Agile Development with Groovy and Grails. Christopher M. Judd. President/Consultant Judd Solutions, LLC

Introduction to Android

Tec: A Cross-Platform Game Engine

Experiences with 2-D and 3-D Mathematical Plots on the Java Platform

An evaluation of JavaFX as 2D game creation tool

Lecture 1 Introduction to Android

The BSN Hardware and Software Platform: Enabling Easy Development of Body Sensor Network Applications

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

Introduction to Web Development with R

Fachbereich Informatik und Elektrotechnik SunSPOT. Ubiquitous Computing. Ubiquitous Computing, Helmut Dispert

Android Fundamentals 1

The Decaffeinated Robot

System Architecture V3.2. Last Update: August 2015

Extending Tizen Native Framework with Node.js

BogDan Vatra and Andy Gryc. Qt on Android: Is it right for you?

Design Approaches of Web Application with Efficient Performance in JAVA

Practical Android Projects Lucas Jordan Pieter Greyling

Developing modular Java applications

Building native mobile apps for Digital Factory

Creating and Using Databases for Android Applications

An Introduction to Android

ActiveVOS Server Architecture. March 2009

Waratek Cloud VM for Java. Technical Architecture Overview

Lua as a business logic language in high load application. Ilya Martynov ilya@iponweb.net CTO at IPONWEB

Game Programming with DXFramework

THE WHIM WINDOW MANAGER

Android Basics. Xin Yang

Mocean Android SDK Developer Guide

GUI and Web Programming

Mobile Application Languages XML, Java, J2ME and JavaCard Lesson 04 Java

PHP vs. Java. In this paper, I am not discussing following two issues since each is currently hotly debated in various communities:

Mobile Game and App Development the Easy Way

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Introduction to Android

Generating Automated Test Scripts for AltioLive using QF Test

Android Development. Lecture AD 0 Android SDK & Development Environment. Università degli Studi di Parma. Mobile Application Development

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Developing Applications for ios

JAVA WEB START OVERVIEW

DEVELOPING MOBILE APPLICATIONS USING ANDROID

Introducing Apache Pivot. Greg Brown, Todd Volkert 6/10/2010

LDAPCON Sébastien Bahloul

RTI Quick Start Guide

Developing and deploying mobile apps

Developer Tutorial Version 1. 0 February 2015

REFERENCE GUIDE 1. INTRODUCTION

Here to take you beyond Mobile Application development using Android Course details

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

Using jvmstat and visualgc to Solve Memory Management Problems

Outline. 1.! Development Platforms for Multimedia Programming!

White Paper. Java Security. What You Need to Know, and How to Protect Yourself

Mobile Phones Operating Systems

C# and Other Languages

Overview of CS 282 & Android

directory to "d:\myproject\android". Hereafter, I shall denote the android installed directory as

An introduction to creating JSF applications in Rational Application Developer Version 8.0

JRuby Now and Future Charles Oliver Nutter JRuby Guy Sun Microsystems

automated acceptance testing of mobile apps

ArcGIS Viewer for Silverlight An Introduction

ANDROID PROGRAMMING - INTRODUCTION. Roberto Beraldi

Programming Mobile Apps with Python

Introduction to NaviGenie SDK Client API for Android

Android (Basic + Advance) Application Development

CS378 -Mobile Computing. Android Overview and Android Development Environment

Overview. The Android operating system is like a cake consisting of various layers.

lubyk lua libraries for live arts Gaspard Bucher (Buma)! artist, musician, coder

SDK Code Examples Version 2.4.2

TouchCore, is a vision tracking engine, that allows for gesture based natural and intuitive interaction of digital content.

GlassFish v3. Building an ex tensible modular Java EE application server. Jerome Dochez and Ludovic Champenois Sun Microsystems, Inc.

<Insert Picture Here> Java, the language for the future

VOC Documentation. Release 0.1. Russell Keith-Magee

ADF. Joe Huang Joe Huang Senior Principal Product Manager, Mobile Development Platform, Oracle Application Development Tools

Crosswalk: build world class hybrid mobile apps

Experimental Evaluation of Distributed Middleware with a Virtualized Java Environment

Mobile Development with Qt

Finger Paint: Cross-platform Augmented Reality

Workshop on Android and Applications Development

Rapid Application Development. and Application Generation Tools. Walter Knesel

Networks and Services

Android Geek Night. Application framework

Mobile development with Apache OFBiz. Ean Schuessler, Brainfood

Blender Notes. Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 9 The Game Engine

OMX, Android, GStreamer How do I decide what to use? 15 July 2011

CLOUD GAMING WITH NVIDIA GRID TECHNOLOGIES Franck DIARD, Ph.D., SW Chief Software Architect GDC 2014

APACHE SLING & FRIENDS TECH MEETUP BERLIN, SEPTEMBER APACHE SLING & SCALA Jochen Fliedner

Mobile App Tutorial Animation with Custom View Class and Animated Object Bouncing and Frame Based Animation

JAVA DEVELOPER S GUIDE TO ASPRISE SCANNING & IMAGE CAPTURE SDK

Application Testing Suite: A fully Java-based software testing platform for testing Oracle E-Business Suite and other web applications

Enabling Cordova (aka PhoneGap) on Tizen. René Pourtier / Luc Yriarte

An Overview of Java. overview-1

Android Architecture. Alexandra Harrison & Jake Saxton

Ruby on Rails in GlassFish Sun Microsystems

Transcription:

Game Programming with Groovy James Williams @ecspike Sr. Software Engineer, BT/Ribbit

About Me Sr. Software Engineer at BT/Ribbit Co-creator of Griffon, a desktop framework for Swing using Groovy Contributer to several open source projects Blogger and aspiring writer

About Ribbit Based in Mountain View, California, USA Subsidiary of British Telecom (BT) Provides a programmable telephony API Products and services include: o Ribbit Mobile o Ribbit for Salesforce o Ribbit for Oracle CRM

Agenda What is Groovy? Why Groovy for Gaming? What games are good for Groovy? Game Loop Enhancing Java Applications/Tooling User Input Alternative Controllers Connecting users

What is Groovy? Dynamically typed language for the JVM Superset of Java Inspired by Python, Ruby, and Smalltak Was designed for Java developers in mind Integrates seamlessless with Java objects and libraries

Why Groovy for Gaming? reduces the amount of code can use Domain Specific Languages to provide fluent APIs provides robust libraries for reading/writing from XML all your Java code just works

Types of games are good for Groovy Turn-based games Side-scrollers Card games Simple arcade classics from the old days

Gaming in Java JavaMonkeyEngine (JME) o Supports JOGL and LWJGL o Full stack providing sound, graphics, and input Lightweight Java Graphics Library o Exposes OpenGL, OpenAL, as well as input controller support JOGL JOAL JInput

Slick Provides a simple 2D API over LWJGL Enables Webstart distribution without the drama Extensible framework Helps with rendering, sound, and collision detection but doesn't overpower Doesn't lock you in

Is it fast enough? Yes! Bubblemark capped at 80fps runs @ 12% CPU utilization Uncapped it devours 90% CPU for 840-1100 fps

BasicGame Self-contained instance of a game Implements o init o update o render Great for single frame games

BasicGame example public class SimpleGame extends BasicGame{ public SimpleGame() { super("simplegame"); } @Override public void init(gamecontainer gc) throws SlickException { } @Override public void update(gamecontainer gc, int delta) throws SlickException{ } public void render(gamecontainer gc, Graphics g) throws SlickException{ } } public static void main(args) throws SlickException { def app = new AppGameContainer(new SimpleGame()) app.setdisplaymode 800, 600, false app.start() }

GameState Useful when there are multiple states like start screen, credits, levels, etc Sort of MVC for games Allows you to decouple your code Supports using visual transitions to move between states

Making things move Frame independent movement o Calculates based on delta time o Same experience on slow and fast computers o Built into Slick @Override public void update(gamecontainer gc, int delta) SlickException { } throws

Bubblemark Demo

Tilemaps Think Legend of Zelda for the NES series of images arranged in a grid format can be of arbitrary size and layer multiple levels Slick supports TileD for import (http://www.mapeditor.org/)

Images Support via ImageIO for: o PNG o JPG o GIF TGA support via a pure Java loader Image img = new Image("res/myimage.png");

Sounds and Music SoundFX o Supports WAV and OGG o Non-spatial sounds def fx = new Sound("resources/scream.wav") fx.play() //or fx.play(1.0f, 0.5f) to set volume and pitch o Spatial sounds fx.playat(-1, 0, 0) Music o Supports WAV, OGG, and MOD/XM tracks def music = new Music("resources/coolThemeSong.ogg") music.loop()

Input Handlers uses Input class and builds on the existing LWJGL support Retrieving input: o can be polled just as in LWJGL o can register InputListeners to handle notifications BasicGame has convenience methods for keyboard, mouse, and controller input

Bluetooth Support on Java (Bluecove) Apache 2 Licensed Implementation of JSR 82 Linux version requires GPL library http://code.google.com/p/bluecove/

Nintendo Wiimote Controller for Nintendo's Wii console Uses Bluetooth for communication IR Camera X, Y, Z accelerometer Can use IR triangulation to determine distance Can use IR to derive roll, pitch, and yaw

Using the Wiimote with Groovy(Java) Motej (http://motej.sourceforge.net/) o pure Java / no native C libs o Supports Wiimote Nunchuk Balance Board Classic Controller o wiiusej (http://code.google.com/p/wiiusej/) o wiimote-simple (http://code.google.com/p/wiimotesimple/)

Motej setup Install Bluetooth native libs Install Bluecove JSR 82 libs o Linux: requires an extra bluecove-gpl jar o OSX SL: needs to compile from src unless using 32-bit JVM On the application classpath, include: o motej-0.9 o bluecove jars o slf4j-api-1.5.8 o slf4j-simple-1.5.8

Motej Sample def listener = [motefound:{mote mote-> System.out.println("Found mote: " + mote.getbluetoothaddress()) mote.setplayerleds([false, true, false, true] as boolean[]) mote.rumble(2000l) motes.add(mote) }] MoteFinder finder = MoteFinder.getMoteFinder() finder.addmotefinderlistener(listener) finder.startdiscovery() Thread.sleep(30000l) finder.stopdiscovery()

Wiimote Demo

How the Pitcher Demo works On button press, the app starts tracking the X motion with slight filtering On button release, the app stops tracking X motion The change in X over time is used to calculate acceleration The X acceleration is used with the distance from the plate to calculate the speed*

Deployment Applets o Can be done but can be flaky o Operates in a sandbox Webstart o Can have full rights for the system o Simple deployment updates o Slick/lwjgl jnlp targets to auto-include native files

Scripting (JSR 223) Exposes third-party script engines to be embedded in Java apps Script Engines available for: o Java/BeanShell o Groovy o Javascript o JRuby o Jython o et al

Scripting API Example def factory = new ScriptEngineManager(); def engine = factory.getenginebyname("groovy"); // basic example println(engine.eval("(1..10).sum()")); // example showing scripting variables engine.put("first", "HELLO"); engine.put("second", "world"); println(engine.eval("first.tolowercase() + second.touppercase()"));

JSR 223 Demo

Connecting with users (Red Dwarf) open source fork of Project Darkstar built to support all the features needed for a MMOG Provides: o persistent data storage o transactions o channel communications o cpu load balancing Client drivers exist in Java, C#, and Python

Questions?

Links LWJGL: http://lwjgl.org JME: http://www.jmonkeyengine.com JOGL:https://jogl.dev.java.net/ JOAL:https://joal.dev.java.net/ JInput:https://jinput.dev.java.net/ Slick: http://slick.cokeandcode.com Red Dwarf: http://www.reddwarfserver.org/ Source code for all apps: http://github.com/jwill/geecon-demos