As of late 2021, we are in the process of updating Stencylpedia and fixing up outdated & broken content. Thanks for your patience!

14,278

Views

Intermediate

Level

3

Comments

Simple Physics vs. Regular Physics

by Ceric (Updated on 2013-04-07)


Contents

  • Introduction
  • Simple Physics
  • Box2D
  • How to Switch Physics Modes
  • Which to use?
  • Full Differences
  • Summary

 

Introduction

One of the hallmarks of Stencyl is its integration of Box2D, a physics engine used in games like Angry Birds. Thanks to Box2D, objects act much like how they do in real-life. Collision detection and object interactions come “for free.”

If Box2D is working so well, why are we offering an alternative? There are plenty of games that don’t require Box2D, such as puzzle games, turn-based games and RPG's.

Due to the increased adoption of Stencyl and expansion in the kinds of games created, we decided to create an alternative called Simple Physics.

 

Simple Physics

Stencyl 3.0 introduces an alternate physics engine which we dub as “Simple Physics”. This engine addresses the common complaints about Box2D.

Advantages

  • Works well for games with many on-screen objects.
  • No physical interactions. Just pure box-to-box collisions.

Disadvantages

  • Only axis-aligned boxes are supported. That means, no polygons, no circles, no rotated boxes. The same goes for tiles too.
  • Don’t expect to turn this on and have the game act identically. It’s a different system, and despite attempts to make some things move around the same, not everything will.
  • Debug drawing is automatically disabled when a game uses Simple Physics. Using the debug drawing block will have no effect.

If you can live with these limitations, simple physics may be a fit for your game. Simple Physics works with the exact same blocks and interface. Even collisions are reported the same way.


Box2D

View our dedicated article on Box2D.

 

How to Switch Physics Modes

To switch between Box2D and Simple Physics, go to Game Settings > Settings > Advanced and change the selection for the Physics dropdown.

You can switch between the two modes at will.

 

Which to use?

Requirement Examples Which to use?
Puzzle Game Tetris, Match 3 Simple Physics
Shoot 'em Up Ikaruga Simple Physics
Simple Platformer Canabalt, Super Meat Boy Simple Physics
RPG / Adventure Zelda, Final Fantasy Simple Physics
Strategy / Turn-Based Fire Emblem, Final Fantasy Tactics,
Tower Defense
Simple Physics
Real-Life Physics Angry Birds, Red Remover,
Fantastic Contraption
Box2D
Modern Platformer Super Mario World, Sonic Box2D

 

Full Differences

Simple Physics “loses” the following features, relative to Box2D.

  • Collisions
    • Rotated Boxes
    • Circles
    • Polygons
    • Continuous Collisions
  • Motion & Interactions
    • Forces / Pushing
    • Momentum
    • Friction
    • Bounciness
    • Damping / Rotational Damping
    • Mass / Angular Mass
  • Scene
    • Custom Terrain
    • Tiles only work with full-sized squares

In short, imagine Simple Physics to be a simple engine in which you can move things around and collide as boxes, and pretty much nothing past that. It’s good enough for many games.

 

Summary

  • Simple Physics is an alternate engine that provides just box <-> box collisions in exchange for faster performance.
  • Use Simple Physics for non-physical games or games with many actors.
Disclaimer: Use comments to provide feedback and point out issues with the article (typo, wrong info, etc.). If you're seeking help for your game, please ask a question on the forums. Thanks!

3 Comments

calabresearts
This is a bit late but I just wanted to update my situation for anyone having the same issue. In short, when using Simple Actor Mode with SetX or SetY position blocks will lose collision functionality if the actor is "killed" and then recreated. This is a confirmed BUG. You can follow the links provided to see what was causing Simple Actor Mode to not function correctly. The version of Stencyl I am using is 3.1.

http://community.stencyl.com/index. php/topic,35425.msg200680.html#msg2 00680

http://community.stencyl.com/index. php/topic,35490.msg201130.html#msg2 01130

0 10 years, 3 months ago
calabresearts
Hello,

I was wondering if someone could clarify this statement : "No physical interactions. Just pure box-to-box collisions.". I have been trying to explore Simple Physics and need to actors to detect a collision/when they overlap. I cannot seem to achieve this using simple physics. The statement above seems to imply that collisions are possible using simple physics but I am at a loss as how to achieve this.

Any clarification would most helpful. Thank you for your time and consideration.

0 10 years, 4 months ago
mikhog
There's also an option to set simple physics on a per actor basis. The article should also mention that and whether there are any limitations of it.
0 10 years, 10 months ago

Sign In to Comment