Git Product home page Git Product logo

slope-ecs's Introduction

Slope ECS

Games, in Java. Crazy thought, isn't it?

Windows Build Status Ubuntu Build Status Mac OS Build Status

Javadoc Maven Central

About Slope

Slope is a developer-friendly Entity Component System written in pure Java. It enables developers of all kinds to create games and other software built on a no-nonsense, cross-platform, open-source code library.

Highlights

  • Cross Platform - Fully supports all major desktop platforms (Linux, macOS, Windows)
  • Developer Friendly
    • Robust testing for all supported platforms, ensuring your programs work as you expect.
    • Well-documented source code, ensuring each part of the library's purpose to be easily understood.
  • Open Source
    • Under the MIT License, you're free to use and modify this library for your own needs.

References

Adding Slope-ECS to your project

This repository can be found on Maven Central -- as such, it can be easily added to your project as a dependency through the use of a build tool.

Requirements

  • Java 15 or later.
    • IMPORTANT: The eventual target Java version will be Java 17.
  • A build tool, such as Maven or Gradle.

Adding the Dependency

When adding the dependency, make sure to replace [latest version here] with the actual latest version (you'll find this in the Maven Central link up above).

A few common dependencies are provided below:

  • Maven
    <dependency>
      <groupId>io.github.lucasstarsz.slopeecs</groupId>
      <artifactId>slope-ecs</artifactId>
      <version>[latest version here]</version>
    </dependency>
  • Gradle
    • Groovy:
      implementation 'io.github.lucasstarsz.slopeecs:slope-ecs:[latest version here]'
    • Kotlin:
      implementation("io.github.lucasstarsz.slopeecs:slope-ecs:[latest version here]")
  • Apache Ivy
    <dependency org="io.github.lucasstarsz.slopeecs" name="slope-ecs" rev="[latest version here]" />

Learning Slope-ECS

The Wiki

I highly recommend Slope's wiki, as it will almost always contain the most up-to-date information on understanding how Slope-ECS works. It is still a work in progress -- as I have more time to work on it, much more will be added to it.

Code Examples

After getting an understanding of how Slope works, these example programs are the best way to learn about using Slope in an actual project.

Building the Source Code

Building Slope's source code is a very easy task. You just need to follow these steps:

  1. If you don't already have it, download Git. It's a powerful source control tool, and is the same source control that Slope-ECS uses.

    • You don't need to have Gradle installed to build Slope-ECS -- Gradle projects come with the build tool.
  2. Using Git, clone the Slope-ECS repository.

    git clone https://github.com/lucasstarsz/Slope-ECS.git
  3. Once you've entered the top directory of the project (cd Slope-ECS), build the project using the gradlew file.

    • On Windows, you'll want to use the gradlew.bat file.
    • For Unix-based systems, you'll need to use the gradlew.sh file (after giving it proper execution permissions).
    ./gradlew build

Having trouble accessing the gradlew file? Read this.

Legal Information

This repository is licensed under the MIT License.

slope-ecs's People

Contributors

lucasstarsz avatar nicvst avatar

Stargazers

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

Watchers

 avatar

Forkers

nicvst

slope-ecs's Issues

Add a Wiki

This project needs explanation and how-tos, asap.

Branding

Setting the project apart from other Java ECS libraries requires more than just a feature list. One of the ways you could make the library unique is by creating branding for your library. Take a look at any of the popular frameworks/engines/libraries/programs. Almost always, the first thing after the title (or even as the title) is a logo.

https://github.com/angular/angular
https://github.com/libgdx/libgdx
https://github.com/neovim/neovim
https://github.com/google/model_search

Of course, logos aren't the only thing that should jump to mind when considering branding.

Is there any specific design/branding goal you have in mind? What should your branding invoke?

Add Issue Templates

Considering the plans for everything else in this project, it would make sense to complete the other bits which make a repository easily used.

One issue template could look something like this:

Slope-ECS Version

The version(s) of Slope-ECS which you experience this issue on

Platform

replace the space (in the platforms you have issues on) with an x

  • Windows
  • Linux
  • Mac OS
  • Other - please specify:

The Issue

Describe in full detail what the issue you have is.

Expected Result

The outcome you expected

Actual Result

The outcome you received

Possible Solutions

Describe in full detail what you suggest could fix this issue

Media Attachments

Place any files you think would be helpful for solving the issue here, such as images, videos, or links to log files if applicable.

[DOCS FIX] Increase documentation readability

The Outdated/Incorrect Information

The overall documentation content is confusingly worded and hard to follow from a beginner's perspective.

Suggestions

Run your documentation through a grammar checker. While the content of the documentation is good, even great, the wording obfuscates just how good it is entirely.

image
This is a great example of what I'm talking about. The beginning documentation makes sense -- the method is important because it initializes the instance for use.
However, in the second sentence of the About section...

This method provides the option of omitting specifying

Can you expect anyone that isn't an English major to comprehend that the first time they read it? (I'm exaggerating, yes, but just to get the point across.)

I really like this documentation, but it needs to be easier to read. I completely understand that your repo is in its incubation phase (it's not even reached v0.1 yet -- this is incredible work so far), but documentation is one of your biggest selling points. If you want that to be upheld, you'll need to keep working on it.

Update to Java 16

Is your feature request related to a problem? Please describe.

Java 16 recently reached general availability -- it's time to upgrade the project to match this.

Progress Checklist

  • update Gradle to Java 16 -- keep up-to-date with milestones and Gradle 7.0.
  • Update project configuration to Java 16
  • Update Javadocs & CSS Styling to Java 16
  • Make use of the inline {@return } tag as necessary in the Javadocs.

This checklist will be updated whenever created commits complete a feature.

[FEATURE REQUEST] Make ECSSystem an interface

Is your feature request related to a problem? Please describe.

The main issue with Slope is that its current API is not yet simple enough. Based on the people who have heard of it up to this point, systems are still very confusing to players. Considering it currently hides things in plain sight (like the entities set and the world instance, as well as the more confusing concepts of how they are created and set up, I don't blame people for being confused.

What should the solution be like?

  • Make ECSSystem an interface - streamline the process of receiving entities as well as standardizing how systems run.
  • Add a standard run method that all ECSSystems have -- that way, this can be easily called by a third-party (such as a game engine.)

Add examples of how to use the ECS

The ECS, while it is available on Maven Central, does not have any explanations or examples of how to use it.
This is an integral part of what a repository should contain -- it needs to be added as soon as possible.

Change examples module name

There's not much explanation needed for this. The module name for the examples module is quite out of sorts for what is normally expected from a module name. It also does not fit the other module names -- it should be all lowercase.

The original

Slope.ECS.examples

Suggested Change

slope.ecs.examples

Breaking Changes

The only breaking change is that modules that access this module will need to change their module name in order to use the module. However, I suspect there isn't anyone using that module in the first place since no parts of it are exposed to be used.

[Bug] Error after a few attempts at guessing the number

Describe the bug
I get an error after a few attempts at guessing the number.

To Reproduce
Steps to reproduce the behavior:

  1. Run GuessGameExample
  2. Attempt to guess the number
  3. After a few tries the error will appear
  4. See error

Expected behavior
It should continue until there are no numbers left.

Screenshots
image

More Documentation

Now that the wiki has been added, we need to have documentation that matches its clarity.

java.lang.IllegalAccessException when running example guessing game

Version:
both 0.0.8 and 0.0.9.

Issue:
When running the example guessing game, the following will occur:

> Task :GuessingGameExample.main()
Welcome to Guessing Game!
Your goal is to find the secret entity with the special number.

Would you like to play a round? (y/N): 
Alllllright, let's get into it!

Exception in thread "main" java.lang.IllegalStateException: java.lang.IllegalAccessException: class io.github.lucasstarsz.slopeecs.system.ECSSystemManager (in module slope.ecs) cannot access class examples.guessinggame.systems.NumberSystem (in module Slope.ECS.examples) because module Slope.ECS.examples does not export examples.guessinggame.systems to module slope.ecs
	at slope.ecs/io.github.lucasstarsz.slopeecs.system.ECSSystemManager.registerSystem(ECSSystemManager.java:81)
	at slope.ecs/io.github.lucasstarsz.slopeecs.World.registerSystem(World.java:183)
	at slope.ecs/io.github.lucasstarsz.slopeecs.system.ECSSystemBuilder.construct(ECSSystemBuilder.java:96)
	at slope.ecs/io.github.lucasstarsz.slopeecs.system.ECSSystemBuilder.<init>(ECSSystemBuilder.java:91)
	at slope.ecs/io.github.lucasstarsz.slopeecs.system.ECSSystemBuilder.<init>(ECSSystemBuilder.java:71)
	at Slope.ECS.examples/examples.guessinggame.game.GuessingGame.reset(GuessingGame.java:34)
	at Slope.ECS.examples/examples.guessinggame.GuessingGameExample.main(GuessingGameExample.java:23)
Caused by: java.lang.IllegalAccessException: class io.github.lucasstarsz.slopeecs.system.ECSSystemManager (in module slope.ecs) cannot access class examples.guessinggame.systems.NumberSystem (in module Slope.ECS.examples) because module Slope.ECS.examples does not export examples.guessinggame.systems to module slope.ecs
	at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:385)
	at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:693)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:490)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
Caused by: java.lang.IllegalAccessException: class io.github.lucasstarsz.slopeecs.system.ECSSystemManager (in module slope.ecs) cannot access class examples.guessinggame.systems.NumberSystem (in module Slope.ECS.examples) because module Slope.ECS.examples does not export examples.guessinggame.systems to module slope.ecs

	at slope.ecs/io.github.lucasstarsz.slopeecs.system.ECSSystemManager.registerSystem(ECSSystemManager.java:74)
	... 6 more

> Task :GuessingGameExample.main() FAILED

Execution failed for task ':GuessingGameExample.main()'.
> Process 'command 'C:/Program Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/bin/java.exe'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

This is because the module Slope.ECS.examples does not export to slope.ecs , as given in the examples.guessinggame.module-info.java file.

Fix:
This can simply fixed by setting the Slope.ECS.examples module to open. I'll create a PR for this.

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.