Modable Time

Started by Vas, February 26, 2016, 12:49:02 AM

Previous topic - Next topic

Vas

I would like to be able to mod time easily.  To change how long the game days are in ticks, to change how long the game months are individually including adding a leap year.  The idea is that Tynan rewrite the GenDate.cs file to something similar to what you see in Version 3 below, and then the game reads the XML file (not exactly like the 3 I provided, I know there should be more stuff there but I only provided bare minimum examples) to figure out what the months will be in the game and how long each month is with other changeable stuff.

In this C# & XML, you can;

  • Change starting year.
  • Change hours per day.
  • Change ticks per hour.
  • Add or remove months.
  • Specify a specific amount of days in each individual month.
  • Rename months.
  • Enable leap years.
  • Specify which months have a leap day.
  • Specify how often a leap year occurs.
EDIT: Updated with better examples.
With Haplo's help and someone who doesn't even know what the game is telling me what things mean in C# and providing other help as well, I've been able to put together a few things.  Some won't work, but I will show anyway to show the progress of the idea as it was being made.  I really hope that this can become a part of Alpha 13.

The C# stuff:
http://pastebin.com/MFp7n3kP Version 1 of GenDate.cs (excluding other data) (File expires in 1 month) (Possibly functional, but inefficient)
http://pastebin.com/0v17SMB6 Version 2 of GenDate.cs (excluding other data) (File expires in 1 month) (Also non-functional)
http://pastebin.com/wyqQPD8H Version 3 of GenDate.cs (excluding other data) (Does not expire)

The XML stuff: (all of these work off Version 3)
Earth Time: http://pastebin.com/xHvK4Ldp (1 month expiry)
A12 Time: http://pastebin.com/1iqL8rru (1 month expiry)
New Planet: http://pastebin.com/bsgFVeMT (1 month expiry)
Click to see my steam. I'm a lazy modder who takes long breaks and everyone seems to hate.

Fluffy (l2032)

#1
but... why? It seems like needless complexity without gameplay, and it's forcing earth years onto a planet that isn't earth?

if you were to go and do something like this, I think a more generic approach where you could for example randomise the length of days and the number of days per season would be simpler, and bring some actual gameplay elements. A world that has days that last only 6 hours, but has a hundred days in a year would be pretty cool. As would a 'polar' world, where a day lasts months, but there's only a couple of days in a year - that would have some real gameplay implications.

Edit: OP has since massively edited the opening post, so this response is pretty nonsensical now.

Vas

Fluffy, when did I say forcing earth years? This is an example of the file that you could alter.  I typed up an example, not using real game stats.

And I want this so I can alter the game to be longer in terms of days per year, something closer to realism.  The planet's distance from a star is directly related to how many days per year it has, and I'm using earth time for this calculation.  Since the game uses 24 hours per day and uses 60 minutes per hour still, it fits.  The closer a planet is to a star, the hotter the planet becomes.  It does not matter how dim the star is, the dimmer it is, the closer you have to be in order to have that orbit because in all likelyhood, its mass is also less.

I think this would be a good addition to the game, so other players can make custom mods based on different timelines in the game with different planets even.  Making their days longer or shorter.  More hours or less hours per day.  More days or less days per month.  Whatever they want for their particular mod.  This isn't going to be the game's default settings, what I typed.  It'll be whatever the game currently is.  Which is something I can't say because reasons.
Click to see my steam. I'm a lazy modder who takes long breaks and everyone seems to hate.

Wivex

Most of the date\time related data is hardcoded.

public static class GenDate
{
public const int TicksPerRealSecond = 60;
public const int TicksPerDay = 30000;
public const int HoursPerDay = 24;

public const int DaysPerMonth = 10;
public const int MonthsPerYear = 12;
public const float SecondsPerTickAsFractionOfDay = 2f;
public const int TicksPerMonth = 300000;
public const int TicksPerYear = 3600000;
public const int DaysPerYear = 120;
public const int TicksPerHour = 1250;
public const int DefaultStartingYear = 5500;
                ...

Fluffy (l2032)

@wivex, it's a suggestion - presumable these constants could be refactored into def-dependent settings. But yeah, modding it is going to be tricky.

@vas; I understand that. What I'm saying is that I feel you're focusing on too much detail in the wrong places. I don't see a particular need for individual month lengths, but having variable days/seaons would be more interesting to me. I don't particularly care about whether it makes sense physics-wise, but you could still get a pretty good approximation with simpler settings. Of course, that's also just a suggestion.


RemingtonRyder

I think it makes sense to move away from a traditional Earth-based calendar.  While it is familiar, there is an expectation that there will be a few weeks in each month, but in Alpha 12 for example there are just 10 days per month.

For the hell of it, you could have moddable name banks for these. So if you wanted to use, for example, Elder Scrolls names for the passage of time, you could do that.

If you wanted to get really particular, then your RimWorld could be a moon in an inclined orbit around a Jupiter-like planet. So when you get an eclipse, it would be a planetary eclipse rather than a lunar eclipse. I don't know how long those last in such circumstances, but it's possible that this wouldn't result in a mini-winter.

Vas

#6
This won't happen any time soon.
If someone is willing to try and make this work in a mod, please do.  Contact me if you want more info about the ideas I had for this.
Click to see my steam. I'm a lazy modder who takes long breaks and everyone seems to hate.