Questions: Ragdoll Physics, XML and Lua Plugins

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Zenku
Prole
Posts: 12
Joined: Fri Jul 09, 2010 2:18 am
Location: Argentina

Questions: Ragdoll Physics, XML and Lua Plugins

Post by Zenku » Fri Jul 09, 2010 2:31 am

Hello there,

I'm new at game programming and I was wondering if you could help me with two things:

1-
I don't know much about Ragdoll Physics, and may be my question is not directly related with this, but...

The Ragdoll body is generated once the character is dead or the moving character is also a ragdoll? I mean, is the character always under the ragdoll physics? The character is a ragdoll always despite he is "alive"? if the character is a ragdoll, how do I manage to make it move? Do I have to move each ragdoll's components? (Like moving both legs for walking, I don't know)

2-
I would like to manage my tileset using XML, the thing is I never touched an XML so I don't know how is the better way of processing them. I think there should be some kind of plugin or module to help this process. But this takes me to another question...

3-
Is it possible to use Lua plugins with Love? For example I would like to zip some files from lua. Is it possible using love.exe?


Thanks in Advance,

Zenku
Take care of your thoughts because they'll become words
Take care of your words because they'll become acts
Take care of acts because they'll forge your character
Take care of character because it'll determine your destiny
and your destiny ll be your life

User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Questions: Ragdoll Physics, XML and Lua Plugins

Post by kikito » Fri Jul 09, 2010 6:42 am

Hi Zenku, welcome!

I will try to answer your questions the best I can:

1- Ragdoll physics are usually done on 3D games (You know that LÖVE is 2D only right?). Physics isn't an easy subject, even in 2D - it usually requires a lot of math in order to look good. There isn't a "standard" way to implement ragdoll physics; each game does them a little differently. The "cheapest way" is to "ignore" the laws of physics and have a canned set of skeletal animations (run, jump, etc) for the body, which is a skeleton with polygons on top; you ignore all the physics except perhaps gravity and collision detection while the character is "alive" - maybe modeling him as a "cube" or "block" that moves around on the level. When he dies, you transform the skeleton on a set of bodies linked with joints (a ragdoll). More complex games such as GTAIV or The Force Unleashed use a middleware called Euphoria just for the ragdolls.

2- Xml doesn't have any inherent advantages - unless you already have an editor that spills files on xml format . If you have a scripting language such as Lua available, it's going to be much simpler to just use it instead of xml - you can use Lua both as a scripting language and a data specification language. If I remember correctly, Tiled exports maps directly in Lua (disclaimer: I haven't used it). If you absolutely need xml, you can use an external xml library, such as luaXML.

3- I don't know what you mean by "plugins". If you mean "libaries", then yes, you can use most LUA libraries, providing that they are only lua and don't have binaries associated. For example, the library I'm developing, PÄSSION, is a lua library (documentation isn't finished yet - sorry).

I hope this helps.
When I write def I mean function.

User avatar
Zenku
Prole
Posts: 12
Joined: Fri Jul 09, 2010 2:18 am
Location: Argentina

Re: Questions: Ragdoll Physics, XML and Lua Plugins

Post by Zenku » Fri Jul 09, 2010 1:45 pm

hello kikito,

Thank you for the answer.

You are right, I should use lua for data specification. It's just I was programming a Tile Editor in delphi (I don't have to waste time programming buttons or menues) and I was wondering in which format I should output the file.

When I said plugin, may be I was refering to libraries. The thing is that I'm new in Lua and I don't know how to use libraries. For example, I would like to use this: http://www.keplerproject.org/luazip/ and I don't know how to use the zip.dll from love. Or maybe love already has a function for zipping (it should, it works uncompressing .love files >.<) that I don't know, I haven't seen any at the wiki page.

Sorry If I ask something obvious, it's my first approaching to this kind of scripting language.

Again, thanks for the help.

Zenku
Take care of your thoughts because they'll become words
Take care of your words because they'll become acts
Take care of acts because they'll forge your character
Take care of character because it'll determine your destiny
and your destiny ll be your life

User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Questions: Ragdoll Physics, XML and Lua Plugins

Post by kikito » Fri Jul 09, 2010 2:42 pm

dlls are binary files. I don't recommend using them, because you will lose portability.

For the particular case of compressed files, .love files already come compressed. If you just want to compress your maps so they make less space, just put them (uncompressed) on a folder called yourgame/maps or something. Later, when you make the .love file, they will be compressed along with the rest. You will be able to read them directly and LÖVE will do all the compression for you.

In general, installing a (non-binary-dependent) library consists on:
  • Copying a directory full of lua files inside yourgame/
  • Using require to "load" the library. It usually takes 1 single line
When I write def I mean function.

User avatar
Zenku
Prole
Posts: 12
Joined: Fri Jul 09, 2010 2:18 am
Location: Argentina

Re: Questions: Ragdoll Physics, XML and Lua Plugins

Post by Zenku » Fri Jul 09, 2010 2:49 pm

Ok, thanks for your time.

I'll continue investigating.
Take care of your thoughts because they'll become words
Take care of your words because they'll become acts
Take care of acts because they'll forge your character
Take care of character because it'll determine your destiny
and your destiny ll be your life

User avatar
Luiji
Party member
Posts: 396
Joined: Mon May 17, 2010 6:59 pm

Re: Questions: Ragdoll Physics, XML and Lua Plugins

Post by Luiji » Sat Jul 10, 2010 2:27 pm

Well, XML is said to have an advantage because it is sooooooo generic that you can use it for just about anything, and that it makes a "great" standard, thus people are more likely to already understand it when the come upon your program. For the purposes of a game with a level editor, screw XML, it will just increase the size and load-time of your game. For the purposes of document markup, sure.

Happy coding!
Good bye.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 7 guests