Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / new patch causing physics system to change.

Author
Message
malospam
13
Years of Service
User Offline
Joined: 27th Aug 2011
Location: Florida
Posted: 2nd Sep 2011 17:02
Back recently a user posted an example of a volleyball game with code, at this thread http://forum.thegamecreators.com/?m=forum_view&t=188773&b=41&p=0. I based my game off of it very closely, and it worked great. However, after the patch, the physics no longer works the same way and I can't get the ball to bounce and move. Has anybody else had a similar problem? Can anyone help rectify this situation as I had a lot of code written and now I cant progress until I figure out exactly what is happening. Thanks so much.
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 2nd Sep 2011 17:17
Some problems that affected velocity have been fixed in the new version. Try looking for any places where you adjust the velocity of sprites and increase the force values, I think that should sort things out.
malospam
13
Years of Service
User Offline
Joined: 27th Aug 2011
Location: Florida
Posted: 2nd Sep 2011 17:43
Was it specific functions you changed, or just the overall built in physics system? I'm using setspritephysicsvelocity, setspritephysicsangularvelocity, and setspritephysicsforce. Is there a specific function that was updated or the whole system? Thanks for the help!
malospam
13
Years of Service
User Offline
Joined: 27th Aug 2011
Location: Florida
Posted: 2nd Sep 2011 17:59
yes, it appears you are right, I am having to increase values for this function by alot setspritephysicsvelocity.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 2nd Sep 2011 18:14
We updated to the latest Box2D version (which won't have affected the commands in question) and fixed SetSpritePhyscisVelocity() to take the physics scale into account, so velocity values will need to increase roughly 5 times.
malospam
13
Years of Service
User Offline
Joined: 27th Aug 2011
Location: Florida
Posted: 2nd Sep 2011 21:23
Thanks for the info Paul, I was able to tweek that. Another problem I'm noticing is in the collision system. Before, it would register every collision, and I would have this confirmed by puting a print statement in my collision code, and also having it play a sound. Now it only plays the sound sometimes, and prints the collision code randomly, even though the ball itself clearly collides with the character and bounces off of him. Do you know why this might be?
Sinistar99_2
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location:
Posted: 3rd Sep 2011 19:19
I think I'll wait until the ... next patch...
malospam
13
Years of Service
User Offline
Joined: 27th Aug 2011
Location: Florida
Posted: 3rd Sep 2011 22:23
Ya that might be a good idea Sinistar. I really would like a response though just in case, I might have to revert to the previous version. Paul could you comment on this? If you download the volleyball game and code posted previosly you'll know what I'm talking about, as you can see the video where it was working perfectly. THANKS.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 3rd Sep 2011 23:44
My vollyball example seems to need a 5x adjustment on velocity for version 1036...

sprite5_velocity = 60
sprite5_direction = 3

...Become...

sprite5_velocity = 300
sprite5_direction = 15

...then I adjust my formulas as so....

sprite5_direction = ((GetSpriteX (2) - 10) - GetSpriteX (5)) / 2 * -1
sprite5_direction = ((GetSpriteX (3) + 10) - GetSpriteX (5)) / 2 * -1

...Become...

sprite5_direction = ((GetSpriteX (2) - 10) - GetSpriteX (5)) * -2
sprite5_direction = ((GetSpriteX (3) + 10) - GetSpriteX (5)) * -2

...By changing these values the example should work in v1036 similar to the way the old code did in v1028.

I hope this helps.

malospam
13
Years of Service
User Offline
Joined: 27th Aug 2011
Location: Florida
Posted: 4th Sep 2011 01:14
I copied your code exactly. It still does the same thing. The ball bounces so there should be a collision event registering, and since I have a play s ound code and a print statement in the area of the collision code, it should do both, as it did fine before the update. I'm so confused!
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 4th Sep 2011 02:30
I tried the code and couldn't see any problem with the sound playing on collision, did you unistall the previous version and reinstall the new version? Installing over the top is known to cause problems.

Login to post a reply

Server time is: 2024-11-21 16:28:01
Your offset time is: 2024-11-21 16:28:01