Cataclysm-dda: Initial Day option unintentially affects food rot and monster evolution

Created on 4 May 2019  路  6Comments  路  Source: CleverRaven/Cataclysm-DDA

Describe the bug
When creating a new world and heading to the World Options menu, the Initial Day setting is intended to allow the player to start the game at any day throughout the year. The setting also states, "This does not advance food rot or monster evolution." When changing the value, it will actually advance food rot and evolution, depending on what value you set. If you set the value to around 100, child zombie variants and other unique zombies will spawn, at its maximum, you could be facing Hulks, Predators, and Juggernauts in the same street.

To Reproduce
Steps to reproduce the behavior:

  1. Make a new world without mods.
  2. Change the value in the Initial Day setting to anything over 100 for noticeable results.
  3. Start a new game with the default survivor and scenario.
  4. Go to any city and notice rotten food and more zombie variants.

Expected behavior
Initial Day should do what its designed to do, have zero impact to evolution scaling and food rot.
There is already a setting called Spawn Delay which advances time before the player is spawned.

Versions and configuration:

  • OS: Windows 10
  • Game Version: 0.D-2500-g64898d6
  • Graphics version: Tiles
  • Mods loaded: Dark Days Ahead
(S4 - Invalid) <Bug> Items / Item Actions / Item Qualities Monsters Time / Turns / Duration / Date

All 6 comments

I can't reproduce this on the current master.

Relevant line (I think) is 4244 in item.cpp. calendar::start sounds wrong, but according to #31953 it is correct, and it certainly seems to work.

right now calendar::time_of_cataclysm is essentially the zero-point of the game's simulation, and not actually related to when the cataclysm itself occurred. That honor goes to calendar::start, which is also not super clear by name alone.

I don't know if this is the right place to talk about this, but I have spent the evening trying to work out a fix because this problem still exists (and is more prolific now that the starting day is Day 30)

31953 fixes monster evolution, but items still rot as if they were created on Spring 1, but not always. This is because (as far as my testing shows) there are lots of calls of map::place_items that have the sixth argument (time of creation) set to '0' (e.g. line 243 of map_extras.cpp) . Some don't, so that means sometimes you will have perishable goods when you set Initial Day to 999.

I've managed to make a short and hacky solution by adding the following to line 201 of item.cpp:

    if( bday == calendar::turn_zero ) {
        bday = calendar::start_of_cataclysm;
    }

This basically means that if an item is designated to be created on Spring 1 (for any reason), it will instead be created at the start of the cataclysm instead.

A proper solution would involve going through all of the calls to place_items and replace all instances where the sixth argument is '0' with calendar::start_of_cataclysm .

I have only just managed to work out how to build my own local copy of cataclysm and make the necessary code changes, and don't have the skill or time to make this fix, astyle everything, and test everything, so someone else can take the prestige of doing the actual hard work.

33345 and #33714 should have the items rotting correctly with start date.

Is this now fixed?

Yep jut tested, advanced initial day setting, monster evolution and food rot is now not advancing too. due to the aforementioned 3 fixes.

Was this page helpful?
0 / 5 - 0 ratings