olleharstedt / civ-clicker

Fork of the open source game CivClicker, by David Holley, Scott A. Colcord and Luke Nickerson.
http://31.24.227.106/
GNU General Public License v3.0
0 stars 1 forks source link

Climate #7

Open olleharstedt opened 7 years ago

olleharstedt commented 7 years ago

Climate and weather.

Climate

Season

Depends a lot on where on earth you are.

Weather

Including temperature, day-night cycle, moon.

kierajreed commented 7 years ago

Climate

  • Draught (more sun than rain for multiple years)
  • Ice-age (lower temperature for multiple years)

My suggestion for this section is when someone starts a game you use RNG to determine the climate.

kierajreed commented 7 years ago

Seasons Depends a lot on where on earth you are.

  • Winter
  • Spring
  • Summer
  • Autumn
  • Rain season
  • Dry season

For this I suggest adding days. The way days would work is that 10 life minutes = 1 game day. This can be achieved by using setInterval(). Every day would increment a variable (lets say gameAge). Every 30 days would be 1 month* (this world is perfect). Every 3 months = 1 season (another variable, say gameSeason). Every 12 months (4 seasons, 360 days) would be 1 year (gameYears). Game age could be a statistic, as well as time played. Each season would have effects, but that's for later.

* Every month is a full moon, so wolves would have a higher chance to attack.

kierajreed commented 7 years ago

Weather Including temperature, day-night cycle, moon.

  • Rain
  • Sun
  • Snow
  • Storm

See above comment.

olleharstedt commented 7 years ago

OK, I need to explain the architecture a little bit. Do you know what events are, in a programming context? When something happens, one part of the code can send out a notification, and then other parts of the code can listen to it. It's also called the "observer pattern" or "publish-subscribe pattern".

So, there's one important event in civclicker2, called tick. It happens once each second, and a bunch of plugins listen to it, like the DayNightCycle plugin and Weather plugin.

olleharstedt commented 7 years ago

A lunar month is 28 days, by the way, so I think I'll use that number for the lunar cycle.

olleharstedt commented 7 years ago

Also, I would prefer that one year in game was approx 1 hour of real time, but that a complete day-night cycle is 1 minute. That leaves 60 day-night cycles for one year, so the calendar will be a bit skewed to make playing the game more interesting.

olleharstedt commented 7 years ago

So one lunar cycle might be 10 minutes, or 10 in-game days. That leaves two lunar cycles for each season, I guess (assuming a climate which have 4 seasons - that's very different in different regions).

kierajreed commented 7 years ago

I think your alternative timing is better, gameplay > realism.

olleharstedt commented 7 years ago

:+1: Great, then I will implement this system!

kierajreed commented 7 years ago

Hold on there mate! I have more things.

kierajreed commented 7 years ago

At the start of the game, pick a climate.

They will all have different effects, and it's up to you how to determine them. Tropical, Savannah, Rainforest have 2 seasons.

kierajreed commented 7 years ago
olleharstedt commented 7 years ago

You should have a look at this data: https://github.com/olleharstedt/civ-clicker/blob/stoneage/docs/agriculture.md

kierajreed commented 7 years ago

very interesting

kierajreed commented 7 years ago

Most early civilizations were Temperate or Tropical

kierajreed commented 7 years ago

How about weather first? It's much simpler. Update: Made semi-accurate weather sim here.

olleharstedt commented 7 years ago

For sure, I just wanted to point out the connection between climate and civilization.

kierajreed commented 7 years ago

Anyways, is the weather sim I linked good?

olleharstedt commented 7 years ago

Hm, which link?

kierajreed commented 7 years ago

https://jsfiddle.net/3c6ppeoj/

olleharstedt commented 7 years ago

I'll have a look!

olleharstedt commented 7 years ago

Looks good, but not different from my own code. :) Here: https://github.com/olleharstedt/civ-clicker/blob/stoneage/scripts/plugins/Weather.js#L42

olleharstedt commented 7 years ago

I'll try to setup test pages where we can see the stats of different weather configs.

kierajreed commented 7 years ago

Thanks. Also, mine is just a proof of concept and only outputs a sequence of raining or not.

olleharstedt commented 7 years ago

Yeah, but you nailed the most important aspect: That the probability of rain is dependent on if last day was rainy. It's modeled using a Markov chain in weather generation algorithms.

kierajreed commented 7 years ago

One thing, can you add the libraries + modules to my test script? Also, if we're doing ages, my fork will have the Silicon Age.

olleharstedt commented 7 years ago

I thought it would be nice to have a "clean" page where we only test weather parameters, but we can have both, I guess. :)

Silicon age, like space age? I've thought about that and I think it's a good idea. Didn't flesh out any specific concepts yet, though.

kierajreed commented 7 years ago

Well, I added some things already, such as the resources Silicate and Silicon; a building, Apartment; and finally an upgrade to unlock it all. If you want I can add you as a contributor on my fork.

kierajreed commented 7 years ago

This issue is getting long...

olleharstedt commented 7 years ago

Ah, OK! Cool!

No need to add me as contributor, but of course it would be nice if we could merge the two ages eventually, either in your fork or mine.

kierajreed commented 7 years ago

This is very long, I'm splitting weather and (possibly) ages into separate issues. This issue is now for climate related things only.

olleharstedt commented 7 years ago

Some guys on reddit are actually looking for projects to help with: https://www.reddit.com/r/incremental_games/comments/6w4rao/any_projects_need_an_extra_coder/

Let's see if someone new tags along. :)

kierajreed commented 7 years ago

Nice! We could use some help. Also, this issue is for climate. I'll make a general discussion issue for normal talk.