Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Tue Oct 16, 2018 11:53 pm

All times are UTC




Post new topic  Reply to topic  [ 385 posts ]  Go to page Previous 114 15 16 17 1820 Next
Author Message
PostPosted: Tue Mar 04, 2014 7:42 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9037
Location: Sol d
Can we please avoid double and tripple posts? You can edit your posts after creation. And when replying your can quote several postings easily by pressing 'quote' in the appropriate posts (by scrolling down further the list of postings of the thread when making your reply).

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Tue Mar 04, 2014 3:08 pm 
Offline
Engineer
Engineer

Joined: Fri Oct 11, 2013 11:20 pm
Posts: 16
planetmaker wrote:
Can we please avoid double and tripple posts? You can edit your posts after creation. And when replying your can quote several postings easily by pressing 'quote' in the appropriate posts (by scrolling down further the list of postings of the thread when making your reply).


Sorry, got used to another forum where you had a very limited time to edit your posts.

:)


I dont know if this is the right place, but has anyone achieved patching the source with the automated timetables and this daylength patch? Those are the two things im really wishing i had before i start a new map :)

viewtopic.php?t=46391 (automated timetable)

Thanks!


Top
   
PostPosted: Sat Apr 19, 2014 2:02 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 17, 2008 12:17 pm
Posts: 2385
Location: Virgo Supercluster
I've ran into a bit of trouble getting the patch to work with current trunk:
Code:
static const SaveLoadGlobVarList _date_desc[] = {
     SLEG_CONDVAR(_date,                   SLE_FILE_U16 | SLE_VAR_I32,  0,  30),
     SLEG_CONDVAR(_date,                   SLE_INT32,                  31, SL_MAX_VERSION),
         SLEG_VAR(_date_fract,             SLE_UINT16),
         SLEG_VAR(_tick_counter,           SLE_UINT16),
     SLE_CONDNULL(2, 0, 156), // _vehicle_id_ctr_day

now is
Code:
static const SaveLoad _date_desc[] = {
   SLEG_VAR(_date,                   SLE_FILE_U16 | SLE_VAR_I32,  , ,   0,  30),
   SLEG_VAR(_date,                   SLE_INT32,                  0, ,  31,    ),
   SLEG_VAR(_date_fract,             SLE_UINT16),
   SLEG_VAR(_tick_counter,           SLE_UINT16),
   SLE_NULL(2, , , 0, 156), // _vehicle_id_ctr_day

which conflicts with the patch adding this line:
Code:
SLEG_CONDVAR(_date,                   SLE_INT32,                  31, SL_MAX_VERSION),
        SLEG_VAR(_date_fract,             SLE_UINT16),
        SLEG_VAR(_tick_counter,           SLE_UINT16),
+       SLEG_CONDVAR(_tick_skip_counter,      SLE_UINT8,                 200, SL_MAX_VERSION),
    SLE_CONDNULL(2, 0, 156), // _vehicle_id_ctr_day
    SLEG_CONDVAR(_age_cargo_skip_counter, SLE_UINT8,                   0, 161),
    SLE_CONDNULL(1, 0, 45),

Apparently CONDVARS aren't wanted anymore ...

Unfortunately I have absolute zero programming knowledge. Changing condvar to var compiles the game and it actually seems to be running fine, but, surprise surprise, newly made saves are corrupted/can't be loaded. Anything I can do about that? ^^;

€: to be more precise it crashes for saves with daylength set to not 1, at date.cpp "assert(fract < DAY_TICKS);".


Top
   
PostPosted: Sat Apr 19, 2014 3:17 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7156
you probably need to replace the DAY_TICKS in this assert, to consider the daylength of the new savegame. and this is probably unrelated to the above conflict.


the difference between "VAR" and "CONDVAR" was that "CONDVAR" had a from-to range for the valid savegame versions. this difference was not very useful since all new things need CONDVAR anyway, so the two things were combined. so all "VAR" now have this range, with missing values filled with default. (0 and max)

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Sat Apr 19, 2014 3:44 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 17, 2008 12:17 pm
Posts: 2385
Location: Virgo Supercluster
Mh. I thought about that, but none of the patch revs ever do anything in date.cpp, and also neither spring patch pack nor hard patch pack (always a good place to check for updated patches but currently both are too old ^^;). I tried changing it to DAY_TICKS_DAY_LENGTH (which the patch uses at some other point) but that makes it crash right at the start ;) It's also I think a file virtually unchanged since quitealotofrevs.

That's basically why my mental connection went "game runs fine, but loading saves doesn't work" -> probably something to do with misc_sl, which is the only saveload thing that's changed. But I guess with your explanation that seems unlikely as well. Hm.

Oh well. There's only so far you can get with a bit of trial & error ^^; Thanks for trying to help though :)


Top
   
PostPosted: Sat Apr 19, 2014 4:20 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7156
the startup crash may be because order of setting initalization has changed, so at certain points there may be places where daylength has a value of 0. might need to guard against that.

since it's an assert, you can also just leave it out. it has no effect on how the program works, it's just a reminder to developers about preconditions this part of the code assumes

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Sat Apr 19, 2014 5:27 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 17, 2008 12:17 pm
Posts: 2385
Location: Virgo Supercluster
That indeed did the trick. Thanks again, seems to work fine now :)


Top
   
PostPosted: Mon Apr 21, 2014 9:49 pm 
Offline
Engineer
Engineer

Joined: Fri Oct 11, 2013 11:20 pm
Posts: 16
Im sorry, but what did you do to fix the savegame crashes? Im having the same issue, and total noob!

Thanks


Top
   
PostPosted: Tue Apr 22, 2014 7:08 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 17, 2008 12:17 pm
Posts: 2385
Location: Virgo Supercluster
In date.cpp line 38 I commented out the assertion:
Quote:
// assert(fract < DAY_TICKS);

...might as well just delete that line.


Top
   
PostPosted: Tue Apr 22, 2014 1:47 pm 
Offline
Engineer
Engineer

Joined: Fri Oct 11, 2013 11:20 pm
Posts: 16
Ok, deleted the line but still the issue.

I started a new test game, saved using 8 daylength, closed openttd, launched again, loaded and crash :(

Code:
Error: Assertion failed at line 38 of /home/gabriel/openttd/src/date.cpp: fract < DAY_TICKS


Top
   
PostPosted: Tue Apr 22, 2014 5:10 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4671
Location: home
Deleting a line in the source code doesn't change the binary program, you'll have to compile the source code again.

Edit: Anyway, "assert" usually means that the condition should always hold, or something very bad will happen.
Deleting the assert line will of course remove the check and the crash, but one should normally also make sure that nothing bad will happen when you run into the territory of values where the check would have failed.
(in other words, you remove an assert only after verifying that doing so will not cause any problem)


Top
   
PostPosted: Tue Apr 22, 2014 5:33 pm 
Offline
Engineer
Engineer

Joined: Fri Oct 11, 2013 11:20 pm
Posts: 16
Oh, little mistake by me then hehe.

So ill now remove the line before compiling. Will also do my best on checking if it causes problems.

Thanks for helping a new guy !


Edit: Worked like a charm now!


Top
   
PostPosted: Sat May 03, 2014 6:07 am 
Offline
Engineer
Engineer

Joined: Sat May 03, 2014 5:59 am
Posts: 1
Uggggh. This is so Confusing.

I just want to play with slower days.

I only play with the FIRS Industry Set and the FISH Ship set.

I downloaded the executable from page 14 on this thread.

Opened it up and downloaded FIRS and the FISH set and the OpenSFX and OpenMSX from the available online content.

Now how do I choose the daylength?

*edit*

Eureka I found it.

Now for my next question.

Instead of using that e xecutable. Is there a simple guide on how to get the current official Version to use this "True" Daylength Patch? It's impossible trying to sift through all the info on the threads, takes far too much time. I'm sure theres like 10 steps to getting the patch to work with the current build.... Just need the steps and I can do it.... Please :D


Top
   
PostPosted: Sat May 03, 2014 7:52 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Sep 28, 2009 5:15 pm
Posts: 6180
Location: Eastern KY
No, there's no simple steps to applying a patch to a current version of OpenTTD. You will need some familiarity with programming and modifying source files. If you're lucky you may be able to just apply the patch without having to make modifications, but considering that OpenTTD is a constantly-changing project, it is likely going to be trial-and-error. Apply the patch, compile, wait for it to fail, take a note of the errors and fix them. With any luck you'll finally end up with a patch that is updated and works. Feel free to share the source code of the patch here, and if you need help with specific issues feel free to ask.

_________________
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Image

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | RoadTypes?


Top
   
PostPosted: Sat May 03, 2014 10:39 am 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7156
well, there are 3 "simple" steps.
  1. Install a compiling environment for your operating system as per http://wiki.openttd.org/Compiling and compile the unmodified version
  2. Compile a modified version of the revision the patch was originally written for
  3. update the patch in slower or faster steps.

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Fri Jul 18, 2014 3:42 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Sun Dec 03, 2006 1:22 pm
Posts: 473
Location: Czech Republic
Updated to current trunk. Problem only in save game version and game loop changed a bit.

edit: I noticed, that with this day length, I break the timetables. Updated patch included.


Attachments:
true_day_length_r26686.patch [8.01 KiB]
Downloaded 358 times

_________________
My patches: Day length (new concept), Conditional loading, Auto separation, Unload all adds Leave empty, Better statue placement (in trunk)
My abandoned patches: Speed limits for RVs, Day length (old concept)
Top
   
PostPosted: Sun Aug 03, 2014 9:12 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Apr 09, 2014 11:10 am
Posts: 262
Thankyou for this patch, it has made the game playable again, I had sometimes over 100 trucks for each factory and 12 track wide train lines in places, and it still was not enough to move everything, on a large map with 3 players the lag soon causes desyncs. Now I can move everything with a good number of vehicles and realistic layout because they can make more trips per month.


Top
   
PostPosted: Sun Aug 03, 2014 12:30 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7156
lag never ever causes desync.

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Sun Aug 03, 2014 1:06 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Apr 09, 2014 11:10 am
Posts: 262
server lags, stops sending data to clients, client connection times out, I don't know what else to call that other than desync, but that's besides the point. All I was trying to say was using this patch allows me to move the same amount of cargo with less vehicles, increasing my enjoyment of the game.


Top
   
PostPosted: Sun Aug 03, 2014 7:58 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7156
... calling a timeout a desync is like calling a derailment a plane crash....

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 385 posts ]  Go to page Previous 114 15 16 17 1820 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.