I had some curiosities while messing with sc earlier this week, and came across the real meanings behind accelertation and turn style in flingy.dat.
Turn Style - this is actually the acceleration constant. Units will add this to their speed each frame until they reach their top speed.
Acceleration - used as a check for the top limit until speed is obtained. Calculated by - speed squared divided by 2 times turn style, rounded up. Somewhat unknown still.
Also, it takes the same amount of time to decelerate as to stop.
So, to figure out how long the unit takes to accelerate to top speed, take the speed, and divide it by the frame rate time the turn style.
Anyway, hope this is something that can be used by the rest of you modder...
BK, looks like DatEdit needs an update in flingy.dat....
Nice! Excellent work, DoA!
Well, when you've got a week off school, there is a bit of free time there. And programming can get old some times. And this is something that I've seen people ask about a lot, and finally got sick of not knowing.
Yay! You're the man, mate - great work. I've tried to solve this myself, but having lacked the EXE-related skills, I found out notting. DatEd on its way for update
Okay. Here's the completed flingy.dat information, by old name - what it does. New names are up to you guys. This should make the flingy.dat questions go away.
Acceleration -See BST's explanation over at Warboards on Kinematic equations. Is a distance to start decel at.
Turn Style - controls how fast the unit speeds up or slows down most of the time. Added to or subtraced from current speed. Used independantly of current direction. This is changed for each individual unit for speed upgrades(along with the speed variable, which each unit has their own.)
Turn Radius - controls how many, out of 255, directions the unit changes per frame. Is actually 2 times the number to apply. So, if I am facing directly up(0), and want to move the unit down(to 128), and have a Turn Radius of 32, it would take 8(+) frames to complete the turn. I say 8+ because the unit is accelerating at the same time, and may require more turns to get to the desired direction, or the desired direction may change because it will loop around. Try placing a value of about 8 on the overlord to really see why it takes more than the calculated frames to change.
Unknown - I can't find if this is even used. I've looked and looked, and I don't see it being used. There is 2 more places to look(staredit, but I don't believe it is, and during orders with units as a target). However, I'm almost sure that it isn't used. Probably left over from something.
I'm pretty sure that everything is measured in pixels....
I think I solved a good bit of the acceleration unknown, heres a quote from where I posted it in the DatEdit thread
QUOTE(TERRAINFIGHTER @ Apr 19 2006, 01:23 PM)
(sorry about the earlier post, it was off by a bit so I edited it to post the correct information)
I think the acceleration is based off of minitiles, every 2 minitiles it counts as 1 in the acceleration field
there are 32 going down and 32 minitiles going right in a tile and 256 tiles in a tileset
16 • 16 = 256 (I counted half the minitiles since thats how acceleration reads it), 256 • 256 = 65536 (the maximum value)
[right][snapback]468544[/snapback][/right]
That's good. I'm trying to figure out the way distance is calculated in respect to that unit, so it should make things a bit easier.
I have a guess about how it works, but theres no way I can test it...so you will have to test it for me
Speed = the maximum speed
acceleration = how long it takes to accelerate
Turn Style = how big each acceleration burst is
the game checks how long the acceleration time is,
then divides it by the turn style to find out how often to make the bursts,
then turn style tells it how much to accelerate in each burst
Not really.
Acceleration = distance to decelerate
Turn Style = acceleration
Speed = top speed
Speeding up is done by adding the acceleration to the current speed until the top speed is reached.
Speeding down is done by calculating distance left to travel and comparing to either the distance set or distance solved from this physics equation(can't remember how to format it correctly...) :
Vf^2 = Vi^2 + 2(aceeleration)(distance)
where distance = -Vi^2 / (2 * acceleration)
Distance is in pixels, speed and accel are in pixels per frame
And I'm almost done figureing out how distances are calculated.
If we wanted to be really really specific, we could call it "distance to decelerate from top speed", which I know you already knew, but I'm just putting it all together. If you want to see my big long rant about why "acceleration" is actually the "stopping distance" TERRAINFIGHTER, you can see it here:
http://www.warboards.org/showthread.php?t=16044&page=2.
Anyway, I can't wait to find out how distances are calculated. Generally I think we've (almost entirely DiscipleOfAdun) have worked out everything about flingy.dat now, once you get distances down, everything will be known about that file. I just have to say, good job DiscipleOfAdun, that's really something. Seriously, I never thought anyone would work it out.
I hope you can explain why all the speed values are multiples of 320 / 3. Perhaps Blizzard just wanted to be really exact. I guess you don't need help anymore, you sound like you've got it all settled. So I'll just leave you to work it out.
QUOTE(DiscipleOfAdun @ Apr 19 2006, 11:06 PM)
Not really.
Acceleration = distance to decelerate
Turn Style = acceleration
Speed = top speed
Speeding up is done by adding the acceleration to the current speed until the top speed is reached.
Speeding down is done by calculating distance left to travel and comparing to either the distance set or distance solved from this physics equation(can't remember how to format it correctly...) :
Vf^2 = Vi^2 + 2(aceeleration)(distance)
where distance = -Vi^2 / (2 * acceleration)
Distance is in pixels, speed and accel are in pixels per frame
And I'm almost done figureing out how distances are calculated.
[right][snapback]468960[/snapback][/right]
Sounds about right, except for the last part...
I'm pretty sure the distance and speed/accel are in Minitiles, not pixels
remind me, how many mini tiles are there in a main tile in staredit? If that is right, I need to know how big it is going to be in relationship to the everything else. I know the time rate is frames. I know how the values relate to map size(sometimes), but I don't know the mini-tile relationship yet. We'll get it figured out soon.
--there's 32 per main tile, isn't there. So, I just need to go home and look at a map to figure out if it is right or not. And, later today I'll have the distance formula that they use.
yes there is 32 minitiles per tile (read quote in the earlier post where I explained it)
Hmm, that's wierd. Through the tile editor in a3, a mega tile is made up of 4x4 minitiles, which are made up of 8x8 pixels. So, in conclusion, I'm going to say that the distances in flingy.dat are:
pixels * 256
This is what distances are. Trust me on this one.
Good, finally you came in useful, DoA....
QUOTE(DiscipleOfAdun @ Apr 21 2006, 08:42 AM)
Hmm, that's wierd. Through the tile editor in a3, a mega tile is made up of 4x4 minitiles, which are made up of 8x8 pixels. So, in conclusion, I'm going to say that the distances in flingy.dat are:
pixels * 256
This is what distances are. Trust me on this one.
[right][snapback]469666[/snapback][/right]
Don't trust Arsenal III's tile editor, it was very poorly made
even if Arsenal III says the tiles are in 8x8 pixels, that doesn't mean its true,
actual tiles are 32x32, but the thing reads it as half so youd have to base measurements by 16x16
So, I guess that the real question I should be asking:
When a square tile of 1x1 is placed in a map editor(not isometric), how many pixels wide is it?
...same answer as I've been posting...32
and as I've mentioned many times before, the value reads it as half so you'd have to use 16x16 instead of 32x32
Okay, just double checking. I don't do much with maps or stuff like that, so I can get confused really fast while doing them. Thanks for that. We understand how it is measured now, right?
Anyways, I was browsing the tutorials and was looking at the one on flingy speed. In that, it is suggested that each Iscript unit is 320 flingy units. Since I can't test this for about 4 hours, could someone else do it and find out for me?