New savegame revision

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
pasky
OpenTTD Developer
OpenTTD Developer
Posts: 90
Joined: 25 Apr 2004 15:14
Location: Czech Republic
Contact:

New savegame revision

Post by pasky »

This topic aims to collect all things we need to change in the new savegame revision. Feel free to edit.
  • Change all the dates from 16bit to 32bit (applies even to the points above) (optional - this will take a lot of work so do that only if someone will volunteer to do it, but please do not block the revision bump by this if it would take too long)
Please add yours. This topic should be periodically editted and purged as new savegame revisions are rolled out..

-----

Note that a more liberal policy has been adopted lately and we just bump the revision number whenever necessary. Therefore this topic has been deemed obsolete and I'm unstickying it.
Last edited by pasky on 01 Apr 2005 12:24, edited 3 times in total.
The flush toilet is the basis of Western civilization. -- Alan Coult
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Post by SHADOW-XIII »

just curious, you are going to use the same variable for waypoints and stations ? (byte stat_id) [or variable name] wouldn't be better to change it to byte wayp_id :?:
what are you looking at? it's a signature!
pasky
OpenTTD Developer
OpenTTD Developer
Posts: 90
Joined: 25 Apr 2004 15:14
Location: Czech Republic
Contact:

Post by pasky »

class_id+stat_id is for custom stations graphics - it contains id of the particular custom station definition in a particular class. However for checkpoints the class_id is always 'WAYP' so there's no need to save it.
The flush toilet is the basis of Western civilization. -- Alan Coult
User avatar
charlieg
Transport Coordinator
Transport Coordinator
Posts: 323
Joined: 08 Oct 2003 14:07
Contact:

Post by charlieg »

Will the next release be compatable with existing OpenTTD (ie <= 0.3.2.1) save games?
Open source tycoon games
--
Free Gamer - open source and Free Software games
FreeGameDev forums - open source game development community
User avatar
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

Savegame versions are always downward compatible. But you won't be able to load the new savegames into an old version of OpenTTD, of course.
"There's a readme that comes with the source. I suggest you read it."
- Korenn
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

  • Save 'pause' field in savegames too. Needed for multiplayer to function correctly.
I think this is the easiest way to communicate the saved-game state of a game to the other players.

May I also urge the implementation of the savegame revision bump? Pasky cannot continue his work, and I keep getting bug reports about airports :(
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
pasky
OpenTTD Developer
OpenTTD Developer
Posts: 90
Joined: 25 Apr 2004 15:14
Location: Czech Republic
Contact:

Post by pasky »

The new revision was finally done by ludde, so I updated the master topic and removed the items which got implemented there. I'll also make the topic sticky so that it can serve for future generations as well.
The flush toilet is the basis of Western civilization. -- Alan Coult
User avatar
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

****, now i'm too late. Another byte value for each player would be nice: cheats. So we can trace what cheats were used (up to 8 cheats possible).
"There's a readme that comes with the source. I suggest you read it."
- Korenn
User avatar
orudge
Administrator
Administrator
Posts: 25134
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Post by orudge »

Somewhere to store the bribe attempts and whether the players are locked out of the Local Authority window too would be a good thing, in the next saved game revision - I never implemented this to be saved in the game, but it should, really.
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

Store an additional difficulty setting (town council's attitude towards area restructuring). This is an int at the end of the GameOptions struct.

This needs to be kinda hacked in like st->airport_flags, since it increases the GameOptions struct by an int. Until then, patch cannot be added, since it will screw loading games. When done, please apply patch [ 987498 ] Extra Dynamite Fixes etc.


And also we can remove alpha-order from the savegame since it's not used anymore
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
User avatar
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

We need a is_active variable in the Player struct. Currently the name of the company is used to determine if this company does exist. If (name_1!=0) the company exists. That's not only ugly, it also results in two serious bugs: I can do all the other adjustments once is_active is stored in the savegame.
"There's a readme that comes with the source. I suggest you read it."
- Korenn
User avatar
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

I've taken the liberty to bump the savegame format to version 4, after getting my patch approved from two people. These are the changes:
  • Store the _cheat struct to remember if a cheat has been used before.
  • Store failed bribe attempts so that saving/loading game won't reset them.
  • Store an additional difficulty setting (town council's attitude towards area restructuring). This is an int at the end of the GameOptions struct.
  • Remove alpha_order from stations since it's obsolete.
  • Store _pause (mainly for multiplayer)
  • Add is_active to Player struct.
"There's a readme that comes with the source. I suggest you read it."
- Korenn
User avatar
hAmpzter
Engineer
Engineer
Posts: 41
Joined: 17 Jul 2004 15:04
Location: Sweden
Contact:

For revision 5

Post by hAmpzter »

I would want
  • Add exclusive_rights to City-struct
  • Add exclusive_rights_owner to City-struct
  • Remove blocked_months from Station-struck as it will become obsolete
As I plan to move the exclusive-rights from the stations and to the city for better control.
And if I can't save the information in the save-file it would be rather useless!
Working on the patch right now!
matthijs
Engineer
Engineer
Posts: 76
Joined: 25 Jun 2004 15:20
Location: Enschede, Netherlands
Contact:

Post by matthijs »

Add uint16 arrived_at_station to Vehicle struct. This is needed for the fifo loading patch I am working on (It's kinda done already, I'll upload it to SF soon, only still needs the savegame part).

Matthijs
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 10 guests