<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Game Guide Notes]]></title><description><![CDATA[Game Guide Notes]]></description><link>https://gameguidenotes.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Dec 2026 23:05:53 GMT</lastBuildDate><atom:link href="https://gameguidenotes.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[See which pages ChatGPT reads, with a Cloudflare Worker and D1]]></title><description><![CDATA[Analytics shows people who click through from ChatGPT. It doesn't show whether ChatGPT read your page in the first place, because crawlers don't run…]]></description><link>https://gameguidenotes.hashnode.dev/see-which-pages-chatgpt-reads-with-a-cloudflare-worker-and-d1</link><guid isPermaLink="true">https://gameguidenotes.hashnode.dev/see-which-pages-chatgpt-reads-with-a-cloudflare-worker-and-d1</guid><category><![CDATA[cloudflare]]></category><category><![CDATA[webdev]]></category><category><![CDATA[SEO]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Alex Reed]]></dc:creator><pubDate>Tue, 24 Nov 2026 15:23:09 GMT</pubDate><content:encoded><![CDATA[<p>Analytics shows people who click through from ChatGPT. It doesn't show whether ChatGPT read your page in the first place, because crawlers don't run JavaScript.</p>
<p>My sites run on Cloudflare Workers, so every request goes through my code anyway. Counting crawlers there took about a hundred lines.</p>
<h2>One table</h2>
<pre><code class="language-sql">CREATE TABLE crawl_daily (
  day TEXT, path TEXT, bot TEXT, status TEXT, hits INTEGER,
  PRIMARY KEY (day, path, bot, status)
);
</code></pre>
<p>One row per day, page, crawler and status. No IPs, no user-agent strings, nothing about people. Each crawler request bumps a counter:</p>
<pre><code class="language-js">const UPSERT = `INSERT INTO crawl_daily (day, path, bot, status, hits)
  VALUES (?1, ?2, ?3, ?4, 1)
  ON CONFLICT (day, path, bot, status) DO UPDATE SET hits = hits + 1`;
</code></pre>
<h2>Which crawlers</h2>
<p>Only ones whose vendor documents the user-agent token. A few things I learned reading those docs:</p>
<ul>
<li>OpenAI has three. <code>ChatGPT-User</code> means someone asked ChatGPT and it opened your page. <code>OAI-SearchBot</code> builds the search index. <code>GPTBot</code> is for training.</li>
<li><code>Google-Extended</code> never appears in a request. It's a robots.txt switch, nothing more.</li>
<li>If I couldn't open a vendor's docs page, I left that crawler out.</li>
</ul>
<p>Matching is a lowercase substring check. User agents are easy to fake, so every number really means "requests claiming to be X". Good enough for spotting patterns.</p>
<h2>Don't slow anything down</h2>
<p>Only page URLs count, plus <code>robots.txt</code>, <code>sitemap.xml</code> and <code>llms.txt</code>. The write happens after the response with <code>ctx.waitUntil</code>, and it can't throw:</p>
<pre><code class="language-js">export default {
  async fetch(request, env, ctx) {
    const response = await respond(request, env, new URL(request.url));
    recordCrawl(request, new URL(request.url), response.status, env, ctx);
    return response;
  },
};
</code></pre>
<h2>What it showed</h2>
<p>Within a day it paid off. I'd published a batch of pages that were only in the sitemap, with no links from anywhere else. <code>OAI-SearchBot</code> and <code>bingbot</code> hadn't fetched a single one, while happily crawling everything they could reach through links. So I linked the new pages from the home page and related guides.</p>
<p>I also watch the gap between fetches and visits. ChatGPT opening a page a lot while few people arrive from chatgpt.com is a different problem from never being read at all.</p>
<p>Cost is one D1 write per crawler page view. Nothing for people.</p>
<p>If you play the heist game ROB RUN, my player wiki for it is <a href="https://robrunwiki.net/">ROB RUN Wiki</a>.</p>
<p><em>Originally published on <a href="https://dev.to/robrunwiki/see-which-pages-chatgpt-reads-with-a-cloudflare-worker-and-d1-297h">DEV</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[A game map in MapLibre, and share links in 7 characters]]></title><description><![CDATA[I'm building a fan map of Leonida, the state in GTA 6. About 3,700 places, drawn with MapLibre GL. MapLibre wants real longitude and latitude. A game world…]]></description><link>https://gameguidenotes.hashnode.dev/a-game-map-in-maplibre-and-share-links-in-7-characters</link><guid isPermaLink="true">https://gameguidenotes.hashnode.dev/a-game-map-in-maplibre-and-share-links-in-7-characters</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[webdev]]></category><category><![CDATA[maplibre]]></category><category><![CDATA[GameDev]]></category><dc:creator><![CDATA[Alex Reed]]></dc:creator><pubDate>Tue, 24 Nov 2026 15:21:17 GMT</pubDate><content:encoded><![CDATA[<p>I'm building a fan map of Leonida, the state in GTA 6. About 3,700 places, drawn with MapLibre GL. MapLibre wants real longitude and latitude. A game world has neither, so here's how I bent it into shape.</p>
<h2>Fake the globe</h2>
<p>The game data is in metres, from -16,384 to 16,384 on both axes. Web Mercator is a square too. So I stretch the game square over the whole Mercator square and treat lng/lat as a carrier, not a place on Earth:</p>
<pre><code class="language-js">const WORLD = 16384;

export function toLngLat(x, y) {
  const u = (x + WORLD) / (2 * WORLD);
  const v = (WORLD - y) / (2 * WORLD);
  return [u * 360 - 180, Math.atan(Math.sinh(Math.PI * (1 - 2 * v))) * 180 / Math.PI];
}
</code></pre>
<p>Everything is stored in game metres. Only this one file knows about lat/lng.</p>
<p>A nice side effect: the community tiles from GTADB (CC BY 4.0) line up with standard XYZ tiles, just shifted by two zoom levels. At the deepest level one pixel is half a metre.</p>
<p>The catch is that MapLibre's idea of distance is now meaningless. No scale bar. I measure in game metres myself.</p>
<h2>Share links</h2>
<p>People send each other "the safe is here" links all the time. <code>#@25.7612,-80.1918,5.5</code> works, but it looks awful in a chat.</p>
<p>Round the centre to 4 m and each axis has 8,192 steps, so 13 bits. Zoom to one decimal fits in 7 bits. That's 33 bits, and 36^7 is about 78 billion, so a whole view fits in 7 base-36 characters:</p>
<pre><code class="language-js">function viewCode(lat, lng, zoom) {
  const [x, y] = fromLngLat(lng, lat);
  const q = (v) =&gt; Math.max(0, Math.min(8191, Math.round((v + WORLD) / 4)));
  const z = Math.max(0, Math.min(127, Math.round((zoom + 2) * 10)));
  return ((q(x) * 8192 + q(y)) * 128 + z).toString(36).padStart(7, '0');
}
</code></pre>
<p>A single place is a 5-character hash of its ID. Old long links still parse.</p>
<h2>Don't make phones wait for the map</h2>
<p>This one mattered most. On a phone, a first-time visitor sat on a loading screen for 6 to 10 seconds while the map library, every place and the icon sprite came in.</p>
<p>Now the HTML ships a small picture of the island, with the popular guide spots as plain links on top. They're positioned with the same maths the map uses, so when MapLibre fades in over them nothing moves. Tap a spot before the map is ready and it's just a link.</p>
<p>The heavy files are marked in the page and only start loading once the first screen is drawn:</p>
<pre><code class="language-js">for (const l of document.querySelectorAll('link[data-later]')) {
  const n = document.createElement('link');
  n.rel = l.dataset.later;
  n.as = l.getAttribute('as');
  n.href = l.getAttribute('href');
  document.head.append(n);
}
</code></pre>
<p>In the same test, the popular spots now show at 1.5 s instead of 5.1 s. The full map arrives 0.4 s later than before. I'll take that.</p>
<p>The map is at <a href="https://gta-6-map.org/">gta-6-map.org</a> if you want to poke at it.</p>
<p><em>Originally published on <a href="https://dev.to/gta6map/a-game-map-in-maplibre-and-share-links-in-7-characters-30fa">DEV</a>.</em></p>
]]></content:encoded></item></channel></rss>