Jump to content

XNA Implementation With Bones


Recommended Posts

Hi!

Just a quick bug report:

You should replace SpriterWriter.cs line 35 with:

return float.TryParse(p_element.Attribute(p_name).Value, NumberStyles.Any, CultureInfo.InvariantCulture, out p_out);

The current version might not work depending on your system variables.

Also, I don't think calling SpriteBatch begin/end in sprite drawing function is a good idea since it can be quite a performance sink.

This is ofc not the objective truth and you can do as you please.

Cheers.

Link to comment
Share on other sites

Hi!

Just a quick bug report:

You should replace SpriterWriter.cs line 35 with:

return float.TryParse(p_element.Attribute(p_name).Value, NumberStyles.Any, CultureInfo.InvariantCulture, out p_out);

The current version might not work depending on your system variables.

Also, I don't think calling SpriteBatch begin/end in sprite drawing function is a good idea since it can be quite a performance sink.

This is ofc not the objective truth and you can do as you please.

Cheers.

Thanks! I'll take a look as soon as I get home. As for the Draw function, I wasn't entirely sure people would be using that one or trying to roll their own; so I figured I'd just give everyone the basic idea of how to draw and they could take it from there.

Thanks

-- NSP

Link to comment
Share on other sites

Hi, again.

I have been playing around a bit more with this library. However I just realized that you don't have defined license anywhere. This is something I need to know before continuing to work on this, since I'm planning to use it with a commercial project. We were previously using XSpriter, but your work has some features that are missing from it and much better codebase.

I also found more bugs and missing features and have patches for those. Bigger than one liners this time. I tried to create an account at assembla, but it doesn't let me fork and I don't want spend time figuring out why. Tell me if you have preferred way of receiving patches. I/You could put it up at CodePlex or GitHub if the license allows and you are fine with it.

Link to comment
Share on other sites

Oi. Never really expected people to use it let alone upgrade it. Haha.

I'll set up a repository on one of the two sites you suggested. I've no problem with people fixing my code (I never expected it to be perfect) or using it in their projects. I'll create a repo, pick a license that suits, and link it here as soon as I get the chance tonight.

Thanks again

-- NSP

Link to comment
Share on other sites

Got it! You can download\branch\fork it here.

It's under the GPLv2 license.

Hope it's not too restrictive. I tried to pick a license that was as open as possible. If anyone finds or squishes some bugs in their own forks of the project I'd love to see or hear about them so I can fix the master.

-- NSP

Thanks for your work.

GPL is indeed too restrictive, since it doesn't allow linking to the library without forcing the whole software to be licensed under GPL. It would be much appreciated if you could switch that to for example LGPL or MS-PL.

Link to comment
Share on other sites

Hello NowSayPillow.

I downloaded your implementation and tried, but simply compiling the code results in nothing, a blank page.

I tried to load my own .scml but it also gives a bad result: only the feet of my wolf appears, and the rest of the body appears only one frame on the loop, i guess is the first one.

Am i doing something wrong? There are something i supposed to do?

Link to comment
Share on other sites

Hello NowSayPillow.

I downloaded your implementation and tried, but simply compiling the code results in nothing, a blank page.

I tried to load my own .scml but it also gives a bad result: only the feet of my wolf appears, and the rest of the body appears only one frame on the loop, i guess is the first one.

Am i doing something wrong? There are something i supposed to do?

Hi LadyApoLLo!

I would suggest you try my fork on GitHub. It has some fixes so maybe you'll get a better result. I put a pull request for NowSayPillow so maybe those changes will be made into the main repo in the near future.

If you could post your results (success or failure) here it would be much appreciated.

Link to comment
Share on other sites

  • 3 weeks later...

Hey guys,

Sorry for the double post.

As an experiment I tried and managed to port all my Java code to C#: https://github.com/Trixt0r/SpriterXNATest

Now there is no need for ikvm. In the repo is still an XNA test. The source code should also run with any other backend since the implementation only uses the "System" and "Generics" namespaces. This means you could create easily a Spriter plugin for e.g. Unity, Playstation Mobile SDK (tested my port here and got the same result as in XNA), or any other game engine which uses C#. ;)

Maybe I will bring some updates in the repo as the Java library evolves.

-Trixt0r

Link to comment
Share on other sites

  • 2 months later...

Hi NowSayPillow and Laquendi,

First, I would like to thank you for your Spriter implementation.

We have an indie studio that started last year and we are using it to develop our first game for PC.

We are making a 2d shooter game in a "Metal Slug" style.

Although, our characters move theirs arms towards the aim's direction and therefore we have some issues concerning the implementation.

1. Is it possible to rotate a single bone dynamically instead of the whole animation?

2. Is it possible to change the texture dynamically (through coding) instead of changing the whole animation to another animation that has another texture?

(Example: I have a Character that got hit by a bullet and I want to change his head texture without changing anything else).

3. Do you plan to implement the next version of Spriter (beta 6)? If you don't, could you please implement the reference points at least?

We really appreciate your help. You did an amazing job.

Thank you very much.

Link to comment
Share on other sites

I know what you're trying to do because we had to do the same thing for our game (we're even building the same kind of game oddly enough). What we did is have the arms separate and we drew them on afterwards, if you want to do what you're talking about you're gonna have to crawl through the data provided and look for a specific bone ID and object ID, find out where they are and update their location after they've been updated but before they've been drawn. This implementation isn't really built for what you want to do; what you're looking for is called inverse kinematics. You can read up on that if you want. (Good luck, it's way over my head. lol)

You can change the texture to a "ouch" face again you're gonna have to find out which objectID it is and update the texture ID it's looking at before it's drawn. Just remember to set it back when you're done.

Yeah, we'll be updating as often as possible (keep in mind though, any time spend on this is time taken away from my game) so if the updates are slow in coming, that's why.

Link to comment
Share on other sites

  • 1 month later...

Yeah all those skinned stuff is cool but also pretty overkill, will you be adding the easying curves support? That's something we are going to need for sure at some point so I need to know if someone else is adding those or if we need to add them at some point :)

Sadly Laquendi didn't continue on our project, he had our knowledge off your work!

Cheers,

-Kimo

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...