News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Simutrans Experimental [Original thread]

Started by jamespetts, January 21, 2009, 12:20:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

VS

Play? Sadly that word is not in my dictionary.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

jamespetts

Note: I have discovered a bug in the 8th of February version that will cause the game to crash when it is saved. I have fixed the problem in my own copy of the sourcecode, and hope to upload a fixed version of the executable within a few days.
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.

jamespetts

Update: The bug of the 8th of February version is fixed. Saving works once again. Also, the origins of goods/mail/passengers are displayed.
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.

jamespetts

Update: I have released a new binary, including (1) Isidoro's vehicle replacement patch (adapted for Simutrans-Experimental's way constraints), as discussed here; and (2) a bugfix for issues relating to cornering and weight limits where, in effect, each vehicle's cornering and weight settings would contaminate settings for all others. The settings are now properly separated, so cornering and weight limits should work as designed.
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.

z9999

I don't believe someone playing with this.
Both previous version and current version can't load any savegames.
It will crash after loading any savegames.

Quote
Assertion failed!

Program: ...
File: .\vehicle\simvehikel.cc
Line: 745

Expression: ok

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)

jamespetts

z9999,

thank you very much for your bug report. Looking into this, it is very odd - the bug occurs only on a release build. With a debug build, the bug does not occur at all. The problem is, it is not easy to debug a release build because the optimisations interfere with the debugger. I will have a go at debugging it, but, in the meantime, can anyone think what the problem might be?
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.

prissi

For Releasebuilt, assert should be undefined ...

gauthier

a bit offtopic :

I haven't followed this topic, what's exactly "Simutrans experimental" ?

jamespetts

#43
Prissi,

yes, I'm aware of that, but, despite putting "NDEBUG" in "PreprocessorDefinitions=" in the .vcproj file, for some reason, asserts still seem to be on. I'm currently combing the code for any asserts with side effects.

Gauthier,

read the first post of the thread for a detailed explanation ;-) In essence, Simutrans-Experimental is a branch of Simutrans containing some revisions to gameplay and newer features not found in the trunk, either because they are too new (such as Isidoro's vehicle replacement tool), or because they change the gameplay significantly (such as a number of my economic changes; for example, having private cars compete with the player's passenger transport depending on the year).

The idea of Simutrans-Experimental is ultimately as a testbed for the addition of greater economic depth and realism to Simutrans. If, after testing, it is decided not to add the features to the trunk because those who maintain the trunk prefer a different style of gameplay, the aim is to continue to produce this branch as a variant of Simutrans with different gameplay, to appeal to those who prefer economic accuracy. Have a look at the first post in the thread for a list of current and planned changes to get a flavour of the sorts of things that are different.

Edit: I have found why all the "assert()"s were on: have a look at the following code in simdebug.h:


#ifndef simdebug_h
#define simdebug_h

// do not check assertions
//#define NDEBUG 1


// check assertions
#undef NDEBUG
//#define NDEBUG


#include <assert.h>


Whatever the compile options, debug is set to be on in any event! I still do not understand, however, why the assert is failing in substance: an assertion failure means that something is wrong somewhere, even if the error should be suppressed in a release build. Can anyone cast any light on why the value of the data itself would be different in the debug than the release build? The code is:


slist_iterator_tpl<ware_t> iter (kill_queue);
while( iter.next() ) {
total_freight -= iter.get_current().menge;
bool ok = fracht.remove(iter.get_current());
assert(ok);
}
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.

gauthier

... Maybe you should do this in Simutrans experimental ?
=> http://forum.simutrans.com/index.php?topic=1523.new#new

This extension would help me very well for making my addons ...

jamespetts

#45
Gauthier,

thank you for the suggestion :-) Unfortunately, I am not terribly good at things involving geometry, which your suggestion would, so I'd not be the best person to do that, even if I didn't have quite a long list of things already planned (see the first post for details). However, if somebody else were to code the patch, and it didn't look as though it was going to make it into the trunk any time soon, I'd be glad to add it to Simutrans-Experimental, if it was stable enough and, on testing, the GUI was easy to use :-)

Update: By removing the "#undef NDEBUG" line, the compiler options for debugging now work correctly. The assert failure is no longer present when loading a saved game: the binary file has now been updated. As a side effect of removing all the assert statements, the executable file is now a good many kilobytes smaller - performance should be slightly improved, too.
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.

prissi

Well, probably a compiler issue with MSVC. I would anyway suggest to supply debug builds to get useful error informations. Even the normal SImutrans has assertions usually enabled, since otherwise bug reports are even harder to reproduce.

jamespetts

Prissi,

it's not a compiler issue - if there's a line "#undef NDEBUG" in the code, that will override the "NDEBUG" precompiler setting. Commenting out "#undef NDEBUG" removed that effect.

And I'm not sure that I agree with having all the debugging options on in a release build, increasing the possibility of assert failures (which might, but for the assertion, pass harmlessly), increasing the size of the code and reducing the performance: for code designed for playing rather than testing (i.e., release builds), the sensible setup is one that maximises performance and minimises error. Any bugs reported by users can then be reproduced by recreating the circumstances in which the bug arose in a full debug build, with the debugger on: one can just ask the users to upload a savegame to files.simutrans-germany.com.
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.

Combuijs

QuoteAny bugs reported by users can then be reproduced by recreating the circumstances in which the bug arose in a full debug build, with the debugger on: one can just ask the users to upload a savegame to files.simutrans-germany.com.

Yes, but you can't ask for his computer, his operating system and the environment it is running in. Lots of bugs are caused by just that. The key for bug repair is not changing the source code but to reproduce the bug. This is often very tedious and time consuming.

To give you an idea: in the professional software package my company produces we have made a release version of ASSERT. It's by far the most efficient way to reproduce bugs. The loss of performance is neglectable these days. Causing the software to crash at the place where first things are going wrong is immensely valuable.

On the other hand, we release a "release" version, not a debug one.
Bob Marley: No woman, no cry

Programmer: No user, no bugs



HeinBloed

Hi,

I want to report two crashes with the latest binary (compiled on Feb 10th):

The first one happens very often when I initialize a new map (from a custom height map). It doesn't happen ALL the time though, a few times it went through and I could play the map.

The second one happened only once so far. It occured right when the vehicle you can see in the attached screenshot reached the station. Maybe it's of help for debugging that I had saved the game after the bus had already loaded some passengers. It said "from unknown" as origin then for those passengers after re-loading the game.

EDIT: screenshots are in the wrong order
(previously known as "tttron")

jamespetts

Combuijs,

In the event that a bug could not be reproduced, a debug build could easily be sent to the end-user to test whether any asserts are triggered.

tttron,

thank you very much for your bug report :-) But are you sure that you have the latest version of the binary? You give the date as the 10th, but I released a new one yesterday (the 15th), which contained a number of bug fixes. If you can't get it to work with the latest version, please do let me know by replying to this thread :-)

Edit: Both of those are assertion failures, which means that you are using an older version. Incidentally, do you get these failures in the normal Simutrans? I ask because they are in areas of code not directly affected by my modifications. That does not rule out the problem being specific to Simutrans-Experimental, but it ought be investigated.
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.

HeinBloed

#51
Quote from: jamespetts on February 16, 2009, 02:29:53 PM
thank you very much for your bug report :-) But are you sure that you have the latest version of the binary? You give the date as the 10th, but I released a new one yesterday (the 15th), which contained a number of bug fixes. If you can't get it to work with the latest version, please do let me know by replying to this thread :-)

Edit: Both of those are assertion failures, which means that you are using an older version. Incidentally, do you get these failures in the normal Simutrans? I ask because they are in areas of code not directly affected by my modifications. That does not rule out the problem being specific to Simutrans-Experimental, but it ought be investigated.

Hmm are you sure you uploaded it to the server? I re-downloaded it from http://simutrans-germany.com/files/upload/Simutrans-Experimental.zip just now, but it's the same file. And no, I didn't get any of those two failures in default Simutrans 101 - didn't test any nightlies or even default 102 yet though.

Edit: Ok, the map initialization failure happens with 101, too. I hadn't tried with a custom height map (of that size) so far.

Edit 2: The map initialization failure is gone in the latest nightly, 102-2325.
(previously known as "tttron")

jamespetts

Tttron,

thank you for your reply :-) Simutrans-Germany was down when I last tried it, (firstly, I could not access it at all, and then I could access it, but not delete my file) so I have uploaded the file to a temporary location, which is linked in the opening post of this thread.

Thank you for checking the map initialisation failure against 101 standard. I do merge the updates from the nightlies into Simutrans-Experimental periodically, so, if the main developers have fixed the standard version, Simutrans-Experimental should be fixed, too. Have a look at the opening post of the thread to download the new version, and see how you get along :-)
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.

HeinBloed

#53
Quote from: jamespetts on February 16, 2009, 03:02:26 PM
Simutrans-Germany was down when I last tried it, (firstly, I could not access it at all, and then I could access it, but not delete my file) so I have uploaded the file to a temporary location, which is linked in the opening post of this thread.

Ah ok, my bad I didn't check the other link (I had certainly seen your note). You should maybe rephrase the text though as it still says "and a Windows executable version of Makeobj-Experimental (for making assets that take advantage of Simutrans-Experimental's new features) can be downloaded here", where "here" points to the game binary. ;)

Edit: I can't reproduce the other crash with my savegame with the new binary. Origin is still set to "unknown" (I think you mentioned in the patch description that origins don't get saved yet), but no crash upon arrival at the station.

Edit 2: I wanted to test the new replacement feature, but it doesn't seem to work...? Either that or I'm doing something wrong. When I complete the Replace dialog (cf. screenshot), the buttons of all vehicles in the line turn red and say "Replacing", and "No load" is set, too. But then they just keep on cycling the schedule forever, driving past the depot all the time but not entering it. Is the depot meant to be added as a stop in the schedule anyway?
(previously known as "tttron")

z9999

Thank you. Now I can load Simutrans-Experimental savegames.
Another question. Is it difficult to load original simutrans games ?
Most of them will crash after loading.

For example, start pak96.comic and demo game will be loaded at first.
This game will crash soon.

Quote
Simutrans-Experimental.exe caused an Integer Divide By Zero at location 00467e13 in module Simutrans-Experimental.exe.

Registers:
eax=00000030 ebx=00000000 ecx=00000000 edx=00000000 esi=00000005 edi=0066044c
eip=00467e13 esp=0013e4f4 ebp=0013e60c iopl=0         nv up ei pl nz na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000206

Call stack:
00467E13  Simutrans-Experimental.exe:00467E13
00468A4E  Simutrans-Experimental.exe:00468A4E
00465B7A  Simutrans-Experimental.exe:00465B7A
0049771B  Simutrans-Experimental.exe:0049771B
004495B9  Simutrans-Experimental.exe:004495B9
0047F15B  Simutrans-Experimental.exe:0047F15B
0047F17D  Simutrans-Experimental.exe:0047F17D
00449EE1  Simutrans-Experimental.exe:00449EE1
00450CC2  Simutrans-Experimental.exe:00450CC2
0047D00F  Simutrans-Experimental.exe:0047D00F
004718E0  Simutrans-Experimental.exe:004718E0
004318F9  Simutrans-Experimental.exe:004318F9
7C817067  kernel32.dll:7C817067  RegisterWaitForInputIdle

prissi

The not-replacing is due to convois never get empty, even if they pass the stations in question. I saw this too, but saw no obvious reason.

jamespetts

tttron,

thank you for your latest bug report - it is always most helpful to have feedback! The part of the code - the replacement of vehicles - with which you are having trouble was written by Isidoro, although I adapted it to work with some of the features of Simutrans-Experimental. Could I ask you to test with the version of the executable found here: http://simutrans-germany.com/~patches/download.php?file=sim-wingdi-replacing-r2260.zip (which is just Isidoro's original version of the vehicle replacement feature, without any of the Simutrans-Experimental additions) to see whether you still get the problem then? If you do, there is a bug with the vehicle replacement code itself, which should be reported in this thread. If not, then I will have to look into it further, since it would be my changes that would have caused the problem. If you are not able to reproduce it with Isidoro's clean version, please send me the saved game so that I can look into it.

Edit: Incidentally, thank you for pointing out the error in relation to the download links on the original post - I have edited the post now to correct the error.

Z9999,

oddly, I have been unable to reproduce this one. I tried, both with release and debug builds, loading Pak96.Comic and  letting the demonstration game run for a fair while (in fast forward mode, too), and had no problems. Is it only Pak96.Comic that gives you trouble, or do you also have problems loading saved games from, say, Pak64 or Pak128? I have not noticed any difficulty in loading saved games with the latest version of Simutrans-Experimental - certainly, there should not be any additional problems loading games saved in standard Simutrans, since I have not knowingly changed the save game format.

Prissi,

ahh, interesting. Perhaps, then, the vehicle replacement code should, when a vehicle is marked to be replaced, also mark it not to load? Or does it do that anyway? Isidoro - if you are reading - do you have any thoughts?
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.

HeinBloed

Quote from: prissi on February 16, 2009, 08:19:25 PM
The not-replacing is due to convois never get empty, even if they pass the stations in question. I saw this too, but saw no obvious reason.

Before I try James' proposed executable, let me just say that the buses actually had 0 passengers.  ???

Quoteahh, interesting. Perhaps, then, the vehicle replacement code should, when a vehicle is marked to be replaced, also mark it not to load? Or does it do that anyway? Isidoro - if you are reading - do you have any thoughts?
As I said, the "No load" button gets activated when I use the replacement dialog, and it works as intended.
(previously known as "tttron")

jamespetts

Hmm, perhaps Prissi's diagnosis is not correct, then. Either that or we have misunderstood what he meant. I'd be grateful if you could try Isidoro's binary, tttron, to see whether the problem is the original code or my integration.
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.

HeinBloed

I will, as soon as the download server works again. ;) Getting a timeout atm.
(previously known as "tttron")

prissi

Even though no-load was on it was not unloading certain passengers.

z9999

Crashing is 90% of my games, include 64, 96, and 128.

I found someting. In pak96.comic demo game,it crashed the train reached a cretain track which max. weight is 74579648. See attached screenshot.

jamespetts

#62
Z9999,

thank you for that information - it does indeed look as if one of my modifications has caused this (weight limits). I am not sure how, though, or why I cannot immediately reproduce it. I shall look into that.

Update: I have found the problem: in some cases, the weight limit variable was not initialised properly on loading a game, causing a crash when that variable was accessed. I have temporarily fixed the problem by setting a default value for the weight limits, but this often obliterates the true weight limits when a game is reloaded. A proper fix will involve reversioning the save game files, which I will do in due course. Thank you for spotting that problem - it is most useful! I have uploaded now a fixed version of the binary (and am about to upload the source), so do try it and let me know how you get on.
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.

HeinBloed

James,

I've tested with the executable you linked earlier (http://simutrans-germany.com/~patches/download.php?file=sim-wingdi-replacing-r2260.zip) - the replacement does work with that one. Just to be sure, I started another game with your Experimental executable and the replacement still didn't work as described above. Did you try it for yourself with your executable?
(previously known as "tttron")

isidoro

Quote from: jamespetts on February 16, 2009, 09:05:49 PM
Isidoro - if you are reading - do you have any thoughts?

I'm reading, James. :)  Did you adapt the seventh version of the patch?  The sixth was completely broken.


z9999

Thank you. Max. weight problem was solved. It shows 999.
But still many of savegames cause crash within 1 minute after loading.
Maybe there is another problem.

Several games shows same location in error message.

Quote
Simutrans-Experimental.exe caused an Access Violation at location 0040a980 in module Simutrans-Experimental.exe Reading from location 000002a8.

Registers:
eax=0013e4e8 ebx=00000000 ecx=00000000 edx=000002a8 esi=00000046 edi=000003fc
eip=0040a980 esp=0013e4c4 ebp=0013e4c8 iopl=0         nv up ei pl nz na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000206

Call stack:
0040A980  Simutrans-Experimental.exe:0040A980
00484D11  Simutrans-Experimental.exe:00484D11
004A19E5  Simutrans-Experimental.exe:004A19E5
004A357F  Simutrans-Experimental.exe:004A357F
00450986  Simutrans-Experimental.exe:00450986
00450C85  Simutrans-Experimental.exe:00450C85
0047D08F  Simutrans-Experimental.exe:0047D08F
00471960  Simutrans-Experimental.exe:00471960
00431969  Simutrans-Experimental.exe:00431969
7C817067  kernel32.dll:7C817067  RegisterWaitForInputIdle

jamespetts

Tttron,

thank you for testing that - I will have to integrate Isidoro's latest version of the patch and try it again.

Isidoro,

thank you for updating the patch: I cannot remember which version that I tried, except that it was the one before the latest one that you have recently posted. However, I had terrible trouble trying to get it to merge, because I use Git, whereas patch files are designed to work against SVN. Git does not seem to have a system of working with patch files. Do you think that you could use Git branches as well as SVN patches for your code modifications? There is a Git repository both for Simutrans-Experimental and normal Simutrans, and it is designed such that any single patch can effectively be made a branch, which is very easy to merge back with the trunk. PM me if you would like more information on how to set it up.

Z9999,

Hmm, that's rather odd. As I noted before, I have not had that problem myself, so reproducing it is not easy. Do you notice anything in particular happening just before the crash? Also, I have uploaded a debug build of Simutrans-Experimental, here: http://simutrans-germany.com/files/upload/Simutrans-Experimental-debug.zip . Do try that and tell me whether the problem recurs. (Note: that debug build contains an incomplete version of the next feature on which I am working, so behaviour might be different in some places, but it should not cause instability nor affect this issue).
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.

z9999

Thank you.
But I don't install MSVC, so I can't run debug version. Sorry.

jamespetts

Z9999,

you've tried running it and it doesn't work?
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.

comrade

Hi,

firstly, thanks for making this modification. I really love the new features.

I've tried the latest version (not the debug one, it won't run for me) and I have experienced the following bug:
after loading a game, vehicles sometimes will not unload cargo they are currently carrying. They will however load new cargo on top of the old cargo, exceeding their maximum capacity.

I have attached a save with the bug (follow the train to see what I'm talking about).