Skip to content

A modern 3D Open source Java game engine, with Lua scripting and maven build support.

License

Notifications You must be signed in to change notification settings

Qualia91/lockdown_game_engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LOCKDOWN GAME ENGINE

Show Reel

Show Reel

  

Infinite Terrain Generation Infinite Terrain Generation

How to use release

The release is a runnable jar file that takes in one input, a lua file to be run.

A framework example is provided in:

git clone https://github.com/qualia91/com.boc_dev.lge_lua_front_end

The file in this repo called game_scene.lua is the one that can be provided as a command line input, like:

java -jar .\lockdown_game_engine-1.0.0.jar <PATH_TO_REPO>/com.boc_dev.lge_lua_front_end/game_scene.lua

Game Model

Components

ParticleSpring (Not Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.ParticleSpring.java

Fields:

  1. dampingConstant (float):

  2. springConstant (float):

  3. restLength (float):

Pickable (Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.Pickable.java

Fields:

  1. active (boolean):

List (Not Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.List.java

Fields:

  1. spacerZ (float): space each object is from the next one in the z axis

  2. indentZ (float): indent of a sub list in the z axis

  3. spacerY (float): space each object is from the next one in the y axis

  4. indentY (float): indent of a sub list in the y axis

Button (Not Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.Button.java

Fields:

  1. functionName (String): this will be the name of what function is activated when this button is pressed

  2. active (boolean):

Timer (Not Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.Timer.java

Fields:

  1. active (boolean):

  2. timeoutFlag (boolean):

  3. functionName (String): this will be the name of what function is ativated when this timer runs out

  4. timeoutLength (long):

  5. repeate (boolean):

  6. startFrame (long):

MarchingCubeGeneration (Not Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.MarchingCubeGeneration.java

Fields:

  1. materialID (UUID):

  2. chunkSize (int):

  3. generationRange (int):

SelectedItems (Not Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.SelectedItems.java

Fields:

  1. pickingHappened (boolean): Flag to tell selection system that a picking event occured and selection needs to clear and update

Mesh (Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.Mesh.java

Fields:

  1. vertexPositions (com.boc_dev.maths.objects.vector.Vec3f[]):

  2. materialID (UUID):

  3. index (com.boc_dev.maths.objects.vector.Vec3i):

TerrainGeneration (Not Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.TerrainGeneration.java

Fields:

  1. octaves (int):

  2. segmentSize (int):

  3. lacunarity (float):

  4. materialID (UUID):

  5. amplitude (int):

  6. chunkSize (int):

  7. cellSpace (int):

  8. generationRange (int):

Light (Renderable)

Description: Component that gets affected by the rigid body system. It must be under a transform, and thats the one that gets transformed.

Class: com.boc_dev.lge_model.generated.components.Light.java

Fields:

  1. attenuationExponent (float):

  2. coneAngle (float):

  3. attenuationLinear (float):

  4. attenuationConstant (float):

  5. colour (com.boc_dev.maths.objects.vector.Vec3f):

  6. lightingType (LightingType): light type

  7. direction (com.boc_dev.maths.objects.vector.Vec3f):

  8. intensity (float):

NormalMap (Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.NormalMap.java

Fields:

  1. path (String):

Collision (Not Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.Collision.java

Fields:

  1. collisionRestitution (float):

Transform (Not Renderable)

Description: Transform of an object. Will affect the objects underneath it.

Class: com.boc_dev.lge_model.generated.components.Transform.java

Fields:

  1. scale (com.boc_dev.maths.objects.vector.Vec3f): scale component of transform

  2. position (com.boc_dev.maths.objects.vector.Vec3f): positon component of transform

  3. rotation (com.boc_dev.maths.objects.QuaternionF): rotation component of transform

ViscousDrag (Not Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.ViscousDrag.java

Fields:

  1. coefficientOfDrag (float):

RigidBody (Not Renderable)

Description: Component that gets affected by the rigid body system. It must be under a transform, and thats the one that gets transformed.

Class: com.boc_dev.lge_model.generated.components.RigidBody.java

Fields:

  1. mass (double): Mass in kg's of entity.

  2. linearMomentum (com.boc_dev.maths.objects.vector.Vec3d): linearMomentum of entity.

  3. rigidBodyType (RigidBodyObjectType): Type of rigid body.

  4. angularMomentum (com.boc_dev.maths.objects.vector.Vec3d): angularMomentum of entity

  5. dimensions (com.boc_dev.maths.objects.vector.Vec3d): Dimensions of entity.

Texture (Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.Texture.java

Fields:

  1. path (String):

SkyBox (Renderable)

Description: Skybox used in scene.

Class: com.boc_dev.lge_model.generated.components.SkyBox.java

Fields:

  1. skyboxType (SkyboxType): Type of geometry used to make sykbox. Can be CUBE or SPHERE

  2. distance (float): Distance the skybox is rendered at

  3. texture (String): Texture of the skybox

Controllable (Not Renderable)

Description: Object that enables user control to a transform it is under.

Class: com.boc_dev.lge_model.generated.components.Controllable.java

Fields:

  1. sensitivity (float): rotation speed

  2. enableLook (boolean): Can rotate object

  3. speed (float): translate speed

  4. enableMove (boolean): Can translate object

Script (Not Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.Script.java

Fields:

  1. script (String): Lua Script file. This is searched for within

ParticleBody (Not Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.ParticleBody.java

Fields:

  1. mass (float):

  2. velocity (com.boc_dev.maths.objects.vector.Vec3d):

TerrainChunk (Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.TerrainChunk.java

Fields:

  1. materialID (UUID):

  2. origin (com.boc_dev.maths.objects.vector.Vec3f):

  3. grid (float[][]):

  4. cellSpace (double):

  5. index (com.boc_dev.maths.objects.vector.Vec2i):

Selectable (Not Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.Selectable.java

Fields:

  1. selectedMaterialUUID (UUID):

  2. selected (boolean):

  3. unselectedMaterialUUID (UUID):

WaterGeneration (Not Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.WaterGeneration.java

Fields:

  1. chunkSize (int):

  2. cellSpace (int):

  3. height (int):

Impulse (Not Renderable)

Description: Impulse given from player.

Class: com.boc_dev.lge_model.generated.components.Impulse.java

Fields:

  1. linearVelocityImpulse (com.boc_dev.maths.objects.vector.Vec3d): linear velocity impulse of entity

  2. angularVelocityImpulse (com.boc_dev.maths.objects.vector.Vec3d): angular velocity impulse of entity

Camera (Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.Camera.java

Fields:

  1. width (int):

  2. cameraObjectType (CameraObjectType):

  3. far (float):

  4. near (float):

  5. CameraProjectionType (CameraProjectionType):

  6. height (int):

  7. fov (float):

Geometry (Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.Geometry.java

Fields:

  1. localTransformation (com.boc_dev.maths.objects.matrix.Matrix4f):

  2. material (UUID):

  3. modelFile (String):

WaterChunk (Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.WaterChunk.java

Fields:

  1. cellSpace (int):

  2. grid (float[][]):

ImpulseControllable (Not Renderable)

Description: Object that enables user control to a transform it is under via linear and angular momentum impulses.

Class: com.boc_dev.lge_model.generated.components.ImpulseControllable.java

Fields:

  1. angularSpeed (float): Rotation speed.

  2. enableRotate (boolean): Can rotate object.

  3. linearSpeed (float): Translate speed.

  4. enableMove (boolean): Can translate object.

Gravity (Not Renderable)

Description: Component to enable gravity on transform object above.

Class: com.boc_dev.lge_model.generated.components.Gravity.java

Fields:

  1. simple (boolean): If simple gravity is true, each object is accelerated towards negative z axis. If false, it uses universal law of gravitation

  2. G (float): Gravitational

Material (Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.Material.java

Fields:

  1. specularColour (com.boc_dev.maths.objects.vector.Vec3f):

  2. diffuseColour (com.boc_dev.maths.objects.vector.Vec3f):

  3. reflectance (float):

  4. shininess (float):

Boid (Not Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.Boid.java

Fields:

  1. velocity (com.boc_dev.maths.objects.vector.Vec3f):

  2. minSpeed (float):

  3. lengthAwayGroupSquared (float):

  4. lengthAwayMinSquared (float):

  5. antiCollideScale (float):

  6. perceivedCenterScale (float):

  7. velocityMatchScale (float):

  8. boundScale (float):

  9. speed (float):

  10. radius (float):

  11. goal (com.boc_dev.maths.objects.vector.Vec3f):

Text (Renderable)

Description:

Class: com.boc_dev.lge_model.generated.components.Text.java

Fields:

  1. fontAlignment (FontAlignment):

  2. fontSize (float):

  3. fontName (String):

  4. text (String):

Enumerations

SkyboxType

Description: Type of object used for the skybox.

Class: com.boc_dev.lge_model.generated.enums.SkyboxType.java

Values:

  1. SPHERE
  2. CUBE

RigidBodyObjectType

Description: Type of rigid body created, used in rigid body sim to generate the moment of inertia tensor.

Class: com.boc_dev.lge_model.generated.enums.RigidBodyObjectType.java

Values:

  1. CUBOID
  2. SPHERE
  3. SPHERE_INNER
  4. NONE

CameraObjectType

Description: Camera type. Primary is the one used as the main camera. FBO is a secondary camera that can be used to create textures to be rendered to an object.

Class: com.boc_dev.lge_model.generated.enums.CameraObjectType.java

Values:

  1. PRIMARY
  2. FBO

CameraProjectionType

Description: Type of projection matrix used for camera. Perspective produces a normal 3D camera view, orthographic produces a 2D view.

Class: com.boc_dev.lge_model.generated.enums.CameraProjectionType.java

Values:

  1. PERSPECTIVE
  2. ORTHOGRAPHIC

Orientation

Description: Direction in which a list positions the objects within it.

Class: com.boc_dev.lge_model.generated.enums.Orientation.java

Values:

  1. HORIZONTAL
  2. VERTICLE

LightingType

Description: Type of light create in the graphics engine.

Class: com.boc_dev.lge_model.generated.enums.LightingType.java

Values:

  1. POINT
  2. SPOT
  3. DIRECTIONAL

FontAlignment

Description: Used to set allignment of text.

Class: com.boc_dev.lge_model.generated.enums.FontAlignment.java

Values:

  1. BEGIN
  2. END
  3. CENTER

CollisionShape

Description: Shape used to define how it responds to a collision with another collision shape.

Class: com.boc_dev.lge_model.generated.enums.CollisionShape.java

Values:

  1. SPEHER
  2. CUBOID
How to develop

Dependancies

You will need all the following repo's to get the game engine working:

com.nick.wood.game_engine.core: https://github.com/Qualia91/com.boc_dev.lge_core

com.nick.wood.game_engine.event_bus: https://github.com/Qualia91/com.boc_dev.event_bus

com.nick.wood.game_engine.examples: https://github.com/Qualia91/com.boc_dev.lge_examples

com.nick.wood.game_engine.gcs_model: https://github.com/Qualia91/com.boc_dev.lge_model

com.nick.wood.game_engine.systems: https://github.com/Qualia91/com.boc_dev.lge_systems

com.nick.wood.lge_scripting: https://github.com/Qualia91/com.boc_dev.lge_scripting

com.nick.wood.graphics_library: https://github.com/Qualia91/com.boc_dev.graphics_library

com.nick.wood.maths: https://github.com/Qualia91/com.boc_dev.maths

com.nick.wood.physics_library: https://github.com/Qualia91/com.boc_dev.physics_library

com.nick.wood.lge_scripts: https://github.com/Qualia91/com.boc_dev.lge_scripts

com.nick.wood.lge_lua_front_end: https://github.com/Qualia91/com.boc_dev.lge_lua_front_end

game_engine_build: https://github.com/Qualia91/lockdown_game_engine

Clone Script

Clone script below should do the trick:

git clone https://github.com/qualia91/com.boc_dev.lge_core

git clone https://github.com/qualia91/com.boc_dev.event_bus

git clone https://github.com/qualia91/com.boc_dev.lge_examples

git clone https://github.com/qualia91/com.boc_dev.lge_model

git clone https://github.com/qualia91/com.boc_dev.lge_systems

git clone https://github.com/qualia91/com.boc_dev.lge_scripting

git clone https://github.com/qualia91/com.boc_dev.graphics_library

git clone https://github.com/qualia91/com.boc_dev.maths

git clone https://github.com/qualia91/com.boc_dev.physics_library

git clone https://github.com/qualia91/lockdown_game_engine

git clone https://github.com/qualia91/com.boc_dev.lge_scripts

git clone https://github.com/qualia91/com.boc_dev.lge_lua_front_end

then you will need to navigate to com.boc_dev.lge_model\def and run generation.lua in lua to generate the java classes that define the model.

Lua Scripting Update: Due to the maven dist of lua not being compatible with java modules, i have included a module ready dist of lua in com.boc_dev.lge_scripting/lib. To add this to your local maven repo, simple double click the maven_repo_builder.cmd file in that dir.

Then look to com.boc_dev.lge_examples for how to use it!

If you are using IDEA with this game engine, you may struggle with it not finding some dll's. this seems to be a bug with idea and maven, and i have no idea how to fix it other than downloading the necessary dlls from the lwjgl website and putting them in AppData\Local\Temp\lwjgl\3.2.3-build-13

If anyone knows more about this, please let me know!