Bump in Defold


#1

Has anyone used Bump with Defold? I’ve used it before in another engine and wondered if there are any gotchas replacing Box2D with Bump for collisions.


#2

The only gotcha is that it’s not really possible to replace the physics engine. (Hopefully it will be possible at some point in the future though.)


#3

I was thinking of skipping the current way of using collisions and control the sprites independently with Bump. That should still work, right?


#4

Bump seems to be pure Lua so it should not be a problem at all.


#5

Also check out this thread: DAABBCC: Dynamic AABB Tree + Experimental Collision Detection


#6

I’ve been using bump.lua quite a lot over the last couple of weeks - it’s a perfect fit for platformer !

Only issue is not being able to work ‘visually’ with your collision boxes.


#7

That’s cool @kgoya! Are you using tilemaps?


#8

Yes!

Currently im parsing the whole tilemap and adding an object for each tile (I maintain a library of the tiles).

I’m planning on grouping them in the future but it is quite fast as it is :slight_smile:


#9

Yeah Bump is speedy in my experience too (way faster than Box2D, of course, even in plain Lua).

I’m just being lazy now, but have you shared the implementation somewhere?


#10

The simulation/CPU time is faster? Did you actually test that? Or are you talking about ease of use?


#11

It’s only “rectangles” collision detection - so it must be, but agreed - i haven’t tested it.

@totebo you should check out the examples of bump, they are pretty straightforward (I basically reused the whole entity class and instantiate it in my go scripts)


#12

@ross.grams I meant both CPU time and ease of use. Although I haven’t benchmarked the CPU part! Box2D deals with a full simulation for any shape, whereas Bump deals with collisions and basic physics for non-rotated rectangles only.

Box2D feels like overkill for simple platformers, where you don’t need the simulation of forces and friction and all that stuff. Especially as I think each tile in a tilemap is represented by a square in Box2D, which can lead to objects sticking to the squares because of a bug in Box2D.


#13

Maybe one of you think about uploading a simple platformer template using bump to the asset portal?


#14

It would actually be a good exercise.

I’ve currently integrated it as a class i instance in each of my objects’ scripts but it might be relevant to integrate it directly in scripts.

Maybe reusing an existing tutorial and replacing all the box2d physic by bump.

I’m also super interested into digging into hardoncollider, because i’m not sure how reliant on LÖVE it is…


#15

I tried out Hardoncollider too, but to me it didn’t make sense to use it because of performance. In my tests it was a CPU drain in comparison to Bump. I suppose if you need circles and other shapes then it might be a good compromise to use it instead of Box2D.