Logging in...
Oops, try again... Email: Password: Submit
Really Useful Box2D Editor iforce2d

Intro


R.U.B.E stands for Really Useful Box2D Editor. This editor allows you to graphically manipulate a Box2D world and save it to a file. You can then load the saved file in your game/app and run the world. R.U.B.E can create any physics scene that Box2D itself can, with the exception that some joint types are currently not supported (gear, pulley).

The main advantage of an editor like this is the speed and ease of development gained by being able to place items visually. Being able to tweak values and quickly see the results improves turnaround time when fine tuning physical behaviors. When the editing of scenes is quick and easy, more time and incentive exists for exploring different ideas, making more interesting content (or simply more of it), and creating a quality game/app that doesn't cut corners.

See the video below for an overview, and the 'Features' section for a detailed list of features.


Necktie fighter image courtesy of Erik Montoya: http://erikmontoya.com/


User feedback:
" The primary format for saved files is JSON, and the source code (C++) to load a file made by this editor is available The primary format for saved files is JSON, and the source code (C++) to load a file made by this editor is available " - Tim S.
Box2D editor R.U.B.E
Hand-drawn game level background used with permission from Peter McClory. http://curveagency.com/




Features


Here is a breakdown of some of the current features in R.U.B.E.
  • Editable items
    • Bodies
      • Translate, rotate, scale
      • Copy, paste, duplicate
      • Copy joints along with bodies
      • Entire structures of bodies with joints can be scaled
      • Negative scale (flip bodies across x/y axis)
    • Fixtures
      • Translate, rotate, scale
      • Copy, paste (onto body), duplicate
      • Negative scale (flip fixtures across x/y axis)
      • One-step creation of polygon fixtures from images
      • Automatic polygon decomposition for concave polygons
      • Reverse vertex winding
      • Convex hull
      • Fat shapes
    • Vertices
      • Translate, rotate, scale
      • Insert along existing edge (split)
      • Append/insert to chain (draw a sequence of points)
    • Joints
      • Types
        • Revolute
        • Prismatic
        • Distance
        • Rope
        • Wheel
        • Friction
        • Weld
        • Motor
      • Change bodyA/bodyB
      • Set local anchor positions
      • Set limits (revolute, prismatic)
      • Set length (distance, rope)
      • Rotate local axis (prismatic, wheel)
      • Set damping and frequency (distance, wheel)
      • Joints will be copied along with bodies so entire structures can be easily duplicated
    • Images
      • Position images as background props or use them as guides when creating physics objects
      • Attach images to bodies
      • Translate, rotate, scale
      • Duplicate
      • Set opacity, filter type, flip, color tint
    • Samplers

    • A sampler defines a rectangular area from which to sample image pixels.
      • Sample multiple source images as a composition
      • Attach samplers to bodies
      • Translate, rotate, scale, duplicate
      • Set output file, opacity, flip, color tint
      • Use alpha or color edge data to automatically create fixtures
      • Write sampled output to file
      • Write Sobel edge filter, local maxima edge output to file
    • World
      • Set gravity
  • Customization
    • Items (body, fixture, joint, image, sampler) can be given custom properties (int, float, string, vec2, bool, color)
    • Action menu contents can be modified to include your own scripts
    • Customizable labels for items
    • Item properties display is customizable (which properties to show for currently selected items)
  • General
    • Reference grid to help judge dimensions
    • All items can be multiple-selected
    • Selection supports undo/redo
    • Context menu to disambiguate items in the same location
    • Translations can be restricted to x/y axes
    • Rotation and scale can be about selection center or cursor position
    • Switch between degree or radian display for angles
    • Items can be named for access from your program
  • Editor views
    • Multiple editor views per document
    • Move items between views
    • Customizable labels for items
    • Set/get view position in script
  • Integrated scene player
    • Interactive view to test the scene
    • Multiple player views per document
    • Pause, single step, modify speed
    • Markers displayef for joints, body CoM etc
  • Item browser
    • Shows items in the scene in a textual list
    • Allows selection and name changing of items
    • Items expand to show their relation in a tree format (eg. a joint will expand to show two bodies)
    • List can be filtered to quickly find items
    • Hovering the mouse over an item in the list highlights it in the scene view
      (if the item is offscreen an arrow will be shown pointing to it)
  • Scripting
    • Angelscript engine
    • Any operation possible on the scene via the GUI can be scripted
    • Integrated script editor with code highlighting, auto-compile and error line-marking
    • Scripts can access current state (eg. getSelectedBodies) to implement contextual tasks
    • Customizable menu for calling your scripts
    • Script can access all information necessary to write custom exporters
    • All actions are logged to script as autosave data
    • Scripts can query the user for numbers and strings during execution
    • Scripts can be attached to event hooks (eg. keypress) to run automatically
    • Click here to see the full script API (under 'Rubescript reference').
  • Exporting
    • Save scene to .json
    • Items can be excluded from export by customizable script
    • Dump C++ code (Box2D's standard feature)
  • Available JSON loaders/sample projects
    • C++ (b2dJson). Samples here.
    • Cocos2d, cocos2d-x, SFML. Samples here.
    • Javascript (box2dweb). Sample here).
    • Java (b2dJson based on JBox2D). Sample here.
    • See many more loaders here
  • Help
    • Integrated help browser for script API and general help
    • Context help panel (content changes depending on current editor state)
    • General log output to report warnings, errors and tips.
  • Other
    • Dialog to check for updates and view release notes
    • Integrated feedback/bug-report dialog with screenshot capability
    • Build-on-demand executable file requires no further DRM
    • Almost identical across Windows, Mac and Linux (some shortcut keys differ on Mac)
    • Full UTF-8 support



Trial version


A trial version is available to evaluate the software before purchasing. The trial version includes all the functionality of the full version with no time limit or data size restrictions, but without the ability to save documents or extract the created scene (you can use 'script logs' to avoid losing your work - see details below).


Download trial version


R.U.B.E trial version - Windows (32 bit) 69.7 MB, February 10 2022
R.U.B.E trial version - MacOS (64 bit) 62.2 MB, February 10 2022 *** see 'notes on macOS usage' below
R.U.B.E trial version - Linux (64 bit) 63.4 MB, February 10 2022

Notes on macOS usage...

Running on macOS


Some points to note when running on macOS:
  • In recent versions of macOS Apple introduced a 'security feature' called translocation that prevents applications from knowing the location (working directory) they are running from. Like many great ideas from Apple this has dubious actual value but is quite successful at making life difficult for thousands of users and developers all over the world.

    To work around this RUBE requires that you manually set the working directory you wish to use. This only needs to be done once. The directory should be the location of the rubehelp_en.* files and the 'config' folder that contains the default action menu. You can set this in the 'Workspace' tab of the Options dialog (aka 'Preferences' on macOS).

    macOS working directory setup
    Without this setting the program will run, but the help documentation and action menu will not be present.

  • When the desktop theme is set to dark mode, some of the panels in RUBE (eg. script panel) will be hard to read. For now you can exclude RUBE from dark mode behavior by opening a terminal window and executing this command:

      defaults write com.iforce2d.rube NSRequiresAquaSystemAppearance -bool yes

    To re-include RUBE for dark mode behavior you can do this:

      defaults delete com.iforce2d.rube NSRequiresAquaSystemAppearance

Notes on Linux usage...

Running on Linux


Some points to note when running on Linux:
  • Use the 'rube.sh' file to run the program, not the 'rube.bin' file.

  • The program has been tested on the following distros:

    Fedora 35 Ubuntu 16.04
    OK OK

    Whether a distro will be ok usually depends on the version of GLIBC it provides. You can check this on your installation by opening a terminal and running these commands:

      strings /lib64/libc.so.6 | grep GLIBC
      strings /lib64/libstdc++.so.6 | grep GLIBC

    If you see 'GLIBC_2.23' somewhere in the output of the first command, and 'GLIBCXX_3.4.21' for the second command, your setup should be ok. The libc.so.6 and libstdc++.so.6 files may be in another location depending on your distro - if so you can usually locate them like:

      locate libc.so.6


The trial version has the following features disabled:
  • Exporting scene to .json or .cpp
  • Saving scene as .rube
  • Printing strings in script
  • Writing to files in script
  • Plain-text copy/paste
  • Saving sampler output to image files overlays a watermark
Script logs can be used to avoid losing work created while evaluating. A script log is a record of every editing action, translated into 'rubescript' and written to a file. The script can be run when the scene is loaded again to replay the editing actions as if the user had manually performed them, and restores the scene to the former state. This means that any scenes edited with the trial version can subsequently be used with the full version.

More about script logs...

Script logs


While you are editing a scene file, every change you make will be logged to a file with the suffix '-scriptLog.rs', in a subfolder next to the scene file you are editing. For example if you are editing a scene file called 'tank.json', a file called 'tank.json-scriptLog.rs' will be saved in a folder called 'tank.json-backups' next to the scene file.

Box2D editor R.U.B.E

Editing changes are written to this file as soon as they are applied to the scene, so you could (as an extreme example) shut off your computer at any time without losing any work. Each time the scene file is newly opened, the old script logs are backed up using their file time to create a unique label, so you will not lose any previous script logs.

Box2D editor R.U.B.E

To restore the information contained in a script log, open the scenefile, drag the script log file onto the script panel, and run the script.

Box2D editor R.U.B.E

Note: the script log expects to be run from a clean open file state, so if you open the scene file and make some changes, the script log may not work correctly. Make sure to run it immediately after opening the scene.



Release notes


Choose two versions below to see the changes between them.

From to Show release notes

Getting release notes...



























Supported platforms


R.U.B.E is supported for:
  • Windows (XP or later) More...
    Tested and confirmed versions:
    • Windows XP
    • Windows Vista
    • Windows 7
    • Windows 10
  • MacOS (10.14 or later) More...
    Tested and confirmed versions:
    • 10.14 Mojave
    • 10.15 Catalina
    • 12.1 Monterey
  • Linux (Fedora 24 / Ubuntu 16.04 or later) More...
    The program has been tested on the following distros:

    Fedora 35 Ubuntu 16.04
    OK OK

    Whether a distro will be ok usually depends on the version of GLIBC it provides. You can check this on your installation by opening a terminal and running these commands:

      strings /lib64/libc.so.6 | grep GLIBC
      strings /lib64/libstdc++.so.6 | grep GLIBC

    If you see 'GLIBC_2.23' somewhere in the output of the first command, and 'GLIBCXX_3.4.21' for the second command, your setup should be ok. The libc.so.6 and libstdc++.so.6 files may be in another location depending on your distro - if so you can usually locate them like:

      locate libc.so.6


You can download the trial version to check how the program runs on your system.


Recommended hardware


CPU: Obviously the faster the better, but a 1.4Ghz or so processor should be fine for most common usage.

Memory: Editing a typical scene (200 bodies, 300 fixtures, 180 joints) consumes around 20Mb of memory. Large scenes (10,000 bodies, 15,000 fixtures, 8500 joints) can use around 150Mb.

Input: A mouse capable of both left and right click inputs is necessary. A scroll-wheel mouse is highly recommended.

Video: A sturdy graphics card is recommended, preferably with hardware support for OpenGL. Rendering problems have been observed on netbooks with low-spec video hardware, eg. Intel GMA 945/950/3150

Network: The 'Check for updates' and 'Send feedback' dialogs require an internet connection.




























Purchase R.U.B.E


The full version of R.U.B.E is available for JPY ¥3500 (around USD $30) through PayPal.
(Click these links to see live conversions for common currencies:
EUR, USD, GBP, INR, AUD, CAD, CNY, NZD, RUB)

Please try the trial version first to check how the program runs on your system and become familiar with the available features.

Yes, I've evaluated the trial. I want the full version.
Please tick the checkbox below to continue.


  1. This software is provided 'as-is', without any express or implied warranty. In no event will
     the author be held liable for any damages arising from the use of this software.
  2. Permission is granted to the purchaser to use this software for any purpose, including
     commercial applications.
  3. All future updates and additions to the software will be made available to the purchaser at no
     extra cost, but there is no guarantee that any updates will actually be made. Any planned
     future features mentioned on this website are to be treated as speculation only.
  4. Permission is granted for the purchaser to supply the software to a maximum of two other
     persons for the purpose of collaboration on projects. The other persons do not have permission
     to further supply the software.
  5. The software is individually compiled for each user and contains reliable watermarks to trace
     the origin of the purchaser. If the software is made publicly available in any form the
     purchaser will become ineligible for further updates and the promise of (3) is made void.
  6. The purchaser's email address will be recorded and used as the login username on this website
     to access the software, and for occasional notifications about software updates.
  7. If the purchaser is not completely satisfied with the software the purchase price will be
     refunded in full, until 30 days from the purchase date.

See also the PayPal Acceptable Use Policy.

































Supported languages


R.U.B.E exports scenes to plain-text JSON, so any language that can read JSON can make use of the output. The full file format can be seen here.

Some reference implementations to do this in various languages are listed below, along with samples that you can try out. The source code for all these is included in the files accompanying the R.U.B.E download.

There is also a sticky post in the forums where you can find links to loader implementations for other languages and frameworks contributed by users: http://www.iforce2d.net/forums/viewtopic.php?f=6&t=240 Currently there are loaders for AndEngine, libGDX, Farseer, NAPE, PyBox2D, Cocos2d-HTML5, Flash (partial only), Gideros, Cocos2d-x v3, Isogenic engine, App Game Kit.



C++


The b2dJson utility is used to read and write scenes to JSON. This can easily be added to most C++ or ObjC projects. Here are two demos using this.
  • Box2D testbed sample
    This adds a 'test' to load a tank with images into the Box2D testbed.

    Here is a compiled binary you can download and run (Windows, Mac, Linux):
    rube-C++-sample-box2d-testbed.zip

  • iOS sample project
    This project is built by starting with the OpenGL ES XCode template and adding R.U.B.E scene loading functionality.

    Unfortunately Apple does not let one distribute compiled binaries freely. To run this on your iOS device you will need to pay $99 to join the developer program, and compile the source code yourself:
    rube-iOS-sample-project-src.zip

  • Cocos2d-iPhone sample project
    This project uses R.U.B.E to load a scene into a CCLayer and render the images with CCSprites. It demonstrates touch dragging, pinch zooming, and destroying bodies. A pinball table demo and a simple simple platform game demonstrate how to find and control items in the scene, react to collisions and use custom properties.

    Unfortunately Apple does not let one distribute compiled binaries freely. To run this on your iOS device you will need to pay $99 to join the developer program, and compile the source code yourself:
    rube-cocos2d-sample-project-src.zip

  • Cocos2d-X sample project
    As above, but for Cocos2d-X using C++
    rube-cocos2d-x-sample-project-src.zip

  • Cocos2d-X V3 sample project
    As above, but for Cocos2d-X V3
    rube-cocos2d-x-V3-sample-project-src.zip
    Android users can try this using the .apk below:
    rube-cocos2d-x-V3-sample-debug.apk

  • SFML sample
    This sample uses R.U.B.E to load some scenes and render the images with sf::Sprites. It demonstrates panning and zooming the view, dragging and destroying bodies. A pinball table demo and a simple simple platform game demonstrate how to find and control items in the scene, react to collisions and use custom properties.

    This zipfile contains both source code and pre-built binaries (Windows, Mac, Linux64, Linux32):
    rube-C++-sample-SFML.zip

  • SDL2 sample
    This sample uses R.U.B.E to load some scenes and render the images with SDL_Textures. It demonstrates panning and zooming the view, dragging and destroying bodies. A pinball table demo and a simple simple platform game demonstrate how to find and control items in the scene, react to collisions and use custom properties.

    This zipfile contains both source code and pre-built binaries (Windows, Mac, Linux64):
    rube-C++-sample-SDL2.zip

  • Chipmunk demos sample
    A partial implementation of a R.U.B.E scene loader for the Chipmunk physics engine.
    This was mainly just an exercise in learning Chipmunk, rather than a proper loader implementation.

    Here is a compiled binary you can download and run (Windows, Mac, Linux):
    rube-C++-sample-chipmunk-demos.zip





Javascript


  • box2dweb sample
    Javascript source code is available to read scenes from JSON and create a world in box2dweb.

    You can try this in your browser right now: Javascript demo.
    The demo loads various scenes, some with images, and seems to perform best in Chrome or Firefox. Wheel joints have been replaced with a line/distance joint combo.

  • Phaser framework sample
    A sample loader for the Phaser framework is available. This is currently also using box2dweb as the physics engine.
    Source code: rube-phaser-sample.zip
    You can try these demos in your browser below:

    Basic scene
    Skeleton scene showing the most basic usage.


    Simple game
    A simple platform game, demonstrating how to find and control items in the scene, react to collisions and use custom properties.






  • Java


    A Java version of the b2dJson utility is available to read and write scenes to JSON, based on JBox2D.

    Here is a compiled version of the JBox2D testbed which loads some scenes from JSON:
    rube-java-sample-jbox2d-testbed.zip
    *** Image loading is not implemented.



    Tutorials


    You can find video tutorials about using R.U.B.E on YouTube. Choose from the pull-down list below to view them here on this page.


    User section


    Welcome to the user pages! Please choose a link from the menu above.

    You can request builds of the editor in the 'Download' section.

    You can change your password in the 'Account' section.

    You can vote for future features in the 'Voting' section.































    Download R.U.B.E


    Instead of downloading the program and then applying a license key, R.U.B.E is individually compiled for each user. These customized 'builds' contain your user identification details so no further action is required to enable the program.

    Before downloading you'll need to request builds for the platforms you will be using.


    Request a build


    Choose the platform(s) you require.

    Requesting new build...
    Request That build has already been requested. Request received ok.

    The program will be compiled after requesting a build. This usually takes around 5 minutes, but builds are processed sequentially so it can take longer if there are other people in the queue. Your position in the queue will be shown in the table below, so you can estimate about 5 minutes for each place in the queue.


    Current builds


    Refresh table

    Getting latest build info...

    Builds will be stored on the server for two days.


    Sample loaders


    To keep file sizes down, the sample loaders and associated files are not included in the build downloads. If you downloaded the trial version you will already have these anyway, but if necessary you can get them separately here: rube-sampleLoaders.zip


    Release notes


    Choose two versions below to see the changes between them.

    From to Show release notes

    Getting release notes...




    User account



    Change password

    Please enter the new password. Cancel
    New password:
    Confirm:


    Your password was changed successfully.



























































    Feature voting


    Here you can vote for which features should be given priority in future updates to the program.

    Features What's this?

    Enter values in the text boxes below to give priority to the features you would like to see implemented. You can change these at any time.

    Only the ratio between the values is important, so for example entering 1,2,3 is the same as entering 100,200,300 (note that entering the same value for every feature has the same effect as not voting at all).

    Your changes will be automatically sent to the server every couple of seconds - you can tell that your vote has been received when the green bars are updated.

    The orange bars show the total results for all users.

    Getting features list...
    Getting feature details...

    Click on each feature to view a description.