Page 2 of 2 < 1 2
Topic Options
#124907 - 01/17/09 11:54 PM Re: Custom marble movement debugging [Re: _LB]
JimJam


Registered: 06/30/06
Posts: 49
I'm trying to keep the system extension free. Unfortunately, my engine requires that I use functions to prevent repetition of complex events. Though I suppose I could use a 1 loop Fastloop as a function, but I need it to call immediately, and I haven't tested if it works.

I am also trying to keep the system independent, so it can be run in a behavior or applied to multiple objects.

And no, testing if its at the current speed won't work. With vectors its hard to just say if its at a certain speed or not because it also has a direction. I'd have to find some method of comparing direction too. That wouldn't actually fix the problem and would be a work around.

The issue is that the vector keeps adding every single game frame, and it adds too fast. I did do a test that sort of worked by simply putting a delay between the forces, but the delay has to be proportional to the force, otherwise you have the same issue of being a work around.

Top
#125080 - 01/18/09 09:28 PM Re: Custom marble movement debugging [Re: JimJam]
_LB


Registered: 06/07/07
Posts: 887
Loc: Richardson, Texas, America.
What formula do you use to calculate how far to move it? Use that to get the X/Y movement and just compare X and Y separatly. Also fastloop does run instantly upon calling in the middle of lines of events, then when it's over it resumes from where it left off.
_________________________
Check the awsome games at http://ragdollsoft.com/
~Multimedia Fusion 2 Standard User~
My Site - LB-Stuff
-LB

Top
#125084 - 01/18/09 10:06 PM Re: Custom marble movement debugging [Re: _LB]
JimJam


Registered: 06/30/06
Posts: 49
Thanks for the info on the Looping. Hey, is there a way I can name a loop a Fixed Value, and compare it to an object to form association? Or maybe some other form to associate loops to specific objects, or multiples of objects?

I'm using a simple distance formula, to convert an angle and magnitude into an X/Y Magnitude. You know, sine and cosine, and what not. Did you look at the file?

Either way, I tried a method which compares the X/Y individually, but that would have to compare the coordinates at each instance of "impact". It just didn't work. Also, since negative numbers are less than zero, moving in the opposite direction would compare as being lower than the current speed, not equal. I could compare them using the Absolute value, but then without negative numbers you couldn't tell which direction you were travelling in. The only work around would be to compare the absolute value for numeric purposes, and use the real value for directional purposes. But that would be redundant and probably take a hit to the FPS. It just didn't work in all situations, only some.

I have found a method that works. Its a simple Acceleration formula.

Just set the speed to this:
(value( "Top Speed" )-value( "Actual Velocity" ))*value( "Accel" )

In which case Top Speed would be the desired speed to reach, actual velocity being the current speed of the player, and Accel being some decimal coefficient (in my case, 0.25). This will add to the Actual Velocity by a fraction of the difference of the two. While technically this acceleration would create an opposite parabola that would be considered deceleration... it works for my purposes.

But yet another glitch arises.

For some reason, at speeds lower than 1, turning at a right angle will set the Y speed in the thousands! It only applies as long as you hold the direction key, so it seems to be a fault of the deceleration formula I'm using. I'll figure it out and upload a new version.

Top
#125130 - Yesterday at 10:48 AM Re: Custom marble movement debugging [Re: JimJam]
_LB


Registered: 06/07/07
Posts: 887
Loc: Richardson, Texas, America.
For the first part of your post, just use Compare to active Objects value = Loopindex

Also, can't you just use compare two general values and use to conditions, one is the max speed, one is greator than 0, opposite for going left, ect...

Sorry I really just think logically rather than doing sometimes.
_________________________
Check the awsome games at http://ragdollsoft.com/
~Multimedia Fusion 2 Standard User~
My Site - LB-Stuff
-LB

Top
#125292 - Today at 02:18 AM Re: Custom marble movement debugging [Re: _LB]
JimJam


Registered: 06/30/06
Posts: 49
Quote:
For the first part of your post, just use Compare to active Objects value = Loopindex

Ooooh, I know what you mean. Thanks.

Quote:
Also, can't you just use compare two general values and use to conditions, one is the max speed, one is greator than 0, opposite for going left, ect...

...Hmmm... I think I see what you are saying here, but I'm a little confused. Could you clarify? If I understand what you are saying, I don't think it would work, because technically my movement system would have to to have an event for all 4 directions and combinations for the directions. Well, it would work (I think) but would require lots of hard coding for direction checking.

Here is my updated file. Check it out and see. If you run into the eastward wind while facing down and holding shift (run key), it reacts just fine, but if you go in without holding shift and facing down, it will flip you around and super accelerate backwards. I'm not sure whats causing it, but its got to do with the acceleration formula.

Oh, I also looked at your site. "The way I think" totally describes me. Even the thing about perpetual magnets and perfect tune music memory!

EDIT: I fixed the problem. The problem was when changing from a higher top speed to a lower one. Now I've set the top speed to change to the higher of the speeds. Still having a bit of trouble with the wind. I've included the updated file, which also has an acceleration grapher.


Attachments
Vector v3.mfa (5 downloads)



Edited by JimJam (Today at 05:01 AM)

Top
#125314 - Today at 07:32 AM Re: Custom marble movement debugging [Re: JimJam]
_LB


Registered: 06/07/07
Posts: 887
Loc: Richardson, Texas, America.
The game's coming out really nice, the wind problem seems fine to me, or is that what you fixed? I got all the way through the level and only encountered one bug, the thing that spurts out balls, I was behind it and got sucked into it and bounced at and angle against the wall and instead of bouncing normally I bounced by plus 180 degrees. Everythings seems pretty nice so far, maybe just some smoothing.

And glad to see somone who thinks like me!
_________________________
Check the awsome games at http://ragdollsoft.com/
~Multimedia Fusion 2 Standard User~
My Site - LB-Stuff
-LB

Top
Page 2 of 2 < 1 2


Site Links
Forum Index

Home Page
Online Store
Tutorials
Download Center
French Forum
Quick File Links
Multimedia Fusion 2
Updates - build 248
Standard Version
Developer Version

Extension Packs
Bonus Pack 1
Bonus Pack 2
z33z Extension Pack
LIJI Extension Pack

The Games Factory 2
Latest Update - build 248
Community Links
Madword Arcade

GameBuilder
Fusion2Developers
The Daily Click

Extensions
Neatwares Extension List
Extension Updater (FusionUpdater)
Zoom Gamer
Click Chat
6 People are chatting