Giter Site home page Giter Site logo

paladin-t / bitty Goto Github PK

View Code? Open in Web Editor NEW
245.0 9.0 16.0 46.42 MB

Bitty Engine - An itty bitty 2D game engine, with built-in editors, programmable in Lua.

Home Page: https://paladin-t.github.io/bitty

License: BSD 3-Clause "New" or "Revised" License

CMake 0.78% C++ 70.90% Objective-C 0.35% Objective-C++ 0.22% Makefile 7.81% HTML 8.54% CSS 0.07% Shell 1.98% M4 1.62% Batchfile 0.31% D 0.22% DTrace 0.01% Perl 1.43% Roff 3.94% VBScript 0.04% DIGITAL Command Language 0.60% Python 0.27% C# 0.45% HLSL 0.23% Java 0.26%
game-engine fantasy-console fantasy-computer bitty bitty-engine lua game-development gamedev indiedev pixelart sdl engine

bitty's Introduction

Home | Steam | Itch | Documents | About

An itty bitty game engine.

About Bitty Engine

Bitty Engine is a cross-platform itty bitty Game Engine and open-source Framework. The full featured engine is programmable in Lua and integrated with built-in editors. It keeps the nature of both engine's productivity, and fantasy computer/console's ease to iterate. It boosts your commercial/non-commercial projects, prototypes, game jams, or just thought experiments.

Why Bitty Engine?

Bitty Engine has everything built-in for coding, graphics composing, etc; it has a full featured debugger for breakpoint, variable inspecting, stepping, and call-stack traversing; it offers a set of well-designed API with full documentation; it builds fast binaries with code and asset obfuscating, moreover its package size is small (around 10MB with empty project, other engine outputs more than 10 times bigger).

It is supposed to be your ultimate 2D game creating software.

Features

Bitty Engine offers a set of orthogonal features that makes game development comfortable and enjoyable.

  • Resources API
    • Resources.load(...), Resources.unload(...)
    • Resources.wait(...), Resources.collect(...)
    • Etc.
  • Graphics API
    • Shapes: plot(...), line(...), circ(...), ellipse(...), rect(...), tri(...)
    • Text: text(...), font(...), measure(...)
    • Texture: tex(...)
    • Sprite: spr(...)
    • Map: map(...)
    • clip(...), camera(...)
    • Etc.
  • Input API
    • Gamepad
    • Keyboard
    • Mouse and touch
  • Audio API
    • Supports MP3, OGG, WAV, FLAC, etc.
  • Physics API
    • Space, Shape, Body, Arbiter, etc.
  • Libraries
    • Algorithms, Archive, Bytes, Color, DateTime, Encoding, File, Filesystem, Image, Json, Math, Network, Platform, Web
  • Application interfaces
    • Application, Canvas, Project, Debug

Technical specifications

  • Display: configurable resolution
  • Code: Lua, supports multiple source files
  • Image: either true-color (PNG, JPG, BMP, TGA) or paletted, up to 1024x1024 pixels per file
  • Palette: 256 colors with transparency support
  • Sprite: up to 1024x1024 pixels per frame, up to 1024 frames per sprite
  • Map: up to 4096x4096 tiles per page
  • Font: supports Bitmap and TrueType
  • Audio: 1 BGM channel, 4 SFX channels; supports MP3, OGG, WAV, FLAC, etc.
  • Gamepad: 6 buttons for each pad (D-Pad + A/B), up to 2 players
  • Keyboard and mouse: supported

Glance

Code

local obj = nil

function setup()
  obj = Resources.load('hero.spr')
  obj:play('move', true, true)
end

function update(delta)
  spr(obj, 208, 128, 64, 64)
end

See more in examples.

Games

Redistributing

Bitty Engine helps you to make standalone binaries for Windows, MacOS, Linux, and HTML (WebAssembly). It is redistributable for both non-commercial and commercial use without extra fee, your project is totally yours.

Everything is done with Bitty Engine (pro) by nothing more than a few mouse clicks.

Put an image at "../icon.png" relative to executable to customize the icon dynamically. Put an image at "../splash.png" as well to customize the splash, the image could be transparent.

Getting Bitty Engine

The pro version is available on Steam and Itch.

See version comparison.

Compiling from source

A C++14 capable compiler is required, any compiler came after 2014 should be ok. You need to get this repository and its submodules before build:

git clone https://github.com/paladin-t/bitty.git
cd bitty
git submodule init
git submodule update
Details

See the README under the "src" directory for source code architecture.

There are some customizable macros:

  • BITTY_MULTITHREAD_ENABLED[=1]: indicates whether project code executes on a thread separately from graphics
  • BITTY_DEBUG_ENABLED[=1]: indicates whether project code debug is enabled; requires BITTY_MULTITHREAD_ENABLED==1; disable this to build a pure runner
  • BITTY_NETWORK_ENABLED[=1]: indicates whether the Network API is enabled
  • BITTY_WEB_ENABLED[=1]: indicates whether the Web API is enabled; disable this if you don't need web accessibility
  • BITTY_SPLASH_ENABLED[=1]: indicates whether the splash is enabled
  • BITTY_EFFECTS_ENABLED[=0]: whether full screen effects is enabled
  • BITTY_PROJECT_STRATEGY_MAP_BATCH_ENABLED[=0]: indicates whether map batch is preferred; it might speed up map rendering if enabled, but requires more memory and could be slow with mset(...)

Startup project

Once you have setup and built a binary, it loads from "../data" or "../data.bit" automatically as startup project. Otherwise it shows a programmable workspace.

Windows

Dependencies: Visual Studio (with C++ development tools installed).

Steps
  1. Build SDL2
    1. Compile from "lib/sdl/VisualC/SDL.sln"
    2. Execute lib/sdl/copy_win.cmd
  2. Build SDL2_mixer
    1. Compile from "lib/sdl_mixer/VisualC/SDL_mixer.sln" (need to setup SDL2 including and linking paths from previous step manually)
    2. Execute lib/sdl_mixer/copy_win.cmd
  3. Build Bitty Engine
    1. Compile from "bitty.sln"

MacOS

Dependencies: Xcode.

Steps
  1. Build cURL
    1. Execute:
      cd lib/curl
      ./MacOSX-Framework
      cd ../..
  2. Build SDL2
    1. Compile framework from "lib/sdl/Xcode/SDL/SDL.xcodeproj"
    2. Reveal "SDL2.framework" in Finder
    3. Copy "SDL2.framework" to both "lib/sdl/lib/" and "/Library/Frameworks/" (used in following step)
  3. Build SDL2_mixer
    1. Compile framework from "lib/sdl_mixer/Xcode/SDL_mixer.xcodeproj"
    2. Reveal "SDL2_mixer.framework" in Finder
    3. Copy "SDL2_mixer.framework" to "lib/sdl_mixer/lib/"
  4. Build Bitty Engine
    1. Compile from "bitty.xcodeproj"

Linux

Dependencies: CMake, GCC.

Steps
  1. Build cURL
    1. Execute:
      cd lib/curl
      ./configure
      make
      cd ../..
    2. Execute lib/curl/copy_linux.sh
  2. Build libuv
    1. Execute:
      cd lib/libuv
      sh autogen.sh
      ./configure
      make
      make install
      cd ../..
    2. Execute lib/libuv/copy_linux.sh
  3. Build SDL2
    1. Execute:
      cd lib/sdl
      ./configure
      make
      sudo make install
      cd ../..
    2. Execute lib/sdl/copy_linux.sh
  4. Build SDL2_mixer
    1. Install necessary dependencies to enable extra audio format support, eg. for Ubuntu execute:
      sudo apt install libflac-dev libfluidsynth-dev libmodplug-dev libmpg123-dev libopus-dev libopusfile-dev libvorbis-dev
    2. Execute:
      cd lib/sdl_mixer
      ./configure
      make
      cd ../..
    3. Execute lib/sdl_mixer/copy_linux.sh
  5. Build Bitty Engine
    1. Execute:
      cd bitty.linux
      cmake . && make
      cd ..

Other platforms

Details

You can also setup your own build pipeline for other platforms. The "lib" and "src" directories are almost what you need. See the README under the "src" directory for code architecture.

The "platform_*" files contain most platform dependent code, you'll probably make a specific port.

Note the file dialog library is only usable on desktop builds, make your own adaption if you need it on other platforms.

Community and contributing

Documentation

bitty's People

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

bitty's Issues

Editor crash

When playing with the included example, Physics/Sticky, the editor crashes with the following error when I click on one of the sticky objects, and then I drag my mouse off screen to the right. I'm using x64/Bitty on Pop!_OS.

Code editor opened: "main.lua".
Initializing cpSpace - Chipmunk v7.0.3 (Debug Enabled)
Compile with -DNDEBUG defined to disable debug mode and runtime assertion checks
Aborting due to Chipmunk error: Unsolvable constraint.
	Failed condition: det != 0.0
	Source:/home/tony/Documents/shared/bitty/bitty.linux/../lib/chipmunk2d/include/chipmunk/chipmunk_private.h:255
Aborted (core dumped)

doubt

have network support, i.e., luasocket or tcp/udp custom based ?
native or dll/so

Evaluate Profile-Guided Optimization (PGO)

Hi!

I am collecting all materials (benchmarks, articles, stories, showcases, etc.) about Profile-Guided Optimization (PGO) across different applications here. I am sure you will be able to find helpful information regarding PGO.

Related to the gamedev domains, I suggest you look at the following things:

  • I did some benchmarks for Bevy with PGO. PGO-run (first) vs non-PGO (second) - Pastebin. In these results you need to interpret performance decrease as "Release version is slower than PGOed" and performance increase as "Release version is faster than PGOed". As you see, in many scenarios PGO improves performance, but in some of them performance is decreased.
  • Unreal Engine supports PGO build since 4.27 (release notes). According to the documentation, PGO allows to achieve better performance on UE too (+10% on some CPU-heavy scenarios from this page). Also, I've talked with developers in a local Telegram chat about UE. A person said that they use PGO as a default optimization with UE and their games. The PGO profiles are collected via crafted local test workloads (usually - the most difficult scenes) with Gauntlet. The performance improvement is something like 6-8%
  • Godot proposal about PGO - link
  • Unity Burst thread about PGO - link

We need to check the PGO effects on Bitty, and if it works well - write a note in the Bitty documentation about building with PGO. I'd appreciate your providing an easy way to build Bitty with PGO (e.g. via custom build options), and experienced users will be able to do it on their own for their own usage scenarios. Another option is to optimize Bitty prebuilt binaries with a generic-enough profile. Providing PGO-optimized binaries could be a trickier task (since it requires preparing a good-enough profile) but as an option would be great to see too.

As an additional optimization, I suggest looking at LLVM BOLT. But from my experience, starting with PGO and then using BOLT would be better.

doubt

hi

whats diff between steam and github ?
it's possible add new functions using dll (in case of windows) ?

Licensing Question

Are games made with Bitty required to be GPL licensed because of the dependency on Mongoose?

"open"/"save" silently do nothing, itch.io paid download

I think I've got a bug, but there's not a lot to go on - no matter what I do, I can't get "open" or "save" to do anything; opening from examples works, but "open", "open from directory", and all the save options just silently do nothing.

This is the itch.io pro download on linux x64

  1. run bitty (sorry I accidentally changed workspaces)
  2. prove the app works, it runs
  3. try to save, nothing happens
  4. try to save as, nothing happens
  5. try to save as directory, nothing happens
  6. quit, asked to save, nothing happens

https://youtu.be/Lhp5JfAd06I

​Happy to get anything else that would be helpful!
​​

bitty 易用性改进

我对bitty做了大量的易用性和UI方面的改进
一部分的演示:

2022-05-18.09.09.46.mp4

其中一些修改了第三方包, imgui_code_editor, imgui这些包都有改动
暂时没有提交pr

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.