Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 3 4 [5]

Author Topic: Astrology (Blatantly Stolen from Neonivek)  (Read 7644 times)

Mel_Vixen

  • Bay Watcher
  • Hobby: accidently thread derailment
    • View Profile
Re: Astrology (Blatantly Stolen from Neonivek)
« Reply #60 on: January 23, 2010, 05:01:57 pm »


Does anyone here have good enough chops to build a CPU cheap astronomy model (it has to be able to run for the duration of worldgen) that could keep track of the movements of several planets across a backdrop of stars? We never did find anyone who could explain what needs to be done, last time this thread was awake.

Beyond that. Astrology. What do you think of it? What should it do?

Well actually it doesnt need to compute at runtime. Aslong we cant affect astro-objects in some way (like detonating it with 4 nukes - i hate that movie) you can compute periodics of allignment once pre-worldgen and save them as actual dates, periods from a certain start-date ( 0th day from WG) and/or Formulas + the increae/decrease of power of the effect before and after the event as some sort of Allignment-calendar. As long you dont take the non-radial movement of stuff into account millions of years and hundrets of stars fit into some kilobytes of memory. The calcs for the starpositions are cheap enought to be done once you hit "look" and a look into the alignment-calendar will give you the needed data for a prediction. 

Events that happen excactly once like Novas Meteors etc. dont need to have the sky calculated once again therefor you have to calculate the allingment effects a new.
« Last Edit: January 23, 2010, 05:18:09 pm by Heph »
Logged
[sarcasm] You know what? I love grammar Nazis! They give me that warm and fuzzy feeling. I am so ashamed of my bad english and that my first language is German. [/sarcasm]

Proud to be a Furry.

Felblood

  • Bay Watcher
  • No, you don't.
    • View Profile
Re: Astrology (Blatantly Stolen from Neonivek)
« Reply #61 on: January 23, 2010, 11:43:01 pm »

'Eh Heph, could you clarify that for me a little bit.

You want to put together a table of what times the planets will be aligned, and simply ignore the apparent movement of the planets through the starfield?

First of all, the vast majority of the calls will be made during worldgen anyway, so I don't see how we gain anything from calculating everything before worldgen and storing a table in memory. Just check the function as often as you would need a table entry, and discard the result when the date has passed. That way, you don't end up spending system resources on the parts of the almanac that never come.

I recognize that stars aren't a problem, as they are effectively fixed, but planets, their movements and their relative position to constellations are pretty important to most forms of astrology, and I don't see how pre-calculating their movements years in advance could possibly be economical.

Here's my counter proposal:

We build an almanac table of the cyclic events at the start of worldgen, and then calculate the non-cyclic stuff closer to the time when we need it.

We build a starfield, that is effectively a fixed formation of major stars and constellations, that scrolls across the sky each night. Only about 3/4 of it will be visible on a given night, and only about 1/2 at a given time. hHis is pretty much the precalculated almanac you suggested, but without alignments.

Because the starfield repeats consistently for the lifetime of the world, it's worthwhile to save it, instead of building it from a function.

It's the planets that make that a pain, so they could be plugged into the starfield at a later time.I suggest building a table of near future events, and adding to it at the start of every year or season. Old sections of the table can be discarded, after they are no longer useful.

In the event that somebody wants to make a prediction more than a few table segments in advance, we'll need to make some extra calculations at that time, but I think that's more reasonable than making all potential calculations and then storing the results, potentially for hundreds of worldgen years.

My reading (which wasn't terribly extensive) indicates that the movement of planets across the starfield takes a day or two to make a visible difference. This means that as far as star gazers are concerned, stars only move if you look at them on successive days. This means that no significant astrological event will take less than 24 hours, so we only have to plot the positions of the stars in the field once a day.

So, once for each day, we calculate the position of each planet, relative to the star field, and record that value. At that time, we also check to see if the planet is in proximity to any major stars or constellations, and record all the important events.

Since constellations are larger they should dominate a larger area. e.g. the planet doesn't need to be as close to have an effect.

This gives us most of the benefits of a precalculated table, but it scales more nicely, which is important when you have no idea how much data you're going to need for a given world.
Logged
The path through the wilderness is rarely direct. Reaching the destination is useless,
if you don't learn the lessons of the dessert.
--but you do have to keep walking.

Mel_Vixen

  • Bay Watcher
  • Hobby: accidently thread derailment
    • View Profile
Re: Astrology (Blatantly Stolen from Neonivek)
« Reply #62 on: January 24, 2010, 03:06:17 am »

Actually i want to compute all objects incl. stars, moons, planets etc. once. Since everything happens periodicly with periods ranging from once a month over once in a blue moon( every 2 or 3 years) to once every thousand years etc. You dont need to do the computing over and over again with the same numbers. You just compute the stuff once. This saves time with the same results. The WG-engine/astrologer can just check a file for the periods which peaks get near / for the periodics of a desired event. for combined (say 2 things at the sama time) events you multyply (?) just the periods of the events (the resultiong period you can store too).   

Even planets do periodical stuff. Wikipedia on venus transits illustrates that:

Quote
Transits of Venus are among the rarest of predictable astronomical  phenomena and currently occur in a pattern that repeats every 243 years,  with pairs of transits eight years apart separated by long gaps of  121.5 years and 105.5 years.

The file could look like this (simplified)for said venus transit:
Event            Startdate          period                         effect
event 10each 121.5 years love phere power+ 20%
event 2event 1after 8 yearslove phere power+ 5%

I know this isnt worked out entirely but schould do the trick. It also saves time since you only have to recalculate the starpositions once you hit look and not every day. The game itself has only to keep track of say the upcoming events of the next year. This means once a year the periods will checked and everything that happens this year gets written on -this was a very nice idea by the way- onto your near future events plan.

The problem with your plan by the way is that you have to look for eclipses, transists and cobined stuff every time you do the calculation for the positions (as i understand you you want to do this). Say with up to some hundret objects (a number of planets, moons, stars, meteorit swarms, comets) it could be to computing-heavy for a realtime calculation. Thought my method isnt much better either if we hit a certain not yet calculateable number of objects.

Doing the calculation before WG has also some other advatages. For example bugs are easyer to find and fix and you could insert a static Astrology-model (to skip all the procedural stuff) more easely for every world generation. This would mean too that (half) handwritten starmodels would be a bit more uncompilcated to add where the player can add stuff like "Zosins comet" (ref. to The Last Airbender) or other stuff.

Oh and you also know before the WG if Jupiter crashes into earth by 2012 -.-` so you can avaoid it with different numbers  .
 
edit: Damn no spellchecker on this laptop.
« Last Edit: January 24, 2010, 03:09:23 am by Heph »
Logged
[sarcasm] You know what? I love grammar Nazis! They give me that warm and fuzzy feeling. I am so ashamed of my bad english and that my first language is German. [/sarcasm]

Proud to be a Furry.
Pages: 1 ... 3 4 [5]