Giter VIP home page Giter VIP logo

fs17_seasons's Introduction

FS17 Seasons

Build Status

WARNING: You are looking at the DEVELOPMENT VERSION of the Seasons mod. To play Seasons, download at the Giants ModHub: https://farming-simulator.com/mod.php?mod_id=79288. The code here might break your savegame, and computer, and give a lot of pain.

WARNING: We do not officially support activating the Seasons mod on an existing savegame. Do this at your own risk. Read more about this in the F.A.Q.

Please do give feedback on Slack and post any issues you find!

Publishing

Only the Realismus Modding team is allowed to publish any of this code as a mod to any mod site, or file sharing site. The code is open for your own use, but give credit where due. Thus, when building your own version of Seasons, give a credit notice to Realismus Modding when publishing screenshots or images. This is not required when using the only official published mod by Realismis Modding, on Giants ModHub. It would be a nice gesture however.

Making videos of development version

We have a couple of rules regarding videos to keep both our and our players experience the best. You are allowed to make videos with Seasons, under a couple of simple conditions:

  • Do not share the GitHub link, if you are using a development version of the mod.

  • Do not explain how to install this mod. (The mod might also change at any moment, making your video outdated)

  • Give credit to 'Realismus Modding' as creators of the mod.

  • Link to our YouTube channel.

  • You do not need to put the mod name in the video title, but you can if you want.

  • Join us on Slack and tell us all about your awesome video.

Videos that are not holding to the rules will get a request for removal. If you have any questions about this policy you can ask them on Slack.

Forking the code

You are allowed to fork this repository, apply changes and use those for private use. You are not allowed to distribute these changes yourself. Please open a pull request to allow for merging back your adjustments. (See also 'Publishing')

Pull Requests

Please join us on Slack to discuss any changes you wish to make via pull requests, otherwise they are likely to be rejected, except for translations.

For map makers

For a better game experience, custom maps should add one new density layer: Seasons mask. See here for more information, or join our Slack.

Features

Seasons

  • Changeable season lengths. (For best results, restart the game / server after changing season length)
  • Plowable snow in the winter! Reduced tire friction when driving in snow.
  • Soil temperature is properly modelled using thermodynamic equations and historical data, which introduces interesting aspects like soil is frozen in the winter and sometimes in the first few days of spring, so you can't work on it
  • Changed the weather system to fit the seasons
    • Rainy in autumn
    • Sunny in summer
    • Snow and rain in winter.
  • Winters have longer nights than summers. In the winter it might be light only 8 hours while in summer it is near 17 hours.
  • Pedestrians do not spawn in the Winter.
  • When snow falls, tippers and shovels fill up. Put them in a shed (when the map has a snow mask) or activate the cover.
  • Snow will melt from tippers and shovels when it is not freezing outside.
  • Bunker Silo contents now take one third of a season to ferment.
  • Tree and bush textures will change with season and weather (trees drop their leaves when temperature becomes low etc.)

Weather forecast

  • 7 day weather forecast
  • Hail may occur unexpectedly

Crops

  • At the beginning of a new game, the mod will reset all fields to the harvested state. This is to simulate the fact that you just bought the farm and the fields haven't been worked since the last harvest.
  • Using the mod on an existing save game is not recommended. The mod will prompt if you wish to reset all fields in this situation.
  • Vanilla growth is completely disabled. The mod controls all growth of fruits.
  • Winter kills certain crops
  • Grass is knocked back to state 2 in the winter
  • Crop growth duration is much, much longer: for some crops more than half a year
  • Growth is adjusted to match real life life as much as possible - for example, crops will not grow if planted at the wrong time of the year
  • Winter and spring crops are possible now. Some crops can be planted in autumn (barley, wheat and canola) and in spring and will reach harvestable state by the summer. Some crops can only be planted at certain times of the year.
  • Growth is configurable and can be changed by map makers to suit their map
  • Germination of planted crops will only occur if the soil temperatures rise above the germination temperature.
  • Swaths will reduce over time.
  • Grass bales will rot and disappear after two days.
  • Hay and straw bales exposed to rain will start to rot so keep them inside (only when the map has a snow mask)
  • Wrapped bales needs time (one third of a season) to ferment before they are turned into silage
  • Wrapped hay will not ferment. Wrapped hay bales can be stored outside.
  • Treshing can only be done when moisture content of the crop is sufficiently low. After rain the crop needs time and sunny weather to dry. Moist summer nights can also occur.
  • Custom fruits are handled gracefully by using barley's growth patterns. Map makers can choose to modify the growth patterns of vanilla fruits and also make the mod aware of custom fruits by supplying custom growth patterns for them
  • Crops are only harvestable in the final growth state, except for poplar, oilseedradish, sugarbeet and potato. Min forage growth state has not been modified.
  • Once a non-root crop reaches the first harvestable stage according to the growth overview in the esc menu, it is ready to harvest. This is the final harvestable stage.
  • Using a tedder when crops are wet or when it is raining, leaves wet grass, not dry grass.
  • Growth and withering settings are disabled as this mod overwrites this functionality
  • The mod also controls the growth of planted trees. It takes 5 years for trees to be fully grown, harvestable after 2 years.
  • Trees inhibit the growth of other trees if they have been planted too close together. To restart the growth of the tree you will need to thin out the trees.

Vehicles and maintenance

  • Age in maintenance GUI is now days since last repair
  • New maintenance algorithm with repair, maintenance and taxes
  • Keep your machine clean to lower daily maintenance costs
  • Machine not used? Pay less
  • You can repair your vehicles at the vehicle workshop (placeable or on the map). It is more expensive at the dealer
  • If you don't maintain your vehicle, starting of the vehicle takes longer, and after a while it may be very hard to start it.
  • Motor start setting is disabled as this mod overwrites the functionality
  • You can borrow vehicles for a free demo as long as it is returned within the same day with less than 0.5 engine hours. This only works for base configuration vehicles

Economy

  • Loan cap is set to 80% of your total owned land + placeable buildings value with a minimum of 300,000
  • The interest has been adjusted to the new year length.
  • Prices of almost everything changes during a year, realistically.
  • You can't sell grass/hay/straw in an unbaled form. (Price is 0)
  • You can't sell wet grass bales (price is 0)
  • Income from missions is reduced to ~5x what a worker would earn if 100% of the time for a mission is used.
  • Field prices can be adjusted via the economy xml file using fieldPriceFactor. 1 = default prices. < 1 for cheaper fields and > 1 for more expensive fields. For example, setting this value to 0.5 will result in a price half of what it would be in the standard game

Helpers

  • Wages have been changed to fit the new economy.
  • Overtime, before 6AM and after 6PM or on the weekends, pays 150%

Animals

  • Animals have been adjusted to the seasons
    • They drink more water in summer than in winter
    • They need more straw in winter than in summer
    • They only give birth to offspring at certain times of year. Sheep in spring, pigs in spring and autumn, cows in summer
    • Milk and wool production depend on season (Wool only in spring and summer, milk spread, mostly in winter and spring)
  • Animals die when they have no food. (Disabled on 'Easy')
  • Max feeding capacity is lowered to 3 days

Warnings for gameplay

  • Do not fast forward faster than 6000x on singleplayer (preferable even slower)
  • Do not fast forward faster than 1200x on multiplayer (120x is even better)
  • The game will get out of sync with the extra load of Seasons
  • The released version of this mod does not work with save games created using any previous versions. Delete the old version and start a new save game.

Mod conflicts

Do not load multiple map mods. Only load the map you are using!

  • Any mod that manipulates the weather, e.g. Multi overlay hud
  • Any mod that manipulates growth
  • Any mod that changes animals
  • Any 'season manager' type mods
  • Some animal cleaning mods may not work correctly, especially during the winter

Contributing

You are free to contribute any code. But by doing this you transfer your copyright to the Realismus Modding team so that we can publish this mod and change the code. Only we are allowed to publish Seasons.

Please follow the following code formatting rules:

  • End your lines with \n (LF), not CRLF
  • Use spaces, not tabs

Copyright

Copyright (c) 2016-2017 Realismus Modding All rights reserved.

This copyright does not impugn any trademarks or copyrights owned by Giants

Warranty disclaimer. You agree that you are using the software solely at your own risk. Realismus Modding provides the software “as is” and without warranty of any kind, and Realismus Modding for itself and its publishers and licensors hereby disclaims all express or implied warranties, including without limitation warranties of merchantability, fitness for a particular purpose, performance, accuracy, reliability, and non-infringement.

The Terms and Conditions of GIANTS Software GmbH also apply.

Informal explanation

An informal explanation of what this all means (this part is not legalese and can't be treated as such)

Realismus Modding (we) wrote the Mod and we have the copyright on this Mod. That means the code is ours and we can do with it what we want. It also means you can't just copy our code and use it for your own projects. Only we can distribute the Mod to others. We allow you to make small changes for your own gameplay or with your friends. But you are not allowed to publish these changes openly. When you make a contribution (translations, code changes) you give that code to us. Otherwise we would not be able to publish this Mod anymore. If you lose your savegame or if your computer crashes due to our Mod, you can tell us and we will attempt to fix the mod but we will not be paying for a new computer nor getting your savegame back. (Make backups!)

fs17_seasons's People

Contributors

akuenzi avatar anonymous-any avatar balebaron avatar blaggy-0 avatar demers94 avatar drewcz avatar dzi4d3k avatar farmer1602 avatar fcelsa avatar gonimy-vetrom avatar gorgona2 avatar ian898 avatar joshvzeyl avatar joskuijpers avatar kitt3000 avatar laxz avatar leifege640 avatar mayhem17 avatar mrbear avatar n0tr3ady avatar promgames avatar r87x avatar reallogger avatar stijnwop avatar theseb1979 avatar turbostar190 avatar tykonket avatar vanquish081 avatar wieselflinked avatar zed636 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fs17_seasons's Issues

[GM] Crop Cycles and Season Length

Posting as myself until Akuenzi has an account.

Akuenzi: We're working on this crop growth thing at the moment. Right now it sets the growth cycle ONCE for all crops. Is there any reason we couldn't set this mod up to change the growth cycles during the game? With a counter of some type thrown in there, it seems like a way could be found to get the grass to grow at the right times... or the growth times could even be elongated over the designated 'winter' time, and then be adjusted when spring hits.

Something should likely be built in to notify the player as to which season they are in at any given time. I suppose it could even be linked up with a 'real' year if you wanted. Maybe a 'day' in Farming Sim could be treated the same as 1 week in real life? That'd be 52 days for a complete cycle. The specific day could even be chosen at random within a particular week to make it look more 'normal.' And the crops could be timed with it...

[economy] Reduce worker wages

Need to consider the effect this will have on the game's economy. If a player cannot sow and harvest all in one day and with the addition of long crop growth cycles, this will make the game unplayable without cheating in my opinion. I have tried figuring out how to reduce the AI worker wages and I cannot do it. It's all in AIVehicle specialization.

self.pricePerMS = Utils.getNoNil(getXMLFloat(self.xmlFile, "vehicle.ai.pricePerHour"), 2000)/60/60/1000;

https://gdn.giants-software.com/documentation_scripting.php?version=script&category=70&class=1546#load21532

Normally you would overwrite that, but I have no idea how to do this in Lua/FS and I am not sure if it's possible. It may not be, since there are no mods that do it. I have spent time trying to figure this out and I am none the wiser.

Remove magic values when creating swaths

Function: loadmap(name)
File: fixFruit.lua

Need to access the straw swath type properly, instead of assuming it's always 30
Need to remove hard coded value of 6 for windrowLiterPerSqm

[WM] Weather Manager initial implementation

What I see is in the weatherManager class we will have a day changed listener

g_currentMission.environment:addDayChangeListener(ssWeatherManager)
then we implement function ssWeatherManager:dayChanged()
in this function we check the day and get the season
and manipulate upcoming temperatures appropriately
in the deleteMap function we can save the weather state
in the loadMap function we create the initial weather appropriate to the season, if it’s a new save game that does not have our manipulated weather (edited)
otherwise we load our mainpulated weather into g_currentMission.weatherTemperatures tables and g_currentMission.environment.rains
dayChanged will be called automatically by the game because it is a call back function to an event that is triggered by the game engine
whenever the day changes

initially going to just use tables of temperatures appropriate for the season and use them randomly. You guys can then tell me how to implement your special temperatures

But I want to create the initial implementation and test it because I am not entirely certain how the engine regenerates the weather so need to play around with it

it seems to add stuff to the weather tables at the end of each day

[visual] Time management

Hi,

I am working on the Time class, that will update the day/night cycle according to the time of the year.
In winter there will be longer nights, and in summer longer days.

Will see if I can actually change the settings and make it have effect.

[WM] Weather manipulation

Akuenzi: Messing around with visual effects to show seasons - Seb: I see this as a low priority for now (FP: Low)

Akuenzi: Maybe it's impractical to have snow fall... but it might be possible to make things feel a bit more chilly by changing the background. Maybe even the temperatures could be messed with to make them appear more accurate. Seb: Will need to dive into the game to see if we can manipulate the temperatures and rain probability. Higher priority than visual effects (FP: Medium)

This should probably be split out into two cards. One for the visual effects and one for weather manipulation (temperature + chance of rain).

Grass Disappears

grass foliage layer disappears when loading saved game after adding mod to mods folder

Add support for non-standard environment configurations

If a map has changed its environment, we completely ignore it.
There is two ways we could fix this:

  1. Ask the map maker to make a script that works with Seasons to update the environment
  2. Use the xyz values form the environment file while using the time values from our own system. Will only work if they only changed the xyz(w) values.

[WF] Change how buildforecast works for performance improvements

BuildForecast now calls getWeatherStateForDay, so it's iterating within a loop from another loop. The loops are tiny, so performance considerations are small, but we can still look at fixing this in the future.

Perhaps the entire forecast only needs to be built once when the mod loads. Then, when the forecast is refreshing at midnight, it only needs to remove the first element from the table and add one more day to the end of the table.

So, build it for days 2 to 8 (configurable via foreCastLength, of course) and then the next day, remove day 2 forecast and add day 9 forecast without rebuilding everything in between.

g_currentMission.environment.weatherTemperaturesNight and g_currentMission.environment.weatherTemperaturesDay are updated at the end of each day by the game engine. Not sure how often environment.rains is updated.

Implement straw swaths for soybean and canola

I’ve added a straw swath to canola and it’s dropping onto the ground from the harvester. I can pick it up. But the animation of it coming out of the harvester is missing. The swath just appears after the harvester, which looks quite disconcerting. Further investigation is required.

Class prefixes

Maybe we should be using prefixes so that classes will nog collide with other mods.

Something like: ssTime, (ss = SeasonS), ssWeatherForecast. Also name the files this.

Translation ready

Hi guys,

I know that you are working hard and this is very alpha progress but how about making it translation ready from beginning instead of hardcoding text.
I realize that this is low priority as English is wide know, but I just want to trow idea.

[GM] Implement config load and save

ssGrowthManager.firstTimeload needs to be in a config file. It has to be true initially when the mod / map loads for the very first time. This will enable GM to reset all the crops on the map. Once it's done this the setting needs to be set to false and saved to a config file. The next time the save game loads, GM needs to read this value (it should be false) and not do a reset of the crops.

Todo list

I know, it is duplicate, but I really like a list where I can see how far we are.

  • Settings
  • Calculate season stuff
  • Adjust day/night length #23
  • Disable working on land in winter #10
  • Disable missions in winter
  • Apply new weather system
  • New maintenance system #9
    • Repair when near shop
    • Change maintenance costs
    • Up the sell price
    • (Change the lease pricing)
  • Adjust wages of hired workers
  • Add localisation
  • Up the height of the loan cap and interest
  • Settings GUI
    • Fix missions - Adjust the useFieldMission field daily.
    • Fix missions - Set some state value of the fieldDefs so the game is confused and does not do stuff when it shouldnt
    • Set season length
  • Wither crops in winter #28
  • Make it all work in multiplayer
  • Allow changing the season length
  • Growth Manager canPlantData GUI
    • Improve growth simulation to take into account cut and wither
    • Build GUI and link with canPlantData
    • Implement months
  • Growth Manager
    • Implement check if saveGame exists and seasons is new, then ask if growth should be reset
    • Fix fertilising issue
    • Performance Improvements #51
    • Config load and save #49
    • Use growthStateChanged #50
    • Move growthData to an XML file #53
    • Allow growthData to be loaded from map mod. If none, then use growth.xml
    • Improve mod map growthData loading - not full xml file
    • Impact on normal trees #54
    • Changes required for missions based on what can be planted
    • Implement removeUngerminatedSeedsBeforeGrowth - only on > easy difficulty
    • Refactor to use mrbear's improved scanner and helper function #55
    • Double check growth for potatoes/sugarbeet - potential issues
    • Add default growth data for non standard fruits #52
  • FoliageLayer replacements for modmaps.
  • Object visibility be season for modmaps.
  • Fix multiplayer
  • Change animals feed and manure to be season length based
  • Implement seasonLengthChanged listener
  • Read weather data from custom maps
  • Art assets needed
    • Finish the set of replacement Art assets for winter season.
    • Icon for Snow filltype
    • Particle system for Snow
    • Texture for snowmask areas in editor
    • Autumn textures for Poplar (Tree)
    • Winter textures for Oak, Maple and Popplar (Tree)
    • Improved winter LOD texture for Birch
    • Mod icon
  • WM
    • get hail back in
    • longer fog in the wet seasons

[GM] Modify to use growthStageChanged

For testing purposes GM currently advances the crop transition stage by one every time you press K. This needs to be hooked up properly with growthStageChanged

WF - rework the implementation so that the forecast is only built once per day

This depends on how we implement displaying the weather forecast info, but we need to consider the performance implications of a mod. It is pointless to be recalculating values that don't change often. Need to change this once we have implemented the weather forecast display, so that it only rebuilds once per day. I am not entirely sure when the game engine refreshes g_CurrentMission.environment.rains, but it is set up for more than 7 days ahead, so there is no need to be doing it more often than once per day.

[SM] Wrong machinery working in the wrong season

When you try to harvest during rain, a message appears that you cannot do it. I see a simple implementation similar to that. Detect what the player is doing and then prevent the action. A more complicated solution: allow the player to do it, and make crops fail. This will be heavily dependent on how we implement the crop cycle / growth length, so should be parked for now.

[WF] Create an overlay to display weather forecast and season

This should be an overlay which is displayed on the screen. Possibly above the vehicle hud, or below the time hud. If it's below the time hud, then it will conflict with the Livestock manager mod.

But, looking at livestock manager, it adds itself into g_currentMission, so we can check for its presence and move the hud down, if necessary.

Multiplayer support

  • Animals (no need, is static values or based on season)
  • Debug (no need)
  • Economy
    • Player stuff only on server side?
    • Send ssLoan to clients
  • FixFruit (??? does this do anything?)
  • GrowthManager (unknown, has yet to be implemented)
  • Lang (no need)
  • Repairable
    • Add read/writeStream
    • Test if barriers are needed
    • Will need a repair event, that updates the properties of the vehicle on all clients
  • Replace Visual (no need. Non-random, depends only on current season -> seasonutil)
  • Intro
    • Assuming the seasonChanged code does not niet an isClient barrier
    • Question remains when to show it: can't be a 'dont show again' server wide. Only admin should be able to do that?
  • Mod (done, nothign seems to change during time, expect listeners and they are based per peer)
  • Util (latestSeason is used for the listener callbacks (on all peers),
    • Add read/writeStream with values that change from savegame
    • Warning, the statistical functions must only be called on the server, because of their random nature
  • XML (no need, is utilities)
  • Snow
    • Disable calcultions on client: density is managed by server+vanilla
  • Storage (no need, is utilities)
  • Time
    • Share latitude
    • verify when the readStream is done, and if it requires an adaptTime() call
  • Vehicle
    • Does not store anything
  • WeatherForecast (client side only)
    • Controls
  • Weather Manager

Plowable snow

I'm trying to implement snow using terrainDetailHeight or tipAnyware in the Season Manager framework.

The idea is to add one layer of snow for each unique hale by usning an hourly listner. So every hour if it's snowing and was not snowing the hour before we add a layer. Do we have hales outside of the winter period that should not add snow?

When spring comes all snow is cleared.

The actual update will be done in the update function using a doAddSnow flag and X, Z coordinates doing 1/n x 1/n of the map at a time. Initialy I test with 1/10 of the mapsize.

Snow will only be added where there is not already material tipped. Further I would suggest that we use a mask layer that the map maker can add to the map to keep show out of the sheds. If the mask layer is not present we add snow every ware, let pretend it have been blowing so it ended up in the sheds as well. I cant come up with a reasonable way to automatically mask the call to addDensityMaskedParallelogram depending on weather there is a building above or not.

[economy] Reduce daily maintenance costs

Sticking with the theme of economy and the impact of this mod, we should aim to reduce vehicle daily maintenance costs. The repairVehicles mod is an excellent example of what can be done. Ideally, in my opinion, there should be no daily maintenance cost, only a service every x amount of hours.

g_currentMission

After much struggling I've finally managed to get a dump out from g_currentMission and it's now part of the project for reference. One thing that is missing from the g_currentMission dump is the functions. Need to try and work on this some more.

It's not in the friendliest format, but it's workable.

The first table marked as {1} shows the top level data.

So if we look down the list we can see, for example, environment.

["environment"]={13},

Now search for {13}

You will find this

-- Table: {13}
table: 0x01ccb889c300{
   ["lightTimer"]=4807.3099722862,
   ["nightEnd"]=330,
   ["minRainDuration"]=10800000,
   ["weatherChangeListeners"]={218},
   ["realHourTimer"]=2548060.1929288,
   ["dustGeometry"]=4370,
   ["rainFadeDuration"]=1800000,
   ["water"]=19490,
   ["sunLightId"]=5895,
   ["dayNightCycle"]=true,
   ["needsLights"]=false,
   ["isSunOn"]=true,
   ["currentHour"]=8,
   ["ambientCurve"]={219},
   ["sunHeightAngle"]=-1.221730476396,
   ["autoRain"]=true,
   ["minuteChangeListeners"]={220},
   ["nightStart"]=1260,
   ["sunRotCurve"]={221},
   ["groundWetness"]=0,
   ["dustRootNode"]=4371,
   ["rainForecastDays"]=15,
   ["dayTime"]=30423051.163517,
   ["rainFadeCurve"]={222},
   ["atmosphericRainTypesWeighted"]={223},
   ["timeUpdateTime"]=4810.807071209,
   ["dustDensityCurve"]={224},
   ["timeUpdateInterval"]=60000,
   ["volumeFogCurve"]={225},
   ["lastRainScale"]=0,
   ["rainFogColor"]={226},
   ["minRainInterval"]=345600000,
   ["lastWindFactor"]=0.29657309212685,
   ["maxRainInterval"]=691200000,
   ["maxRainDuration"]=25200000,
   ["currentDay"]=1,
   ["timeSinceLastRain"]=10000105.08018,
   ["skyDayTimeEnd"]=68400000,
   ["weatherTemperaturesNight"]={227},
   ["firstTimeRun"]=true,
   ["weatherForecastDays"]=14,
   ["skyDayTimeStart"]=21600000,
   ["rains"]={228},
   ["allowRain"]=true,
   ["hourChangeListeners"]={229},
   ["rainTypeIdToType"]={230},
   ["rainTypes"]={231},
   ["weatherTemperaturesDay"]={232},
   ["skyId"]=4353,
   ["dayLength"]=86400000,
   ["rainTypesWeighted"]={233},
   ["realHourLength"]=3600000,
   ["currentMinute"]=27,
   ["skyRootId"]=4352,
   ["sunColorCurve"]={234},
   ["realHourChangeListeners"]={235},
   ["dayChangeListeners"]={236},
   ["xmlFilename"]="data/maps/map01_environment.xml",
   ["lightUpdateInterval"]=10000,
   ["skyCurve"]={237},
   ["distanceFogCurve"]={238},
},

Quite a few interesting things here, like weatherTemperaturesDay {232} and weatherTemperaturesNight {227}. If you look into {232} you will find this

-- Table: {232}
table: 0x01ccb889c300{
   21,
   23,
   25,
   13,
   27,
   19,
   18,
   19,
   24,
   24,
   17,
   23,
   15,
   27,
},

In theory we can change those based on the season and it should show up as colder temperatures. However, I am not sure if these temperatures are changing dynamically based on something like weatherChangeListeners.

Another thing that I've been thinking about is the progression of time. This will be pretty easy because we can dig out the game day, which starts at 1 and increases at midnight (I've tested it)

self:debugPrint("Current day: " .. g_currentMission.environment.currentDay);

If we were to say that day 1 = first day of autumn, or summer, or spring, or whatever arbitrary unit of time we agree on, then we can simply check the day as the game is progressing and force crop growth and other variables to do what we want.

The key thing is to decide what a game day is in real life terms. You mentioned one day to equate to a week. I think that would make things a bit too complex, because some months have different numbers of weeks. I am trying to keep this simple to work out, if possible. In other words, I don't see the need to worry about a time unit as small as a week, because the progression of crops and tasks would not normally change from one week to the next, unless the next week was in the next season. So, I was thinking that perhaps, to keep things simple, 10 days could be a season. Once 10 days have passed, we progress to the next season. This could mean that days 1 to 10 are autumn, 11 to 20 are winter, 21 to 30 are spring, 31 to 40 are summer and 41 to 50 are again autumn. This makes it a lot simpler to work out the season based on the current day. The 10 days per season could be a configurable parameter, so that people can set the season length to whatever they want.

[GM] Add default growth data for non-standard fruits

Top level check is :

if self.growthData[self.currentGrowthTransitionPeriod][fruitName] ~= nil then

when iterating through g_currentMission.fruits.

If a fruit is encountered that isn't in the table, it won't be considered for growth. Need to add a [default] growth pattern that can deal with those fruits. Obviously still have to exclude stuff like dryGrass.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.