Open TTD ending year

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
User avatar
Muxy
Engineer
Engineer
Posts: 80
Joined: 05 Oct 2008 17:06
Location: Goulp, FR
Contact:

Open TTD ending year

Post by Muxy »

Hello,

before creating a new bug in flyspray, i would like to have some information about Open TTD ending year.

in 0.6.3 release this code is responsible for checking the end of the game :

Code: Select all

	/* check if we reached end of the game */
	if (_cur_year == _patches.ending_year) {
			ShowEndGameChart();
in 0.7.0, there is no more ending_year patch :

Code: Select all

	/* check if we reached end of the game */
	if (_cur_year == ORIGINAL_END_YEAR) {
		ShowEndGameChart();
may be i missed something, but where ?
Pourquoi faire simple quand on peut faire compliqué ?
KISS - Keep It Simple, Stupid.
Open TTD Goulp Web Service
OpenTTD Goulp Web Forum
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: Open TTD ending year

Post by Alberth »

IIRC The ending year was less flexible than anticipated due to broken layout in the window that appears when you reach the end-year.

As a result, the setting was pulled out:

Code: Select all

$ hg log -r 10500
changeset:   10500:cb5a0f145d06     
user:        rubidium               
date:        Sun Dec 28 16:09:58 2008 +0000
summary:     (svn r14755) -Codechange: remove ending year as it can't be changed anyways.
I don't know what kind of bug you are considering to report, but reporting the lack of the setting as bug is useless, as it was a decision made by the devs to remove it.
User avatar
Muxy
Engineer
Engineer
Posts: 80
Joined: 05 Oct 2008 17:06
Location: Goulp, FR
Contact:

Re: Open TTD ending year

Post by Muxy »

Thanks for the changelog information.

But in my 4 servers, i changed the value in the openttd.cfg, and the score appears at the end of year set.

So i would like to have this patch back please.
Pourquoi faire simple quand on peut faire compliqué ?
KISS - Keep It Simple, Stupid.
Open TTD Goulp Web Service
OpenTTD Goulp Web Forum
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Open TTD ending year

Post by Bilbo »

That end game chart annoyed me today. I was running some AI experiments, I put few AI's in the map, then I walked away from the computer. Guess what ... I returned after few hours to check results and the score chart was shown, the game being paused for long time of course .....

Some feature "Do not show that damned stupid scorechart once the end year is reached" would be nice.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Mizipzor
Engineer
Engineer
Posts: 23
Joined: 17 Jan 2006 12:09

Re: Open TTD ending year

Post by Mizipzor »

Muxy wrote:Thanks for the changelog information.

But in my 4 servers, i changed the value in the openttd.cfg, and the score appears at the end of year set.

So i would like to have this patch back please.
Well, you have obviously already hunted down the exact line that toggles the behaviour you want. Changing it back seems trivial?
Or do you want a change on the trunk? Do you want every player to play the way you do? Since the ones in charge of the "main version" of the code made a decision, I doubt that will happen.
But thats the beauty of open source! Here, everyone except you can actually be wrong. And youre not hindered by the others stupid decisions. :D
User avatar
Muxy
Engineer
Engineer
Posts: 80
Joined: 05 Oct 2008 17:06
Location: Goulp, FR
Contact:

Re: Open TTD ending year

Post by Muxy »

Mizipzor wrote:Changing it back seems trivial?
Let'say it does not, i have other solutions to detect an end of game and start a new game.
The problem with this functionnal deletion is that you will have a score chart screen appearing ALWAYS at the end of 2050, even if you want to play and stop later.
Mizipzor wrote:Do you want every player to play the way you do
That's not the point, I want the players connected on the Open TTD Goulp servers have an evaluation at the end of the game only. If I want a network game starting at starting_year and ending at ending_year it's my choice. And if players come to the Open TTD Goulp Servers they agree with that config. And also i decided also for these network games to have a "not like every body" config (map size, no aircraft, no 90 turn...). People are playing on Open TTD Goulp Servers and dont complain.

This a strange beahvior thinking that everybody using Open TTD will use it the regular way : playing alone with some AI's. Sometime, i use it this way, but i also have 4 dedicated servers with their own config.

So i think i would be better to have better config around this score chart screen.

Code: Select all

If dev's agreed {
      they will do it, and everyone will be happy
} else {
      i will do it myself, of course, and i dont care about people complaining against that score chart screen appearing at the end of 2050
}
Pourquoi faire simple quand on peut faire compliqué ?
KISS - Keep It Simple, Stupid.
Open TTD Goulp Web Service
OpenTTD Goulp Web Forum
Mizipzor
Engineer
Engineer
Posts: 23
Joined: 17 Jan 2006 12:09

Re: Open TTD ending year

Post by Mizipzor »

If you just revert that first line you posted, does the game work as you want? If so, I wonder why it was pulled out. "Cant be changed anyways" sounds a little vague, or was it the ShowEndGameChart() that couldnt handle any other year?

Ive been looking for a small project to get a better understanding of the code, this may be something fitting. :)
Neuralize
Engineer
Engineer
Posts: 17
Joined: 20 Jan 2009 04:28

Re: Open TTD ending year

Post by Neuralize »

I just got this working, pretty sweet considering I know very little about coding. Here is the diff, if anyone else wants to patch their game, I can post an exe too..
Attachments
ending_year.patch
(5.75 KiB) Downloaded 225 times
Neuralize
Engineer
Engineer
Posts: 17
Joined: 20 Jan 2009 04:28

Re: Open TTD ending year

Post by Neuralize »

Is anyone interested in helping me clean this up and getting it back into the game?
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Open TTD ending year

Post by Zuu »

Quickly reading your patch I didn't see anything that would need to be cleaned up. But you might know some things that does? Check that you have all spaces/tabs correctly and submit the patch to bugs.openttd.org as a "patch". Wait for comments and answer them when they come but most important, be patient. Eventually it might get committed.

And with being patient I mean that you should not be surprised if it takes months before the code gets committed. Yet posting it to bugs.openttd.org will increase the chances of having it committed as bugs.openttd.org is the tool that the devs uses to keep track of bugs/patches. Here at the forums things easily get lost.


Which reminds me that at some point I probably should post my filter sign list patch to bugs.openttd.org. :)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 13 guests