Tech: Changing the year in the game

Use the wiki to refer to underlying game logic, modding techniques and as a technical reference.

Moderators: Veedub, Sean, RacerBG

Tech: Changing the year in the game

Postby Veedub » Mon Feb 25, 2019 12:20 pm

After analysing the internal game code, it appears that GPW uses an internal calendar to track the current date and what day of the week it is. A ten year calendar is generated on game start up, with days of the week (Mon-Sun), days in a month (01-28/29/30/31) and days in a year (001-365/366), including leap year logic, season start date and the number of days between race weekends (e.g. there were five weeks between round 15 and 16!)

Correct me if I'm wrong but as players we do not see evidence of date display or management during gameplay, so the code may be redundant and not actually used.

GPW Edit v1.1 allows you to change the game year. As part of this functionality, the start date in the game (8th March 1998) is updated appropriately to reflect the same Sunday of the new game year selected. Leap year logic is also updated to suit and to ensure that the correct day of the week is reflected in the years that follow.

One potential defect we may come across is that in 1998, there were only two leap years in a ten year calendar (2000 and 2004), which are currently calculated for in the internal game code. But if you were to choose a year like 2003 or 2004, there are three leap years (2004, 2008, 2012) in a ten year calendar. Unfortunately no calculation in the internal game code is performed on the third leap year, as far as days of the week are concerned (Mon-Sun). Which means that the day of the week will fall behind by a day in the third leap year (e.g. every Saturday in 2012 should in fact be a Sunday).

Given we only view a change in rounds rather than a change in days within the game, hopefully this issue will be non existant. :1smiley:

Number of days between rounds:
Code: Select all
variable_01 = 21;
variable_02 = 14;
variable_03 = 14;
variable_04 = 14;
variable_05 = 14;
variable_06 = 14;
variable_07 = 21;
variable_08 = 14;
variable_09 = 14;
variable_10 = 7;
variable_11 = 14;
variable_12 = 14;
variable_13 = 14;
variable_14 = 14;
variable_15 = 35;

Number of days in each month:
Code: Select all
variable_01 = 31;
variable_02 = 28;
variable_03 = 31;
variable_04 = 30;
variable_05 = 31;
variable_06 = 30;
variable_07 = 31;
variable_08 = 31;
variable_09 = 30;
variable_10 = 31;
variable_11 = 30;
variable_12 = 31;

EDITOR: GPW Edit v1.1 has the functionality to change the game year and will update all references to 1997, 1998, 1999 etc. to the appropriate year and handle changes to leap years and days of the week. All references to year values have been verified as game year code and not other code.
There is no limit to what a man can do so long as he does not care a straw who gets the credit for it.
Posts: 437
Joined: Sun Jun 02, 2013 12:09 am

Re: Tech: Changing the year in the game

Postby Ferrim » Tue Mar 05, 2019 11:59 am

Interesting stuff. Maybe at some point the design team wanted to move away from "turns", like in GPM and GPM2, towards a system based on actual days. But in the end they went back to the former logic.

This decision must have been taken early in the development, I guess - as you say, there's not even a hint of date management in the game. Which then brings the question of why did such code remain in place...?

Maybe the design and development of new parts does follow this calendar? Meaning that progress in the design phase would be twice as much when there are 4 weeks between races than when there are 2 weeks. This is difficult to check because progress depends on so many variables (number of staff, morale...), but maybe some comparison could be made using Italian GP -> Luxembourg GP (2 weeks), then Luxembourg GP -> Japanese GP (5 weeks).
Posts: 113
Joined: Mon Aug 12, 2013 10:52 am

Return to Wiki

Who is online

Users browsing this forum: No registered users and 1 guest