Skip to main content
Topic: New branch on Github for developers (Read 14801 times) previous topic - next topic

New branch on Github for developers

Following requests from people ****isting with development for Simutrans-Experimental (to whom I am always most grateful), I have created a new Github branch for the Simutrans-Experimental called "devel" (there is also one called "devel-2" - currently, they should be the same; the reason for the redundancy is that I had some trouble initially creating "devel". "Devel" is a local branch and "devel-2" is a tracking branch). See here for my Github page.

Only the master branch will be automatically compiled into the nightly Linux builds; the "devel" branch will be pushed more frequently than the master branch to enable others to collaborate more easily on the development of Simutrans-Experimental.

At present, I have been having trouble merging the latest changes from Simutrans-Standard - there seems to be some clash/problem in header files that is giving thousands of repeated compile errors. I have been working on Pak128.Britain of late, but should be very grateful if anyone could ****ist in trying to find the trouble. Until I have tracked that down, I will not merge in Bernd Gabriel's or Knightly's latest updates, nor the more recent additions to Simutrans-Standard, so as not to make the problem any harder to track down. I do intend to merge those additions in, though, before releasing 7.1.

Do let me know whether the new branch is working for everyone.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: New branch on Github for developers

Reply #1
It seems that the branch that I uploaded was the same as the master branch, which is somewhat unhelpful - I have not yet mastered the intricacies of Git branches using Git GUI for Windows, it seems - any help would be appreciated.

In any event, I have fixed all of the compiler errors with the merged code from the trunk (there was a missing close brace in haus_besch_t.h), but am now having numerous linker errors with the new network module. I have pushed the revised code to the master branch for the time being (it won't link, so it won't cause problems for the Linux automated builds). I should be extremely grateful if anyone who could give an indication of what to do about the linker errors would do so.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: New branch on Github for developers

Reply #2
It seems that the branch that I uploaded was the same as the master branch, which is somewhat unhelpful - I have not yet mastered the intricacies of Git branches using Git GUI for Windows, it seems - any help would be appreciated.

Judging from the network graph at Github, I think you have done the right thing when creating the development branch. When you work with the code, make sure that you have checked out the devel branch (instead of the master branch), and push changes from the devel branch to the master repository at Github once done. When you are ready to make a new release, check out the master branch, merge commits from the devel branch, and finally push the master branch up to Github.


"Devel" is a local branch and "devel-2" is a tracking branch).

BTW, I think both devel and devel-2 are created as local branches in your local repository. You will probably see both of them under the local branch category in the branch checkout page. Tracking branches mean branches from the remotes which you have set up -- i.e. remotes branches that you are keeping track of. When you create a local branch, you can choose either a local branch's or a tracking branch's head revision as the starting revision, but that does not mean that the branch is not local. And once the new local branch is pushed up to Github, there will be a new remote tracking branch from where both you and others will be able to download and merge code changes (it will be shown as a tracking branch in the local merge page).


One final thing. I am not sure if it works, but if you want to remove the duplicated devel-2 branch at Github, maybe you can try to execute Remote==>Delete Branch.

Re: New branch on Github for developers

Reply #3
Knightly,

thank you very much. It's checking out that I'm having problems with - in Git GUI, whenever I check out, I just seem to end up reverting to 7.0 rather than setting the branch to the latest changes. I'm not sure that I fully understand how checking out works; what does one do to check out a branch such that my changes are committed to one branch and not another?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: New branch on Github for developers

Reply #4
James,

You have to first check out the branch you want to work with, then make the desired changes and commit them, and those changes will belong to that branch. Put it simply, current committed changes apply to the current branch only.

If you check out your devel branch (not devel-2 branch) now, it should not be at v7.0. You may take a look here : http://github.com/jamespetts/simutrans-experimental/network

Are you currently working with the master branch or devel branch locally? The current branch is shown just underneath the toolbar of the GIT GUI.

Knightly

Re: New branch on Github for developers

Reply #5
Ahh, I see! That makes sense now. I'm currently working with the master, which would explain the issues. But, supposing that I've made some changes to the devel branch - how would I then apply those to the master branch?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: New branch on Github for developers

Reply #6
Simple :) : Just check out the master branch, then locally merge changes from the local devel branch. After that changes from the devel branch will be reflected in the master branch as well.

Re: New branch on Github for developers

Reply #7
Thank you for your help! I'll have to try that at an appropriate moment.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: New branch on Github for developers

Reply #8
I have now, following Knightly's advice, uploaded a preliminary version of 7.1 to Github, the -devel branch. The code now compiles and links, but the load/save routine does not work for reasons that are not entirely obvious (but may be connected somehow to the transition to bzlib).

I should be very grateful for any ****istance in tracking down this issue so that I can release a working version of 7.1 this week end, which should be compatible with the latest Simutrans-Standard saved games, will incorporate the preliminary networking code, all of the latest fixes of the nighties, and Bernd Gabriel's latest physics code, which I should be very interested for people to test.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: New branch on Github for developers

Reply #9
I have now, following Knightly's advice, uploaded a preliminary version of 7.1 to Github, the -devel branch. The code now compiles and links, but the load/save routine does not work for reasons that are not entirely obvious (but may be connected somehow to the transition to bzlib).
I will have a look at it this evening. I added the bzlib support to my Visual C++ standard-simutrans copy some weeks ago. I didn't notice any problems there (BTW did I save a game since then? Yes! And I'm able to load it again.)

I should be very grateful for any ****istance in tracking down this issue so that I can release a working version of 7.1 this week end, which should be compatible with the latest Simutrans-Standard saved games, will incorporate the preliminary networking code, all of the latest fixes of the nighties, and Bernd Gabriel's latest physics code, which I should be very interested for people to test.
Please notice, that there is the 'Overhauled Physics Model 2.0' merged into my 'master' branch. It is more 'economy balance friendly' and there is only 1 cl**** left for all physics calculation, both for driving existing convoys and for creating speed and acceleration vs. weight forecasts in convoy_info_t resp. for 'potential' convoys in gui_convoy_****embler_t.
The journey is the reward!

Re: New branch on Github for developers

Reply #10
The code now compiles and links, but the load/save routine does not work for reasons that are not entirely obvious (but may be connected somehow to the transition to bzlib).

I have merged the changes from your devel branch, but compilation fails :
Code: [Select]
1>------ Build started: Project: Simutrans-Experimental, Configuration: Debug Win32 ------
1>Compiling...
1>cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release
1>convoi_info_t.cc
1>.\gui\convoi_info_t.cc(20) : fatal error C1083: Cannot open include file: '../convoy.h': No such file or directory
1>convoy.cc
1>c1xx : fatal error C1083: Cannot open source file: '.\convoy.cc': No such file or directory
1>gui_convoy_****embler.cc
1>.\gui\components\gui_convoy_****embler.cc(19) : fatal error C1083: Cannot open include file: '../../convoy.h': No such file or directory
1>gui_convoy_label.cc
1>.\gui\components\gui_convoy_label.cc(15) : fatal error C1083: Cannot open include file: '../../convoy.h': No such file or directory
1>roadsign.cc
1>.\dings\roadsign.cc(27) : fatal error C1083: Cannot open include file: '../gui/trafficlight_info.h': No such file or directory
1>simconvoi.cc
1>.\simconvoi.cc(51) : fatal error C1083: Cannot open include file: 'convoy.h': No such file or directory
1>trafficlight_info.cc
1>c1xx : fatal error C1083: Cannot open source file: '.\gui\trafficlight_info.cc': No such file or directory
1>Generating Code...
1>Build log was saved at "file://e:\Programs\Simutrans_Exp_Dbg\simutrans-experimental-binaries\intermediates\debug\BuildLog.htm"
1>Simutrans-Experimental - 7 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Bernd's convoy.cc and convoy.h are both missing, as well as /gui/trafficlight_info.cc too. I checked the file listing of your repository at Github, and these files cannot be found.

BTW, your last commit says you have merged changes from both Bernd's and my branch, but it's rather strange that there are no linking arrows which indicate branch merging in the network graph at Github.

Re: New branch on Github for developers

Reply #11
@jamespetts
- If your problem is the missing bzlib.h, please follow the instruction in simutrans-experimental/readme.txt
You will download http://www.bzip.org/1.0.5/bzip2-1.0.5.tar.gz and copy bzlib.h to the location, where you stored zlib.h. The same applies to the library location.

- Ah, you already merged in the OPM 2.0 (Overhauled Physics Model Version 2.0) with potential_convoy_t and existing_convoy_t version, but unfortunatelly you didn't commit their sources convoy.h/convoy.cc. You probably missed them, when you merge branch 'master' of git://github.com/BerndGabriel/simutrans-experimental.git on Nov 21. I will prepare a convoi_info_t with an ifdef/endif around the acceleration graph code. So you can merge easily the newest 'master' without drawbacks.

@Knightly
BTW, your last commit says you have merged changes from both Bernd's and my branch, but it's rather strange that there are no linking arrows which indicate branch merging in the network graph at Github.

That's why I suggested to add the code, which appeared to be already there...
The journey is the reward!


Re: New branch on Github for developers

Reply #13
Please notice, that there is the 'Overhauled Physics Model 2.0' merged into my 'master' branch. It is more 'economy balance friendly' and there is only 1 cl**** left for all physics calculation, both for driving existing convoys and for creating speed and acceleration vs. weight forecasts in convoy_info_t resp. for 'potential' convoys in gui_convoy_****embler_t.

'add the code' refers to this section. I couldn't find the merge entry in the network graph.
The journey is the reward!

Re: New branch on Github for developers

Reply #14
I see. Thanks for your explanation :)  It's really magical that James can merge our changes without making a merge entry in the network graph.

Re: New branch on Github for developers

Reply #15
something very strange must have happened to his brush-wood ;)



@jamespetts

I committed convoi_info_t.h/.cc with undefined ACCELERATION_BUTTON, which excludes the acceleration graph code.



James,

loading a savegame runs out of sync in simplay.cc loading finance_history_year.

      for(int year = 0;  year<MAX_PLAYER_HISTORY_YEARS;  year++  )
      {
         for(  int cost_type = 0;   cost_type<MAX_PLAYER_COST;   cost_type++  )
         {
--> skipping these values does not load them, although they are in the savegame:
            if(  cost_type<COST_NETWEALTH  ||  cost_type>COST_MARGIN  )
            {
               if(file->get_experimental_version() <= 1 && (cost_type == COST_INTEREST || cost_type == COST_CREDIT_LIMIT))
               {
                  finance_history_year[year][cost_type] = 0;
               }
               else
               {
                  file->rdwr_longlong(finance_history_year[year][cost_type], " ");
               }
            }
         }
      }

Have a look at http://www.fast-function-factory.de/simutrans/simplay-out-of-sync.jpg.
On the left hand simutrans standard after reading the finance_history_year correct.
On the right hand you see, how simutrans experimetal loads the same values into different locations in the array.

Mod note: please, avoid from posting three post in a row within 24 hs. - Igor
The journey is the reward!

Re: New branch on Github for developers

Reply #16
Bernd and Knightly - thank you both for your feedback. Apologies for missing the requisite files: I have now pushed all three of them to -devel. I do not have time to look at the issue with loading the finance history this evening, but will endeavour to fix that when I get a chance, and will see whether that fixes the crashes that I am getting on loading.

Thank you again for your ****istance!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.


Re: New branch on Github for developers

Reply #18
Knightly,

oops - sorry. I have just added the further missing files now. Thank you for pointing that out!

Bernd,

thank you for pointing out the problem with the finance history. The issue was that the save game version was incorrectly set to:

Code: [Select]
else if(  file->get_version()<102002  ) 

instead of

Code: [Select]
else if(  file->get_version()<102003  ) 

as is set in Simutrans-Standard. I have now corrected that, but, unfortunately, that still does not solve the problem of the loading routine for lines going wrong.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: New branch on Github for developers

Reply #19
James,

I've continued my investigations:
In Simutrans 102.3 Exp 7.1 my savegame's file.version is 999,999,999 instead of 102,001, what it is in Simutrans 102.2 Exp 7.0.

loadsave_t::combined_version loadsave_t::int_version(const char *version_text, int *mode, char *pak_extension_str) sets it, if it cannot recognize the correct version number/s.

I found the incompatibility in int_version(): Reading digits does not include reading dots. See attachment.
The journey is the reward!

Re: New branch on Github for developers

Reply #20
Bernd,

thank you for spotting that - I have fixed it now. Bizarrely, however, that does not fix the problem with loading things from line management. I have narrowed down the problem, which is proving most intractable. The error occurs in this part of linemanagement.cc:

Code: [Select]
sint32 totalLines = 0;
file->rdwr_long(totalLines, " ");
DBG_MESSAGE("simlinemgmt_t::rdwr()","number of lines=%i",totalLines);
for (int i = 0; i<totalLines; i++) {
simline_t::linetype lt=simline_t::line;
file->rdwr_enum(lt, "\n");
simline_t * line;
switch(lt) {
case simline_t::truckline:    line = new truckline_t(   welt, sp); break;
case simline_t::trainline:    line = new trainline_t(   welt, sp); break;
case simline_t::shipline:     line = new shipline_t(    welt, sp); break;
case simline_t::airline:      line = new airline_t(     welt, sp); break;
case simline_t::monorailline: line = new monorailline_t(welt, sp); break;
case simline_t::tramline:     line = new tramline_t(    welt, sp); break;
case simline_t::maglevline:   line = new maglevline_t(  welt, sp); break;
case simline_t::narrowgaugeline:line = new narrowgaugeline_t(welt, sp); break;
default:
// line = new simline_t(     welt, sp); break;
dbg->fatal( "simlinemgmt_t::create_line()", "Cannot create default line!" );
}
line->rdwr(file);
add_line( line->get_handle() );

The problem occurs here and only here: games so old that they do not have any "linemanagement" parts to their saves (from 2007 and earlier) load without problem, so there is no generalised corruption on loading.

The second value loaded in the line file->rdwr_enum(lt, "\n"); (in other words, the second time that that method is called, whenever i is 1) is always loaded as 0 (translated to the appropriate enum, "line") rather than the correct value, which then triggers the "invalid line" error message provided for further down in the code. The problem does not appear to be a general problem with the rdwr_enum method, since that method is used in many other places in the load/save code that all appear to work correctly when loading a very old saved game.

The problem is not a problem with saving, since I tested using a saved game from the latest nightly of Simutrans-Standard, which I had created with two lines specifically for the purpose. In Simutrans-Standard, the second value is read correctly as 2 (rail), but in Simutrans-Experimental, it is read incorrectly as 0 (invalid).

The code section reproduced above is identical both to its equivalent in the latest version of Simutrans-Standard, and the known good version in Simutrans-Experimental 7.0, so no change to that code can account for the problem.

Any help on solving this Alice in Wonderland riddle would be very much appreciated.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: New branch on Github for developers

Reply #21
James,

any new findings about that?

I'll start looking at it right now...

Bernd
The journey is the reward!

Re: New branch on Github for developers

Reply #22
No new findings since my last post, or thoughts. It is really a most bizarre problem. I can't work it out.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: New branch on Github for developers

Reply #23
Could you please send me your savegame?
My savegame from yesterday works now.
My next test candidate p****es the line management, but produces an error while reading convoys...

Erm, it does not p****, but skip it, as it is not a version between 82003 and 88003...
The journey is the reward!

Re: New branch on Github for developers

Reply #24
I have e-mailed you the save game that I used to test it - thank you very much for your work on this.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: New branch on Github for developers

Reply #25
sint16 loadsave_t::rd_obj_id()
{
   sint16 id;
   if(!saving) {
      if(!is_xml()) {
         sint8 idc;
         read(&idc, sizeof(sint8));
--> this typecast should be (sint16), but it is too old to do any harm.
         id = (sint8)idc;
      }
      else {
         sint64 ll;
         rdwr_xml_number( ll, "id" );
         return (sint16)ll;
      }
   }
   return id;
}




James,

please have a look at convoi_t::rdwr():
there is a new section, which - at first glance - looks different to the following 'else' section, which is processed for version=102001 in STE 102.2.7

   else if(  file->get_version()<103000  ){
      // load statistics
      for (int j = 0; j<5; j++) {
         for (int k = MAX_MONTHS-1; k>=0; k--) {
            file->rdwr_longlong(financial_history[k][j], " ");
         }
      }
      for (int k = MAX_MONTHS-1; k>=0; k--) {
         financial_history[k][CONVOI_DISTANCE] = 0;
      }
   }


Mod note: please, avoid double-post. - Igor
The journey is the reward!

 

Re: New branch on Github for developers

Reply #26
Bernd,

thank you very much indeed for your eagle-eyed bug spotting. I have now fixed both of the issues that you identified (and the double reading of the odometer that you pointed out in your e-mail), and have committed those changes. Now, however, I have a different problem on loading, in the convoy section. Very odd. Thank you again for your work!

Update: Bernd and I (mainly Bernd) have managed to track down some of the problems in the code causing this behaviour (it turns out that it was earlier values being read incorrectly), and the partly fixed code has been pushed to -devel on Github. Simutrans-Standard games are now loading properly, but Simutrans-Experimental saved games are currently not loading correctly. Also, the waiting times system is not working correctly, such that convoys move as soon as they reach their destination, rather than waiting the pre-designated time before doing so.

As ever, any help would be very much appreciated.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.