Giter VIP home page Giter VIP logo

braingdx's Introduction

logo

๐ŸŽฎ Game jam Java framework based on libgdx.

Build Status mavencentral javadoc codecov license

๐Ÿ‘พ Features | ๐Ÿ“ฆ Installation | ๐Ÿ“— Documentation | ๐Ÿป Collaboration | ๐Ÿš€ License | ๐Ÿ“ Changelog


Motivation

Another game development framework? Really?! ๐Ÿค”

In Java world, we game developers already have libgdx in order to create beautiful, feature-rich games. It allows us to be highly flexible how we design our game, however it is not ideal for small game jams. Especially in the first hours time is spent on wiring everything together, creating game object classes, setting up lighting, physics, tweening, writing shaders and particle management as well as sound manipulation.

From experience, this can take several hours which is costly, especially on small 24 hour game jams. You could move away from Java and use a popular game engine instead, but we Java developers like it simple and we do not want to give up on Java! Alternatively, all the boilerplate work should be done for you - and this is where braingdx comes into play!

This framework does not replace libgdx but gives your game superpowers!

rpg

Features

This framework provides:

  • Scene transitions how to switch between screens by applying different and custom animations
  • Tweening pipeline Using Universal Tween Engine to make the most of animations in a few lines.
  • World rendering pipeline no more custom Java classes for game entities. brainGDX offers a way to add objects to a game world, handle physics, collision detection and updating out of the box.
  • Lighting brainGDX comes with Box2DLights under the hood. Apply and configure dynamic lighting even for your entities.
  • Physics this framework has Box2D support out of the box!
  • Particles a game is no game without proper particles. brainGDX comes with full particle support. Attach particles to entities, apply behaviors to particles or define particle fields and effects out of the box.
  • Parallaxing beautiful parallax scrolling effects await you in this framework.
  • Scene shaders apply different shaders like Bloom, Antialiasing or Vignette effects to your scenes.
  • 3D audio support apply 3D sound effects and set sound sources in your world. Additionally, apply sound sources to moving game objects, fade in between music etc.
  • Controller support for components plug in your controller and go ahead. No more configuration hell!
  • Actor library (button menu, nameplates, tooltips) ever wanted to write an RPG or just show little tooltips on the screen? brainGDX provides several UI components for your needs.
  • Extended Tiled Map support Ever wanted to write a multi-layered game by using the map editor of your choice? brainGDX provides a framework to render and handle multi-layered 2D maps
  • Entity behaviors brainGDX comes with a various palette of inbuilt entity behaviors, such as flickering torch lights, WASD movement, random movement or directional movement.

physics

Roadmap

This framework is currently developed by a single person. Pull requests are very welcome! The following roadmap is planned for the first 1.0 release of this framework:

milestones

Installation

Maven

<dependency>
    <groupId>io.github.bitbrain</groupId>
    <artifactId>braingdx-2d</artifactId>
    <version>$braingdxVersion</version>
</dependency>

Gradle

Add the following to your build.gradle file to your core module:

compile "io.github.bitbrain:braingdx-2d:$braingdxVersion"
compile "io.github.bitbrain:braingdx-2d:$braingdxVersion:sources"
compile "io.github.bitbrain:braingdx-2d:$braingdxVersion:javadoc"

Replace $brainGdxVersion with the version on Maven Central.

Important! This framework requires box2dlights >= 1.5.x which automatically comes with this framework as a dependency. Make sure to remove any box2dlights dependencies from your core setup which are <1.5!

After that you are ready to go! Learn here how to integrate braingdx into your libgdx game!

Collaboration

Feel free to create a new pull request. When you detect an issue please report it here.

Games created with braingdx

๐ŸงŸ shelter

๐ŸŽฃ fishmonger

๐Ÿค– mindmazer

๐Ÿ’€ pragma

๐Ÿš€ v0id

License

This software is licensed under the Apache 2 License.

Special thanks

I would like to thank Mario Zechner and the libgdx community for developing such an amazing framework to work with. Also special thanks to Aurelien Ribon for creating a Java tween engine which can be used all over the place. This project also includes his work.

Social

follow-me

braingdx's People

Contributors

bitbrain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

braingdx's Issues

Layered Particle Management and Rendering

Implement a particle system with the following requirements:

  • particles can be attached to game objects and share the same z-index
  • particles get removed when their respective object gets removed
  • detached particles which leave the world bounds will get removed

Setup Maven Central repository

Setup this repository for Maven Central according to these requirements and OSSRH Guide.

The relevant request ticket can be found here.

Tasks

  • request braingdx repository on Sonartype
  • change pom.xml to deploy to Maven Central
  • setup GPG signing within TravisCI. (example)
  • integrate Javadoc deployment into pipeline (example)
  • update README.md to use official Maven Central Nexus
  • promote staged artifacts into Maven Central (Release)

Combined shader support

Since layered shader support (see #27) does not work properly, roll back to combined shader support for now. Apply all shaders on the sam texture.

PostProcessor does not work when using multiple instances

Apparently the PostProcessor class used for shader computing does not work since it is designed in a way for Single Usage. Defining multiple processors breaks the rendering of shaders. Instead, use PostProcessor as a storage of all kind of effects for each render pipe and enable/disable shaders respectively for each layer.

SVG support for libGDX

Add basic svg support to render SVG files to textures.

This particular feature consists of the following parts:

  • providing an API
  • loading of SVG data (XML parsing)
  • processing of SVG commands
  • rendering to a texture

Introduce ASCIITiledMapLoader

Depends on #30.

Create a class which loads TiledMap objects from an input stream which provides ASCII characters. These characters can be translated into tiles and objects respectively.

e.g.:

xxxxxxxxx
x a   b x
xxxxxxxxx

where x is a wall texture (collision), whitespace means air (walkable) and a and b are game objects, specified by the loading instructions.

Introduce Animation API 2.0

The v0.1 animation API is quite messy to play with. It is feature rich but needs separation of concerns. Also, it should integrate with the animation class of libgdx.

The current API has several drawbacks:

  • hard to configure: it requires a lot of boilerplate code
  • ambiguous classes and APIs, similar to the one of libgdx itself
  • high coupling: the API is not easy to extend

The solution to this is a reworked animation API with separation of concerns.

Separation of Concerns

The main focus of the new API is separation of concerns, without sacrificing usability and abstraction:

  • animation and tileset properties such as animation delay, direction of animation (horizontal or vertical), tileset origin
  • rendering of animations
  • configuration styles such as yaml or Java
  • handling of animation state

Layered Render Pipeline

Introduce a more general rendering pipeline to support shaders for UI and graphics and single components also. Each layer consists of a rendering sub-layer and a post-shader layer.

layers

Each post-shader layer can have two different rendering modes:

  • Additive: renders on top of the previous layer, including all shader operations.
  • Single: renders on top of the previous layer. However, all shader operations apply only to this layer.

Example

For example there could be two default layers:

  • world (Additive, default)
  • user interface (Single)

Depends on #11, #19

Tooltip V2

The new tooltip has:

  • multiscreen support (configurable)
  • 2 mode: quering and stacking
  • multi instance support

Layered shader support

Current shader implementation does not support alpha channels and renders on a black texture instead (if no pixels are provided as texture). This is why layered shader support by using frame buffers does not work. Alpha blending is not an option because lose all alpha information after shading is applied.

libgdx Viewport does not work properly

The new render pipeline does not work with various libgdx viewports. Expected behavior is that viewports are applied correctly (also resizing the screen should work). Currently resizing the screen causes the whole screen to resize incorrectly. Also viewports do not behave as intended!

Introduce TimeWarp

Introduce and facilitate a mechanic to slow down time, including TweenManager support.

Extended TiledMap support

tiled-logo
This feature offers extended support for the TiledMap implementation. It will integrate smoothly with braingdx and provides easy configuration.

Motivation

The TiledMap implementation provided by libgdx gives general support for using tiled maps. However, when creating games for game jams it is always time-consuming to write the render pipeline for tiled maps and levels all over again. Also having an API which provides easy support for collision detection and object handling is one goal of this story.

Rendering and z-indexing

One particular problem when implementing this story is in which order to render layers and objects. The rendering itself can not be implemented as an own RenderLayer since GameObject instances should get rendered before or after a certain layer. In addition GameObject instances for layers should not be taken into account for collision detection or world deletion. This can be achieved by treating a MapLayer as a game object and assigning own renderers for each layer individually. Afterwards braingdx needs to calculate the z-index for every GameObject to decide in which order to render:

index = (layerIndex + 1) * rowCount + yPosition

Explanation: first of all the z-index needs to be higher on a higher layer, regardless of how big the index is in the layer beneath. This can be ensured by multiplying the current index of the layer with the total number of rows. Afterwards the current yPosition of the GameObject is added.

Tasks

  • implement active/inactive mode for GameObject
  • implement z-index calculator and z-index assignment for GameObject instances
  • implement MapLayerRenderManager (generating individual ids for render layers and assigning own renderers to it)
  • implement MapLayerRenderer
  • implement collision cache
  • implement TiledMapManager to load tiled maps and populate the world with defined objects
  • implement TiledMapAPI to provide access like collision checks, indexed-based field checks (neighbours, layers)
  • implement support for moving game objects between layers at runtime (configurable via TiledMapConfiguration)
  • introduce a TiledMapConfiguration in order to define how to parse attributes like collision, game objects, items etc.
  • Implement collision detection

Apply individual context to Renderers

Right now renderers can only be applied per GameObject type. Instead, make it configurable to apply renderers for individual game objects instead of whole types. This is a dependency of #35.

Introduce quad tree object comparison ๐ŸŒณ

Right now objects are compared for collision detection and behavior via the bruteforce strategy. An implementation of a quad tree leads to better performance since we should not check collision for objects which are too far away.

Write API for screen transitions

This feature allows transitions between 2 screens.

List of supported transitions

  • FadeTransition fades the alpha value of the current screen to 0 and the alpha value of the new screen to 1 simultaneously.
  • SwipeTransition moves the current screen to [top | left | right | bottom] and the next screen moves to the middle.
  • ColorTransition fades the current screen to a color specified and fades from the color to the next screen.

Notes and considerations

  • the buffer texture of the current screen can be obtained by the rendering pipeline
  • the buffer texture of the next screen could be obtained by the rendering pipeline. However it may not be configured correctly. Additionally the pipeline may depend on assets which are not loaded. Make sure to support screen transitions for lazy-loading of assets later on!
  • if a texture can not be obtained correctly, do not fade at all and show a warning in the log.

Simplify Movement API

Simpliar to the Animation API this needs some cleanup. Movement<Type> is not sufficient and creates too much boilerplate code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.