The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: 1318 on February 21, 2011, 08:54:11 AM

Title: About "diagonal_multiplier"
Post by: 1318 on February 21, 2011, 08:54:11 AM
First of all, I found that carriages on diagonal tracks were too close. The problem was caused by old positioning.
I changed the value of diagonal_multiplier to 1024 and it worked in 102.2.2.
The same problem also occur in 110.
However, diagonal_multiplier seems to be useless.
The carriages became too close again when I had saved game although diagonal_multiplier had been changed to 1024.
Is it possible to fix the problem?
Title: Re: About "diagonal_multiplier"
Post by: paco_m on February 21, 2011, 09:50:14 AM
Are you sure that you changed the simuconf.tab file in your pakset directory (e.g. simutrans/pak/config/simuconf.tab )? This one overrides the settings of the global simuconf.tab ( simutrans/config/simuconf.tab )
Title: Re: About "diagonal_multiplier"
Post by: 1318 on February 21, 2011, 09:56:33 AM
Quote from: paco_m on February 21, 2011, 09:50:14 AM
Are you sure that you changed the simuconf.tab file in your pakset directory (e.g. simutrans/pak/config/simuconf.tab )? This one overrides the settings of the global simuconf.tab ( simutrans/config/simuconf.tab )
Both of them had been changed and carriages were "far away" from each other.
But it worked until game was saved.
Title: Re: About "diagonal_multiplier"
Post by: paco_m on February 21, 2011, 12:23:01 PM
I am using a pak with 1024 multiplier and can't see any problem in ST 110
Title: Re: About "diagonal_multiplier"
Post by: 1318 on February 21, 2011, 01:30:33 PM
The problem doesn't occur at first until saving the game :-[
Title: Re: About "diagonal_multiplier"
Post by: paco_m on February 21, 2011, 01:43:02 PM
I can't reproduce it
starting new map - all diagonal views ok
saving the game - they are still fine
loading the saved game - still nothing different

could you describe more exactly what happened when and what pak/vehicles are affected?
Title: Re: About "diagonal_multiplier"
Post by: 1318 on February 21, 2011, 02:37:27 PM
Quote from: paco_m on February 21, 2011, 01:43:02 PM
I can't reproduce it
starting new map - all diagonal views ok
saving the game - they are still fine
loading the saved game - still nothing different

could you describe more exactly what happened when and what pak/vehicles are affected?
1. Installing Simtrans(By online installer and download xxx.zip)
2. starting new map - all diagonal views ok
3. saving the game - problem occurs
Before the step 3, the carriages are 'far away' form each other(i.e. there is space between carriages)
After te step 3, the carriages 'insert' into each other

BTW, I am using pak128.(I have tried the pak with and without addons)

Also, I have tested pak64 without addons, and same problem still appear
Title: Re: About "diagonal_multiplier"
Post by: paco_m on February 21, 2011, 04:09:20 PM
I tried it with Simutrans stable 0.110.0 and openpak128 r1500 and still can't see anything wrong, also the vehicle look fine with the default diagonal multiplier 724. Are you using GDI or SDL version?
Title: Re: About "diagonal_multiplier"
Post by: Ters on February 21, 2011, 09:11:14 PM
I have seen some tenders overlapping their locomotives when the train is running diagonally in Pak64, and BR 234 is wrong in all views, but I have never experienced that everything is wrongly spaced. My diagonal_multiplier is set to 724, which is the default.
Title: Re: About "diagonal_multiplier"
Post by: jamespetts on February 21, 2011, 09:32:26 PM
The relevant code is here in einstellungen.cc:


// since vehicle will need realignment afterwards!
if(file->get_version()<=99018) {
vehikel_basis_t::set_diagonal_multiplier( pak_diagonal_multiplier, 1024 );
}
else {
uint16 old_multiplier = pak_diagonal_multiplier;
file->rdwr_short(old_multiplier );
vehikel_basis_t::set_diagonal_multiplier( pak_diagonal_multiplier, old_multiplier );
// since vehicle will need realignment afterwards!
}


And also here in simvehikel.cc:


uint8 vehikel_basis_t::old_diagonal_length = 127;
uint8 vehikel_basis_t::diagonal_length = 180;
uint16 vehikel_basis_t::diagonal_multiplier = 724;

// set only once, before loading!
void vehikel_basis_t::set_diagonal_multiplier( uint32 multiplier, uint32 old_diagonal_multiplier )
{
diagonal_multiplier = (uint16)multiplier;
diagonal_length = (uint8)(130560u/diagonal_multiplier);
old_diagonal_length = (uint8)(130560u/old_diagonal_multiplier);
}
Title: Re: About "diagonal_multiplier"
Post by: 1318 on February 22, 2011, 05:22:10 AM
I am using GDI.
Here are screenshots from the game:
(http://i598.photobucket.com/albums/tt70/1318den/simscr00-2.png?t=1298352315)
Screenshot after saving the game:
(http://i598.photobucket.com/albums/tt70/1318den/simscr01-2.png?t=1298352315)
Title: Re: About "diagonal_multiplier"
Post by: jamespetts on February 22, 2011, 11:30:28 AM
The "after" seems more correct to me.
Title: Re: About "diagonal_multiplier"
Post by: DirrrtyDirk on February 22, 2011, 02:26:13 PM
Yes, but with the 1024 setting it should be (and stay) as shown in the first picture (even though 724 and the second picture is the desired behaviour for pak128)
Title: Re: About "diagonal_multiplier"
Post by: 1318 on February 22, 2011, 03:30:27 PM
Quote from: DirrrtyDirk on February 22, 2011, 02:26:13 PM
Yes, but with the 1024 setting it should be (and stay) as shown in the first picture (even though 724 and the second picture is the desired behaviour for pak128)
However, it doesn't.
BTW, I found that 1024 setting works in pak128.Britain without addons.
Title: Re: About "diagonal_multiplier"
Post by: paco_m on February 22, 2011, 03:45:05 PM
Quote from: 1318 on February 22, 2011, 03:30:27 PM
However, it doesn't.
BTW, I found that 1024 setting works in pak128.Britain without addons.

In your picture the vehicle is going to the left in the upper image and to the right below - could it be a graphic error of this vehicle that only occurs in one direction?
Title: Re: About "diagonal_multiplier"
Post by: 1318 on February 22, 2011, 03:59:47 PM
Quote from: paco_m on February 22, 2011, 03:45:05 PM
In your picture the vehicle is going to the left in the upper image and to the right below - could it be a graphic error of this vehicle that only occurs in one direction?
Well, the vehicles have no problem in both directions, until saving.