Author Topic: Perihelion initial year  (Read 9605 times)

0 Members and 1 Guest are viewing this topic.

Offline scient

Perihelion initial year
« on: March 08, 2013, 07:16:19 PM »
I was talking to Guv in IRC about this earlier but thought I'd post in here.  According to manual, this event is suppose to occur 80 years.

Quote
Once every 80 years, as Alpha Centauri B reaches perihelion (its closest
approach to Alpha Centauri A), it generates enough heat to increase Planet’s
average temperature by 0.3° C.

There are also a number of references to this fact in Prima strategy guide.  However, this is how game works for following script.txt events.

Quote
#PERIHELION
#xs 440
#caption Chief Planetologist
Hercules (Alpha Centauri B) is approaching perihelion!
For the next 20 years, we expect native life activity to
increase dramatically.

1. check if current_turn_number is greater than 50 ; so minimum for this to pass in normal game is 2051
2. if ((mission_start_year + current_turn_number - 2190) % 80) == 0 ; mission_start_year is defined in alphax as 2100 under "normal starting year"

So it triggers with turn 90, 170, 250, ... (+80) are first three but it will continue on. This means that 2190 will be the first year it can be triggered.

Quote
#PERIHELIONENDS
#xs 440
#caption Chief Planetologist
Hercules has receded from perihelion. Native life activity
should return to normal levels.

1. check if #PERIHELION game state flag is active
2. if ((mission_start_year + current_turn_number - 2210) % 80) == 0

So the first time this triggers is on turn 110 which is 20 "years" after event started.

...

The logic for this is correct except for the initial year.  In this case, the Planet took 90 years to get close to Alpha Centauri A and then after that the cycle becomes 80 years.  So, either this is bug or perhaps game balance?  If it were to be changed, it would mean that mind worm activity would increase 10 turns earlier then it currently does.

Thoughts?
« Last Edit: March 18, 2013, 10:57:17 AM by sisko »

Online Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49271
  • €440
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: Perihelion initial year
« Reply #1 on: March 08, 2013, 07:28:14 PM »
Well, the story is important in AC, so a fix to the internal logic makes sense...

Offline scient

Re: Perihelion initial year
« Reply #2 on: March 08, 2013, 08:11:52 PM »
Yah, I agree.  It could of been typo/mistake and weight is towards having it always be 80.  By 80 turns, I don't think starting perihelion is going to make much difference 10 turns earlier.  And having it out of sync 90 then rest being 80 is odd.  Unless someone puts up some kind of objection, I'm leaning toward correcting it to start at 2180.  Just a matter of modifying the constant subtraction values.
« Last Edit: March 08, 2013, 09:07:19 PM by scient »

Offline Yitzi

Re: Perihelion initial year
« Reply #3 on: March 08, 2013, 09:13:34 PM »
Even if it's 80, wouldn't that mean that the first 20 years should be perihelion years?

Offline Guv’ner

Re: Perihelion initial year
« Reply #4 on: March 08, 2013, 09:29:59 PM »
It’s easier to think of it as a perihelion starts every 80 years and each one lasts 20. So there is a sixty year gap between perihelions. That should be clear as mud.

The 50 year exclusion is, presumably, to give players a chance to get established. It does create an issue of the missing first perihelion though, unless the first one starts in 2150-2160.

I can rewrite the script and datalinks to imply the first perihelion is being predicted or is only now having an effect, but moving it to 2150ish would be a more elegant solution.

Offline scient

Re: Perihelion initial year
« Reply #5 on: March 08, 2013, 11:27:52 PM »
Ah, maybe I wasn't clear enough.  Excluding the initial starting point which is abnormal from logic, it works like this.

80 years -> outside perihelion range
20 years -> inside perihelion range (perihelion toggle active)
80 years -> outside perihelion range
20 years -> inside perihelion range (perihelion toggle active)
...

So it's a cycle of 100 years, 20 of which are where it's closest to Alpha Centauri B triggering Perihelion event.  Then it takes another 80 years to get back to this point again.


@Yitzi: The way I'm thinking with it starting in 2180 is that it would mean that Perihelion "trigged" in 2080 and ended in 2100 just as you land (perfect timing!).  I can't think of how to logically explain why Perihelion starts in 2190, 90 years after last time, but then every other cycle is 80 years.  I guess the only way would be if the first 10 years of game starting, Perihelion is active.  But if that was case, everyone would prob die from mindworms.  The way it currently is just seems  inconsistent.
« Last Edit: March 09, 2013, 12:59:56 AM by scient »

Offline Lord Avalon

Re: Perihelion initial year
« Reply #6 on: March 09, 2013, 12:18:09 AM »
Hey, scient! :waves:


Manual p.213 says: "Alpha Centauri A and B have ... one of the quickest revolutions (80 years) of all binary stars.  (Period of 79.91 +/- 0.011 yrs per Wikipedia.)  So in actuality it seems to me it should be 20 yrs near, 60 far, as Guv'ner said.


Maybe it was changed for gameplay, but a 100-yr cycle is wrong.


I like the idea of a random start in 2151-60.
Your agonizer, please.

Offline Guv’ner

Re: Perihelion initial year
« Reply #7 on: March 09, 2013, 12:27:11 AM »
I decided to update the perihelion entry in the datalinks because it looked easy. Then I realised the first event is skipped, and I wasn't sure whether "every 80 years" meant started every 80 years, or there was an 80 years gap between perihelions. Lord Avalon pointed out what the intention was; question is, can it be fixed through code by Scient or does it require a lot of creative writing to explain what actually happens.

I favour rewriting script.txt, the datalinks, and redoing the manual from scratch with all new artwork from Buster. But that's just because I've got lots of free time at the moment and can't do anything on the code front.

Offline scient

Re: Perihelion initial year
« Reply #8 on: March 09, 2013, 01:06:36 AM »
Hey Lord Avalon! It's been awhile.  :D

Ok, 20 near and 60 far makes sense.  And actually, that's what code is doing.  My initial post about game logic is correct.  Juggling a lot of stuff so my follow up is incorrect.  So based on current logic the dates work as follows:

2110 - start (ignored)
2130 - end (ignored)
2190 - start
2210 - end
2270 - start
2290 - end
2350 - start
...

Having it start that early wouldn't be good from gameplay stand point however it leaves you with cycle being inconsistent for initial value.  I think a better solution would be to assume that 2100 is ending period for one of cycles and then have it start 2160.  That means it will start 30 years earlier than it currently does however I don't see that as a problem.  By 60 turns you should be able to defend against mind worms.  New dates would be as follows:

end - 2100
start - 2160
end - 2180
start - 2240
...

Does this seem like a good solution?  Modifying constant values to adjust date is simple enough.

Offline Guv’ner

Re: Perihelion initial year
« Reply #9 on: March 09, 2013, 01:10:36 AM »
Well that certainly has my vote. If this is a voting type thing; if not, I’ll differ to the largest hat as usual.

Offline Lord Avalon

Re: Perihelion initial year
« Reply #10 on: March 09, 2013, 02:51:51 AM »
I like my random idea, but I guess I could live with 2160.
Your agonizer, please.

Offline Guv’ner

Re: Perihelion initial year
« Reply #11 on: March 09, 2013, 04:49:21 PM »
Random does appeal but I think it’s a coding issue

Offline scient

Re: Perihelion initial year
« Reply #12 on: March 09, 2013, 05:27:46 PM »
I've modified it to start in 2160 now.  I like the random idea too, it makes it more variable but it does require some more coding work.  I'd need to create new random variable that gets generated at start of new game.  Then I'd add this value to all calculations in actual Perihelion code.  I can't just do this on execution of perihelion otherwise you'd end up with every instance of perihelion being randomish.  My understanding is that it should be fixed once you decide on start date.

It's something I could look into in the future, I want to try and get out an update as soon as possible.  Unlike last few times where I got sidetracked then ended up never posting work I've done few years ago.  I like the idea to because it adds a bit of variability to game play rather than knowing start date be it 2160 or 2190.
« Last Edit: March 09, 2013, 05:43:13 PM by scient »

Offline Lord Avalon

Re: Perihelion initial year
« Reply #13 on: March 09, 2013, 05:59:12 PM »
Variability is just a nice to have; wouldn't want it to prevent you from getting your update out.

Is there a latest bug fix only version, which includes everybody's fixes (if there are such from others besides scient [which off the top of my head I don't recall right now])?
Your agonizer, please.

Offline scient

Re: Perihelion initial year
« Reply #14 on: March 09, 2013, 07:15:57 PM »
This is off topic, but I spoke to ete about this.  Both kyrub and Yitzi use my 1.0 patched exe as base for their patches.  I'm not sure if there are any other projects that have popped up since I was last active?  There is a plugin for installer I'm using that lets you create small file with different changes between exe versions.  So, idea was that for future releases of their patches could be rolled in as component of unofficial patch installer.  That way you'd have option to apply AI or other changes forked from my bug fixes.  It would be up to them if they want to do this.  Otherwise, I can provide some C++ source code to make small CLI utility with ability to apply patches on top of my updated exe's.

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

I maintain nonetheless that yin-yang dualism can be overcome. With sufficient enlightenment we can give substance to any distinction: mind without body, north without south, pleasure without pain. Remember, enlightenment is a function of willpower, not of physical strength.
~Chairman Sheng-ji Yang 'Essays on Mind and Matter'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 40.

[Show Queries]