mischief
Safe HaskellNone
LanguageGHC2024

Mischief

Synopsis

    What is Mischief?

    Mischief is a free, open-source, ECS Game Engine written in Haskell. It is a unique blend of data-oriented design and functional programming.

    Our Values

    Mischief is all about creativity and human expression and having fun. Is is a celebration of programming, art, and the creation of unique games and projects.

    It is not an engine meant to fit everyone, to be the "best game engine ever" or to make money. It is a project born of passion for data-oriented design, functional programming, and the art of crafting video games.

    You can read more about our values here.

    "AI" Disclaimer

    Mischief uses no "generative AI" (in code or otherwise) and strives to be a space that fosters creativity and wholesome human interaction.

    What do I Need to Know?

    You should generally be able to read through the official books and understand most logic without needing to have written Haskell before. However, you'll have a way better time if you have at least a basic knowledge of Haskell syntax, so it is recommended that you first follow a beginner tutorial for Haskell if you are not familiar with the language.

    The official books try not to assume any prior knowledge of ECS or game engines in general.

    Setting up

    In order to use Mischief, you'll first need to install GHC and cabal. We recommend doing so through the ghcup installer.

    After you have set up a project, add mischief-ecs under build-depends in you .cabal file.

    We recommend using GHC2024 as the language standard (set in your .cabal file).

    Language Extensions

    We generally recommend using the following language extensions in a Mischief project:

    DeriveAnyClass
    DuplicateRecordFields
    NoFieldSelectors
    DerivingStrategies
    OverloadedRecordDot
    MultiWayIf
    OverloadedStrings
    QuasiQuotes
    TypeFamilyDependencies
    ImportQualifiedPost
    

    QuasiQuotes and OverloadedStrings are especially important because some Mischief features are not available without them (namely quasi-queries and logging). The rest of the extensions are optional.

    You can paste these extensions in the default-extensions field of your .cabal file.

    Text

    Mischief uses Text instead of String where possible, including in its logging system.

    You'll often see functions from Data.Text being used, such as T.show, so it's recommended to add text as a dependency to your project and to qualify it when you want to use it:

    import Data.Text qualified as T
    

    Where to Start

    Mischief is made up of a fully decentralized ecosystem of libraries built on top of mischief-ecs.

    Most of the them are indeed made by the same people who also make the core ECS. But plugging libraries in and out is highly encouraged and one of the main focuses of the engine. So feel free to experiment with various libs to find what suits your game, or even make your own plugins to share with others!

    To get started, check out the startup guide from the Learn You an ECS for Great Mischief! book. You can also click on each of the links in the next section to see their documentation / book and learn to use them! You don't need to read any one book to completion before moving on, feel free to switch between them depending on what you wish to learn about.

    If you want to skip ahead past the introductory stuff and get a feel for what Mischief can do, check out the Rendering Book.

    Note that this library that you're reading right now, mischief, isn't meant to be added as a dependency or to be used directly. It exists just for centralizing documentation and helping keep the version of each library in check.

    Libraries

    This is a list of the current libraries that exist within the ecosystem:

    Feel free to open an issue or PR in the official repo if you want your library to be added to this list. The "AI" policy applies.

    Community

    You can keep in touch with the maintainers and the rest of the community by joining the official discord server.

    Contributing

    You can contribute to the official Mischief repository by opening issues to request features or report bugs. PRs may also be accepeted.