grimfang4 Posted October 15, 2012 Report Share Posted October 15, 2012 Hey everyone, I'm working on a generic API for C++ that is not tied to a specific rendering engine. If you have feature requests specific to such an interface, leave a message here, email me, or create a new issue on the Google Code page. You can find my info at http://www.dinomage.com. EDIT: It's ready to use! Get the code at http://code.google.com/p/scml-pp/ Included is a sample implementation targeting the SDL_gpu rendering API. I'm still interested in feedback and interface suggestions! Currently implemented renderers: SDL_gpu SPriG (no GPU) SFML 2.0 Quote Link to comment Share on other sites More sharing options...
Mike at BrashMonkey Posted October 16, 2012 Report Share Posted October 16, 2012 Welcome to the forums grimfang4, and thanks for working on Spriter support for C++! cheers, Mike ay BrashMonkey Quote Link to comment Share on other sites More sharing options...
grimfang4 Posted October 16, 2012 Author Report Share Posted October 16, 2012 I've just finished a first pass of loading the SCML format into memory. You can get the code and keep up with progress at: http://code.google.com/p/scml-pp/ Quote Link to comment Share on other sites More sharing options...
grimfang4 Posted October 18, 2012 Author Report Share Posted October 18, 2012 I've gotten entities drawing mostly right. Next is tweening. Quote Link to comment Share on other sites More sharing options...
Mike at BrashMonkey Posted October 19, 2012 Report Share Posted October 19, 2012 Wow. Fast progress! Awesome work. Mike at BrashMonkey Quote Link to comment Share on other sites More sharing options...
grimfang4 Posted October 19, 2012 Author Report Share Posted October 19, 2012 Thanks, Mike! I just fixed the "drawing mostly right" issue (you can see it in the previous image where some joints don't seem to line up - notably the forward knee). Tweening of the basic positioning parameters is implemented now too, so the animation is nice and smooth. So, except for comprehensive use cases, it's ready to be put into a game. I'm just awaiting an example that uses bones so I can finish that part. Then there are all the details left, like atlases, character maps, metadata and such. Here's to Spriter! Quote Link to comment Share on other sites More sharing options...
grimfang4 Posted October 29, 2012 Author Report Share Posted October 29, 2012 Thanks to Edgar and Spriter A4! SCMLpp now draws entities that have bone hierarchies. A sample is included in the source repository. The sample and code might also be helpful to developers who are implementing bone animation in other plugins (more so when it gets cleaned up). I'll put together some extra documentation for such an implementation. Quote Link to comment Share on other sites More sharing options...
lucid Posted October 31, 2012 Report Share Posted October 31, 2012 ha, that knight is awesome! looks like actual crayon, but then I wouldn't know how you got the png transparency so perfect. Thanks again for creating this api. Quote Link to comment Share on other sites More sharing options...
grimfang4 Posted October 31, 2012 Author Report Share Posted October 31, 2012 You're welcome. It'll be very useful personally, once my projects are ready for it. The knight sprite is indeed crayon. My daughter drew it (and others) for my little game, Button Battle (http://www.dinomage.com/?s=button+battle). I didn't use Spriter for Button Battle, so it has very simple movements. To retain the authentic messy crayon style, I used the GIMP to cut a white layer to the shape of the sprite and the Color to Alpha tool (in the Colors menu) to overlay the drawing on top of the cutout. Quote Link to comment Share on other sites More sharing options...
grimfang4 Posted October 31, 2012 Author Report Share Posted October 31, 2012 For those who might want to create a new renderer for SCMLpp, I've just factored out all of the SCML complexity so the renderer implementation is incredibly simple. Take a look at SCML_SDL_gpu.h and SCML_SDL_gpu.cpp. The overall interface is still evolving, but the renderer-specific interface is settling down. If you want to contribute a renderer to the project and source repository, let me know! Quote Link to comment Share on other sites More sharing options...
Obg1 Posted November 3, 2012 Report Share Posted November 3, 2012 Hi, Thanks for working on the CPP implementation. I like that you split the code to a rendered. I'm currently trying to use your implementation to get it working on Cocos2d-x. It seems like the bones aren't working well, the anchor points are wrong. Maybe you should send them in the rendered draw call? Also, I've tried running "Hero.SCML" example, and it crashes. Thanks & keep with the great work :!: Quote Link to comment Share on other sites More sharing options...
grimfang4 Posted November 3, 2012 Author Report Share Posted November 3, 2012 Thanks Obg1. It'll be great to have Cocos2d-x support. If you write the renderer code, you can email it to me or if I have your Google account email address, I can add you to the repository project members. The renderer interface draw_internal() is meant to rotate about and draw at the center of the image. This is the simplest renderer-agnostic choice. All the hard work is done elsewhere so that this function can be just a dumb drawing wrapper. I've fixed up the tweening so it doesn't crash on Hero.SCML (now included in the repo). However, it looks like there's a spin direction issue still... Quote Link to comment Share on other sites More sharing options...
grimfang4 Posted November 3, 2012 Author Report Share Posted November 3, 2012 Also, I just finished adding an SFML 2.0 renderer and test code. That makes three completed renderers so far: SDL_gpu, SPriG (no GPU), and SFML. Quote Link to comment Share on other sites More sharing options...
Obg1 Posted November 3, 2012 Report Share Posted November 3, 2012 Hi, I've just emailed you regarding this. Also, if you need an example file to test bones let me know and I'll send you one. I think it will be best if all of the efforts will be made on your port due to its generic nature. If someone from the Spriter team can also help on improving your port, it will help a lot. Especially the bone mechanism. Quote Link to comment Share on other sites More sharing options...
grimfang4 Posted November 6, 2012 Author Report Share Posted November 6, 2012 I've just added some bone transform caching. Now each bone transform is calculated only once per draw. Quote Link to comment Share on other sites More sharing options...
Obg1 Posted November 6, 2012 Report Share Posted November 6, 2012 Awesome! Also, there is Cocos2d-x support now :) Did you get any answer from Edgar about the rotation bug? Quote Link to comment Share on other sites More sharing options...
grimfang4 Posted November 7, 2012 Author Report Share Posted November 7, 2012 Yep, I figured out what the problem was. I was assuming that the mainline object ids could be used to refer to the same object in different keys, but Spriter actually follows the timeline for each object to do tweening. I fixed SCMLpp to use the timeline for that purpose. Problem solved. The Cocos2d-x renderer technically works, but I'll make it official as soon as it works as well as the others. There are still some kinks to smooth out. Quote Link to comment Share on other sites More sharing options...
grimfang4 Posted November 25, 2012 Author Report Share Posted November 25, 2012 There is now an interface to get current bone and object transforms. This can be used both for drawing bones and for in-game effect placement. Let me know if you have any feedback or suggestions on this: int SCML::Entity::getNumBones() const; int SCML::Entity::getNumObjects() const; bool SCML::Entity::getBoneTransform(SCML::Transform& result, int boneID); bool SCML::Entity::getObjectTransform(SCML::Transform& result, int objectID); Quote Link to comment Share on other sites More sharing options...
chunkyguy Posted December 26, 2012 Report Share Posted December 26, 2012 I was able to run your api on Mac using the SFML renderer after a little tweaking. Thanks! Quote Link to comment Share on other sites More sharing options...
grimfang4 Posted December 27, 2012 Author Report Share Posted December 27, 2012 I was able to run your api on Mac using the SFML renderer after a little tweaking.Thanks! Awesome. :) Please send me the tweaks if you think they apply to others, too. Quote Link to comment Share on other sites More sharing options...
chunkyguy Posted December 27, 2012 Report Share Posted December 27, 2012 I was able to run your api on Mac using the SFML renderer after a little tweaking.Thanks! Awesome. :) Please send me the tweaks if you think they apply to others, too. Basically, the tweak is just to change the way we load resources, as the Mac apps have this sandboxing system where all the assests are within that sandbox. I guess everyone who uses SFML on mac knows about it. We just need to modify two methods: //main.cppint main(int argc, char* argv[]){ if(!init(800, 600)) return 1; vector data_files; data_files.push_back(resourcePath() + "Example.SCML"); data_files.push_back(resourcePath() + "knight.scml"); data_files.push_back(resourcePath() + "Hero.SCML"); data_files.push_back(resourcePath() + "fish.scml"); main_loop(data_files); quit(); return 0;}//SCML_SFML.cppbool FileSystem::loadImageFile(int folderID, int fileID, const std::string& filename){ sf::Texture* img = new sf::Texture; img->loadFromFile(resourcePath() + filename); if(img == NULL) return false; if(!SCML_MAP_INSERT(images, SCML_MAKE_PAIR(folderID, fileID), img)) { printf("SCML_SFML::FileSystem failed to load image: Loading %s duplicates a folder/file id (%d/%d)\n", SCML_TO_CSTRING(filename), folderID, fileID); delete img; return false; } return true;} Here resourcePath() is available from the ResourcePath.hpp, that comes with SFML, and is also available on github And when adding the images and the .scml files to the project, keeping them with the .SCML file at the root level with other images added with 'Folder Type' reference. Such that the images are available at path: YourApp.app/Contents/Resources/mon_arms/hand_0_2.png For example, this is how my Xcode's Project Navigator looks like I hope this helps all the SFML Mac devs. If not, let me know, I'd be glad to help :) Quote Link to comment Share on other sites More sharing options...
StOrM3 Posted April 4, 2013 Report Share Posted April 4, 2013 Hey everyone,I'm working on a generic API for C++ that is not tied to a specific rendering engine. If you have feature requests specific to such an interface, leave a message here, email me, or create a new issue on the Google Code page. You can find my info at http://www.dinomage.com. EDIT: It's ready to use! Get the code at http://code.google.com/p/scml-pp/ Included is a sample implementation targeting the SDL_gpu rendering API. I'm still interested in feedback and interface suggestions! Currently implemented renderers: SDL_gpu SPriG (no GPU) SFML 2.0 Please Support App Game Kit C++ Tier 2 Rendering... I've been waiting on an interface to AGK from The Game Creators for a while now, and I think this is the perfect opportunity, especially since I would rather work in C++ than the basic like language of Tier 1.. I'm more than happy to help test it out, as I am a registered spriter pro pre-purchase owner, and AGK Beta tester, currently on version 1.08 beta 9.. I have plenty of C++ experience, so would love to get this working, and welcome your implementation for AGK 1.08 Tier 2 C++ Rendering.. Thank you for this soooo Much! Ken Cornett aka StOrM3 storm3@twlakes.net Quote Link to comment Share on other sites More sharing options...
grimfang4 Posted April 4, 2013 Author Report Share Posted April 4, 2013 Hey StOrM3, since I don't have or use that particular engine, could you give the implementation a go? Take a look at SCML_SDL_gpu.cpp. If you can load an image (FileSystem::loadImageFile) and draw a centered image (Entity::draw_internal), then you're all set. Check out the GETTING_STARTED.txt for a little more info. Quote Link to comment Share on other sites More sharing options...
BigJDTec Posted April 19, 2013 Report Share Posted April 19, 2013 Thanks very much for this grim fang. I've recently almost got it fully working in OpenGL ES on iPhone. Quote Link to comment Share on other sites More sharing options...
StOrM3 Posted April 19, 2013 Report Share Posted April 19, 2013 Hey I will give it a go, if you can zip up the entire repository, and either send it to my email or post it some where I can snag it.. I am not using GIT nor do I have any subversion client setup right now.. Sorry for the lack of my reply, but I have been battling a problem with my current game, I have a physics game, done with GM:Studio and the prismatic joint and motor is not working as it should, to allow my spike objects to go up and down, to kill the player etc.. I had to make 2 prismatic joints with motors and create and delete them based on collision of spikes with sensor boxes, and this is needless to say less than Ideal setup, so I posted a bug report that setting / changing the motor speed to a -negative number does not make it move back up as it should.. But, I still do want to make this work with App Game Kit, especially since I will be doing alot more work in AGK at least until GM:Studio can fix these bugs or add these features, also I requested Ashley add a prismatic joint and motors to Construct 2 Physics behaviors and properties also.. We'll see, but until then, I will be trying to work exclusively in AGK, once PEP is done for level editing and sprite placement and physics shapes and properties can be setup.. If I have the complete package, it should be nothing to change the member functions we need to get it rendering inside AGK Tier 2 or C++ inside Eclipse.. Thank you for all your help as many others have stated already, this is a great thing to have... Just let me know where I can snag it from, or if you want to email it to me, you can send it to my gmail account at: storm36969@gmail.com Thanks again, StOrM3 aka Ken Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.