Giter Club home page Giter Club logo

openhex's Introduction

OpenHex

Open-Source hexagonal java jME 3 library

Original goal of this project

Written by MisterCavespider

The original goal for this project was to create a game library for games that featured hexagons. Currently, the project is packed with all sorts of generic classes and interfaces. The project was supposed to include entities (game objects) through an entity-component-system (ECS), full support for different style maps/boards (made up out of individual tiles), and support for AI/pathfinding.

The most notable features are the HexTerrainMesh, and the Vectors.

HexTerrainMesh

The HexTerrainMesh is optimized to display an entire field hexagons. It does this by iterating over the field, adding a hex tile or a wall where necessary. This process is not supposed to happen to frequently. Because of that, the Board object (data holder for tiles) is told to 'lock' itself, thereby not allowing any changes. It will then call the process once. It uses different colors for walls and floors (blue and red, respectively), what could be used in a custom shader to optimize textures.

This means it can draw a lot of hexagons really fast.

Vectors

I kinda went over the top with this.

Hexagons aligned in a raster use different axes than normal objects. Hexagons can either use Axial (2 axes) or Cube (3 axes) coordinates, might have a height variable, and can use either floats (Dynamic) or ints (Static). This resulted in 4 different vectors, using 2 different precisions, and 2 different dimension counts (Axial vectors are 3d, Cube vectors are 4d). I wanted to use 4 different classes for this, but I quickly learnt that Java generic parameters and reflection are not very fun to work with.

Why this project is abandoned

This project simply started too big. Although the goal was to create a game library, the result was more a game engine, with classes that control logic and stuff.

I do want to come back and clean this project up one day. I would like to make it slimmer, featuring code that can be used along side jME, not code that is built on top of jME.

openhex's People

Contributors

b0rg3rt avatar mistercavespider avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.