www.quadsoftware.com
FAQ  FAQ   Search  Search   Memberlist  Memberlist   Usergroups  Usergroups
Register  ::  Log in Log in to check your private messages


Post new topic  Reply to topic
 Plugin development: Ups & Downs « View previous topic :: View next topic » 
Author Message
cmusch
PostPosted: Thu Aug 02, 2007 8:06 pm    Post subject: Plugin development: Ups & Downs Reply with quote



Joined: 02 Aug 2007
Posts: 33

Hi!

I've spent the last three days developing Grome plugins for our engine. Here I want to share some of the experiences I made, and request some aid.

First off, starting the plugin in debug mode doesn't work for me. Specifying the grome executable as application to launch results in the following error at startup:

First-chance exception at 0x0075faa5 in Grome.exe: 0xC000001D: Illegal Instruction.
First-chance exception at 0x0075fbae in Grome.exe: 0xC0000096: Privileged instruction.
First-chance exception at 0x007602ba in Grome.exe: 0xC0000005: Access violation reading location 0xffffffff.

I use MSVS C++ Express Edition, and Grome Professional. Does anybody know a solution to this problem?


The second thing to note is that if you just do the tiniest thing wrong or something unexpected in your plugin, Grome crashes. My favorite example is returning 1 in iStoragePlugin::GetNodesNo() at Grome startup, before Parse() was called (we have one model per file). Most of the time spent developing until now was finding out why Grome did not like something about my plugin, by carefully comparing what I did to what was implemented in the examples.

Documentation could be better. I would say it is impossible to write a plugin based on the documentation alone, you have to study the examples. Ok, one could consider the examples part of the documentation...

What I really appreciate is the possibility to scale images, and save them in an arbitrary format. This really saved me some time. What I don't like is that after scaling an image used as a texture mask, the corresponding mask becomes uneditable in Grome. Either an error code should be returned, or it should work.

In sum, I think the plugin SDK delivers what it promises, but the ride isn't as smooth as I had hoped for.

cm
Back to top
View user's profile Send private message
ALicu
PostPosted: Fri Aug 03, 2007 7:02 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Hi,

Quote:

First off, starting the plugin in debug mode doesn't work for me. Specifying the grome executable as application to launch results in the following error at startup:

First-chance exception at 0x0075faa5 in Grome.exe: 0xC000001D: Illegal Instruction.
First-chance exception at 0x0075fbae in Grome.exe: 0xC0000096: Privileged instruction.
First-chance exception at 0x007602ba in Grome.exe: 0xC0000005: Access violation reading location 0xffffffff.


This is a known bug. Next patch will solve this (hopefully today).

Quote:

The second thing to note is that if you just do the tiniest thing wrong or something unexpected in your plugin, Grome crashes. My favorite example is returning 1 in iStoragePlugin::GetNodesNo() at Grome startup, before Parse() was called (we have one model per file). Most of the time spent developing until now was finding out why Grome did not like something about my plugin, by carefully comparing what I did to what was implemented in the examples.


Yes this is a problem with all the plugin systems in general. We've considered using some sort of protection so when a plug-in crashes the main application would not. But a general case cannot be done, the shared memory gets corrupted. A solution would be for the plugins to run on separate processes with separate memory but this would complicate things a lot.

Anyway, when you will have debugging running things will be much more easier, you will be able to tell the exact place where the plugin creates an error case.

Quote:
Documentation could be better. I would say it is impossible to write a plugin based on the documentation alone, you have to study the examples. Ok, one could consider the examples part of the documentation...


Documentation will get better and better. But our belief was that examples usually work better.

Quote:
What I really appreciate is the possibility to scale images, and save them in an arbitrary format. This really saved me some time. What I don't like is that after scaling an image used as a texture mask, the corresponding mask becomes uneditable in Grome. Either an error code should be returned, or it should work.


Images (and data in general) created by the editor cannot be modified. This would cause all sorts of problems (undo, UI update, internal data update etc). So in theory you shouldn't be able to modify the mask size. This may be a bug, I have to check on that.

To modify the editor data you should do something like reading it in your own created images, modify it in any way, clear the old layer data and assign the new layer definition to the layer.

We will try to make a patch ASAP so you can continue with your work. I will let you know when the new version is on the site.

I've also added your user rights to the professional edition forums. Please use that forum for bug reports so we can track your issues.

Regards,
Adrian L.
Back to top
View user's profile Send private message
ALicu
PostPosted: Fri Aug 03, 2007 11:00 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Hi,

A new patch was added. You can login from the main web page (in the left part). And after that select Available Service. This new patch (01.08.14) should fix your debugging problem.

Regards,
Adrian L.
Back to top
View user's profile Send private message
cmusch
PostPosted: Fri Aug 03, 2007 12:08 pm    Post subject: Reply with quote



Joined: 02 Aug 2007
Posts: 33

Thanks, it seems to work now.

One thing to note: I had to put the program debug database file (.pdb) into the plugin directory for things to work out.

regards
chris
Back to top
View user's profile Send private message
ALicu
PostPosted: Fri Aug 03, 2007 12:12 pm    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Was that the .pdb of your plug-in or of the SDK / application ?
Back to top
View user's profile Send private message
cmusch
PostPosted: Fri Aug 03, 2007 12:33 pm    Post subject: Reply with quote



Joined: 02 Aug 2007
Posts: 33

The .pdb of my plugin.
Are those other .pdbs in the builder\bin directory of any use to grome users? Or are they used for automatic error reporting?
Back to top
View user's profile Send private message
ALicu
PostPosted: Fri Aug 03, 2007 12:40 pm    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Ok, I see. I think you can indicate the .pdb folder for the current debugging session inside Visual Studio though.

And you are right, the pdb in Bin are for bug reporting.

Regards,
Adrian L.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Based on a template by Dustin Baccetti
Powered by phpBB © 2001, 2005 phpBB Group