Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

View previous topic View next topic Go down

Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  monkeys on Tue Jul 28, 2009 8:55 pm

I was wondering if you would be so kind as to explain to me what I need to do to get a character with an animated convex hull collision shape (like the zombie from tutorial 15 of sio2 v1.4, very nice work by the way!), to move around the map in third person, like with the 'player' cylinder from tutorial 9.

I was able to achieve this quite easily in v1.35, I simply used the some of the code from tutorial 9, using the functions _btRigidBody->getWorldTransform, for rotation and _btRigidBody->setLinearVelocity for moving around the world using bullet physics. This worked well in v1.35

In v1.4 I needed to add '_SIO2objectphysic->' to the function, and that got the ROTATION working again. But I can't seem to MOVE around the map (i.e walk forwards and backwards).. So at the moment my character (the zombie) will rotate around with my camera staying in the same perspective, but he wont move anywhere..

I have tried using different objects other than the zombie character, and they work as usual, so this leads me to think that it must have something to do with the addition of the convex_hull collision type shape for the zombie, which is not responding to the setLinerVelocity? As other simple rigid objects behave normallly?

The thing is that I want to keep the convex_hull collision shape so that I can collide my animated character with objects as I walk him around the map.

I'm sure you must be very busy preparing tutorials for SIO2 V1.4 so I am so very thankful in advance for any help you can offer on this matter.

Kindest regards.

monkeys

Posts : 8
Join date : 2009-07-22

View user profile

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  yarri on Tue Jul 28, 2009 9:53 pm

Might be a Bullet issue, try setting the state to active before applying impulse or setting velocity perhaps:

Code:

zombie->_SIO2objectphysic->_btRigidBody->setActivationState( ACTIVE_TAG );

--yarri

yarri

Posts : 81
Join date : 2009-04-10

View user profile

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  monkeys on Tue Jul 28, 2009 10:03 pm

Thanks for the fast reply yarri, I've done that already.

Here's the code I'm trying to use:

Code:

if( MOV_DIR )
         {
            // Make sure that our rigid body is activated instead whatever
            // we do would be ignored.
            zombie->_SIO2objectphysic->_btRigidBody->setActivationState( ACTIVE_TAG );
            
            // Set the linear velocity of our physic object with a push in
            // the right direction.
            zombie->_SIO2objectphysic->_btRigidBody->setLinearVelocity( btVector3( ( MOV_DIR * sio2->_SIO2camera->_SIO2transform->dir->x ) * ZOOMSPEED,
                                                                 ( MOV_DIR * sio2->_SIO2camera->_SIO2transform->dir->y ) * ZOOMSPEED,
                                                                 zombie->_SIO2objectphysic->_btRigidBody->getLinearVelocity()[ 2 ] ) );
         }

If i use any other object, such as the 'player' cylinder from tut 9 it works perfectly, as with v1.35.

Has anyone else tried this?

monkeys

Posts : 8
Join date : 2009-07-22

View user profile

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  shul on Fri Oct 09, 2009 7:07 pm

hi,
trying to re-export the scene from a new zip gets the program to load (on 3.1 simulation in debug) but the program exits immediately. I am using blender 2.49b, snow leopard and latest xcode,

Thanks
shul

shul

Posts : 23
Join date : 2008-10-18

View user profile

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  sio2interactive on Fri Oct 09, 2009 7:11 pm

Can you tell where the program break using the debugger?

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  shul on Fri Oct 09, 2009 7:24 pm

looks like if you add "zombie_normal.jpg" and re-find the files and re-export, and now it works. but, it does not work more than once or twice.. the error is back..

shul

Posts : 23
Join date : 2008-10-18

View user profile

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  sio2interactive on Sat Oct 10, 2009 2:36 am

Use the debugger...

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  shul on Sat Oct 10, 2009 8:43 am

Hi,
The program breaks at sio2_stream.cc line 268, in : while (*_SIO2stream->cur )

_SIO2stream is a pointer (donno if its valid, 0x485eec0) but all of the pointers within point to null, the debugger then says "EXC_BAD_ACCESS"

shul

(I should add that this is the 10th iteration of the breakpoint)

shul

Posts : 23
Join date : 2008-10-18

View user profile

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  sio2interactive on Sat Oct 10, 2009 3:19 pm

Can someone please confirm this issue... Cuz on my machine everything run ship sharp...

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  shul on Sat Oct 10, 2009 7:23 pm

Are you using the same config I do? snow leopard, latest xcode 3.2 (1610) and sio2 from the download page with blender 2.49b?

what I did was:
1. unzip sio2
2. go to data, delete tutorial15.sio2
3. open tutorial15.blend
4. find and "make absolute" path for all files
5. copy zombie_diffuse.jpg to zombie_normal.jpg
6. find again
7. open sio2_exporter.py in blender text mode in the same file
8. alt+p
9. give path as the "data" path (full path)
10. press export
11. rebuild and run in debug simulator


hopefully I didn't forget anything

shul

Posts : 23
Join date : 2008-10-18

View user profile

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  sio2interactive on Sun Oct 11, 2009 12:25 pm

1. unzip sio2
2. go to data, delete tutorial15.sio2
3. open tutorial15.blend
4. find and "make absolute" path for all files
5. copy zombie_diffuse.jpg to zombie_normal.jpg

>> zombie_normal is not even linked to any material...

6. find again

>> Why?

7. open sio2_exporter.py in blender text mode in the same file
8. alt+p

>> Why?

9. give path as the "data" path (full path)
10. press export

>> Are you selecting the objects and all the actions (visible) to export?

11. rebuild and run in debug simulator

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  shul on Sun Oct 11, 2009 1:31 pm

1. unzip sio2
2. go to data, delete tutorial15.sio2
3. open tutorial15.blend
4. find and "make absolute" path for all files
5. copy zombie_diffuse.jpg to zombie_normal.jpg

>> zombie_normal is not even linked to any material... - its in the image view, but even without the file it does not run correctly in the binary

6. find again

>> Why? - that's how I did it, again, doesn't really matter

7. open sio2_exporter.py in blender text mode in the same file
8. alt+p

>> Why? - how else do you run a script?

9. give path as the "data" path (full path)
10. press export

>> Are you selecting the objects and all the actions (visible) to export? - Yes, forgot to add that:

>>> 9.5 - choose everything ('a') in 3d view panel

11. rebuild and run in debug simulator

shul

Posts : 23
Join date : 2008-10-18

View user profile

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  shul on Mon Oct 12, 2009 12:55 pm

ok, did it once again, the first time it works (as I said) the second time I changed one of the vertices in the box , delete the exported files and dirs and exported again, the failure returned.

shul

Posts : 23
Join date : 2008-10-18

View user profile

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  sio2interactive on Mon Oct 12, 2009 2:18 pm

Is there anyone else with the same issue, or this is an isolated case?

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  Francescu on Mon Oct 12, 2009 3:30 pm

Why are you copying zombie_diffuse.jpg to zombie_normal.jpg if you don't intend to link it to some material?

The problem is that by adding steps like this, it does not make it easy to understand what you are trying to do...

I followed pretty much your steps and rebuilt tutorial15.sio2 from scratch and ran the project with NO problem.

Make sure to follow existing video tutorials to check how exporting is done.

You may be able to run a script with Alt+P but that is not what is showed in the various video tutorials...

Also, before 4. find and "make absolute" path for all files

You should also do the steps mentioned in the tutorial15 blend text file that sio2 put, such as:

- File -> External Data -> Find Missing Files

- Select the appropriate directory from the data directory of the SDK:

../SIO2_SDK/data/SDK_textures
../SIO2_SDK/data/SDK_sounds
../SIO2_SDK/data/SDK_scripts

- And link back the resources.


- File -> External Data -> Mall All Paths Absolute

Not sure what is going wrong for you. HTH nonetheless...

Francescu

Posts : 136
Join date : 2009-03-18

View user profile

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  shul on Mon Oct 12, 2009 4:00 pm

Francescu,
Thank you for the help, I did all of the things you point to. I also have ran the "run script" directly from the menu, nothing is changed.

Did you try to export, build, change something in the blend, export again and run the xcode project? are you using snow leopard with the latest stable version of blender (2.49b) and the latest xcode?

Thanks,
Shaul

shul

Posts : 23
Join date : 2008-10-18

View user profile

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  Francescu on Mon Oct 12, 2009 4:45 pm

shul wrote:Francescu,
Thank you for the help, I did all of the things you point to. I also have ran the "run script" directly from the menu, nothing is changed.

Did you try to export, build, change something in the blend, export again and run the xcode project? are you using snow leopard with the latest stable version of blender (2.49b) and the latest xcode?

Thanks,
Shaul

Yes, I did - mind that I didn't use the exporter Update option - I just re-created the sio2 archive everytime. No problem.

I'm using blender 2.48a and Not snow leopard.

I'm using XCode 3.1.3

Francescu

Posts : 136
Join date : 2009-03-18

View user profile

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  sio2interactive on Mon Oct 12, 2009 4:51 pm

I really don't think that the blender version & snow leopard & XCode version have nothing to do with it...

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  shul on Mon Oct 12, 2009 8:57 pm

Hi,
I unzipped and diffed the version I created and the one in the zip, it does not look like there are any major changes. if you want, I can send you anything you need so you can check on your side.

As for the version of xcode, it comes with a change in other things like run time libs etc., maybe some of those are the cause of the problem ?

shul

shul

Posts : 23
Join date : 2008-10-18

View user profile

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  sio2interactive on Mon Oct 12, 2009 9:21 pm

Well if its the case, it should be really easy to track the problem using your debugger...

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  shul on Tue Oct 13, 2009 7:31 am

Hi,
I sent the debug info, is there something else you need? I don't know the code enough to understand what is done there,

Shaul

shul

Posts : 23
Join date : 2008-10-18

View user profile

Back to top Go down

Re: Move Convex Hull character (like zombie in Tutorial 15) around in third person in sio2 V1.4

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum