[?] Reading out top speed
- Senshi
- PR:BF2 Developer
- Posts: 358
- Joined: 2010-04-29 10:44
[?] Reading out top speed
Considering that the engine modeling in BF2 is not really simple, is there a good formula how one can read the theoretical top speed of a land vehicle purely out of code or ingame via debug or similar? Jets are able to read the actual speed, so is there an easy workaround to get this to work for other vehicles as well? But I'd mostly prefer a way to calculate it out of the .tweak themselves or the editor values. I'm not entirely sure how the many values interact with each other. And of course "real" topspeed is difficult, as it depends on ground terrain, slope etc. , but an "approximate" +/-5km/h would be sufficient
.
- Senshi
- PR:BF2 Developer
- Posts: 358
- Joined: 2010-04-29 10:44
Re: [?]Reading out top speed
Alternatively, how would I go on about slapping the jet HUD on a vehicle? I think I found the correct Hud GUID (630) that has the speedometer included, but when I try adding it to a land vehicle as Vehicle HUD GUID nothing at all shows up in the editor w/ render HUD on. On planes it works, so I'm not sure why not on land vehicles? Tested it on the mec_apc_btr60.
-
J.F.Leusch69
- Retired PR Developer
- Posts: 2988
- Joined: 2008-04-23 16:37
Re: [?]Reading out top speed
you need to add the GUI number to the vehicles man weapon.
- Senshi
- PR:BF2 Developer
- Posts: 358
- Joined: 2010-04-29 10:44
Re: [?]Reading out top speed
Ah, my bad. I thought VehicleHUD and WeaponHUD could be interchanged, considering they use the same GUID table...
Thank you for the help, works fine this way and pretty easily allows to get the speeds, even accounting for various terrains (or water if amphib).
But: On flat surface (grass or asphalt doesn't really matter) the BTR-60 reaches a shown speed of 220/230. That seems a bit...fast...On a steep incline uphill it still shows 100. And in water a straight 50. What units is this in? I strongly doubt it's km/h...? Is it battlefield units? If so, what is "one BF Unit" in meters?
Wiki states a BTR should reach 100km/h on road and 10 in water. So am I safe in just halving the numbers to get a proper result?
EDIT: Added the HUD to all vehicles now, and I think the "Divide by two" approach isn't the worst one, though Divide by 2,5 would be more correct. T-90 reaches 160/170 on flat terrain, T-62 reaches 120. They should have about 60 (T-90) and 50 (T-62) in km/h.
Thank you for the help, works fine this way and pretty easily allows to get the speeds, even accounting for various terrains (or water if amphib).
But: On flat surface (grass or asphalt doesn't really matter) the BTR-60 reaches a shown speed of 220/230. That seems a bit...fast...On a steep incline uphill it still shows 100. And in water a straight 50. What units is this in? I strongly doubt it's km/h...? Is it battlefield units? If so, what is "one BF Unit" in meters?
Wiki states a BTR should reach 100km/h on road and 10 in water. So am I safe in just halving the numbers to get a proper result?
EDIT: Added the HUD to all vehicles now, and I think the "Divide by two" approach isn't the worst one, though Divide by 2,5 would be more correct. T-90 reaches 160/170 on flat terrain, T-62 reaches 120. They should have about 60 (T-90) and 50 (T-62) in km/h.
Last edited by Senshi on 2011-08-22 16:58, edited 1 time in total.
-
AcornBeing
- Posts: 105
- Joined: 2009-08-18 23:00
Re: [?]Reading out top speed
Yes, it is in the Battlefield units. As far as I know there is no straighforward conversion to any measurment system. However, if you try to consistently bring down the numbers (maybe halve it) it would be more reasonable. It is like when you taxi the jets to the runway, the speed is 50, which is a bit too fast IMO if in km/h, and more so if in mph. And like you said, the BTR cannot run 220 either. I think it would be really a great addition to PR if it would be possible to modify the speeds (or its' representation in BF units) for specific vehicles, rather than bringing the whole speed scale/array for all vehicles down ... which then is going to be less realistic for jets (500-1000 km/h??).Senshi wrote:What units is this in? I strongly doubt it's km/h...? Is it battlefield units? If so, what is "one BF Unit" in meters?
Anyway, it's just my 2 cents. Good luck!
-
Mosquill
- Retired PR Developer
- Posts: 857
- Joined: 2007-08-12 10:13
Re: [?]Reading out top speed
1 BF speed unit is precisely 0.375 km/h.Senshi wrote:What units is this in? I strongly doubt it's km/h...? Is it battlefield units? If so, what is "one BF Unit" in meters?
- Senshi
- PR:BF2 Developer
- Posts: 358
- Joined: 2010-04-29 10:44
Re: [?]Reading out top speed
0.375 is a good scale, I wasn't too far off with my "Divide by 2.5" then
.
Thank you again Leusch and Mosquill, this allows me to get some good data on the vehicles with relatively minor hassle.
EDIT: Another weird thing I noticed. Whereas road and water speed are - as expected - always the same, the offroad speed varies greatly from test to test. Test setup is: A terrain ramp of 25? (grass material), vehicle starts from zero at the bottom and climbs up. Speed is recorded after half the ramp is passed (speed usually is level by then). The thing is, after I load the vehicle and hop in, the first run gives insane speeds. This is most apparent for tracked vehicles. E.g. the MTLB didn't lose ANY speed when climbinb (160 road, 150/160 hill), the BMP dropped from 180 (road) to 150(hill).
After some more driving around, stopping, reversing etc another test run shows dramatically changed results: The BMP only reaches 20-30 uphill, the MTLB dropped to 100.
Weird. What causes this?
EDIT2: Further testing of the hillclimb-speeds shows this:
First run: Speed uphill is almost unchanged from level speed, the vehicle loses 10/20 speed max. MTLB Road 160 - Hill 160.
Second run: MTLB Uphill 120
Third run: MTLB Uphill 100
Fourth run: MTLB Uphill 90
Fifth run: MTLB Uphill 70
Sixth run (waited 3min with idling engine in editor): MTLB Uphill 50/60
Stable after that.
This is pretty weird. Along with losing speed, the vehicle gets far more "slippery" and the grip worsens. On the sixth run the vehicle no longer goes straight up but starts to slip sideways, forcing me to make corrections by steering. This would point to the ground material behaviour but I absolutely don't understand why the friction should change during playtesting in the editor...
Thank you again Leusch and Mosquill, this allows me to get some good data on the vehicles with relatively minor hassle.
EDIT: Another weird thing I noticed. Whereas road and water speed are - as expected - always the same, the offroad speed varies greatly from test to test. Test setup is: A terrain ramp of 25? (grass material), vehicle starts from zero at the bottom and climbs up. Speed is recorded after half the ramp is passed (speed usually is level by then). The thing is, after I load the vehicle and hop in, the first run gives insane speeds. This is most apparent for tracked vehicles. E.g. the MTLB didn't lose ANY speed when climbinb (160 road, 150/160 hill), the BMP dropped from 180 (road) to 150(hill).
After some more driving around, stopping, reversing etc another test run shows dramatically changed results: The BMP only reaches 20-30 uphill, the MTLB dropped to 100.
Weird. What causes this?
EDIT2: Further testing of the hillclimb-speeds shows this:
First run: Speed uphill is almost unchanged from level speed, the vehicle loses 10/20 speed max. MTLB Road 160 - Hill 160.
Second run: MTLB Uphill 120
Third run: MTLB Uphill 100
Fourth run: MTLB Uphill 90
Fifth run: MTLB Uphill 70
Sixth run (waited 3min with idling engine in editor): MTLB Uphill 50/60
Stable after that.
This is pretty weird. Along with losing speed, the vehicle gets far more "slippery" and the grip worsens. On the sixth run the vehicle no longer goes straight up but starts to slip sideways, forcing me to make corrections by steering. This would point to the ground material behaviour but I absolutely don't understand why the friction should change during playtesting in the editor...
Last edited by Senshi on 2011-08-23 11:17, edited 2 times in total.
- Senshi
- PR:BF2 Developer
- Posts: 358
- Joined: 2010-04-29 10:44
Re: [?]Reading out top speed
*dustoff* A bit different, but still pretty related question:
Is the ObjectTemplate.maxSpeed 30 parameter of projectils and similar in BFmeter/s or in m/s?
I'm confused as it seems that distances themselves are measured in metric format (flag radius and similar). So I'm kind of uncertain about the internal unit used for speed.
Is the ObjectTemplate.maxSpeed 30 parameter of projectils and similar in BFmeter/s or in m/s?
I'm confused as it seems that distances themselves are measured in metric format (flag radius and similar). So I'm kind of uncertain about the internal unit used for speed.
- Senshi
- PR:BF2 Developer
- Posts: 358
- Joined: 2010-04-29 10:44
Re: [?]Reading out top speed
Nobody?
-
Mosquill
- Retired PR Developer
- Posts: 857
- Joined: 2007-08-12 10:13
Re: [?]Reading out top speed
Everything is in meters and m/s. The BF speed unit thing applies only to hud velocity indicators and nothing else.
- Senshi
- PR:BF2 Developer
- Posts: 358
- Joined: 2010-04-29 10:44
Re: [?]Reading out top speed
Thank you. I was just confused a bit because I read out some - seemingly - pretty extreme data for some weapons: Bayonets would have a range of 2,6m according to the game files (speed 40, timetolive=0,065 -> v = s / t -> 2,6). Knifes have 1,5m. That seems pretty much on first sight but I guess it's engine-related to make them effective at all.
