Magnesus

I'm still improving my (not doing very well) platformer The Lost Heroes - https://play.google.com/store/apps/deta ... lostheroes - and I have an idea how to do a large moving parts like moving mountains in Rayman: by using Spine2D animation with bounding boxes.

Do you think it's a good idea? The bounding boxes would create the platforms and different animations could be triggered during the game - for example when character jumps on a large rock (made from many different parts) it might sink in water or explode. I'm worrying a little about performance (I already have problems with it, especially since I try to support high resolution tablets well, but devices are getting faster and finishing the game will probably take an additional year since it's a side project right now).

I will be testing the bounding boxes in an Arkanoid clone (for the paddle animation), doing it in the platformer should be similar...

PS. I've just realised the bounding boxes are so powerful I might even use it for the platformer characters - which are constructed from multiple box2D parts. That would allow for a lot of precision in collision detection.
Magnesus

Kickstarter Backer
  • Mensajes: 111

Nate

You could probably do level design stuff in Spine, but you might be better off using a tool like RUBE:
https://www.iforce2d.net/rube/
This will have easier integration with Box2d and might save some time. You won't be able to control animations like you can in Spine, but might be able to make something work by leveraging Box2D. Eg, you could make the rock sink by removing a Box2D body under it and let the physics make it sink.
Avatar de Usuario
Nate

Nate
  • Mensajes: 11833

Magnesus

As a level editor I use Inkscape and it's quite working for me, but is only suitable for static elements. All complex box2D stuff and animations I add later in code (by attaching it to places where placeholder images are in Inkscape file) - so such animated mountains/rocks would also be placeholders in Inkscape replaced by Spine2D animation in code. I will check out Ruby though, it might also be helpful, especially since I plan on adding for example ropes...

Using bounding boxes as box2D bodies seems to work in my first test (with some limitations because of what types of polygons box2D allows), I will check if animating them will be doable... and I will post some videos if I'm successful.
Magnesus

Kickstarter Backer
  • Mensajes: 111

Magnesus

edit: I've made some progress, will edit this post with more details as I work.

- creating the body from a bounding box is relatively easy,
- when using more than 1 bounding box I can't put them all in one body as fixture - otherwise I won't be able to move them separately
- scaling is doable only with rebuilding the bodies, might be better to just ignore scale,
- moving and rotating should be doable (with use of forces/velocity)

edit2: I will probably abandon this idea - for now it works for but doesn't react to collisions well enough (because I change position of the bodies instead of using forces/velocity) and causes many additional problems.
Magnesus

Kickstarter Backer
  • Mensajes: 111

Nate

Aye, scale is an issue for most physics.

Using physics bodies for your Spine skeleton is probably most useful for having other things (which are manipulated via forces) react to the skeleton (which is manipulated by setting the position/rotation). It seems like you could use a skeleton for some part of the level, eg have some part of the ground animate.
Avatar de Usuario
Nate

Nate
  • Mensajes: 11833

Magnesus

I actually sat down on this again and managed to do the position changing by using forces and it now works much better (collisions work as they should). I use it (as a test) on an Arkanoid clone to make the paddle change shape when you collect some powerups. Only movement works for now because I don't need rotation yet. I will most likely ignore scale.
Nate escribió:Using physics bodies for your Spine skeleton is probably most useful for having other things (which are manipulated via forces) react to the skeleton (which is manipulated by setting the position/rotation).
Good idea. I could attach an existing box2D body to some bone for example to make a moving, animated hammer.
It seems like you could use a skeleton for some part of the level, eg have some part of the ground animate.
Yes, that is the intention. Only for parts that move. I might have not made that clear before. :)
Magnesus

Kickstarter Backer
  • Mensajes: 111

Magnesus

PS. I've also recorded a video showing it at work (the ending): http://www.youtube.com/watch?v=kaWAaaNOiME - it's only a small element (the paddle), but I was only testing the ground for more advanced stuff later. :)
Magnesus

Kickstarter Backer
  • Mensajes: 111

Nate

The paddle growing? Neat.

FWIW, you might make the balls move much faster when they are far from the paddle, then slow as the get near the paddle. Would make the game more fast paced without making it harder to control.
Avatar de Usuario
Nate

Nate
  • Mensajes: 11833

Magnesus

Nice idea. For some reason I was going to do it the opposite way (faster when closer) which in a hindsight was a stupid idea. :)
Magnesus

Kickstarter Backer
  • Mensajes: 111


Volver a Off-topic