jMonkeyEngine 3.0 Beginner's Guide

Book description

Whether you want to design 3D games with Java for love or for money, this is the primer you need to start using the free libraries of jMonkeyEngine 3.0. All hands on, all fun – it makes light work of learning.

  • Create 3D games that run on Android devices, Windows, Mac OS, Linux desktop PCs and in web browsers – for commercial, hobbyists, or educational purposes.
  • Follow end-to-end examples that teach essential concepts and processes of game development, from the basic layout of a scene to interactive game characters.
  • Make your artwork come alive and publish your game to multiple platforms, all from one unified development environment.

In Detail

jMonkeyEngine 3.0 is a powerful set of free Java libraries that allows you to unlock your imagination, create 3D games and stunning graphics. Using jMonkeyEngine’s library of time-tested methods, this book will allow you to unlock its potential and make the creation of beautiful interactive 3D environments a breeze.

"jMonkeyEngine 3.0 Beginner’s Guide" teaches aspiring game developers how to build modern 3D games with Java. This primer on 3D programming is packed with best practices, tips and tricks and loads of example code. Progressing from elementary concepts to advanced effects, budding game developers will have their first game up and running by the end of this book.

From basic concepts and project creation to building a complex 3D Game, you will learn to layout 3D scenes, make them interactive and add various multi-media effects.

You will find answers to common questions including best practices and approaches, how game characters can act and interact, how to simulate solid walls and physical forces, how to take it online to play over a network and much more.

From Zero to Hero, start your journey to make your game idea a reality.

Table of contents

  1. jMonkeyEngine 3.0 Beginner's Guide
    1. Table of Contents
    2. jMonkeyEngine 3.0 Beginner's Guide
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    7. Preface
      1. What this book covers
      2. Get a head start
      3. Who this book is for
      4. Getting things done
      5. The building blocks of game development
        1. Listening to the heartbeat of your game
        2. Putting the pieces together
      6. Sources of information
      7. Conventions
      8. Time for action – heading
        1. What just happened?
        2. Pop quiz – heading
        3. Have a go hero – heading
      9. Reader feedback
      10. Customer support
        1. Downloading the example code
      11. Downloading the color images of this book
        1. Errata
        2. Piracy
        3. Questions
    8. 1. Installing jMonkeyEngine
      1. Installation requirements for game developers
      2. Time for action – installing the jMonkeyEngine SDK
      3. jMonkeyEngine SDK at your service
      4. Can I work in other Java IDEs?
      5. Time for action – running a demo
        1. What just happened?
      6. Time for action – creating a project
        1. What just happened?
      7. Assets and the art pipeline
      8. Time for action – distributing a game
        1. What just happened?
      9. Can I sell my jMonkeyEngine game?
      10. Summary
    9. 2. Creating Your First 3D Scene
      1. A basic template to initialize scenes
      2. Time for action – initializing a scene step by step
        1. What just happened?
      3. Starting and stopping the application
      4. Time for action – starting the application
        1. What just happened?
      5. Orient yourself in 3D space
      6. Time for action – finding the spot
        1. What just happened?
        2. Pop quiz – which way, vector?
      7. And how do I say that in Java?
      8. Time for action – position it!
        1. What just happened?
      9. Time for action – scale it!
        1. What just happened?
      10. Time for action – rotate it!
        1. What just happened?
      11. Time for action – rotate it again, Sam
        1. What just happened?
      12. Where am I?
      13. Time for action – navigating the scene
        1. Pop quiz ‑ spinning around
      14. Populating the scene
      15. Time for action – node versus geometry
        1. What just happened?
        2. Pop quiz – the truth about spatials
      16. Extending SimpleApplication
      17. Make a big scene
      18. Time for action – configuring display settings
        1. What just happened?
      19. Keeping an eye on your FPS
      20. Time for action – checking vital stats
        1. What just happened?
      21. Navigating the scene with a mouse and a keyboard
      22. Time for action – move it!
        1. What just happened?
        2. Have a go hero – tower defense
      23. Summary
    10. 3. Interacting with the User
      1. The digital Dungeon Master
      2. Time for action – from input to output in slow motion
        1. What just happened?
      3. Time for action – pushing the right buttons
        1. What just happened?
      4. Time for action – trigger meets mapping
        1. What just happened?
      5. Time for action – mapping meets listeners
        1. What just happened?
      6. Time for action – listeners meet actions
        1. What just happened?
      7. Click me if you can
      8. Time for action – pick a brick (using crosshairs)
        1. What just happened?
      9. Time for action – pick a brick (crosshairs with ray casting)
        1. What just happened?
      10. Time for action – pick a brick (using the mouse pointer)
        1. What just happened?
      11. Time for action – pick a brick (pointer with ray casting)
        1. What just happened?
        2. Pop quiz – input handling
      12. How to steer spatials
      13. Time for action – you are the CubeChaser
        1. What just happened?
      14. Time for action – chase all the cubes!
        1. What just happened?
      15. Time for action – get these cubes under control
        1. What just happened?
      16. Time for action – get into the right AppState of mind
        1. What just happened?
      17. Time for action – call me maybe?
        1. What just happened?
      18. Coordinating global game mechanics
      19. The beauty of AppStates and controls
        1. Pop quiz – how to control game mechanics
        2. Have a go hero – shoot down the creeps!
      20. Summary
    11. 4. Adding Character to Your Game
      1. Making a Mesh
      2. Time for action – meshing around with cubes
        1. What just happened?
      3. Time for action – meshing around with spheres
        1. What just happened?
      4. From mesh to geometry
      5. Beg, steal, or borrow
      6. The right wrench to pound in the screw
      7. Time for action – installing the Blender-to-Ogre3D plugin
        1. What just happened?
      8. Time for action – sculpting the mesh
        1. What just happened?
      9. Time for action – coloring the mesh
        1. What just happened?
      10. Time for action – a model for to go, please
        1. What just happened?
      11. Time for action – loading a model (just testing)
        1. What just happened?
      12. Time for action – loading a model (for real)
        1. What just happened?
      13. Managing assets – best practices
      14. Time for action – sorting your stuff out
        1. What just happened?
      15. Time for action – saving and loading .j3o files
        1. What just happened?
        2. Pop quiz
      16. Animating a model
      17. Time for action – rig, skin, and animate
        1. What just happened?
      18. Time for action – loading an animated model
        1. What just happened?
      19. Time for action – playing an animated model
        1. What just happened?
      20. Time for action – responding to animation events
        1. What just happened?
        2. Pop quiz
      21. Loading a simple user interface
      22. Time for action – displaying text
        1. What just happened?
      23. Time for action – loading AngelCode fonts
        1. What just happened?
      24. Time for action – loading icons into the GUI
        1. What just happened?
      25. Time for action – display interactive status icons
        1. What just happened?
      26. Time for action – 3D objects in the 2D GUI?
        1. What just happened?
      27. The art pipeline
        1. Have a go hero – furnishing the tower defense game
      28. Summary
    12. 5. Creating Materials
      1. What is a material?
      2. Time for action – unshaded materials
        1. What just happened?
      3. Material definitions and shaders
      4. Good-bye unshaded, hello lighting!
      5. Time for action – no frills, just color
        1. What just happened?
      6. Time for action – oooh, shiny!
        1. What just happened?
      7. Time for action – illuminated opaque textures
        1. What just happened?
      8. Time for action – semitransparent texture
        1. What just happened?
      9. Time for action – transparent textures
        1. What just happened?
        2. Pop quiz – transparent versus opaque
      10. Multimapping
      11. Time for action – meet the hover tank
        1. What just happened?
      12. Time for action – let the hover tank be groovy
        1. What just happened?
      13. Time for action – give your hover tank a shine
        1. What just happened?
      14. Time for action – make your hover tank glow
        1. What just happened?
      15. Time for action – deep-freeze your materials
        1. What just happened?
        2. Pop quiz – multimapping
      16. Different types of textures
      17. Time for action – scaling and tiling textures
        1. What just happened?
      18. Time for action – lights on!
        1. What just happened?
        2. Have a go hero
      19. Summary
    13. 6. Having Fun with Physics
      1. Solid floors and walls
      2. Time for action – fortify the town
        1. What just happened?
      3. Time for action – first-person navigation
        1. What just happened?
      4. Fun with rigid bodies
      5. Time for action – falling bricks
        1. What just happened?
      6. Time for action – flying cannon balls
        1. What just happened?
      7. Time for action – predict the explosion
        1. What just happened?
      8. Dynamic, static, and kinematic
      9. Time for action – an elevator platform
        1. What just happened?
      10. Time for action – react to collisions
        1. What just happened?
      11. Time for action – timing forces correctly
        1. What just happened?
      12. My whole world is falling apart
      13. LEET skillz – learn from the pros
        1. Pop quiz
        2. Have a go hero – rubber balls versus stacked crates
      14. Summary
    14. 7. Adding Spark to Your Game
      1. Particle effects
      2. Time for action – stir up some dust
        1. What just happened?
      3. Time for action – sparks
        1. What just happened?
      4. Time for action – fit to burst?
        1. What just happened?
          1. Starting and stopping effects
      5. Time for action – fire!
        1. What just happened?
      6. Time for action – design effects in the SDK
        1. What just happened?
      7. Time for action – finding stuff in the scene graph
        1. What just happened?
          1. Custom effect textures
        2. Have a go hero – explosion!
        3. Scene-wide effects
      8. Time for action – welcome to Dark Town
        1. What just happened?
      9. Time for action – welcome to Dark City
        1. What just happened?
      10. Time for action – this city needs more gloom
        1. What just happened?
      11. Time for action – stay focused
        1. What just happened?
      12. Time for action – this city needs more glow
        1. What just happened?
      13. Time for action — toons and artistic effects
        1. What just happened?
        2. Have a go hero
      14. Summary
    15. 8. Creating Landscapes
      1. Welcome to Earth
      2. Time for action – climbing a hill
        1. What just happened?
      3. Time for action – let there be grass
        1. What just happened?
      4. Time for action – splat goes the texture
        1. What just happened?
      5. But wait, there's more
      6. Time for action – up hill and down dale
        1. What just happened?
      7. Time for action – go fast and vast
        1. What just happened?
      8. Time for action – plant a tree
        1. What just happened?
      9. Not even the sky is the limit
      10. Time for action – nothing but blue sky
        1. What just happened?
      11. Time for action – sky factory
        1. What just happened?
      12. Time for action – fog of war
        1. What just happened?
      13. Catch the sun
      14. Time for action – let the sun shine in
        1. What just happened?
      15. Still waters run deep
      16. Time for action – simple water
        1. What just happened?
      17. Time for action – take a swim
        1. What just happened?
        2. Pop quiz
        3. Have a go hero
      18. Summary
    16. 9. Making Yourself Heard
      1. Please roar into the microphone now
      2. Ambient sounds! They are everywhere!
      3. Time for action – add ambient sound
        1. What just happened?
      4. Time for action – to pre-buffer or to stream?
        1. What just happened?
      5. Time for action – push a button to receive *BAM*
        1. What just happened?
      6. Basic sound APIs
      7. Something's coming from behind!
      8. Time for action – positional audio
        1. What just happened?
        2. A closer look at volume fall-off
      9. Time for action – I spy with my little ear
        1. What just happened?
        2. Pop quiz – audio nodes
      10. Sound environments
      11. Time for action – using default sound environments
        1. What just happened?
      12. Time for action – underwater
        1. What just happened?
        2. Have a go hero
      13. Summary
    17. 10. Showing Your Game to the World
      1. Customizing display settings
      2. Time for action – the name of the game
        1. What just happened?
      3. Time for action – make a big splash (screen)
        1. What just happened?
      4. Time for action – window seat or full screen?
        1. What just happened?
      5. Time for action – fine-tuning video settings
        1. What just happened?
      6. Time for action – window, canvas, or headless?
        1. What just happened?
      7. Time for action – reload settings
        1. What just happened?
      8. SimpleApplication options
      9. Time for action – time for a pause
        1. What just happened?
      10. Time for action – hide statistics and FPS
        1. What just happened?
      11. Save, load, and be merry
      12. Time for action – save and load game data
        1. What just happened?
      13. Time for action – save and load display settings
        1. What just happened?
      14. Pre-release checklist
      15. Release checklist
      16. Time for action – build the final release
        1. What just happened?
      17. Summary
    18. A. What's Next?
      1. Hey, this game is fun!
      2. Some dos and don'ts
      3. Superpowers – Go!
      4. Keep it simple
      5. Polishing off the last pages
      6. Summary
    19. B. Additional Resources for Fellow jMonkeys
      1. Game-development resources
        1. Game-development tips
        2. Game-asset resources
      2. Key input triggers
        1. Mouse
        2. Keyboard
        3. Joystick
      3. Setting up jMonkeyEngine in Eclipse
        1. Downloading the software
        2. Creating a new game project
        3. Setting up dependencies
        4. Setting up the assets folder
        5. Writing a simple application
      4. Best practices for jMonkey networking
        1. What do the client and server do?
        2. Getting your physics in sync
        3. Choosing a server type
        4. Hackers, cheaters, and griefers
        5. Welcome to MonkeyZone
    20. C. Pop Quiz Answers
      1. Chapter 2, Creating Your First 3D Scene
        1. Pop quiz – which way, vector?
      2. Chapter 3, Interacting with the User
        1. Pop quiz – input handling
        2. Pop quiz – how to control game mechanics
      3. Chapter 4, Adding Character to Your Game
        1. Pop quiz – managing assets: best practices
        2. Pop quiz – animating a model
      4. Chapter 5, Creating Materials
        1. Pop quiz – transparent versus opaque
        2. Pop quiz – multimapping
      5. Chapter 6, Having Fun with Physics
        1. Pop quiz
      6. Chapter 8, Creating Landscapes
        1. Pop quiz
      7. Chapter 9, Making Yourself Heard
        1. Pop quiz – audio nodes
    21. Index

Product information

  • Title: jMonkeyEngine 3.0 Beginner's Guide
  • Author(s): Ruth Kusterer
  • Release date: June 2013
  • Publisher(s): Packt Publishing
  • ISBN: 9781849516464