lobster icon indicating copy to clipboard operation
lobster copied to clipboard

Physics support

Open RobotCaleb opened this issue 9 years ago • 5 comments

How far along would you call the physics support? It looks like it's just good enough to create the demos you have (that is, falling boxes and water). I don't see any way of getting a physics object back to apply thrust or rotation, or even get position from.

Also, is this the best place for questions like this?

RobotCaleb avatar Dec 01 '14 04:12 RobotCaleb

Yes, not very far along. If you have a precise description of functionality you'd need, I can add it. And sure, this is as good a place as any, though feel free to email me.

aardappel avatar Dec 02 '14 17:12 aardappel

Speaking of physics support, how does interoperability with C look?

If it's in a good state, it shouldn't be extremely difficult to create bindings for Chipmunk.

Asmageddon avatar Jun 16 '15 10:06 Asmageddon

It can bind with C libraries through C++.

Thing is, there's no automated way to bind a whole API, like you can with e.g. SWIG. Such support could be added.

I guess I prefer to do these APIs manually, since the C/C++ APIs are often quite low level, and it is nice to make them more high level, and make them use language features properly (both the current physics and graphics APIs are not a 1:1 mapping).

As for physics, I'd like to stick with LiquidFun that is already integrated, which is a superset of Box2D, which has similar functionality to ChipMunk. I have interest to extend its functionality, so if you can name things that are missing, I'll happily add them.

aardappel avatar Jun 16 '15 15:06 aardappel

Ah, well, I'm not using Lobster, and likely won't - sorry. I have my own plans of developing an engine in Terra+Lua, and in the more distant future, a programming language of my own.

Either way, I don't really know how things in Lobster work, but if it's meant to be game-oriented, then personally I'd suggest leaning towards a data-oriented architecture, rather than an OOP one, likely with a component-entity system included in the standard library.

Actually, that sets me thinking. How practical would a language that lays objects out as struct-of-arrays automatically be? Then again, isn't Jai by Jonathan Blow supposed to have support for doing just that easily? Maybe I should look into it a bit more.

Also, totally unrelated, but wanna exchange some IM addresses? I totally could use someone to ramble about language dev and general programming to/with @_@

Asmageddon avatar Jun 16 '15 20:06 Asmageddon

Currently Lobster doesn't dictate how you organize your game entities at all.. it does not come with a builtin entity (though you could consider the physics entities such, but most of the games I've made so far don't use them).

I'm certainly not a fan of anything OO. At the same time, Lobster is a fairly high level language, such that the differences between SOA or AOS storage currently really don't matter for performance reasons. I hope one day it will :)

Jai's SOA features seem entirely motivated by performance. There's definitely advantages to an ECS beyond that, like being able to add/remove components to an entity at runtime, and I could totally see it being part of the language giving both speed and usability improvements. I guess mixins in some language may come close to what an ECS does (without the storage aspect).

Feel free to email me personally :)

aardappel avatar Jun 16 '15 20:06 aardappel