Skip to main content

Show Posts

This section allows you to view all Show Posts made by this member. Note that you can only see Show Posts made in areas you currently have access to.

Messages - Nathan Samson

2
Simutrans Gaming Discussion / Re: Simutrans vs. OpenTTD
Technically, Simutrans allows for about 32000 colors plus a few special colors. If I remember correctly TTD graphics use 256 colors.
This is also not true anymore: openTTD has a 32bbp renderer, but the "pak" for that is still not complete, so the main pak is still 256 colors (+ non-free)

ThomasA maybe you should have a look at the pak128 pakset, I find that one graphically more appealing than pak64 (default simutrans pak).
3
Simutrans-Extended development / Re: [Extension Request] Other fileending for ST Experimental
Personally I don't find it very important that experimental pak files can be opened in standard version. (so a extension file change can be useful)

What I do find important is that it is easy to generate both an experimental and standard pakset from the same sources (that is in: in the sources are the added data like comfort rating and so on, but they are not "compiled" in the standard pakset file)
Rationale: an extended pak128/pak64 without a "fork" from the current data files
(note: I don't know anything of the current system, so I don't know how hard this is, or maybe that it is already like this)
7
Randomness Lounge / Re: "Read my mind" button
Why is their a poll for this with several options?

It should only have one option: "Read my mind", when you then click the submit poll button it should substitute it with what you think...
8
Simutrans-Extended development / Re: [Bug 4.4] Very weird and costly bug
I had it once again this time with another type of truck:

Latest simu-experimental git, linux 64 bit, openpak128 (latest nightly as of today (v697)), ...

The problem is on one of the trucks when you open the savegame (no 122) on the iron ore line

Saddly enough when I reopened the game it seems to have gone, so I don't know if it will help you...

Download save file
11
Extension Requests / Re: Duplicate Backwards
I think a general undo button (general in the sense it works also for the insert/remove and add "actions) for the schedule window can be very usefull, regardless if you like/use the replicate backwards button.
12
Simutrans-Extended development / Re: Too Heavy
The code already uses the maximum weight of vehicles, not of convoys. A convoy will only be regarded as overweight for a way if the heaviest individual vehicle in that convoy is too heavy for that way, which is more realistic than applying an average weight (which would mean that one could make a locomotive that was too heavy for a way on its own not too heavy simply by adding enough light carriages, which makes no sense).

Oh really? I missed that...
13
Simutrans-Extended development / Re: Too Heavy
As you stated Standard does not enforce weight limits, Experimental does, ergo, it is Experimental that is wrong. Maybe as a temporary fix, you should make your next release so that it too does not enforce weight limits. Or, as I already said, Players will not be able to use airplanes.

By the way, this problem only seems to have started with v5.0. This could be indicative of a problem in your coding.

It is just a new feature of experimental which makes it more realistic. The data that is used from the paks, but since the paks are probably not realistic because it doesn't matter in standard.

You can play without enforce weight limits if you change simuconf.tab

# If enforce_weight_limits is set to 0, weight limits are ignored entirely. If
# enforce_weight_limits is set to 1, then vehicles can travel over roads, rails,
# speed. If enforce_weight_limits is set to 2, then vehicles cannot travel over
# To revert to the behaviour of Simutrans-Standard, set enforce_weight_limits=0
enforce_weight_limits=1
14
Simutrans-Extended development / Re: git pull (13/7) wont compile
I don't know if it has anythhing to do with my "patch" but the path_explorer system crashes when creating a new line and starting the convoi

Quote
Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0x7ff934380700 (LWP 20487)]
0x00000000005e4eb1 in path_explorer_t::compartment_t::step (this=0x2922a48)
    at path_explorer.cc:521
521                  const uint32 projected_iterations = statistic_iteration * time_midpoint / statistic_duration;
(gdb) bt
#0  0x00000000005e4eb1 in path_explorer_t::compartment_t::step (this=0x2922a48)
    at path_explorer.cc:521
#1  0x00000000005e67e9 in path_explorer_t::step () at path_explorer.cc:73
#2  0x00000000005d554c in karte_t::step (this=0x2920ef0) at simworld.cc:3001
#3  0x00000000005d6401 in karte_t::interactive (this=0x2920ef0)
    at simworld.cc:4748
#4  0x00000000005a599d in simu_main (argc=2, argv=0x7fffa0b9df68)
    at simmain.cc:956
#5  0x000000000060f320 in main (argc=2, argv=0x7fffa0b9df68) at simsys_s.cc:779

EDIT: as you may have guessed it is a division by zero...
Also it seems that it does not happen with busses but only with trucks (did not try trains or something else) (it is also possible it just does not happen everytime)
15
Simutrans-Extended development / Re: git pull (13/7) wont compile
What I did to make it compile:

Change the string to string.h

Commented out the mmsystem.h (Too lazy to move it)

Commented out all code that knightly added in simsys_s.cc, and uncommented SDL_GetTicks in dr_time() (Too lazy to place it in an ifdef, as far as I know SDL_GetTicks is good enough on linux/unix, Knightly please correct me if I'm wrong...)

Added path_explorer.cc to SOURCES in Makefile

For reference: complete patch

Code: [Select]
diff --git a/Makefile b/Makefile
index 0cf09c5..53edd4c 100644
--- a/Makefile
+++ b/Makefile
@@ -307,6 +307,7 @@ SOURCES += simware.cc
 SOURCES += simwerkz.cc
 SOURCES += simwin.cc
 SOURCES += simworld.cc
+SOURCES += path_explorer.cc
 SOURCES += sucher/platzsucher.cc
 SOURCES += tpl/debug_helper.cc
 SOURCES += unicode.cc
diff --git a/path_explorer.h b/path_explorer.h
index 0d55358..9cc0208 100644
--- a/path_explorer.h
+++ b/path_explorer.h
@@ -8,7 +8,7 @@
 #ifndef path_explorer_h
 #define path_explorer_h
 
-#include <string>
+#include <string.h>
 
 #include "halthandle_t.h"
 #include "convoihandle_t.h"
diff --git a/simsys_s.cc b/simsys_s.cc
index a514ad0..134e2c3 100644
--- a/simsys_s.cc
+++ b/simsys_s.cc
@@ -35,7 +35,8 @@
 #include <string.h>
 #include <stdlib.h>
 #include <math.h>
-#include <mmsystem.h>
+//#include <mmsystem.h>
+#define LARGE_INTEGER uint64
 
 #ifndef PATH_MAX
 #define PATH_MAX (1024)
@@ -141,7 +142,7 @@ int dr_os_init(const int* parameter)
  atexit(SDL_Quit); // clean up on exit
 
  // Added by : Knightly
- if ( umgebung_t::default_einstellungen.get_system_time_option() == 0 )
+ /*if ( umgebung_t::default_einstellungen.get_system_time_option() == 0 )
  {
  // set precision to 1ms if multimedia timer functions are used
  timeBeginPeriod(1);
@@ -156,7 +157,7 @@ int dr_os_init(const int* parameter)
  umgebung_t::default_einstellungen.set_system_time_option(0); // reset to using multimedia timer
  timeBeginPeriod(1); // set precision to 1ms
  }
- }
+ }*/
 
  return TRUE;
 }
@@ -261,11 +262,11 @@ int dr_os_close(void)
  // SDL_FreeSurface(screen);
 
  // Added by : Knightly
- if ( umgebung_t::default_einstellungen.get_system_time_option() == 0 )
+ /*if ( umgebung_t::default_einstellungen.get_system_time_option() == 0 )
  {
  // reset precision if multimedia timer functions have been used
  timeEndPeriod(1);
- }
+ }*/
 
 
  return TRUE;
@@ -693,7 +694,7 @@ unsigned long dr_time(void)
 {
  // Modified by : Knightly
  // declare and initialize once
- static LARGE_INTEGER t; // for storing current time in counts
+ /*static LARGE_INTEGER t; // for storing current time in counts
  static LARGE_INTEGER f; // for storing performance counter frequency, which is fixed when system is running
  static const bool support_performance_counter = ( QueryPerformanceFrequency(&f) != 0 );
 
@@ -707,10 +708,10 @@ unsigned long dr_time(void)
  {
  // Case : use multimedia timer functions
  return timeGetTime();
- }
+ }*/
 
  // Knightly : this function actually calls timeGetTime()
- // return SDL_GetTicks();
+ return SDL_GetTicks();
 }
16
Simutrans-Extended development / Re: Too Heavy
Note that a similar problem exists with trains (in pak128)

most railways go up to 100 t or so, while most train convois are a lot more than that.

But maybe the interpretation of the weight limit could change since if  the total weight of a convot is easily several 100 tons. Since it is not realistic that a train where each wagon weights 100 t (I don't think they exists but lets ****ume) of length 2 can run over a railway (say the weight limit is 250) but one where each wagon weights 50 ton of length 10 is too heavy...

I think the median weight (total weight / length) should be compared to the weight of a rail track, not the total weight of the convoi...
18
Simutrans-Extended development / Re: [Patch] A New, Centralized, Steppable Path Searching System
As to GitHub pushing other than at releases, the reason that I do not do that at present is that the automatic Linux nightlies will then build a new version, and that version will be linked as the version to download from the "How to get Simutrans-Experimental" post: I do not really want people using half-baked versions, as that is likely to cause confusion with bug reporting. I have currently not had the time to think of the most effective solution to this issue - it might be that, long-term, it is worth moving to a joint system of nightly and release builds, but that relies on somebody (possibly Wernieman) producing nightly builds for all platforms for Simutrans-Experimental, which is not done at present. Any thoughts on how to organise this effectively would be appreciated.

What about using branches?
Say: you use master for your daily work (and often pushes) and release is used used for releases (which you push only on release time). In first instance werniermann could use the releases branch for his nighlty builds (and you to keep the current link in "how to )
download...")
At a later stage (hopefully not to far in the future) the nightly build site could be changed so it uses master for -real- nightly builds and release for release builds... (and you change your link to the latest of this)
20
Incorporated Patches and Solved Bug Reports / Re: settings.xml is very unclear, simuconf.tab has settings that don't affect gamepl
Quote
Editing settings.xml is not wished, since the values there could lead to simutrans crashing upon loading and never be able to start again without deleting it.

Thats one of my problems => a good xml file should not crash when tags are missing/not the expected type, so if the file format is something like <aconfigsetting> and that tag is missing from the file the file just should load perfectly and the setting for "aconfigsetting" should be the default.

<value2> is not the perfect example (did I use that?) I mean <thenameoftheconfigsetting> like <window-width> or <use-timeline> or ...

Quote
However, with these short tags size increases from 4MB to 288MB for savegames,
I never said (human-readable) XML should be used for savegames only for the configuration settings...

Quote
And why do you want to edit settings.xml? Everything there could achieved by simuconf.tab or even the command line. Simuconf.tab is much better documented too.
I came across this "mess" (I still call it a mess, it is not meant offensive) when trying to add a configuration option (for the ltr-graphs I made)

Mod note: I fixed broken quote marquee
~Igor.

21
Incorporated Patches and Solved Bug Reports / Re: settings.xml is very unclear, simuconf.tab has settings that don't affect gamepl
These name are historic, first was einstellungen and umgebung came later.(...)

Most of the time users shouldn't modify configuration files, but still the settings.xml is huge abuse of xml... Say their are some hidden options (like window size) that the user can not modify directly in the UI, or settings that are not wiedly used so that are not in the settings dialiog in-game to not clutter it up => users should still be able to open the settings.xml, find the right setting and edit it.
By the way, I don't understand your thing about ImportantHeadline: h1 is clear if you know what it means => header1 so an header of the first level....
Btw I don't see why <i8> and <bool> and so on are used as tag names, it just could be all <a> (or <b > or <whatthehellisthis>) for all types
or better, just don't call it XML and have a file
"value1
value2
value3
..."
(which would be better than the current XML file => it still can't be read by users, but still by computers and it saves bytes...., and is probably a lot easier to p****... (so it would save us LOC))


Most of the system  (in my idea) will stay intact but I want to add some imrpovements
Now their is some compat code that loads some settings from simuconf.tab and puts them in umgebung, I want to get rid of this (just load the old settings from simuconf.tab once, saves them in the new xml, and then removes them from the tab file)

My idea of virtual functions will not impact performance:
only the save/load will be virtual all the rest can stay in the base cl****

The idea of keys (so for clarity: settings->get_bool_value("timeline-enabled") instead of settings->get_timeline()) wsa only an idea, its right that one is not more flexible than the other, so we kan indeed keep the current system

mod note: fixed the spilling bold for you :-) ~VS

mod note 2: and you don't need to quote an long post that is right above yours :-D ~Igor
22
Incorporated Patches and Solved Bug Reports / Re: settings.xml is very unclear, simuconf.tab has settings that don't affect gamepl
I know what the point of simuconf.tab is, but still the current source code is not consistent + the xml is flawed

My point is to keep simuconf.tab almost completely (also the split up in 3 parts, user, simutrans, pak), but remove the keys that should be in setttings.xml + design a better way to achieve things (so its clear for new devs what to use)

einstellungen is btw a confusing name => it translates (as far as i know) as configuration but this seems wrong (environment seems a better name - the environment where the current game is living in, but umgebung_t seems to translate to environment, so these names should be better chosen)
23
Incorporated Patches and Solved Bug Reports / settings.xml is very unclear, simuconf.tab has settings that don't affect gamepl
This topic is all about to improve the configuration mechanisms in simutrans

My problems with it:
* its very unclear for new developers what is where
* settings.xml is just a mess (its a really big [don't evade curse filter]  you to XML)
* Some non-gamplay settings are in simuconf.tab

As I can see their are 3 types of configuration:

1 Non-gameplay settings => day/night settings, visibility of trees etc, window size, ...
2 Gameplay settings that should be saved in the game once started, but don't have a GUI at startup
3 Gameplay settings that should be saved in the game, but /have/ a GUI at startup (timeline, start year, starting money....)

1 is now partly in settings.xml but this format is really bad, another part is still in simuconf.tab
2 is now (partly?) in settings.xml in another tag
3 Is in simuconf.tab

(Please correct me if I'm wrong in one of the above ****umptions)

For configurations of type 1 an XML format is good, but it should be human readable (and the order of tags shouldn't matter neiter the absence of some tags)
it could look something like this
Code: [Select]
<configuration>
<window-width>800</window-width>
<window-height>600</window-height>
<language>en</language>
...etc...
</configuration>

Configurations of type 2 could stay in simuconf.tab, the one of type 3 could be also in simuconf.tab (in the users home directory) but I don't know if this format has a write option in simutrans, so maybe we could use XML here too...
1 should be in a different file than 3, 2 and 3 could maybe be in the same file

disadvantage of really using XML (instead of what we have now: NXUL => Non Extendible Unordered Language) is that we can't use our current XML p****r, and we have to use an external dependency, but this shouldn't really be a problem

Codewise things could look like this:
* A static configuration cl**** (currently umbegung_t) for type 1
* An abstract cl**** (that works with keys instead of a function for each variable) for 2 and 3 which is used in welt (reading/saving from/to savegame) and before startup (reading/saving from/to simuconf.tab and/or xml file)

Any comments on this plan?

[red]Mod note: Don't evade curse filter.
~Igor.[/red]
24
Randomness Lounge / Re: Collaborative game site
A very rough first version is ready

* I still don't have some server access => Isaac you wanted to help out?
* The layout is very basic so if some webdesigner could help me out with this (I can code the CSS, bug I'm not a designer...)
* I'm still wondering what license to use:

AGPL (Affero GPL => users of the site should be able to download the source: the site is opensource, but if anyone forks it he is obliged to release the source too:
I don't know if any other licenses have the same protection...
26
Incorporated Patches and Solved Bug Reports / Re: [patch] Change the graphs so they go from old-to-new instead of new-to-old
Final patch (with configuration options in display) (only final if no problems are found...)

Download patch

Apply with "patch -p1 -i graphs_final_r2569.patch" it applies to r2596 and r2570 (at least, probably earlier versions too, but that doesn't matter)

As you can see I also did some "refactorings" in colors.cc.
In the earlier versions it was hard do insert a widget (all constants for the widgets after the inserted one had to be adapted), with my "new system" only one constant has to be changed...
I also moved the MAX_BUTTONS constant to colors.h (since the same number has to be used there) and is renamed to COLORS_MAX_BUTTONS (if other widget frames are doing the same I can imagine MAX_BUTTONS will conflict...)
28
Simutrans-Extended development / Re: [Bug v4.5] An Easy Way to Become a Billionnaire ^_^
This post by Nathan is strange to me because, the many years that I have been playing Simutrans this is the first time I have come across this particular phenomenon. I must have missed a version somewhere down the track.

I think I made a mistake:
I interpreted electrifaction as laying power lines between a power factory and another factory, but what was meant here was electrification of tracks
29
Simutrans-Extended development / Re: [Bug v4.5] A Easy Way to Become a Billionnaire ^_^
Because the base values for the price of the way object is an unsigned integer. If that is used in the accounting without casting, where a - is used, it overflows and becomes a very high number. The fix is to cast it to a signed integer somewhere, but, if the code is changed around, somebody might well forget to cast it back again.

That explains it
31
Incorporated Patches and Solved Bug Reports / Re: [patch] Change the graphs so they go from old-to-new instead of new-to-old
Ok it uses now umgebung.

This was the only patch for simutrans I was planning, but now I seriously think to do some others:

overall cleanup (unused variables, etc) => no warnings is my goal (but maybe impossible)
configuration mess cleanup (but I'm afraid part of the messup is to be compatible with older configurations, so this maybe hard to achieve)

I'll will start a thread for this last one to have some communication with the simutrans-devs (if I really start doing this)
32
Incorporated Patches and Solved Bug Reports / Re: [patch] Change the graphs so they go from old-to-new instead of new-to-old
Nathan,

umgebung is used for things that do not need to be saved with the game, and einstellungen is used for things that do need to be saved with the game. The former deals with superficial user preferences (such as cycling between day and night views, etc.), and the latter with things that affect gameplay. The former settings are saved in settings.xml and are specific to each user: the latter are saved with each saved game and are specific to that saved game. The distinction will become even more important when multiplayer gaming via a network/the internet is introduced.

I used einstellungen, but still I can switch an old savegame from old to new behaviour (and the other way arround)
33
Incorporated Patches and Solved Bug Reports / Re: [patch] Change the graphs so they go from old-to-new instead of new-to-old
I didn't even know the existance of these settings.xml

and maybe you are right: user settings should go in settings.xml and other configurations (that are more gameplay specific) should go in simuconf.tab

You are also right in the fact that simuconf.tab is not the most readable format but still I believe that config files should be more or less human readable, which settings.xml is defintely not. (I don't know why, but XML is abused here.  It should not matter in what order the tags are, but in this case it does)

Btw I did not use umgebung because it seemed that it was version specific so I was thinking it had more to do with the gamesave format or so (I had no idea why a config file would have needed a version number), it seems that I was completely wrong (and it is completely clear why a version is needed for this game format)
35
Incorporated Patches and Solved Bug Reports / Re: [patch] Change the graphs so they go from old-to-new instead of new-to-old
I have to say, when I first started using Simutrans, I found the reverse direction of the graphs very confusing, too. However, I suggest that any patch to change something like this that has been in Simutrans since time immorial be made optional, so as not to confuse seasoned players.

That was the idea, but I don't know how to hook it (The graph cl**** has a new function set_ltr(bool) which when set to true uses this behaviour, but the default is still the old behaviour)

So everywhere where a graph is made the function graph->set_ltr(#value in config file) should be called. But I don't have the knowledge to do that...