Anybody can help me with linepick ?

Blitz3D Forums/Blitz3D Programming/Anybody can help me with linepick ?

Filax(Posted 2006) [#1]
Hi :)

I'm trying to make a very simple IA for a little game.
But i don't understand how to turn smoothly my balls :)

http://www.blitz3dfr.com/tempo/IA_Test.rar


Damien Sturdy(Posted 2006) [#2]
OK, I can't test where I am now, so I'm going to have a guess at this for you:

Do two LinePicks at 45 degree angles in the direction the ball is going- (One to the left and one to the right)

Get the Local X coordinate of the pickedx() using Tformpoint.

if you add the Local X of the left collision to the local X of the right hand collision you should end up with a value you can use to turn the object by to avoid hitting things.

I use this technique as part of my Car AI in the racer and it works well :)


Now I just hope this is of use as I can't tell what your actually after ;)


Filax(Posted 2006) [#3]
Any chances to see code ? :)


Damien Sturdy(Posted 2006) [#4]
C'mon Filax, I know you can do this :)

I don't have blitz3D available anymore (for the mean time) but you should be able to work it out.


the easier option is to simply parent two pivots on the ball, and move one out by (-10,0,10) and one out by (10,0,10). the next frame they will have collided with the scenery and you can get their X values by simply doing "EntityX" on them :). after you finish, position them both back at 0,0,0 and call ResetEntity on them :)

I will try to grab code later but not for some time :)


Filax(Posted 2006) [#5]
ResetEntity ? i'm not using blitz collision :) ?
just a linepick, but my problem is that i made
a turn entity to change they directions, but i want
to turn them but with smooth :) So , many thanks by
advance if you can help me Cygnus :)


t3K|Mac(Posted 2006) [#6]
errrm, turning smoothly my balls is pretty easy ;-) just take your fingers and go ahead ;)


Filax(Posted 2006) [#7]
Lol :) sure :)


puki(Posted 2006) [#8]
Hold on a minute, you are bouncing these things of the wall like a nutter:

P\New_Yaw#=180+Rnd(-100,100)

That's hardly going to give a smooth turn.

You are bouncing them off the walls on a random trajectory.


'AligntoVector' that's what I would use.


D4NM4N(Posted 2006) [#9]
Hi Filax, i cant view the example (havent got rar on this machne)

Are you trying to bounce a ball?
wouldnt it be easier to linepick in the balls direction and use picked nx,ny,nz to alight a pivot to the rebounding surface at pickedx,y,z.
Then do some maths to work out the balls rotation to the pivot's.
From this you could work out the rebounding angle with mabe a rnd(-.5,.5) degree of chaos added so its not a 'perfect' rebound.

I think you would mabe need 2 from each edge of the ball rather than its center to detect the edges collision or mabe all 3 (thinking of head on). Im not sure about the radius option, mabe slow (never used it)
ie:

|||
|||
'O'


Filax(Posted 2006) [#10]
Hi guys !

Thanks for reply :) Here is the file in zip format

www.blitz3dfr.com/tempo/IA_Test.zip

No, the bounce is not directly my problem, it seem work
correctly. My problem come from my turn (when balls hit wall
or other ball) actualy i made a quick turn entity but it's
not nice :/ Is there a possibility to turn this entities
slowly ?


OverDozing(Posted 2006) [#11]
Salut Filax,

Essaye ca: http://www.overdozing.com/IA_Test.rar


Filax(Posted 2006) [#12]
Excellent !! merci !! :) Content de voir des amis francophone ici :)


OverDozing(Posted 2006) [#13]
Bin disont on se connait deja lol ^^


Filax(Posted 2006) [#14]
Ah ! lol :) je vieilli :) sinon super ton patch !
je vais remettre un coup de peinture dessus et je
et reposterais le truc car j'ai dans l'idée de faire
une petite lib d'IA en open source :)


Damien Sturdy(Posted 2006) [#15]
Haha, seems you weren't doing what I thought you were at all :)