Commit Graph

112 Commits (3e625b5b1a81b00f774ca87b48d3e4f4e9d014c3)

Author SHA1 Message Date
Patric Stout 3e625b5b1a
Add: track savegame size to report with survey (#12304) 3 months ago
Patric Stout 0dfba564ab
Add: "restart current" console command to regenerate the map based on current settings (#11963) 4 months ago
Patric Stout a0c480c4e4
Change: "restart" now uses your newgame settings, where "reload" uses the current settings (#11962) 4 months ago
rubidium42 27082f9efa Codechange: pass std::string references to OpenBrowser 6 months ago
Patric Stout 7634553d22 Feature: opt-in survey when exiting a game
On first start-up, the game will ask if you want to participate
in our automated survey. You have to opt-in, and can easily opt-out
(via the Options) at any time.

When opt-in, whenever you exit a game, a JSON blob will be send
to the survey server hosted by OpenTTD. This JSON blob contains
information that gives a global picture of the game just played:
- What settings were used
- How many humans vs AIs
- How long the game has been played
- Basic information about the OS / CPU

All this information is kept very generic, so there is no
chance we send private information to our survey server.
Nothing in the JSON blob could identify you as a person; it
mostly tells about the game played. At any time you can see
what the JSON blob includes, by pressing the "Preview Survey
Results" button in-game.
1 year ago
Patric Stout f5fad88723
Change: base autosaves intervals on real time (instead of game time) (#10655)
There are two fundamental issues with autosave:
- When fast-forwarding, it saves way too often
- When paused, it never saves

Both makes no sense. Autosaves are meant to prevent you from
accidentally losing your work. The emphasis on "your" work.

To solve both issues, the autosave now works on real time. You
can select every 10 / 30 / 60 / 120 minutes, which are similar to
what the setting was in game-months.

When you pause, autosaving will stop. Unless you make any change
to the game; then it will continue to make autosaves, even so
the game is paused. Unpausing / pausing resets this mechanism.
1 year ago
Rubidium 4e65ec1dc4 Codechange: do not declare functions in blocks 1 year ago
Patric Stout c12a152ec9
Fix: thread safety issue during exiting the game (#9380)
_exit_game is read by the draw-thread to know when to exit, but
most of the time written by the game-thread.
3 years ago
rubidium42 05394d5216 Fix #6598: Prevent invalid memory accesses when abandoning a join from within a network game
One could join a network game from within an already running network game. This would call a NetworkDisconnect, but keeps the UI alive. If, during that process the join is aborted, e.g. by cancelling on a password dialog, you would still be in your network game but also get shown the server list.
Solve all the underlying problems by falling back to the main UI when (re)connecting to a(nother) server.
3 years ago
rubidium42 c4bccd4f70
Fix #8874: show a warning when a NewGRF scan is requested multiple times from the console (#9022) 3 years ago
Patric Stout 970fedd78c Add: make modal windows update more smooth
Basically, modal windows had their own thread-locking for what
drawing was possible. This is a bit nonsense now we have a
game-thread. And it makes much more sense to do things like
NewGRFScan and GenerateWorld in the game-thread, and not in a
thread next to the game-thread.

This commit changes that: it removes the threads for NewGRFScan
and GenerateWorld, and just runs the code in the game-thread.
On regular intervals it allows the draw-thread to do a tick,
which gives a much smoother look and feel.

It does slow down NewGRFScan and GenerateWorld ever so slightly
as it spends more time on drawing. But the slowdown is not
measureable on my machines (with 700+ NewGRFs / 4kx4k map and
a Debug build).

Running without a game-thread means NewGRFScan and GenerateWorld
are now blocking.
3 years ago
Patric Stout 760b0cdc11 Change: change console command "restart" and add "reload"
The current "restart" command is now called "reload", as that is
what it does.
The old "restart" command is now called "restart", as that is what
it did.

As this has not been in any official release yet, this shouldn't
harm any kitten.
3 years ago
Jonathan G Rennison 0c5dc5d41e Change: [Linkgraph] Pause the game when linkgraph jobs lag (#6470)
Check if the job is still running two date fract ticks before it is due
to join, and if so pause the game until its done.
When loading a game, check if the game would block immediately due to
a job which is scheduled to be joined within two date fract ticks,
and if so pause the game until its done.
This avoids the main thread being blocked on a thread join, which appears
to the user as if the game is unresponsive, as the UI does not repaint
and cannot be interacted with.
Show if pause is due to link graph job in status bar, update network
messages.
This does not apply for network clients.
3 years ago
Patric Stout c66bd18a10
Add: save openttd.cfg immediately on changing a setting (#8358)
Formally it was only done on exit. This means that if it crashes
changes in settings were not stored. This is often rather
frustrating. Additionally, targets (like emscripten) where people
are unlike to use "Exit Game", will never see their configuration
stored.

The drawback is that on every setting change there is some minor
I/O of writing the ini file to disk again.
4 years ago
Berbe 8f3d1ec970 Feature: Improve restart command
When the restart command is issued, a normal map is always spawned.

This improvement takes into account the current state of _file_to_saveload to check if a savegame/scenario/heightmap was previously loaded, and loads the same resource again.
4 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Charles Pigott 327ff89808 Codechange: Remove PauseModeByte 5 years ago
rubidium 5b2a5ac790 (svn r25506) -Document: a function, and name it slightly better 11 years ago
truebrain 55de5d336c (svn r23618) -Add: ScriptGame::Pause, ScriptGame::Unpause, and ScriptGame::GetLandscape (GameScript only) 13 years ago
rubidium b231e80125 (svn r23470) -Codechange: move declaration of SwitchToMode to a header instead of declaring it in 6 other files 13 years ago
rubidium 02b884d923 (svn r23244) -Feature: if the installation is ananas, try to get the b without b installed 13 years ago
planetmaker 3fb66890ee (svn r22708) -Feature [FS#4701]: Display option to hide competitors' signs and station names (Zuu) 13 years ago
alberth f1cae9960f (svn r22512) -Add: Save heightmap. 13 years ago
alberth c8cbc8ef97 (svn r22507) -Doc: Document SwitchMode. 13 years ago
alberth 990ec6f0a9 (svn r22460) -Doc: Semantic documentation fixes, and doxygen additions (partly by planetmaker). 13 years ago
planetmaker 914f8e9f1d (svn r22080) -Doc: Add doxygen comments to a few functions and improve a few existing comments 13 years ago
rubidium ec9e0690eb (svn r22014) -Codechange: move some more functions out of functions.h 14 years ago
rubidium 7eadf07e44 (svn r21894) -Cleanup: get rid of the unused SM_START_SCENARIO 14 years ago
rubidium 398418b8fa (svn r19812) -Codechange: give some unnamed enums a name or, in case they consisted of unrelated values use static const (u)int 14 years ago
smatz 53aaabe6e9 (svn r19507) -Codechange: remove semicolon after DECLARE_POSTFIX_INCREMENT and DECLARE_ENUM_AS_BIT_SET 14 years ago
rubidium 36a20894aa (svn r18141) -Fix (r18051): one couldn't (easily) continue a game in single player that was 'not enough players'/'waiting on join'-paused 15 years ago
rubidium 934e6a295d (svn r18051) -Codechange: make the active clients pause use a separate bit in the pause mode 15 years ago
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 15 years ago
rubidium ba4fd897b8 (svn r17097) -Fix [FS#3092] (r13256): make restart command work again and make the help show how it works and how it doesn't work 15 years ago
rubidium 65d4d8b46c (svn r16949) -Codechange: unify the way the DisplayOption enums are written 15 years ago
rubidium 2664f2a2d9 (svn r16242) -Codechange: rework pausing
-Fix [FS#2864]: autopause and manual pausing conflict with eachother
-Fix: new game + pause on new game + autopause make the game not unpause on the first join
15 years ago
yexo 3bb872e7dd (svn r15576) -Codechange: rename SwitchModes to SwitchMode and don't hardcode the values for that enum. 15 years ago
yexo 901230bde1 (svn r15575) -Codechange: Rename GameModes to GameMode and store _game_mode as GameMode instead of as byte. 15 years ago
rubidium 1ddfdda02c (svn r13370) -Codechange: move the VARDEF stuff from openttd.h to variables.h so one doesn't need to include openttd.h before variables.h. 16 years ago
rubidium 22d7b25296 (svn r13322) -Codechange: _no_scroll belongs more with the window code. 16 years ago
rubidium 34e2d8f1e1 (svn r13320) -Codechange: move some enums from openttd.h to more logical locations. 16 years ago
rubidium cd7c99452f (svn r12989) -Codechange: move ViewportSign to viewport_type.h. 16 years ago
rubidium 7ccda80b0b (svn r12986) -Codechange: move the landscape and transport related types from openttd.h to their own headers. 16 years ago
rubidium d03994098b (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description. 16 years ago
rubidium 8ca1035316 (svn r12939) -Codechange: do not use the window proc to determine whether a toolbar is a rail toolbar, but use the window number. 16 years ago
rubidium 161b588631 (svn r12784) -Codechange: handle the asynchronious save 'handlers' in saveload.cpp instead of openttd.cpp. 16 years ago
rubidium dde68e922a (svn r12779) -Codechange: remove a few constants from openttd.h. 16 years ago
rubidium 93d59fe448 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h. 16 years ago
rubidium f4d48f0e5b (svn r12474) -Codechange: split type related stuff from waypoints from waypoint.h (and openttd.h) to waypoint_type.h. 16 years ago
rubidium cdd5f90e64 (svn r12473) -Codechange: move EngineList to a more logical location. 16 years ago