Giter Club home page Giter Club logo

fallingsandjava's Introduction

FallingSandJava

Falling sand simulation written in Java and LIBGDX

YouTube video tutorial on how to build this: https://youtu.be/5Ka3tbbT-9E

Overview:

Inspired by classic falling sand games I am making one of my own. The intent is to build and release a falling sand simulation simlar to the ones from the early 2000's. Plans past that are to create a local multiplayer combat game within the falling sand simulation taking influence from Duck Game and integrating the falling sand simulation with Box2D taking influence from Noita.

Online multiplayer would require extremely sophisticated systems to allow for smooth gameplay when each game object is one pixel square. This would be too much to synchronize with basic online implementations. However, With recent improvements in streaming online multiplayer should be possible through Steam Remote Play or Parsec.

Integrating Box2D

Integrating Box2D with a falling sand simulation presents unique technical challenges. The Noita developers have gone into some detail in their video Exploring the Tech and Design of Noita

The basic steps are:

  • Take a 2D array of elements and use marching squares algorithm to get the contour
  • Use a Douglas-Peucker line simplification algorithm to reduce the amount of vertices
  • Pass the simplified set of vertices to a triangulation algorithm
  • Create a Box2D rigidbody from all the resulting triangles
  • If any elements in the rigidbody are destory repeat the process

fallingsandjava's People

Contributors

davidmclaughlin208 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  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

fallingsandjava's Issues

About the Android version of this open source project.

Hello, I found your open source project some time ago, and I tried to make it run on Android.

Android project jump link

The compilation software I use is AIDE.

Because the version you use box2d uses more Java8 syntax and the version I use is Java7, I only tried to run the previous version, and the performance is a bit bad when the game is running.

Would you try to make an Android version?

A bug about this project.

Hello, when I zoomed the camera in the game to be smaller, I stumbled upon a bug.

The green area on this picture is the matrix by fallingsand simulation. (I changed the color of emptycell to this color.)
Screenshot_2020-10-13-20-04-54-35

Then these are abnormal pictures:
Screenshot_2020-10-13-20-05-43-58
Screenshot_2020-10-13-20-05-26-76

When generating new element pixels, this problem appeared on the right side of the original green matrix. I haven't found the root cause of the problem, so I submit this question in the hope that you can solve it.

(Maybe my English is a bit strange, because I am not very good at English. If there is any language inappropriate, I hope you can forgive me)

Suggestions to improve program efficiency.

Hello, I found that your program does not run very smoothly on Android, so I have a few suggestions here, which may be able to help you.

1.Emptycell may not be drawn.

2.Use multiple threads to calculate parameters and draw.

Waiting for completion...

Project fails to run.

Hy,
I followed your video on youtube to this repo.
I really wat to learn this stuff, so I tried to make my hands dirty. However, Im not a Java developer, and do not know a single thing about Gradle and all the odher stuff. However, Pulled the projekt from your repo, but it failed to build. There were two major problem:

  1. Gradle is looking for and outdated version, as such gradle fails to build:
    GradleBuildLog.txt
  2. When the main window is tarted (dektop build) it flashes and moves away, and complains that it can not find the UI asset (uiskin.atlas).
    BuildLog.txt

System specs:

  1. Windows 10
  2. VSCode 1.87.2
  3. ExtensionPack for Java 0.25.15
  4. Java 21.0.2
  5. Gradle for Java 3.15.5
  6. Language Support for Java(TM) by Red Hat 1.28.1

I would be very thankful if you could fix these, or at least give me a guide on how to make it build and run, at least on the desktop!

Thank you!

A desperate plea for help regarding the Box2D integration

Hi, inspired by your video as well as Noita and other projects, I have been working on my own falling sand engine in C# for a few months. I've got Box2D full integrated, but I've run into the "holes" issue you described here, but I'm struggling with a different problem than you were.

See this video: https://streamable.com/jeyklj

The order of operations I am performing is...

  1. Place the pixels from all Box2D components into the main pixel matrix
  2. Run the pixel matrix simulation
  3. Remove all Box2D component pixels from the main pixel matrix and put them back into their respective components

Rather than just ending up with holes when the objects are rotated, it's like the holes appear and then continue to appear as it rotates further, leading to the pixels in the Box2D components just being erased entirely.

I know this repo hasn't been updated in a couple of years, I'm really just hoping you see this and are able to offer some insight, as I've been dealing with this problem for a few weeks now and I'm getting desperate!

Thanks!

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.