Giter Site home page Giter Site logo

vsand's People

Contributors

ealrann 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

Watchers

 avatar  avatar  avatar  avatar

vsand's Issues

Dirt creation

When wet fall down, the solid dirt stay: dirt is created.
Way to reproduce:
bug_dirt
Lead to:
bug_dirt_result

Better colors

VSand could have a better look with different colours.

For example, when the Fuel burn, an intermediate hidden material ("sparkle") is created to propagate the fire. This sparkle is dark red, but it doesn't look really convincing.

They can be tweaked in this file, by simply changing the R, G and B fields (red, green and blue):

<materials name="Void" runoff="60"/>
<materials name="Sand" density="5" runoff="1" r="244" g="244" b="67"/>
<materials name="Dirt" isStatic="true" density="5" runoff="1" r="72" g="38" b="4"/>
<materials name="Wall" isStatic="true" density="20" r="153" g="153" b="143"/>
<materials name="Concrete" density="4" runoff="12" r="94" g="94" b="85"/>
<materials name="Water" density="3" runoff="64" r="67" g="67" b="244"/>
<materials name="Vapor" density="-2" runoff="1" r="159" g="159" b="249"/>
<materials name="WetDirt" density="5" runoff="1" r="48" g="26" b="3" userFriendly="false"/>
<materials name="Grass" isStatic="true" density="1" r="11" g="193" b="11" userFriendly="false"/>
<materials name="Fire" density="-1" r="244" g="67" b="67"/>
<materials name="FireStatic" isStatic="true" r="244" g="38" b="38" userFriendly="false"/>
<materials name="FireFinal" isStatic="true" r="255" userFriendly="false"/>
<materials name="Plant" isStatic="true" density="15" r="67" g="244" b="67"/>
<materials name="Wax" isStatic="true" density="20" r="254" g="254" b="231"/>
<materials name="LiquidWax" density="2" runoff="3" r="231" g="254" b="254" userFriendly="false"/>
<materials name="BurningWax" isStatic="true" r="244" g="38" b="38" userFriendly="false"/>
<materials name="Lava" density="4" runoff="5" r="244" g="111" b="67"/>
<materials name="LavaBoiling" density="2" runoff="6" r="244" g="244" b="67" userFriendly="false"/>
<materials name="Fuel" density="1" runoff="30" r="212" g="158" b="59"/>
<materials name="Petrol" density="2" runoff="30" r="30" g="30" b="95"/>
<materials name="PetrolFire" density="1" runoff="30" r="50" g="15" b="106" userFriendly="false"/>
<materials name="Sparkle" r="185" g="50" b="65" userFriendly="false"/>
<materials name="HotWax" density="1" runoff="3" r="231" g="254" b="254" userFriendly="false"/>

After a change, simply run ./gradlew run to launch the game with your new colours.

Since I'm pretty bad with colours, I let this issue open and ask for help.

Fix the update rate

For now, the update rate depends on the refresh rate of the display, so a game launched on a 120Hz screen will run faster.

For responsiveness, the game should be rendered at the speed of the screen, but the game board should be updated at a fixed rate.

MacOS build

Here the steps required to compile under MacOS (thanks a lot to @kvark #23 ) :

1. Clone the repo

git clone --recursive --single-branch --branch root https://github.com/Ealrann/VSand.git
cd VSand/
git checkout 7fa5a9d
git submodule update

Note : The head version appears to be currently broken on MacOS. After some digging, it looks like some bugs inside GLFW. They fixed some stuf recently related to the MacOS support, but the last LWJGL Snapshot is older than these fix. I'll update the macos compilation when LWJGL will be updated.

2. Use the Snapshot version of LWJGL

The last LWJGL Snapshot contains some mandatory fix for GLFW. Edit the file Lily-vulkan/gradle.properties and change the Lwjgl version :

lwjglVersion = 3.2.4-SNAPSHOT

3. Edit the run configuration

Macos requires some UI library to run inside the native thread, so we need to pass a special argument to the JVM. More information here and here.

Edit the file Vsand/VSand/org.sheepy.vsand/build.gradle and add the -XstartOnFirstThread arg :

application {
	mainModule = 'org.sheepy.vsand'
	mainClass = 'org.sheepy.vsand.VSandApplicationLauncher'

        applicationDefaultJvmArgs = ["-XstartOnFirstThread"]
}

4. Run

Go to the directory Vsand/VSand and run :

./gradlew run

5. Extra steps if you don't want to use MoltenVk

You need to specify the path to the library libvulkan.dylib. To do so, an extra jvmarg is required. See this post for more information.

Edit the file Vsand/VSand/org.sheepy.vsand and add the -Dorg.lwjgl.vulkan.libname arg :

application {
	mainModule = 'org.sheepy.vsand'
	mainClass = 'org.sheepy.vsand.VSandApplicationLauncher'

        applicationDefaultJvmArgs = ["-XstartOnFirstThread", "-Dorg.lwjgl.vulkan.libname=<path_to_vulkan_sdk>/macOS/lib/libvulkan.dylib"]
}

macOS Support via MoltenVK

Is it possible to utilize MoltenVK to add support for macOS? It's a thin wrapper around the native Metal API available on macOS. As an example, the Dolphin project was able to add support using MoltenVK - though that's a C++ project versus Java - hopefully there aren't a significant number of differences or issues preventing implementation.

Speed 1 should represent 1 update at a time

Since the big rewrite of the compute shader 6b5c0f0, the game use double buffering. To display the right buffer, without making a transfert (because I don't want it), is to call too times the update shader, to always print the board1 on screen:

  • 1: Draw on board1
  • 2.1: Update board 2 from board 1
    2.2: Update board 1 from board 2
  • 3: Create image from board 1

We shouldn't update two times in a row when the speed of the game is 1. This pipeline have to be dynamic, and rebuilt every time the speed change, and present the last updated buffer.

A better solution would be to implement some swap buffer mechanism (for compute pipeline first) on https://github.com/Ealrann/Lily-Vulkan project.

Lift the requirement to blit the swapchain image

It looks like the code issues a vkCmdBlitImage operation on a swapchain image without checking if the TRANSFER_SRC/TRANSFER_DST usages are even supported on the swapchains by calling vkGetPhysicalDeviceSurfaceCapabilitiesKHR.

Vulkan doesn't guarantee that anything but COLOR_ATTACHMENT usage is supported. Could we have VSand compatible with such drivers?

UI is blinking

Randomly, the UI is blinking.

I suspect the draw of the UI overridden by the blit of the computed pixel image.

gradlew run BUILD FAILED

I followed your instructions and get BUILD FAILD:

How to produce the error

  • First ... setup a JDK 14

  • clone the repo using:
    git clone --recursive --single-branch --branch root https://github.com/Ealrann/VSand.git

  • launch the game:
    #Go to the VSand project directory
    cd VSand/VSand/
    #Use gradle to run it
    ./gradlew run

  • Now I got the BUILD FAILED in 25s. After reading your instructions further,
    I generated an access token and edit files.

  • After second gradlew run I got the following message (only in 3s, at first run I got same message in 25s):

OUTPUT of gradlew run

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':org.sheepy.vsand:run'.

Could not resolve all task dependencies for configuration ':org.sheepy.vsand:runtimeClasspath'.
Could not resolve emf.standalone:org.eclipse.emf.common:2.21.0.
Required by:
project :org.sheepy.vsand > project :Lily-vulkan:org.sheepy.lily.vulkan.api > project :Lily-vulkan:org.sheepy.lily.game.api > project :Lily-core:org.sheepy.lily.core.api
> Could not resolve emf.standalone:org.eclipse.emf.common:2.21.0.
> Could not get resource 'https://maven.pkg.github.com/ealrann/emf-standalone/emf/standalone/org.eclipse.emf.common/2.21.0/org.eclipse.emf.common-2.21.0.pom'.
> Username must not be null!
Could not resolve emf.standalone:org.eclipse.emf.ecore:2.21.0.
Required by:
project :org.sheepy.vsand > project :Lily-vulkan:org.sheepy.lily.vulkan.api > project :Lily-vulkan:org.sheepy.lily.game.api > project :Lily-core:org.sheepy.lily.core.api
> Could not resolve emf.standalone:org.eclipse.emf.ecore:2.21.0.
> Could not get resource 'https://maven.pkg.github.com/ealrann/emf-standalone/emf/standalone/org.eclipse.emf.ecore/2.21.0/org.eclipse.emf.ecore-2.21.0.pom'.
> Username must not be null!
Could not resolve emf.standalone:org.eclipse.emf.ecore.xmi:2.21.0.
Required by:
project :org.sheepy.vsand > project :Lily-vulkan:org.sheepy.lily.vulkan.api > project :Lily-vulkan:org.sheepy.lily.game.api > project :Lily-core:org.sheepy.lily.core.api
> Could not resolve emf.standalone:org.eclipse.emf.ecore.xmi:2.21.0.
> Could not get resource 'https://maven.pkg.github.com/ealrann/emf-standalone/emf/standalone/org.eclipse.emf.ecore.xmi/2.21.0/org.eclipse.emf.ecore.xmi-2.21.0.pom'.
> Username must not be null!

  • 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.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s

What went wrong?

Are there any further instructions

Improve UI

Add some information about shortcut:

  • Space bar to pause.
  • N to go to next frame.

Maybe some focus for the color buttons?

Failed to submit draw command buffer!

On Nvidia GTX 1070, after placing some moving material (sand, water), error when Submitting draw command buffer:

System Extensions:
        VK_EXT_debug_report
        VK_EXT_display_surface_counter
        VK_KHR_get_physical_device_properties2
        VK_KHR_get_surface_capabilities2
        VK_KHR_surface
        VK_KHR_win32_surface
        VK_KHX_device_group_creation
        VK_KHR_external_fence_capabilities
        VK_KHR_external_memory_capabilities
        VK_KHR_external_semaphore_capabilities
        VK_NV_external_memory_capabilities
System Layers:
        VK_LAYER_NV_optimus
        VK_LAYER_VALVE_steam_overlay
        VK_LAYER_LUNARG_standard_validation

Graphic Device : GeForce GTX 1070
        maxImageDimension2D:    32768
        maxUniformBufferRange:  65536
        maxStorageBufferRange:  2147483647
        maxPushConstantsSize:   256
in (1.0, 1.0) (3.4028235E38, 3.4028235E38)
FPS: 89.132286
FPS: 120.73703
FPS: 89.823044
FPS: 120.26227
FPS: 120.010155
FPS: 120.04769
failed to submit draw command buffer!
FPS: 20.578407

Potential new materials

Bomb

Fall down, explode when touching something.

Acid

Same behaviour than lava, without fire ?
done: #18

Torch/Waterfall

We need the ability to put some static material. Two solutions:

  • (bad) New specific materials (Torch/Waterfall)
  • (good) Redraw the materials at the same place (Static materials could be drawn with shift-clic)
    => We need the capacity to make multiple draw every frames (Simply recall the compute shader?). No, impossible to remove it properly.
    => Tag the board with a static boolean?

Smooth the fall down of particles

Fall down of particle could be optimized: the swap could be made per column of matter.
Iterate the same materials that does not want to move.

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.