The International Simutrans Forum

 

Author Topic: About "diagonal_multiplier"  (Read 4395 times)

0 Members and 1 Guest are viewing this topic.

Offline 1318

  • *
  • Posts: 31
About "diagonal_multiplier"
« 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?

Offline paco_m

  • *
  • Posts: 170
Re: About "diagonal_multiplier"
« Reply #1 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 )

Offline 1318

  • *
  • Posts: 31
Re: About "diagonal_multiplier"
« Reply #2 on: February 21, 2011, 09:56:33 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.

Offline paco_m

  • *
  • Posts: 170
Re: About "diagonal_multiplier"
« Reply #3 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

Offline 1318

  • *
  • Posts: 31
Re: About "diagonal_multiplier"
« Reply #4 on: February 21, 2011, 01:30:33 PM »
The problem doesn't occur at first until saving the game :-[

Offline paco_m

  • *
  • Posts: 170
Re: About "diagonal_multiplier"
« Reply #5 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?

Offline 1318

  • *
  • Posts: 31
Re: About "diagonal_multiplier"
« Reply #6 on: February 21, 2011, 02:37:27 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

Offline paco_m

  • *
  • Posts: 170
Re: About "diagonal_multiplier"
« Reply #7 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?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5691
  • Languages: EN, NO
Re: About "diagonal_multiplier"
« Reply #8 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.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20762
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: About "diagonal_multiplier"
« Reply #9 on: February 21, 2011, 09:32:26 PM »
The relevant code is here in einstellungen.cc:

Code: [Select]
// 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:

Code: [Select]
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);
}

Offline 1318

  • *
  • Posts: 31
Re: About "diagonal_multiplier"
« Reply #10 on: February 22, 2011, 05:22:10 AM »
I am using GDI.
Here are screenshots from the game:

Screenshot after saving the game:

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20762
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: About "diagonal_multiplier"
« Reply #11 on: February 22, 2011, 11:30:28 AM »
The "after" seems more correct to me.

Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: About "diagonal_multiplier"
« Reply #12 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)

Offline 1318

  • *
  • Posts: 31
Re: About "diagonal_multiplier"
« Reply #13 on: February 22, 2011, 03:30:27 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.

Offline paco_m

  • *
  • Posts: 170
Re: About "diagonal_multiplier"
« Reply #14 on: February 22, 2011, 03:45:05 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?

Offline 1318

  • *
  • Posts: 31
Re: About "diagonal_multiplier"
« Reply #15 on: February 22, 2011, 03:59:47 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.