<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://manicpop.org/gewiki/index.php?action=history&amp;feed=atom&amp;title=Planetary_update_cycle</id>
	<title>Planetary update cycle - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://manicpop.org/gewiki/index.php?action=history&amp;feed=atom&amp;title=Planetary_update_cycle"/>
	<link rel="alternate" type="text/html" href="https://manicpop.org/gewiki/index.php?title=Planetary_update_cycle&amp;action=history"/>
	<updated>2026-10-20T14:42:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://manicpop.org/gewiki/index.php?title=Planetary_update_cycle&amp;diff=2164&amp;oldid=prev</id>
		<title>CodexBot: Link Btrieve explanation at first mention</title>
		<link rel="alternate" type="text/html" href="https://manicpop.org/gewiki/index.php?title=Planetary_update_cycle&amp;diff=2164&amp;oldid=prev"/>
		<updated>2026-10-18T17:54:11Z</updated>

		<summary type="html">&lt;p&gt;Link Btrieve explanation at first mention&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Planetary update cycles&amp;#039;&amp;#039;&amp;#039; decide &amp;#039;&amp;#039;when&amp;#039;&amp;#039; a planet record is visited and how many production passes are due. The scheduled routine is &amp;lt;code&amp;gt;plartia()&amp;lt;/code&amp;gt; in the 16-bit [[Source code|source]]; the 5.x &amp;lt;code&amp;gt;plarti()&amp;lt;/code&amp;gt; and 6.x &amp;lt;code&amp;gt;pplarti()&amp;lt;/code&amp;gt; callbacks forward to it. The 32-bit implementation is named &amp;lt;code&amp;gt;plarti()&amp;lt;/code&amp;gt;. When a colony is due, the routine calls &amp;lt;code&amp;gt;multiply()&amp;lt;/code&amp;gt;; [[Planetary production]] explains what that one economic pass does. Neither visiting a planet nor scanning it immediately runs a production pass.&lt;br /&gt;
&lt;br /&gt;
== Classic GE: a continuous database sweep ==&lt;br /&gt;
Classic [[MajorBBS integration|MajorBBS]] schedules the next &amp;lt;code&amp;gt;plartia()&amp;lt;/code&amp;gt; callback after a variable &amp;lt;code&amp;gt;plantime&amp;lt;/code&amp;gt; delay. The &amp;lt;code&amp;gt;PLANTOCK&amp;lt;/code&amp;gt; setting specifies the target duration, in minutes, for &amp;#039;&amp;#039;one complete sweep&amp;#039;&amp;#039; of the database; its distributed value of 360 minutes aims for roughly four sweeps a day. It is not a per-planet timer or a guarantee of four updates on each calendar day.&lt;br /&gt;
&lt;br /&gt;
The routine stores a [[Btrieve]] cursor position in memory and advances through the shared sector, planet, and wormhole file. Each invocation examines up to 20 records while seeking its next planet. A callback that finds no planet may therefore do no economic work. A populated planet with an owner is passed to &amp;lt;code&amp;gt;multiply()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;check_spy()&amp;lt;/code&amp;gt;; empty or unowned planets are skipped. [[Zygor]] and [[Tahanian Station]] also receive special stock resets when their records are encountered, after any applicable ordinary planet processing. See their pages for the resulting classic behavior.&lt;br /&gt;
&lt;br /&gt;
At the end of the file, classic measures approximately how long the sweep took from the number of callbacks and the current delay. It recalculates &amp;lt;code&amp;gt;plantime&amp;lt;/code&amp;gt; to bring the &amp;#039;&amp;#039;next&amp;#039;&amp;#039; sweep closer to &amp;lt;code&amp;gt;PLANTOCK&amp;lt;/code&amp;gt;, but will not schedule callbacks less than three seconds apart. The cursor then starts over immediately. This feedback cannot enforce an exact number of passes: a planet may be reached three or five times in a day, and the work of walking sector and wormhole records increases as the galaxy is explored. A restart loses the in-memory cursor and timing history; downtime is neither recorded nor replayed. See [[Classic bug: Skipped planetary updates]] for the failure modes and examples.&lt;br /&gt;
&lt;br /&gt;
== ge-next: named daily passes ==&lt;br /&gt;
[[ge-next]] 0.2 replaced the continuous-sweep target with &amp;lt;code&amp;gt;PLANUPD&amp;lt;/code&amp;gt;, the desired number of passes per day (four by default; the setting allows 1–15). The scheduler walks the planet portion of the database index rather than scanning ordinary sector and wormhole records. It seeks an owned planet with men or troops, or one of the neutral-zone planets, and processes at most one selected planet per callback. It can inspect up to 25 records while looking for the next eligible one. At the end of a pass, it adjusts &amp;lt;code&amp;gt;plantime&amp;lt;/code&amp;gt; to aim for the remaining passes to fit within 23 hours, leaving some margin before the day ends. Once the configured passes are complete, it stops applying further production passes that day rather than starting an extra sweep.&lt;br /&gt;
&lt;br /&gt;
[[Zygor]], [[Tahanian Station]], and the [[Enforcer Planet]] take dedicated update paths. Ordinary eligible colonies call &amp;lt;code&amp;gt;multiply()&amp;lt;/code&amp;gt; for production and &amp;lt;code&amp;gt;check_spy()&amp;lt;/code&amp;gt; for spies. This separates special market restocking from colony food, population, tax, and revolt processing; it also avoids classic&amp;#039;s first-update starvation problem at Zygor. The scheduler still records progress on the special planets, but they do not run ordinary colony production.&lt;br /&gt;
&lt;br /&gt;
== Timestamps, restart, and catch-up ==&lt;br /&gt;
Every ge-next planet record carries a 32-bit &amp;lt;code&amp;gt;timestamp&amp;lt;/code&amp;gt; combining the current game-day number in its upper bits with the pass number in its low four bits. Those four bits can hold the supported 1–15 daily passes. After a planet is processed, its day and pass are written to the database. A restarted or interrupted sweep may encounter the same record again, but the stored marker prevents it from receiving the same production pass twice.&lt;br /&gt;
&lt;br /&gt;
Zygor&amp;#039;s record additionally saves the global scheduler&amp;#039;s current day/pass marker and calibrated callback interval. On startup, ge-next reads those values to resume today&amp;#039;s work if applicable. If no useful interval has been saved, it estimates one from the current record count. A correction in ge-next 0.2.2 clears a stale saved interval after a day in which even the first pass failed to complete; otherwise rapid early database growth could leave the first pass too slow ever to reach its recalibration point.&lt;br /&gt;
&lt;br /&gt;
If an ordinary planet&amp;#039;s timestamp shows that it missed passes during an interruption or downtime, the scheduler calculates the number due and calls &amp;lt;code&amp;gt;multiply()&amp;lt;/code&amp;gt; repeatedly. This catch-up is limited to recent history: planets behind within the previous seven days can replay missed passes, whereas older records receive one update instead of an unbounded backlog. Intermediate replays suppress repetitive player mail; the final pass may send its normal reports. The timestamp is a record of completed passes, not a promise that all missed work happens immediately when the BBS starts: the scheduler still has to reach that planet&amp;#039;s record.&lt;br /&gt;
&lt;br /&gt;
== What this means in play ==&lt;br /&gt;
A newly claimed colony will not produce goods until the scheduler reaches it. A change to its work allocation, tax, food stock, or bank affects the next pass that &amp;lt;code&amp;gt;multiply()&amp;lt;/code&amp;gt; applies; it does not instantly recalculate existing inventory. After downtime, ge-next may apply several due passes together, so population and stock can change in a burst. Classic instead resumes sweeping from the beginning without knowing which planets were already visited. For the output, food, bank, tax, and revolt calculations within each pass, see [[Planetary production]].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Planetary production]] and [[Colonizing planets]]&lt;br /&gt;
* [[Game timing]] and [[Game execution flow]]&lt;br /&gt;
* [[Classic bug: Skipped planetary updates]]&lt;br /&gt;
* [[Zygor]] and [[Tahanian Station]]&lt;br /&gt;
&lt;br /&gt;
{{GE navigation}}&lt;br /&gt;
[[Category:Planets]]&lt;br /&gt;
[[Category:Game reference]]&lt;/div&gt;</summary>
		<author><name>CodexBot</name></author>
	</entry>
</feed>