Page 1 of 1

Physics engine integration (BulletX / ODE)

PostPosted: Mon Oct 22, 2012 12:58
by MirceaKitsune
I've been pondering this idea for some time, and am very interested if anyone else would like it and believes it's possible. I always thought MineTest has the potential to be even better and more advanced than MineCraft, and this would be one of the bigger guns where I'd like to see it.

I'm wondering about integrating a physics engine in MineTest, such as BulletX or ODE, and allowing certain objects to have modern and realistic physics (bounce, roll around the ground, etc). Although for a blocky game with with 16 x 16 textures such detail might seem unnecessary, I think it would be really fun. Terasology already did it for broken blocks, and it looks really awesome. Here's a video of it in action:

http://www.youtube.com/watch?v=ruPEhDtXmDI

What I'd use such physics for are essentially two things: First of all I'd enable them on dropped items. Currently they fall to the ground and blocks just spin in place... I'd like to see dropped stuff correctly colliding with the ground. In the case of items over nodes, use texture alpha and extrusion to generate the collision box. Second thing I'd use physics for are special blocks. Some player-crafted nodes could have this attribute and turn physical once placed to the ground... or we could also make leafs fall off when you cut the trunk of a tree (before they vanish due to leaf decay). The player could push into such blocks and make them roll around the place... also hit them to make them bounce and what not. Another idea (even bigger and more distant) are ragdolls for 3D players / mobs when they die. Imagine punching a cow to harvest meat, then that cow falling to the ground and ragdoll-ing over the hills for a few seconds before it disappears. Lastly, it could be used to replace current player and mob physics, since the current ones are very basic and unrealistic.

I know there's one concern with such things, and that's how MineTest will run on old computers. Although I consider compatibility with all machines important, I don't believe this should keep us from adding new modern ideas. I do however support making the physics engine an optional server / client setting, and why not an optional build flag. Those who don't want it or can't use it don't have to enable it, and the old physics are used instead. Of course this would require both the client and server to do the same... not sure how that would work out. Stuff like mining with TNT would also cause a lot of physical objects to spawn which might get laggy.

This would be very interesting to see, and I'd like to hear your thoughts on it. I doubt I have the coding skill to do any of this, but from what I know integrating BulletX in such code should be fairly easy (at least for simple blocks).

[EDIT] Suggest seeing this video as well for even more awesomeness: http://www.youtube.com/watch?v=13ha669K88I If you don't wanna see the rest skip to 3:24

PostPosted: Mon Oct 22, 2012 13:35
by mauvebic
MirceaKitsune wrote:
I know there's one concern with such things, and that's how MineTest will run on old computers. Although I consider compatibility with all machines important, I don't believe this should keep us from adding new modern ideas.


even using a brand new AMD for a server performance didn't improve as much as i expected. I think at some point some sort of limit will have to come down on how many different games 1 engine can be at the same time. IMO, im less concerned with bouncing nodes than i am about placing nodes and not having them disappear whenever there's a little lag. Arguably the first goal of the game is to build, if you have a hard time doing that, all other features are irrelevant. I dont think its just a question of remaining compatible with older hardware, but it's a point of pride that we have a free game that performs better than it's paid counterpart.

It would be cool to look at, but i think its a solution looking for a problem. :/

PostPosted: Mon Oct 22, 2012 13:43
by MirceaKitsune
mauvebic wrote:even using a brand new AMD for a server performance didn't improve as much as i expected. I think at some point some sort of limit will have to come down on how many different games 1 engine can be at the same time. IMO, im less concerned with bouncing nodes than i am about placing nodes and not having them disappear whenever there's a little lag. Arguably the first goal of the game is to build, if you have a hard time doing that, all other features are irrelevant. I dont think its just a question of remaining compatible with older hardware, but it's a point of pride that we have a free game that performs better than it's paid counterpart.

It would be cool to look at, but i think its a solution looking for a problem. :/


Yes, not implying new features should take focus away from what's important. I know of that lag problem and it is pretty bad. At the same time, I am eager to see something new and special, and I guess multiple developers can work on separate things (to keep a good 'bug fixes' vs 'new features' balance). Sadly there's not a lot of devs right now... might give code changes a try if I ever get better at it.

I mentioned compatibility with old hardware because some users said it's an important focus of MineTest, and they wouldn't want it to become slow on their older machines. Other FOSS games have modern features and work properly at the same time, by not using hardware intensive features when the user doesn't enable them from settings. With physics it would be harder because they're (also) a server property.

PostPosted: Mon Oct 22, 2012 13:48
by Sokomine
Rather than realistic physics (I carry stacks of 99 nodes with me which are each larger than I am - and that is necessary for gameplay) I'd like to see animated nodeboxes for the animals. It would be great if the engine could support that! Animation could be handled mostly locally. It would consist of individual nodes of a nodebox moving around independently from the rest of the nodebox.

PostPosted: Mon Oct 22, 2012 14:01
by MirceaKitsune
Sokomine wrote:Rather than realistic physics (I carry stacks of 99 nodes with me which are each larger than I am - and that is necessary for gameplay) I'd like to see animated nodeboxes for the animals. It would be great if the engine could support that! Animation could be handled mostly locally. It would consist of individual nodes of a nodebox moving around independently from the rest of the nodebox.


I'm waiting for that for months, totally wanting to see it first. Rather than animated node boxes (or apart from them) I'm hoping for support for rigged models, I think that would be a lot better. Not sure when and if that will happen though... same for the physics (not expecting them to be done in a week or something).

PostPosted: Mon Oct 22, 2012 14:04
by mauvebic
MirceaKitsune wrote:
mauvebic wrote:even using a brand new AMD for a server performance didn't improve as much as i expected. I think at some point some sort of limit will have to come down on how many different games 1 engine can be at the same time. IMO, im less concerned with bouncing nodes than i am about placing nodes and not having them disappear whenever there's a little lag. Arguably the first goal of the game is to build, if you have a hard time doing that, all other features are irrelevant. I dont think its just a question of remaining compatible with older hardware, but it's a point of pride that we have a free game that performs better than it's paid counterpart.

It would be cool to look at, but i think its a solution looking for a problem. :/


Yes, not implying new features should take focus away from what's important. I know of that lag problem and it is pretty bad. At the same time, I am eager to see something new and special, and I guess multiple developers can work on separate things (to keep a good 'bug fixes' vs 'new features' balance). Sadly there's not a lot of devs right now... might give code changes a try if I ever get better at it.

I mentioned compatibility with old hardware because some users said it's an important focus of MineTest, and they wouldn't want it to become slow on their older machines. Other FOSS games have modern features and work properly at the same time, by not using hardware intensive features when the user doesn't enable them from settings. With physics it would be harder because they're (also) a server property.


well, important focus, im pretty sure its a mission statement celeron wrote himself, it was on one of the pages when i discovered minetest. As for new features, between 0.4 and 0.4.2 there have been quite a few new features, like nodeboxes, which people have yet to fully exploit (apart from making stairs and doors). Im a little worried about piling on too many new features at once.

As for devs, (personal feelings aside) we only have one with a head on his shoulders lol Others that can do something don't seem to want to because they can't experiment with the only working copy we have :-/ Tho the general idea is if you can fork, add your features and have em run smoothly, it will be merged into main.

I guess the question then becomes, can you? (fork and add more physics)