Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Collision using sub-parts?
Old
chip
Member
 
chip's Avatar
 
Status: Offline
Posts: 24
Join Date: May 2011
Location: New Hampshire
Default Collision using sub-parts? - 05-17-2011, 09:43 AM

Before I try an idea I have, I figure it's better to see if anyone's already invented this particular wheel.

Using the primitive squares from Alice's stock inventory, I've tested a "collision hull" surrounding the lake in my world. When the character steps (approximately) off the shoreline, she drops about a meter into the water and can then "wade" around in the lake. Leaving the lake through the wall, she rises back to ground level -- a very primitive form of terrain-feature response.

But using the rather small squares to line the entire shore of a rather large lake causes Alice to choke on saving the world -- out of memory error. I guess some optimization of Alice in that regard would be helpful, since the world isn't all that complex. Yet

So my idea is to build a "fence" for the lake in Blender and import it, then use the subparts as collision objects. But do the subparts have individual centers (pivots) that I can reference in my collision routine? I haven't yet used multi-part models, so it's terra incognito for me. Any insight would be appreciated.
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 05-17-2011, 12:23 PM

well you could actually just use on large object and use the functions whether an object is in front of behind left of right of which gives a pretty good collision method, so if the lake is a pretty straight5 edge it would be pretty easy to implement this, look at damerias maze game if you want to try this out


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Old
chip
Member
 
chip's Avatar
 
Status: Offline
Posts: 24
Join Date: May 2011
Location: New Hampshire
Default 05-17-2011, 12:58 PM

That's where I looked first, actually. The problem is that the methods dealing with relative position are all based on object pivots, not the geometry itself. So if you have a large and irregular area (like a lake) to detect collision in, you need lots of smaller objects acting as "sensors." This works, I've already done a proof-of-concept with individual squares from the Alice library, but they're too small & take forever to set up.

So I'm looking to make it more efficient and less trouble to implement by using imported geometry, which can be tailored to fit the landscape, since that was also modeled in Blender.

So far I'm running into probs with getting the meshes into Alice as sub-parts, some issues with the way various translators deal withe the Blender mesh. I'll post here later if I find a solution.
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 05-17-2011, 01:44 PM

well I know you can create sub parts real easily in google sketch up


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Old
chip
Member
 
chip's Avatar
 
Status: Offline
Posts: 24
Join Date: May 2011
Location: New Hampshire
Default 05-17-2011, 02:07 PM

Creating the sub-parts isn't hard from Blender either, I have two different exporters that can do that. The problem has been finding a method that also preserves the object pivots. In my exported ASE files, all the subparts are in the right place, but their pivots have all been moved to the world origin, which isn't useful for what I want to do. If I use options that keep the sub-parts pivots where they belong, all the sub-parts get clustered on the world origin, which is also no joy. Catch22.2
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 05-17-2011, 02:48 PM

yeah I know what you mean, the only way to create perfect sub part pivot points is to create every object on the origin in either blender or sketch up, 3d max I think allows perfect pivot points if you ever used that


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Old
chip
Member
 
chip's Avatar
 
Status: Offline
Posts: 24
Join Date: May 2011
Location: New Hampshire
Default 05-17-2011, 03:04 PM

The object centers in Blender are just as I want them, it's the conversion to ASE that creates the problem. I'm looking into that format to see if I can edit my Blender export script to do something a bit different.
   
Reply With Quote
Old
chip
Member
 
chip's Avatar
 
Status: Offline
Posts: 24
Join Date: May 2011
Location: New Hampshire
Default 05-17-2011, 06:07 PM

Well, after looking into the ASE format and other subjects, it seems that I can't do what I want without scripting, which I'm more than willing to attempt, but I'm having a bit of difficulty finding info about Alice's API and the process for extending Alice with custom Jython scripts. I'm used to apps that use scripting very easily, mainly Blender, where there are beaucoup resources available. Alice's Wonderland seems a bit sparse in that regard, unless there are hidden treasures scattered about Any hints? Treasure maps? Ovaltine?
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Question 05-17-2011, 07:30 PM

Plenty of hidden treasures, but no treasure map. I could go on for ages about scripting in Alice, but if the subparts aren't working have you tried converting from Blender to some other format and using Biturn to convert from that to ase?


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [-]
   
Reply With Quote
Old
chip
Member
 
chip's Avatar
 
Status: Offline
Posts: 24
Join Date: May 2011
Location: New Hampshire
Default 05-17-2011, 07:58 PM

Well, I did find a web page that at least showed how to enable scripting. That's the first step, for sure.

The sub-parts aren't working because of the nature of the ASE format. I've used both a Blender script and Biturn (on .obj exports from Blender) to generate the ASE's, and in those cases, it's not possible to import a set of sub-objects where the pivots are anywhere other than at world origin. I think it's the nature of the ASE beast.

So, my idea is to generate a coordinates list for the sub-objects from Blender, then use a script in Alice to assign those coordinates to the imported sub-objects. When the sub-objects are imported with their pivots intact (at the center of their geometry, that is), they gang up at the world center; I'll then use scripting to re-position them as necessary. Then I can use them as the collision sensors for my world's lake area.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.