Code Monkey home page Code Monkey logo

fallingsandsurvival's Introduction

fallingsandsurvival's People

Contributors

davidmahany avatar pieking1215 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fallingsandsurvival's Issues

Still active?

This project hasn't been updated for a few months. Is it still active, or has it been discontinued?

A couple (new) questions on how you accomplish the Box2D rigidbodies in the falling sand simulation.

Hello, I stumbled upon your repo here where I was surprised to find another David M attempting to accomplish something similar.

I do not have a background in GameDev and have been working on creating a falling sand simulation and integrating Box2D. (Inspired by Noita also). I am not attempting to create an entire engine as that is beyond my current abilities and so am using LIBGDX as a pretty bare bones engine to handle most of the update logic myself.

My Repo: https://github.com/DavidMcLaughlin208/FallingSandJava
DevLog Video around integrating Box2D: https://youtu.be/_xFluvZCSaM?t=74

I have a couple questions not covered by the Noita dev tech talk or your answer in another issue where you talk about Box2D.
Issue: #3

  1. How do you account for a Box2D object in the falling sand simulation when the rigidbody has rotated?

I am assuming you are using a 2D array at the core of your falling sand simulation. Lets say you have a box which is 3x3 and exists in the falling sand simulation. When the box rotates 45 degrees it will no longer easily fit into the 2D array. There will be 'holes' in the box where it does not easily fit into the 2D array. Here is an image of what I mean:

FallingSandIssue

I can think of ways to be able to draw the object without the holes. But the falling sand simulation cannot account for these holes in the rectangle and you can see some sand has fallen into the box.

  1. Did you write your own implementations of marching squares and Douglas Peucker algorithms?

In my implementation I used a custom Moore Neighbor tracing algorithm for finding the perimeter of polygons (although this doesnt account for holes in polygons) and a custom Visvalingam line simplification algorithm but I am running into issues with it. Is there a library you are using or is there source material you referenced?

I see you are close to releasing your code on Github. I will be glad to read through it (although I don't know C++) and get some understanding from the code itself. But would be interested in hearing how you solved these problems yourself.

FPS?

Hello, this project looks amazing! What kind of fps does this program get?

how player collision?

wonderful projects, thanks。
I have seen noita gdc talk and your answer for "rigidbody collision", and you said you have "pixel perfect player collision" . i wonder how you do that for realistic sand. for example:

  1. when people falling to sand, it will trap in it, and some sand will fly to the air
  2. when people move in sand, the speed will slow, and sand will also change
  3. when people swim in water, water will move

the way i can think is: make a mask image for the player, and when the pixel is player mask, it will do the logic, but how to do the logic(for example, player move in sand)

Conan with cmake on linux fails

Describe the problem
After changing conanfile.txt to fix a bzip2 dependency error and removing the v141, cmake succeeds, but make fails with this message

-- Build files have been written to: /home/daniel/Software/Source/FallingSandSurvival/build
[  1%] 
          
[  1%] Built target FallingSandSurvival_PRE_BUILD
[  3%] Building CXX object FallingSandSurvival/CMakeFiles/FallingSandSurvival.dir/cmake_pch.hxx.gch
In file included from ~/FallingSandSurvival/build/FallingSandSurvival/CMakeFiles/FallingSandSurvival.dir/cmake_pch.hxx:5,
                 from <command-line>:
~/FallingSandSurvival/FallingSandSurvival/stdafx.h:42:10: fatal error: SDL_gpu.h: No such file or directory
   42 | #include "SDL_gpu.h"
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [FallingSandSurvival/CMakeFiles/FallingSandSurvival.dir/build.make:64: FallingSandSurvival/CMakeFiles/FallingSandSurvival.dir/cmake_pch.hxx.gch] Error 1
make[1]: *** [CMakeFiles/Makefile2:122: FallingSandSurvival/CMakeFiles/FallingSandSurvival.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Use github workflows to build an executable whenever a release is created

GitHub workflows are very useful tools. I've used one to build and publish voxTalkz to pypi, so as to be to make it easily installable with pip. I believe that it would be beneficial to be able to build Falling Sand Survival after every commit to ensure that it successfully compiles without having to compile it yourself, and to publish it to GitHub after every release so that people can easily download the executable. (Perhaps to another repository, as an artifact, or to a GitHub pages website)

https://medium.com/rkttu/write-your-github-actions-workflow-for-build-windows-application-94e5a989f477

Conan cmake error with SDL2

I'll just post the error report for Conan here, x64 Windows, Visual Studio 2019:

-- Conan: Skipping compiler check: Declared 'compiler.toolset'
CMake Error at source_subfolder/CMakeLists.txt:12 (find_package):
By not providing "FindSDL2.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "SDL2", but
CMake did not find one.

Could not find a package configuration file provided by "SDL2" with any of
the following names:

SDL2Config.cmake
sdl2-config.cmake

Add the installation prefix of "SDL2" to CMAKE_PREFIX_PATH or set
"SDL2_DIR" to a directory containing one of the above files. If "SDL2"
-- Configuring incomplete, errors occurred!
See also "C:/Users/BigD/.conan/data/sdl2_ttf/2.0.15/bincrafters/stable/build/71b33648681346c64a4d98d9026b76188c1b1378/build_subfolder/CMakeFiles/CMakeOutput.log".
provides a separate development package or SDK, be sure it has been
installed.

sdl2_ttf/2.0.15@bincrafters/stable:
WARN: sdl2_ttf/2.0.15@bincrafters/stable: requirement sdl2/2.0.9@bincrafters/stable overridden by your conanfile to sdl2/2.0.12@bincrafters/stable
WARN: freetype/2.9.1@bincrafters/stable: requirement libpng/1.6.37@bincrafters/stable overridden by sdl2_ttf/2.0.15@bincrafters/stable to libpng/1.6.37
WARN: freetype/2.9.1@bincrafters/stable: requirement zlib/1.2.11@conan/stable overridden by sdl2_ttf/2.0.15@bincrafters/stable to zlib/1.2.11
WARN: sdl2_image/2.0.5@bincrafters/stable: requirement sdl2/2.0.10@bincrafters/stable overridden by your conanfile to sdl2/2.0.12@bincrafters/stable
WARN: libtiff/4.0.9: requirement libjpeg/9d overridden by sdl2_image/2.0.5@bincrafters/stable to libjpeg/9c
sdl2/2.0.12@bincrafters/stable: WARN: Can't update, no package in remote
libtiff/4.0.9: WARN: Can't update, no package in remote
sdl2_image/2.0.5@bincrafters/stable: WARN: Can't update, no package in remote
sdl2_ttf/2.0.15@bincrafters/stable: WARN: Package binary is corrupted, removing: 71b33648681346c64a4d98d9026b76188c1b1378
sdl2_ttf/2.0.15@bincrafters/stable: WARN: Build folder is dirty, removing it: C:\Users\BigD.conan\data\sdl2_ttf\2.0.15\bincrafters\stable\build\71b33648681346c64a4d98d9026b76188c1b1378
sdl2_ttf/2.0.15@bincrafters/stable: ERROR: Package '71b33648681346c64a4d98d9026b76188c1b1378' build failed
sdl2_ttf/2.0.15@bincrafters/stable: WARN: Build folder C:\Users\BigD.conan\data\sdl2_ttf\2.0.15\bincrafters\stable\build\71b33648681346c64a4d98d9026b76188c1b1378
ERROR: sdl2_ttf/2.0.15@bincrafters/stable: Error in build() method, line 82
cmake = self._configure_cmake()
while calling '_configure_cmake', line 51
cmake.configure(build_folder=self._build_subfolder)
ConanException: Error 1 while executing cd C:\Users\BigD.conan\data\sdl2_ttf\2.0.15\bincrafters\stable\build\71b33648681346c64a4d98d9026b76188c1b1378\build_subfolder && cmake -G "Visual Studio 16 2019" -A "x64" -DCONAN_LINK_RUNTIME="/MDd" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="Visual Studio" -DCONAN_COMPILER_VERSION="16" -DCONAN_CXX_FLAGS="/MP16" -DCONAN_C_FLAGS="/MP16" -DCMAKE_INSTALL_PREFIX="C:\Users\BigD.conan\data\sdl2_ttf\2.0.15\bincrafters\stable\package\71b33648681346c64a4d98d9026b76188c1b1378" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -Wno-dev -T "v142" C:\Users\BigD.conan\data\sdl2_ttf\2.0.15\bincrafters\stable\build\71b33648681346c64a4d98d9026b76188c1b1378
Conan has returned exit code '1' while processing configuration 'Architecture: x86_64, build type: Debug, compiler toolset: v142, compiler version: 16;, runtime library: MDd'. Please check file 'C:\Users\BigD\Desktop\Folder\FallingSandSurvival\x64\Debug.conan\conan_03a70271-a71a-41a0-b540-8034d4181eb8.log' for details.

I followed all of the install instructions as written, but something is wrong with SDL2 it seems.

Create CmakeList.txt for compilation with cmake

Describe the feature you'd like
I'd like this to be able to use Cmake for development on linux. It should be pretty straightforward to create one from what I can find. It requires is creating a CmakeList.txt make-file in a few directories, and as all of the libraries used seem to be platform independent, it should work well on linux.

Is your feature request related to a problem? Please describe.
Developing Software on Linux is typically easier then on Windows for many reasons, and I just can't get it to work on windows due to firewalls and the general slowness of Visual Studios. I'm able to get all the dependencies on linux, but not being familiar with the code I'm having trouble creating a cmake makefile for FSS. Also, running FSS (from github actions) on linux with WINE yields only white.

Add list of keyboard shortcuts

Describe the feature you'd like
A list of keyboard shortcuts

Is your feature request related to a problem? Please describe.
This is a great looking game, but I can't really figure out how to use it... by playing around, I figured out that P put the character into the game, E destroys everything in a circular area, and C turns a cube of terrain into a falling body, but I cannot figure out how to do anything else. I would apricate a list of keyboard shortcuts in order to use all the features.

Game.cpp -> WINAPI glSpeedUp -> ReleaseDC : Unhandled exception

Hello,

ENV


Windows 10
Microsoft Visual Studio Community 2019(Version 16.11.5)


I can see loading screen in windows command prompt.
but It stop at Game.cpp: 266 (Creating game window.. ).
Visual studio notices a error to me at Game.cpp -> WINAPI glSpeedUp -> ReleaseDC.

FallingSandSurvival-20211025


Unhandled exception at 0x00007FF9C3938628 (atiadlxx.dll) in FallingSandSurvival.exe: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x0000002A50903000).


I have no idea.
Please advice to me.
How can I fix it? Please give me hints.

Thanks.

Some other questions about rigid body simulation.

In the question #4 , it is mentioned that the rigid body shape is recalculated when the angle of the rigid body changes.

Look at this pickaxe.
IMG_20200919_092635
IMG_20200919_092538
IMG_20200919_092616

After the rigid body angle is changed, how is this shape transformation achieved?
I have not used those libraries and algorithms you mentioned.

Question on rigidbodies

In the current version of your engine, it appears like sand doesn't get added to rigidbodies (it can only fall off, and never start to stick to, for instance, a convenient container), based on the gifs sent here. Since you have started working on a new version, do you plan to have sand stick to rigidbodies? If yes, how will / do you do it?

Music

So some ambient music might come in handy to your game maybe chiptune.

Open Source?

This looks amazing! Are you planning on publishing the 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.