The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Topic started by: jamespetts on June 20, 2011, 12:25:01 AM

Title: Preparing for release of 9.9
Post by: jamespetts on June 20, 2011, 12:25:01 AM
I have been working all week-end on the preparing the next release of Experimental, version 9.9, which is now nearly finished on the devel branch of my Github repository (https://github.com/jamespetts/simutrans-experimental/tree/devel). There are still one or two bug fixes to finish, but it is largely complete other than that. It merges all the latest changes from Standard, including the industry boost, the liveries (http://forum.simutrans.com/index.php?topic=7129.0) feature and Inkelyad's recent enhancement to the spacing feature (http://forum.simutrans.com/index.php?topic=7194.msg71393#msg71393).

There are quite a few changes in this one, so I should be grateful if some people could assist in some pre-release testing. One thing with which I have been having trouble is making this with GCC/MinGW. In order to make sure that I have a good stable Linux build, I should very much appreciate any testing that anyone might be able to do with this. Note that, although this is still numbered as 9.x in Experimental version numbering, the Standard version number is increased (to 110.6), and some Experimental features (liveries and Inkelyad's spacing shift) are saved under the 110.6 number, so that games saved with 9.9 cannot be opened with 9.8.

If anyone would like to test the liveries feature, the sources for a liveries enabled version of Pak128.Britain-Ex (with only one or two vehicles with different liveries at present - look for the BR Class 47, which has 3 different liveries for testing) are available on the liveries branch of the Pak128.Britain-Ex Github repository (https://github.com/jamespetts/simutrans-pak128.britain/tree/liveries).

Thank you in advance for any feedback - it is always appreciated.

Edit: One bug that I notice is that passengers do not seem to walk anywhere.
Title: Re: Preparing for release of 9.9
Post by: sdog on June 20, 2011, 02:31:23 AM
Quote
There are quite a few changes in this one, so I should be grateful if some people could assist in some pre-release testing. One thing with which I have been having trouble is making this with GCC/MinGW. In order to make sure that I have a good stable Linux build, I should very much appreciate any testing that anyone might be able to do with this.

Just compiling it with  4.5.2-8ubuntu4 on a 64 bit machine, just using thes standard Makefile. What exactly would you like to have tested?

I'm running a savegame from the server, saved roughly 3 years before the crash fast forward to see if anything happens.


the persistent crash from the server is still there in your preliminary 9.9. See the crash-report-thread for details and a savegame.
Title: Re: Preparing for release of 9.9
Post by: AvG on June 20, 2011, 03:25:43 PM
James,
Just in case you did not see it yourself:
Transport-fees for 250m are 4 times higher than 1000m. Should be 4 times lower.
AvG
Title: Re: Preparing for release of 9.9
Post by: inkelyad on June 20, 2011, 04:35:19 PM
dataobj/fahrplan.cc:
Code: [Select]
              if (file->get_experimental_version() >= 10) {
                        file->rdwr_short(eintrag[i].spacing_shift);

Code: [Select]
   if(file->get_experimental_version() >= 10)
        {
            file->rdwr_bool(same_spacing_shift);
        }
You don't change this?
Title: Re: Preparing for release of 9.9
Post by: jamespetts on June 20, 2011, 09:30:44 PM
Sdog,

thank you for checking that. I wanted to test whether it would compile at all under GCC, as I had been unable to get it to compile with MinGW. You were able to compile and run without difficulty?

AvG,

I cannot reproduce this error, as, with 250m/tile, the base prices of goods/passengers are multiplied by 250 then divided by 1000, which I have confirmed to work correctly with a debugger. Can I clarify here what you mean by "transport fees" and how you tested?

Inkelyad,

thank you for spotting that - fix now pushed.
Title: Re: Preparing for release of 9.9
Post by: sdog on June 20, 2011, 09:41:14 PM
S I wanted to test whether it would compile at all under GCC, as I had been unable to get it to compile with MinGW. You were able to compile and run without difficulty?

it ran out of the box, just pulling and hitting make. same config.default setting as before.

I'm not sure if i understood you correctly, i though you were trying it on your linux machine with gcc? But now you're talking about mingw?
Title: Re: Preparing for release of 9.9
Post by: jamespetts on June 20, 2011, 09:48:27 PM
Ahh, the Linux machine that I had was temporary: it now resides with my parents, so I use MinGW to test GCC compatibility. Glad that it worked for you, though. Can you re-test again now that I have updated the makefile? Thank you for your help.
Title: Re: Preparing for release of 9.9
Post by: sdog on June 20, 2011, 10:13:08 PM
Code: [Select]
From http://github.com/jamespetts/simutrans-experimental
 * branch            9.x        -> FETCH_HEAD
Already up-to-date.
can't see anything new in your 9.x branch.
Title: Re: Preparing for release of 9.9
Post by: jamespetts on June 20, 2011, 10:15:52 PM
That's because I'm using the devel branch at present :-) I was using it to merge in the major changes in Standard whilst I kept the 9.x branch for bug fixes in case I needed to release a bugfix version before I had finished merging, but it looks now as if the next version will be the version with the merges, so the 9.x branch probably won't be used until 9.9 is released.
Title: Re: Preparing for release of 9.9
Post by: sdog on June 20, 2011, 10:23:20 PM
oh, 9.x already steped the version number up to 9.9.

here's gcc's error message:
Code: [Select]
===> CXX bauer/brueckenbauer.cc
In file included from bauer/../simwerkz.h:12:0,
                 from bauer/brueckenbauer.cc:11:
bauer/../simworld.h:428:36: error: duplicate ‘const’
In file included from bauer/../gui/messagebox.h:7:0,
                 from bauer/../simwerkz.h:25,
                 from bauer/brueckenbauer.cc:11:
bauer/../gui/components/gui_fixedwidth_textarea.h:41:7: error: extra qualification ‘gui_fixedwidth_textarea_t::’ on member ‘set_text’
In file included from bauer/../dings/../vehicle/simvehikel.h:19:0,
                 from bauer/../dings/../vehicle/simverkehr.h:15,
                 from bauer/../dings/../simcity.h:20,
                 from bauer/../dings/leitung2.h:16,
                 from bauer/brueckenbauer.cc:40:
bauer/../dings/../vehicle/../simconvoi.h:646:38: warning: type qualifiers ignored on function return type
In file included from bauer/../dings/../vehicle/../besch/vehikel_besch.h:21:0,
                 from bauer/../dings/../vehicle/simvehikel.h:25,
                 from bauer/../dings/../vehicle/simverkehr.h:15,
                 from bauer/../dings/../simcity.h:20,
                 from bauer/../dings/leitung2.h:16,
                 from bauer/brueckenbauer.cc:40:
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:79:58: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:87:59: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:95:58: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:103:59: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:111:59: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:112:59: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:114:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:115:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:116:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:117:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:118:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:119:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:121:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:122:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:123:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:124:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:125:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:126:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:190:27: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:192:27: warning: type qualifiers ignored on function return type
In file included from bauer/../dings/../vehicle/simvehikel.h:25:0,
                 from bauer/../dings/../vehicle/simverkehr.h:15,
                 from bauer/../dings/../simcity.h:20,
                 from bauer/../dings/leitung2.h:16,
                 from bauer/brueckenbauer.cc:40:
bauer/../dings/../vehicle/../besch/vehikel_besch.h:371:44: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/vehikel_besch.h: In member function ‘const bool vehikel_besch_t::check_livery(const char*) const’:
bauer/../dings/../vehicle/../besch/vehikel_besch.h:379:10: warning: unused variable ‘livery_index’
make: *** [build/default/bauer/brueckenbauer.o] Error 1


from bauer/brueckenbauer.cc:11:
bauer/../gui/components/gui_fixedwidth_textarea.h:41:7: error: extra qualification ‘gui_fixedwidth_textarea_t::’ on member ‘set_text’


edit: posted incomplete output at first.
Title: Re: Preparing for release of 9.9
Post by: jamespetts on June 20, 2011, 10:49:38 PM
Hmm - the offending line appears to be

Code: [Select]
void distribute_groundobjs_cities(const settings_t const *set, sint16 old_x, sint16 old_y);

in simworld.h, but that is very odd, as that line is not new with this version, and appears legal: the two consts should indicate that both the pointer and the object to which the pointer is pointing are const. I'm not quite sure what the problem is here, especially as it works on  MSVC++. Any suggestions, anyone?

Thank you very much for testing that, incidentally.

Edit: I've just merged some changes to the makefile from Standard - could you perhaps give it another go with the changes integrated?
Title: Re: Preparing for release of 9.9
Post by: sdog on June 20, 2011, 11:12:45 PM
Code: [Select]
===> CXX bauer/brueckenbauer.cc
In file included from bauer/../simwerkz.h:12:0,
                 from bauer/brueckenbauer.cc:11:
bauer/../simworld.h:428:36: error: duplicate ‘const’
In file included from bauer/../gui/messagebox.h:7:0,
                 from bauer/../simwerkz.h:25,
                 from bauer/brueckenbauer.cc:11:
bauer/../gui/components/gui_fixedwidth_textarea.h:41:7: error: extra qualification ‘gui_fixedwidth_textarea_t::’ on member ‘set_text’
In file included from bauer/../dings/../vehicle/simvehikel.h:19:0,
                 from bauer/../dings/../vehicle/simverkehr.h:15,
                 from bauer/../dings/../simcity.h:20,
                 from bauer/../dings/leitung2.h:16,
                 from bauer/brueckenbauer.cc:40:
bauer/../dings/../vehicle/../simconvoi.h:646:38: warning: type qualifiers ignored on function return type
In file included from bauer/../dings/../vehicle/../besch/vehikel_besch.h:21:0,
                 from bauer/../dings/../vehicle/simvehikel.h:25,
                 from bauer/../dings/../vehicle/simverkehr.h:15,
                 from bauer/../dings/../simcity.h:20,
                 from bauer/../dings/leitung2.h:16,
                 from bauer/brueckenbauer.cc:40:
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:79:58: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:87:59: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:95:58: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:103:59: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:111:59: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:112:59: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:114:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:115:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:116:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:117:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:118:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:119:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:121:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:122:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:123:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:124:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:125:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:126:53: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:190:27: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/../utils/float32e8_t.h:192:27: warning: type qualifiers ignored on function return type
In file included from bauer/../dings/../vehicle/simvehikel.h:25:0,
                 from bauer/../dings/../vehicle/simverkehr.h:15,
                 from bauer/../dings/../simcity.h:20,
                 from bauer/../dings/leitung2.h:16,
                 from bauer/brueckenbauer.cc:40:
bauer/../dings/../vehicle/../besch/vehikel_besch.h:371:44: warning: type qualifiers ignored on function return type
bauer/../dings/../vehicle/../besch/vehikel_besch.h: In member function ‘const bool vehikel_besch_t::check_livery(const char*) const’:
bauer/../dings/../vehicle/../besch/vehikel_besch.h:379:10: warning: unused variable ‘livery_index’
make: *** [build/default/bauer/brueckenbauer.o] Error 1
Title: Re: Preparing for release of 9.9
Post by: TurfIt on June 21, 2011, 02:27:17 AM
Bad merge with https://github.com/aburch/simutrans/commit/2011c22555f97d5e7c4587d87ca6ee5b91ca32f7#diff-0 from standard?
i.e. ‘gui_fixedwidth_textarea_t::set_text’ is removed in standard but not expermental-devel...
Title: Re: Preparing for release of 9.9
Post by: inkelyad on June 21, 2011, 03:55:15 AM
the two consts should indicate that both the pointer and the object to which the pointer is pointing are const. I'm not quite sure what the problem is here, especially as it works on  MSVC++. Any suggestions, anyone?

Then it is
Code: [Select]
const settings_t  * const set
or
Code: [Select]
settings_t const * const set

See http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.5 (http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.5)
Cite from http://duramecho.com/ComputerInformation/WhyHowCppConst.html (http://duramecho.com/ComputerInformation/WhyHowCppConst.html):

Basically ‘const’ applies to whatever is on its immediate left (other than if there is nothing there in which case it applies to whatever is its immediate right).
Title: Re: Preparing for release of 9.9
Post by: inkelyad on June 21, 2011, 03:50:29 PM
vehicle/simvehikel.cc:
Code: [Select]
               switch(waytype)
                {
                        case track_wt:
                        case narrowgauge_wt:
                        case monorail_wt:
                        case maglev_wt:
                                max_speed_90 = kmh_to_speed(30);
                                max_speed_135 = kmh_to_speed(20);
                                max_speed_180 = kmh_to_speed(4);
                                break;

                        case tram_wt:
                                max_speed_90 = kmh_to_speed(42);
                                max_speed_135 = kmh_to_speed(35);
                                max_speed_180 = kmh_to_speed(20);
                                break;

                        case road_wt:
                                max_speed_90 = kmh_to_speed(45);
                                max_speed_135 = kmh_to_speed(40);
                                max_speed_180 = kmh_to_speed(35);
                                break;

                        default:
                                base_limit;
                }
Code: [Select]
vehicle/simvehikel.cc:1525: warning: statement has no effect

EDIT: My own fix for gcc warnings: https://github.com/inkelyad/simutrans-experimental/tree/gcc_warnings (https://github.com/inkelyad/simutrans-experimental/tree/gcc_warnings)
Title: Re: Preparing for release of 9.9
Post by: jamespetts on June 21, 2011, 10:38:17 PM
Inkelyad - thank you: I have merged that now. That is most helpful.
Title: Re: Preparing for release of 9.9
Post by: inkelyad on June 22, 2011, 04:25:42 PM
vehicle/simvehikel.cc:
Code: [Select]
               const char* name = current_livery.c_str();
                file->rdwr_str(name);
                current_livery = name;
From dataobj/loadsave.h:
Code: [Select]
// s is a malloc-ed string (will be freed and newly allocated on load time!)
void rdwr_str(const char *&s);
So code in simvehikel.cc is really wrong on loading.
EDIT^2:
Use this:
Code: [Select]
void loadsave_t::rdwr_string(std::string &s) {
        if (saving) {
                const char* name = s.c_str();
                rdwr_str(name);
        } else {
                const char *name = NULL;
                rdwr_str(name);
                s = name;
                free(const_cast<char *>(name));
        }
}

---
typo ( % -> & ) in bool wkz_change_line_t::init( karte_t *, spieler_t *sp ):
Code: [Select]
sscanf( p, "%c,%hi,&hi", &tool, &line_id, &livery_scheme_index );
Title: Re: Preparing for release of 9.9
Post by: jamespetts on June 22, 2011, 10:49:31 PM
Inkelyad,

thank you very much for that. I have used your std::string save code rather than the code on your Github branch, as I think that the Github code doesn't accommodate both loading and saving. I have also found some other errors in the livery scheme loading/saving code, which I have also fixed. Can you take a look to check that all is correct with this code? Thank you again.
Title: Re: Preparing for release of 9.9
Post by: inkelyad on June 23, 2011, 03:32:10 PM
in void haltestelle_t::add_connexion:
Code: [Select]
simhalt.cc:1421: warning: right shift count >= width of type
simhalt.cc:1431: warning: right shift count >= width of type
simhalt.cc: In member function ‘ware_t haltestelle_t::hole_ab(const ware_besch_t*, uint32, const schedule_t*, const spieler_t*, convoi_t*, bool)’:
simhalt.cc:2332: warning: right shift count >= width of type
It is about
Code: [Select]
average_speed = speed_to_kmh(cnv->get_min_top_speed()) >> 1  * 100;
I think it should be
Code: [Select]
average_speed = (speed_to_kmh(cnv->get_min_top_speed()) >> 1)  * 100;
------------
uint16 haltestelle_t::get_average_waiting_time(halthandle_t halt, uint8 category) const
Code: [Select]
simhalt.cc:1378: warning: taking address of temporary
Code: [Select]
if(&waiting_times[category].get(halt->get_basis_pos()) != NULL)
waiting_times[category] is koordhashtable_tpl<koord, waiting_time_set >
hashtable_tpl::get will return value_t() (in our case waiting_time_set()) when it can't find key.

it is pointless compare its address to NULL.
-------------------
bool wkz_change_line_t::init( karte_t *, spieler_t *sp ):
Code: [Select]
   char tool = 0;
        uint16 line_id = 0;
        uint16 livery_scheme_index = 0;
    
        // skip the rest of the command
        const char *p = default_param;
        while(  *p  &&  *p<=' '  ) {
            p++;
        }
    
        sscanf( p, "%c,%hi,%hi", &tool, &line_id, &livery_scheme_index );
    
        // skip to the commands ...
        for(  int z = 3;  *p  &&  z>0;  p++  ) {
            if(  *p==','  ) {
                z--;
            }
        }
I am very confused. Why you read  livery_scheme_index here, not inside
Code: [Select]
case 'V': // Change livery
If you send livery_scheme_index in every command as second argument, then you must change 'z = 3' to 'z = 2'
Title: Re: Preparing for release of 9.9
Post by: jamespetts on June 23, 2011, 10:11:47 PM
Inkelyad,

thank you very much for that. I have fixed the first; the second, I think, was put in to prevent crashes in particular (and possibly obscure) detected cases, and so I shall leave it in place to retain stability.

The third point I am not sure that I fully understand, since reading all of the tool data have to be read in the same sscanf line, I think, so even if the livery scheme index is only actually used in one of the tools, it has to be read in the general section.
Title: Re: Preparing for release of 9.9
Post by: inkelyad on June 24, 2011, 09:57:29 AM
Your forget
Code: [Select]
simhalt.cc:1421: warning: right shift count >= width of type
simhalt.cc:2332: warning: right shift count >= width of type
It is same error. (Why so complcated?, '*50' is much better).
Title: Re: Preparing for release of 9.9
Post by: jamespetts on June 24, 2011, 10:17:38 AM
Ahh, I think that the >> 1 thing is a leftover from Standard, but you are right: *50 is preferable. This will be changed for the next version. Thank you for spotting it.
Title: Re: Preparing for release of 9.9
Post by: sdog on June 24, 2011, 05:40:16 PM
9.x branch doesn't compile for me (linux, gcc)

Code: [Select]
===> CXX gui/message_frame_t.cc
In file included from gui/message_frame_t.cc:8:0:
gui/../simwin.h:167:33: error: ‘size_t’ has not been declared
make: *** [build/default/gui/message_frame_t.o] Error 1

I suppose you didn't build 9.9's release from your devel branch?
Title: Re: Preparing for release of 9.9
Post by: inkelyad on June 24, 2011, 05:53:30 PM
Well, james said: 'Ahh, the Linux machine that I had was temporary'.

James, how good is your main machine? Can you install VirtualBox with Debian inside? Minimal(gcc, devtools) Debian distribution is not than big.
Title: Re: Preparing for release of 9.9
Post by: sdog on June 24, 2011, 06:00:32 PM
Didn't James wrote he had an i7 or so? HD space shouldn't be an issue. Might it be easier for the beginning to use a distro like Arch or so, when geting a linux for the first time?
Title: Re: Preparing for release of 9.9
Post by: AvG on June 24, 2011, 07:57:33 PM
James,
Sorry I missed your reply on post nr 2.
I came to that conclusion when using key i >settings.
Changing the meters per tile resulted in a higher transport-fee for 250m (4*) then at 1000m.
Alas, this is still the case in Exp 9.9.
AvG
Title: Re: Preparing for release of 9.9
Post by: jamespetts on June 25, 2011, 01:18:41 PM
AvG,

please see my reply to your thread here (http://forum.simutrans.com/index.php?topic=7494) for an explanation of the issue with changing the scale.

SDog,

the Windows 9.9 release was built from the master branch as it now is; the "size_t" problem I think might be specific to GCC, and is fixed according to Inkelyad's suggestion here (http://forum.simutrans.com/index.php?topic=7330.msg71878#msg71878). Can you compile from my 9.x branch?