Git Product home page Git Product logo

3dstris's Introduction

3DStris MIT C+\+ 11 Azure Pipelines GitHub release downloads CodeFactor Weblate

A Tetris clone for the 3DS.

Development currently paused, project will eventually be rewritten

Downloads

The latest automatically generated stable build can be found here.
Development builds are available as Azure Pipelines artifacts. You can find the latest development build here.
3DStris is also available on TinyDB.
You can view the GitHub release stats here.

Screenshots

Main Menu Sprint Ingame Banner

Building

Setup

For building you’ll need to set up devkitPro and you’ll need to have the following tools in your PATH:

Make sure to clone recursively (required for third-party libs, check external/):

git clone --recursive https://github.com/3DStris/3DStris
# If you've already cloned without --recursive, do:
git submodule update --init

Commands

On Windows, the following commands should be run in the devkitPro shell (devkitPro/msys2/usr/bin/bash.exe).
cmake -G "Unix Makefiles" -S . -B build
cmake --build build
# or if your CMake version isn't new enough
mkdir build && cd build
cmake -G "Unix Makefiles" ..
make

Resulting binaries can be found in build/bin/.

Translation

3DStris uses Weblate for its translations. Feel free to contribute or view existing translations at the Hosted Weblate instance.

Pre-Weblate integration credits:

License

Distributed under the MIT license. See the accompanying LICENSE file for more information.

3dstris's People

Contributors

albertcoolguy avatar avganec avatar caheba avatar comradekingu avatar eldarlis avatar epicpkmn11 avatar geniiii avatar horstjens avatar itsdavvid avatar lingcas avatar matcool avatar milotype avatar nathanbnm avatar safirasafitri avatar sam-oak avatar santossi avatar susguir254 avatar waldist avatar weblate avatar whodizhod 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

Watchers

 avatar  avatar  avatar

3dstris's Issues

Use fmtlib

fmt has support for user-defined types, meaning it can be adapted to work with our String and StringView types.

LTO/IPO causes segfault

Thread 1 received signal SIGSEGV, Segmentation fault.
0x0011b494 in phmap::container_internal::raw_hash_set<phmap::container_internal::FlatHashMapPolicy<Keybinds::Action, unsigned long>, phmap::Hash<Keybinds::Action>, phmap::EqualTo<Keybinds::Action>, std::allocator<std::pair<Keybinds::Action const, unsigned long> > >::raw_hash_set(phmap::container_internal::raw_hash_set<phmap::container_internal::FlatHashMapPolicy<Keybinds::Action, unsigned long>, phmap::Hash<Keybinds::Action>, phmap::EqualTo<Keybinds::Action>, std::allocator<std::pair<Keybinds::Action const, unsigned long> > > const&, std::allocator<std::pair<Keybinds::Action const, unsigned long> > const&) [clone .lto_priv.0] ()
(gdb) bt
#0  0x0011b494 in phmap::container_internal::raw_hash_set<phmap::container_internal::FlatHashMapPolicy<Keybinds::Action, unsigned long>, phmap::Hash<Keybinds::Action>, phmap::EqualTo<Keybinds::Action>, std::allocator<std::pair<Keybinds::Action const, unsigned long> > >::raw_hash_set(phmap::container_internal::raw_hash_set<phmap::container_internal::FlatHashMapPolicy<Keybinds::Action, unsigned long>, phmap::Hash<Keybinds::Action>, phmap::EqualTo<Keybinds::Action>, std::allocator<std::pair<Keybinds::Action const, unsigned long> > > const&, std::allocator<std::pair<Keybinds::Action const, unsigned long> > const&) [clone .lto_priv.0] ()
#1  0x00108724 in Config::Config() [clone .constprop.0] ()
#2  0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

I'm not sure if this is a problem with 3DStris' code or an issue with the linker.

Use a different format for save data

This excludes translations.
Msgpack is a viable option; converting the current JSON data to msgpack shouldn't be too difficult. Another option is SQLite, which I haven't looked into too much yet.

Textures

Self-explanatory.
To be made optional.

GUI rewrite

The 3DStris GUI system was made as a placeholder for a less hardcoded one. Something like randrew/layout could help.

Move from CMake to Meson

While CMake has improved a substantial amount over the last few years, it's awful for cross-compilation and still isn't all that good to write or (especially) use. Meson is the only viable alternative, besides Makefiles or a custom build system; Automake is even worse than CMake, I don't like Premake, and a build system written in Java (Bazel) isn't exactly something that appeals to me.

The only issue I can really think of here is IDE support, which is already kind of a mess anyways, due to cross-compilation and having to run the game in an emulator. This may not always be the case, as I do plan to have a PC version of 3DStris for debugging and unit testing purposes. (This is something I had already attempted previously, but CMake was a massive obstacle that led to the whole thing getting scrapped)

Ditch sds

We don't need sds if we already have a String class.

Required for: #126

Replace MessagePack with FlatBuffers

Sorry, sorry.. This should be the last save format change. Automatic conversion will still be available for a few releases, just as it originally was with the switch to MessagePack.

Rewrite

It's about time for a rewrite. (in C11)

My work on 3DStris started out as a way to better learn C++ (as I'm sure many can tell). As a result, 3DStris has become an OOP mess with many Java-isms present, despite mixing many C libraries with C++ code.

Some code criticisms:

  • The String class is a C++ wrapper around a C99 library, when I should've probably just written my own library from scratch.
    • We also have both a StringView and String class, because our String class can only own an sds string
  • The GUI (Screen) system was a placeholder waiting for a future replacement, but I never got around to replacing it, as mentioned in #54.
  • Memory allocation is a mess, and strings are constantly allocated on the heap, just to be freed next frame.
  • Crazy amount of dependencies, many of which are quite unnecessary.
  • CMake sucks.

Changes

  • Cross-platform support (only Win32 and 3DS at first)
    • The main use for the Win32 port will be easier debugging. Debugging on a real 3DS (and especially Citra) is a pain, so I'd like an easier and faster way to debug game logic.
    • Other ports will follow, but mostly as a "side-effect" of engine work
  • Handmade immediate mode GUI
  • Custom save and config format
  • Memory arenas replacing heap whenever possible
    • Might be a pain on the 3DS
  • As little external dependencies as possible, besides metaprogramming libraries like Metadesk

When it comes to code style changes, I'm not too sure. Naming conventions will most definitely change.

This issue will likely receive many edits while I work on other projects, and may not perfectly reflect the final rewrite.

Use Citro2D text alignment/wrapping

These functions aren't available to use in a release yet, however it wouldn't be a bad idea to make a draft PR replacing our alignment code with them until the next Citro2D release.

Weird ingame crash

Dump from v1.0.2-7bf7d65

0x0010ddb4: _ZN5Piece4drawE7Vector2mRK10PieceShape9PieceType at :?
0x0010dde4: _ZN5Piece4drawE7Vector2mRK10PieceShape9PieceType at :?

(used ELF from automated release)
_ZN5Piece4drawE7Vector2mRK10PieceShape9PieceType is

static void Piece::draw(const Vector2 origin, const u32 tileSize,
					 const PieceShape& shape, const PieceType type);

Happened a few times during casual gameplay, seems related to holding pieces.

Closing the game can sometimes crash the system

Summary

Sometimes closing the game or switching to another title can cause a system-wide crash. A hexdump of the crash can be seen below:

0000000 c0de dead cafe dead 0002 0001 000b 0000 0000010 0003 0000 0158 0000 005c 0000 0030 0000 0000020 0094 0000 0010 0000 000b 0000 0000 0000 0000030 081f 0000 0079 0000 ced8 0800 0004 0000 0000040 000d 0000 62c4 0016 000b 0000 0000 0000 0000050 0000 0000 0000 0000 4639 0016 7f6c 0800 0000060 2db4 0011 f44c 0010 0010 2000 0005 0000 0000070 100f 0000 0014 0000 0700 4000 0a27 ee30 0000080 0a27 ee30 8b08 ecbd 8ff0 e8bd 0000 3f00 0000090 69cc 0016 6990 0016 6858 0016 6994 0016 00000a0 69d0 0016 4ff0 e92d 8b02 ed2d 8000 e1a0 00000b0 0014 e591 0000 0000 4000 408f ced8 0800 00000c0 0004 0000 000d 0000 62c4 0016 d5fc 0800 00000d0 0000 0000 0000 0000 0000 0000 2db4 0011 00000e0 0000 4385 0000 4319 0000 0000 ced8 0800 00000f0 0000 0000 0000 0000 0000 0000 607c 0011 0000100 68c0 0016 2f68 0801 0000 0000 d2c0 0010 0000110 68c0 0016 68c0 0016 0000 0000 1100 0010 0000120 4cca 0044 0000 0000 f842 8cd0 0005 0000 0000130 0000 0000 0000 0000 0000 0000 0000 0000 0000140 0000 0000 d2b0 0013 4433 7453 6972 0073 0000150 7400 0ed4 0000 0004 c0de dead cafe dead 0000160 0002 0001 000b 0000 0003 0000 00c4 0000 0000170 005c 0000 0030 0000 0000 0000 0010 0000 0000180 0002 0000 0000 0000 0032 0000 0033 0000 0000190 0002 0000 7730 0016 7794 0016 76ec 0016 00001a0 774c 0016 76f0 0016 4148 0016 0000 0000 00001b0 0132 0000 19a8 0801 6664 0012 7cf4 0013 00001c0 0010 8000 0805 0000 100f 0000 1998 0801 00001d0 0700 0000 0a40 eeb8 0a40 eeb8 ba8d ebff 00001e0 3000 e595 20b8 e1d3 10b6 e1d3 0002 e151 00001f0 8070 98bd 4001 e254 fff2 1aff 8070 e8bd 0000200 b590 0016 76e8 0016 4070 e92d 4433 7453 0000210 6972 0073 7400 0ed4 0000 0004 000021c 

Steps to Reproduce

Hardware: New 3DS

  1. Play several games
  2. Close the title
  3. Crash

Improve sprint times table

The user is unable to scroll by holding down the up/down buttons; instead, they must press either button down, let go of it and then press down on it again.
As said previously in the 40L PR (#85), there should be different pages for different lines.

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.