Coder Social home page Coder Social logo

hactarce / hyperspeedcube Goto Github PK

View Code? Open in Web Editor NEW
66.0 3.0 7.0 10 MB

Modern, beginner-friendly 3D and 4D Rubik's cube simulator

Home Page: https://ajfarkas.dev/hyperspeedcube

License: Apache License 2.0

Rust 97.15% Python 0.88% JavaScript 0.12% HTML 1.71% PowerShell 0.02% WGSL 0.13%
rubiks-cube 4d 3d simulator-game simulator rust rust-lang hacktoberfest

hyperspeedcube's Introduction

Hyperspeedcube logo

Hyperspeedcube is a modern, beginner-friendly 3D and 4D Rubik's cube simulator with customizable mouse and keyboard controls and advanced features for speedsolving. It's been used to break numerous speedsolving records.

For more info, see ajfarkas.dev/hyperspeedcube

hyperspeedcube's People

Contributors

edan-purple avatar hactarce avatar leoongithub avatar milojacquet avatar nonerkao avatar sonicpineapple avatar thatcomputerguy0101 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

Watchers

 avatar  avatar  avatar

hyperspeedcube's Issues

Crash when attempting to click "Manage Keybind Sets" in the "Keybind Sets" tool popup. (v.1.0.6)

Crash when attempting to click "Manage Keybind Sets" in the "Keybind Sets" tool popup. Also occurs when attempting to view or change puzzle keybinds generally.

name = 'Hyperspeedcube'
operating_system = 'unix:NixOS'
crate_version = '1.0.6'
explanation = '''
Panic occurred in file '/build/cargo-vendor-dir/key-names-1.5.1/src/linux.rs' at line 22
'''
cause = 'failed to connect to X11 or Wayland to get keymap: WaylandConnect'
method = 'Panic'
backtrace = '''

   0: 0x55d7a2328893 - core::result::unwrap_failed::h2624e52cdacd8e70
   1: 0x55d7a2c6f1e9 - std::sys::common::thread_local::lazy::LazyKeyInner<T>::initialize::h2f3845ead5e24602
   2: 0x55d7a2c7192b - key_names::linux::scancode_name::hfad6812b3c55287d
   3: 0x55d7a2c6e2eb - key_names::key_name::hc8f3a68ffa9ee3f0
   4: 0x55d7a2368770 - <hyperspeedcube::preferences::keybinds::KeyCombo as core::fmt::Display>::fmt::h823592ac04a966a3
   5: 0x55d7a254261e - core::ops::function::FnOnce::call_once{{vtable.shim}}::h1de456c4c4483676
   6: 0x55d7a2567df6 - egui::ui::Ui::allocate_ui_with_layout_dyn::hd07d820427114724
   7: 0x55d7a254cb27 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h7fbef2ff12858163
   8: 0x55d7a256a4b4 - egui::ui::Ui::scope_dyn::h78efa7b8712a9105
   9: 0x55d7a2547e0e - core::ops::function::FnOnce::call_once{{vtable.shim}}::h517612d3c7733fe5
  10: 0x55d7a256a67f - egui::ui::Ui::scope_dyn::h9636b8663d95b5cb
  11: 0x55d7a256919c - egui::ui::Ui::scope::h6225af8e9d536d5e
  12: 0x55d7a24bf03a - hyperspeedcube::gui::components::reorder::ReorderableList<T>::show::hdb9a26ac5b7be906
  13: 0x55d7a245128b - core::ops::function::FnOnce::call_once{{vtable.shim}}::hb020505d79ece298
  14: 0x55d7a2454f74 - egui::containers::scroll_area::ScrollArea::show_viewport_dyn::h14646763f3ed1d49
  15: 0x55d7a254df90 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h86b1713fa31d84ed
  16: 0x55d7a256a67f - egui::ui::Ui::scope_dyn::h9636b8663d95b5cb
  17: 0x55d7a256966d - egui::ui::Ui::scope::ha497a80a37ea9181
  18: 0x55d7a23be693 - <hyperspeedcube::gui::components::keybinds::KeybindsTable<S> as egui::widgets::Widget>::ui::h8f4e0694705f2726
  19: 0x55d7a24aa838 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h5d7b2a0afdd45727
  20: 0x55d7a2554a5e - core::ops::function::FnOnce::call_once{{vtable.shim}}::hbcdad7395453c52c
  21: 0x55d7a2562158 - egui::containers::collapsing_header::CollapsingState::show_body_indented::{{closure}}::h4aa0da682466192a
  22: 0x55d7a256a67f - egui::ui::Ui::scope_dyn::h9636b8663d95b5cb
  23: 0x55d7a2544a96 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h378ffd19ab7379ff
  24: 0x55d7a2562f79 - egui::containers::collapsing_header::CollapsingHeader::show_dyn::h382241385de9bb47
  25: 0x55d7a24ab443 - core::ops::function::FnOnce::call_once::h21883cefa4cf4ce6
  26: 0x55d7a23a7759 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hd6bbf1cf145dd966
  27: 0x55d7a23a24b6 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h71b0ee2542137cb7
  28: 0x55d7a245520b - egui::containers::frame::Frame::show_dyn::h9373ff24396a96ba
  29: 0x55d7a23bfd2e - hyperspeedcube::gui::side_bar::build::h693e50cabb56dd9e
  30: 0x55d7a24c1b1e - hyperspeedcube::gui::windows::Window::show::h7bea3b8e11c953de
  31: 0x55d7a24c2234 - hyperspeedcube::gui::build::ha37ced63cc70d0e8
  32: 0x55d7a253df03 - hyperspeedcube::run::{{closure}}::{{closure}}::h560314d5844ba5e7
  33: 0x55d7a235fcc4 - winit::platform_impl::platform::x11::EventLoop<T>::run_return::single_iteration::h462cf468f60bcaa3
  34: 0x55d7a23614f6 - winit::platform_impl::platform::x11::EventLoop<T>::run::h37fb392319388a43
  35: 0x55d7a2521b8d - winit::platform_impl::platform::EventLoop<T>::run::hb121024f3919cc8e
  36: 0x55d7a25218d6 - winit::event_loop::EventLoop<T>::run::hc9cf30c05dc7e9f4
  37: 0x55d7a2529e53 - pollster::block_on::h002d0e39148e181e
  38: 0x55d7a241974f - hyperspeedcube::main::h9115464ee42996f1
  39: 0x55d7a2517133 - std::sys_common::backtrace::__rust_begin_short_backtrace::h4a0f64ac90942dcb
  40: 0x55d7a253f039 - std::rt::lang_start::{{closure}}::h1a55b96d55bb528b
  41: 0x55d7a2df5f64 - std::panicking::try::h45c8379f4866ecc7
  42: 0x55d7a2def955 - std::rt::lang_start_internal::hf358ddc7f05da9a0
  43: 0x55d7a241b5a5 - main
  44: 0x145b8e0d710e - __libc_start_call_main
  45: 0x145b8e0d71c9 - __libc_start_main@@GLIBC_2.34
  46: 0x55d7a2328a85 - _start
  47:        0x0 - <unresolved>'''

Version 1 crash on startup under Wayland

The programs crashes when running on Wayland with interface 'wl_surface' has no event 2 error. This is an issue with SCTK 0.16.0 explained here wez/wezterm#3996

A temporary solution is to update to version 0.16.1 using cargo update -p smithay-client-toolkit.

5D twist controls (mouse & keyboard)

We will need to brainstorm 5D twist controls via mouse and keyboard. Hopefully we will come up with a general solution that can also be used in 6D and 7D.

Crash on lua file

puzzledef{
  id = 'skewb_lookalike_hypercube',
  name = "skewb lookalike hypercube",
  ndim = 4,
  meta = {
    id = 'skewb_lookalike_hypercube',
    author = "Milo Jacquet",
  },

  build = function()
    for v in cd{4, 3, 3}:expand('ooox') do
      carve(v:normalized())
      add_color(v)
    end
    for v in cd{4, 3, 3}:expand('xooo') do
      slice(v:normalized()/math.sqrt(3))
    end
  end,
}

Normalizing the color fixes it

Missing dependencies in build instructions

Using Ubuntu 22, I had to install the following dependencies to be able to compile/run the project:

sudo apt install cmake libglib2.0-dev libatk1.0-dev libgtk-3-dev libxkbcommon-x11-dev

Whether you want to add these to the BUILD file or just close this issue, up to you !

Error cutting piece on one of two equivalent shape definitions

TestA works fine, but TestB has error cutting piece

common = require('common')

puzzledef{
  id = 'testA',
  name = "testA",
  ndim = 4,

  build = function()
    for v in cd{4, 3, 3}:expand('xoxo') do
      carve(v)
      -- slice{normal=v,distance=0}
      add_color(v)
    end
  end,
}
puzzledef{
  id = 'testB',
  name = "testB",
  ndim = 4,

  build = function()
    for v in cd{3, 3, 4}:expand('oxox') do
      carve(v)
      -- slice{normal=v,distance=0}
      add_color(v)
    end
  end,
}

This happens in v2.0.0-pre.6

hsc crashes on launch

I use EndeavourOS Linux x86_64 with a 6.3.5-zen1-1-zen kernel (if that helps somehow) on wayland
here's the report file thing

name = 'Hyperspeedcube'
operating_system = 'unix:Unknown'
crate_version = '1.0.5'
explanation = '''
Panic occurred in file 'src/render/state.rs' at line 44
'''
cause = 'called `Result::unwrap()` on an `Err` value: RequestDeviceError'
method = 'Panic'
backtrace = '''

   0: 0x5571beeadb83 - core::result::unwrap_failed::h62abf61e411aaa08
                at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/result.rs:1791
   1: 0x5571bf0a52b0 - pollster::block_on::h850b9c3b667d4b4b
   2: 0x5571bf13ef20 - hyperspeedcube::main::ha7134095c1bbccfd
   3: 0x5571bf088253 - std::sys_common::backtrace::__rust_begin_short_backtrace::h759f3faaf97cb349
   4: 0x5571beec1af9 - std::rt::lang_start::{{closure}}::he9759618ec1b7a7f
   5: 0x5571bf9f824c - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hfa1c3687c9a20bb8
                at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ops/function.rs:606
                 - std::panicking::try::do_call::h0497133ebe1341e5
                at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:483
                 - std::panicking::try::h6c3de05c7ca5d07f
                at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:447
                 - std::panic::catch_unwind::h969058ecb5334b30
                at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panic.rs:137
                 - std::rt::lang_start_internal::{{closure}}::h0de6d98cafb42a58
                at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/rt.rs:148
                 - std::panicking::try::do_call::h77301dcf43953993
                at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:483
                 - std::panicking::try::h45b05523a2fe135a
                at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:447
                 - std::panic::catch_unwind::hd95cea544b2b9bd2
                at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panic.rs:137
                 - std::rt::lang_start_internal::hd16e6ff7bf05a444
                at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/rt.rs:148
   6: 0x5571bf140045 - main
   7: 0x7f32a846f850 - <unresolved>
   8: 0x7f32a846f90a - __libc_start_main
   9: 0x5571beeadd15 - _start
  10:        0x0 - <unresolved>'''

It also says Xlib: extension "NV-GLX" missing on display ":0". when launched before the error message
I hope this was understandable lol

Planned puzzles masterlist

If you would like to see a puzzle added that is not listed here, add a comment on this issue.

At this time, I am only accepting puzzles that are ≤5D and can be built and simulated using current features. That means:

  • Euclidean N-dimensional space
  • only flat cuts
  • no deleted pieces
  • only doctrinaire turns
  • no multi-core

Must-have for v2.0

This is the list of puzzles that I know people will want in v2.0 and have minimal complications. Namely: they are all doctrinaire, have few enough axes that we can reasonably name all the twists, and exist in 3D or 4D.

Nearly all of these are waiting on #53

3D

4D

  • N^4 Rubik's Hypercube generator
  • AxBxCxD hypercuboid generator
  • {A}x{B} duoprism generator
  • N-layer simplex generator (at various cut depths)

Shortlist

3D

4D

  • Megaminx prism generator (at various layers of megaminx and various layers of prism)
  • Facet-Turning 24-cell
  • N-layer Trajber's 16-cell (vertex-turning; shapemod of 3^4) generator
  • Ridge-Turning Hypercube
  • Demi N^4 generator
  • Facet-Turning 120-cell

5D

These are waiting on #54

  • N^5 Rubik's Hypercube
  • AxBxCxDxE hypercuboid generator

QSTM toggle is transient upon restart

Steps to reproduce:

  1. Open the turn metrics popup
  2. Check the QSTM toggle
  3. Restart the program
  4. Note that QSTM is active
  5. Open the turn metrics popup
  6. Note that QSTM is no longer active

Crash on startup "unable to request graphics adapter"

I've been trying to compile the program for nixos. After resolving the missing dependencies the compiled program crashes on startup.

Full log:

name = 'Hyperspeedcube'
operating_system = 'unix:NixOS'
crate_version = '1.0.5'
explanation = '''
Panic occurred in file 'src/render/state.rs' at line 198
'''
cause = 'unable to request graphics adapter'
method = 'Panic'
backtrace = '''

   0: 0x55954c71f452 - pollster::block_on::he08d1f98fc029209
   1: 0x55954c55e450 - hyperspeedcube::main::h8986dc330c20691a
   2: 0x55954c708503 - std::sys_common::backtrace::__rust_begin_short_backtrace::h654e4e32b09662ea
   3: 0x55954c6ba789 - std::rt::lang_start::{{closure}}::h9fb173e7cce2a6b5
   4: 0x55954d0225b8 - std::rt::lang_start_internal::h34bd518f25d68bbe
   5: 0x55954c55f275 - main
   6: 0x7f0bcb408ace - __libc_start_call_main
   7: 0x7f0bcb408b89 - __libc_start_main@@GLIBC_2.34
   8: 0x55954c4c4e05 - _start
   9:        0x0 - <unresolved>'''

I created a reproducible build using nix, which I ran on three different machines:

{ pkgs ?
  import (builtins.fetchGit {
    name = "nixpkgs-unstable-2021-07-19";
    url = "https://github.com/nixos/nixpkgs/";
    ref = "refs/heads/release-23.05";
    rev = "1e409aeb5a9798a36e1cca227b7f8b8f3176e04d";
  })
  {}
}:

pkgs.stdenv.mkDerivation rec {
  pname = "hyper-speed-cube";
  version = "0.1.0";
  src = ./.;
  buildInputs =
    [ pkgs.cargo
      pkgs.gcc
      pkgs.cmake
      pkgs.pkg-config
      pkgs.glib
      pkgs.fontconfig
      pkgs.atkmm
      pkgs.gtk3
      pkgs.python3
      pkgs.libxkbcommon
    ];
  buildPhase = ''
    cargo clean
    cargo build --release
  '';
}

All three machines produce this error when compiling with the above nix file. All three machines run nixos. I tried using clang instead of gcc to no effect but didn't fiddle around with the specific versions of anything of the other dependencies.

If you have nix you can use nix-build with the above to reproduce the build.

Bug with v2.0 twist gizmo

Steps to reproduce:

  1. open FTO
  2. set 3D FOV to -120
  3. try to mimic this video
Screen.Recording.2024-07-23.at.8.19.14.PM.mov

Crash on launch: “Error in Surface::configure: parent device is lost”

Version v1.0.2 for Linux, downloaded from the website, extracted and ran directly (using Linux Fedora Linux 37 KDE)
The crash report:

name = 'Hyperspeedcube'
operating_system = 'unix:Unknown'
crate_version = '1.0.2'
explanation = '''
Panic occurred in file '/home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.13.1/src/backend/direct.rs' at line 281
'''
cause = 'Error in Surface::configure: parent device is lost'
method = 'Panic'
backtrace = '''

   0: 0x556239780949 - wgpu::backend::direct::Context::handle_error_fatal::h3b5e2cc268bd7d09
   1: 0x556239781663 - <wgpu::backend::direct::Context as wgpu::Context>::surface_configure::h18c1a85f680b04e9
   2: 0x5562392563f5 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h22a4bc87f0c383e1
   3: 0x556239418bfb - pollster::block_on::h13997f0d11e9fe56
   4: 0x55623922e1fb - hyperspeedcube::main::h11e4eaabd6ff8448
   5: 0x5562393d4363 - std::sys_common::backtrace::__rust_begin_short_backtrace::h2e626bdd61a55e10
   6: 0x55623921a419 - std::rt::lang_start::{{closure}}::h1ee27baed795d130
   7: 0x556239c28f2b - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h072eb4cd8da964ba
                at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:286
                 - std::panicking::try::do_call::h8eca204fe9266946
                at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:483
                 - std::panicking::try::h12574e1b7b2cbacb
                at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:447
                 - std::panic::catch_unwind::hf71522d4448329d6
                at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panic.rs:137
                 - std::rt::lang_start_internal::{{closure}}::h65b66ac9bff580f8
                at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/rt.rs:148
                 - std::panicking::try::do_call::hfff61e33ca3db9f1
                at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:483
                 - std::panicking::try::he48c8ecead279cad
                at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:447
                 - std::panic::catch_unwind::hd510a26bfc950ccc
                at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panic.rs:137
                 - std::rt::lang_start_internal::hc680b25eab888da9
                at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/rt.rs:148
   8: 0x5562392443e5 - main
   9: 0x7fd4cdf65510 - __libc_start_call_main
  10: 0x7fd4cdf655c9 - __libc_start_main_alias_2
  11: 0x5562391e543e - _start
  12:        0x0 - <unresolved>'''

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.