• Dear forum visitor,

    It looks as though you have not registered for a forum account, or are not signed in. In order to participate in current discussions or create new threads, you will need to register for a forum account by clicking on the link below.

    Click here to register for a forum account!

    If you already have a forum account, you can simply click on the 'Log in' button at the top right of your forum screen.

    Your Elvenar Team

Nine Near Neighbors

DeletedUser61

Guest
This thread is about SHIFTING ISOLATED CITIES towards the interior of the World Map.

This is a feasibility study, rather than a suggestion, as I mostly want to ensure that all of the moving parts are accounted for. While some algorithmic approaches are offered, based on educated guesses, without actual knowledge of the database schema there's no point in being overly specific. We'll be discussing three areas:
  • Archiving unattended cities, even though they have substantial development and/or are sponsored by a premium account
  • Retrieving archived cities, if and when the owner logs in, and their placement on the World Map
  • Moving a city, which can be accomplished by archiving and then immediately retrieving the city, and the selection criteria for selecting eligible cities.
You may wish to review some of the earlier discussions on this same subject:
There's a closely related data thread in the us3: Felyndral world forum.
My earlier approach was comprehensive, and emphasized frequent small shifts for all cities, such that
  • Highly ranked players spiraled toward the center of the map
  • Low activity players drifted toward the fringes of the map
  • There was no preservation of local city + relic combinations
The current effort approaches the same issues from the opposite direction
  • Isolated Cities, those with fewer than 9 active neighbors out of the nearest 18 city sectors, are moved toward the centerline of the map ONLY if there is an appropriate empty city sector.
  • City + Relic combinations are preserved, so you'll simple have some new/different neighbors.
  • While there is no deliberate attempt to group advanced players, all movement is toward the centerline of the map, so advanced cities will thereby tend to cluster near the center of the World Map.

ARCHIVING

When a city hasn't been developed, when it's not sponsored by a premium account, and when it's been inactive for 30+ days, simply deleting the city is the obvious thing to do.

If you look at the global roster, and find the lowest ranked city with a positive score (it will be somewhere near the 30th percentile), you can verify that ALL of the cities with a positive rank are on the world map, while only a few of the zero or negative score cities have been assigned a sector on the world map.

There are good business/legal reasons for retaining cities that have taken a lot of time to develop and/or cities that are sponsored by premium accounts, but there no need to display cities on the world map if they've been inactive for 30+ days. Archived cities might as well stay in the global roster (for at least several weeks) so that the city could be visited, without cluttering up the map. This is already the case for most of the cities in the lower third of the roster.
  • The archived player should receive a notice that their World Map will be temporarily unavailable while their city is being archived. Their explored sectors, relics, and rune shards will remain the same, but they will have a new set of neighbors so the visitation timers will all be reset.
  • The archived player's OWN notification log should be cleared, and they will potentially lose the benefit of supplies that they might otherwise have obtained by returning a visit.
  • The archived player should be purged from all other notification queues, although this is a moot point for a truly inactive player, as the notifications would have long since expired.
  • Ancient Wonder with a partially completed level that has OTHER contributors dshould remain available for a few weeks, so that the Rune Shards can be harvested, but perhaps the Ancient Wonders would be the ONLY interactive element in the archived city. Once the city is altogether pruned from the roster, any Knowledge Points that were invested in a partial level would no longer be accessible unless the owner started playing again
  • If the "archive" is part of an immediate move, then the member should not be expelled from their Fellowship, but otherwise an archived city/player would be expelled from their Fellowship, with an appropriate note in the Fellowship mail.
  • If the archived player was an Archmage, then the most recently active Mage or else Ambassador (if no Mages qualify) or else Fellow (if no Ambassadors qualify) would be promoted.
RETRIEVING

When a city is removed from the world map, it leaves an empty sector that can be:
  • Claimed by an active, isolated City (which we'll discuss later)
  • Claimed by a returning City/Player who has a matching boost
    (There are only nine unique city + relic combinations)
  • Claimed by a new player, without regard for the boosts
Note, significantly, that exactly the same approach could be used to consolidate worlds that are no longer large enough to be viable.

There are a great many opportunities to improve database efficiency when you're looking for an empty slot, but for our purposes we'll assume that a new player gets dropped into the oldest available sector, while returning players will be dropped into the oldest available sector that has the right boosts.
 

DeletedUser61

Guest
MOVING ISOLATED CITIES

If you look at any new world, it's apparent that new cities are added in a clockwise hexagonal spiral, and that new rings always start at the 1 o'clock position. As detailed in https://us.forum.elvenar.com/index.php?threads/neighborhood-renewal-a-ringside-seat.1237/, you can find the center of any world map by finding an outer corner, and tracing to the opposite corner. If you wish to practice, on the us3: Felyndral world map Nanabarb is at the exact center.

If you look closely, using your own city as the center of the universe,
  • The first ring around your city will contain 6 relic sectors
  • The second ring around your city will contain 6 relic sectors, and 6 city sectors, located at the CORNERS of the ring
  • The third ring around your city will contain 18 relic sectors
  • The fourth ring around your city will contain 12 relic sectors + 12 city sectors
  • The pattern extends forever. Each even ring will have 6 more city sectors than did the previous even ring.
IF a city has FEWER than Nine Near Neighbors, considering only the 18 cites in the first four rings, then it needs to be moved to a better location.

It is especially instructive to look at cities that are stuck on the outermost ring of the current world map:
  • Corner cities have 3 + 5 near neighbors at most, and are therefore always eligible to be moved to a better location
  • The insert point city (the end of the spiral) will have 3 + 6 near neighbors at most
  • Cities adjacent to a corner will have 4 + 6 near neighbors at most
  • Cities in the middle of an outer edge will have 4+7 near neighbors at most
  • Cities in the interior of the map will have 6 + 12 near neighbors at most
RELIC BOOSTS

9Bar.jpg


The tessellation primitive on the world map is a sequence of nine relic types
Gems Silk Planks, MagicDust Scrolls Steel, Elixir Crystals Marble, then Gems again, forever.

The next relics 9 bar is offset by 50%, and then there's a row of cities.

IN PARTICULAR, note the green diagonal. EVERY city on that diagonal sees an IDENTICAL arrangement of relics, as does each of the PARALLEL diagonals for it's own combination of relics.

For each city, the boosts are determined by the relic sectors to its immediate southwest, southeast, and double southeast (which is always identical to north.)

It therefore follows that each NINTH city on the horizontal city bar sees an IDENTICAL arrangement of relics.

OK - so the program just zapped an inactive city - NOW WHAT?
  1. Look horizontally, toward the nearest edge, for cities that Need Nine Near Neighbors.
    Cascade the eligible cities. If we zapped city A, and B C D are eligible, B goes to A, C goes to B, D goes to C, and D becomes available for cities that are retrieved, or for new cities
  2. Or Else, if nothing horizontal was found, look likewise diagonally toward the nearest edge, on the diagonal that's parallel to the 5 o'clock to 11 o'clock diameter, wherein every second sector will be a city of the proper type
  3. Or Else mark the empty sector as available for a returning player with the appropriate boosts, or for any new player.
  4. If a move did occur, then mark the outermost empty sector as likewise available.
    While it would perhaps be tempting to maintain an aged queue of available empty cities, pruning the newly isolated sectors at the edge of the map would be VERY messy. The best approach, each time a returning or new player needs a city, is probably to simply run the entire spiral until an appropriate empty city sector is found.
The end result will be a world map that looks like a lopsided football, with active cities mostly near the center of the map, while returning cities and new cities will be mostly on the fringes of the map.

There's also a temptation to use the spiral for finding both cites that need to be vacated AND the cities that need to be moved, but the ring-at-a-time consequences would be that folks would lose nearly all of their established trading partners, Moving directly inward, toward the centerline, will usually shift several nearby, but isolated cities in a similar manner, thereby retaining the integrity of the neighborhood.
 
Last edited by a moderator:

DeletedUser61

Guest
If you'd like to dive into the deep end of the pool, http://www.redblobgames.com/grids/hexagons/ has posted an excellent article about coordinate systems for hexagonal map arrays. Our Elvenar world map behaves in accordance with the flat-topped "odd-q" vertical layout, with Nanabarb [0,0] at the center of our us3: Felyndral world map.
 
Last edited by a moderator:

DeletedUser61

Guest
We've developed this idea quite a bit more in the EN forums at https://en.forum.elvenar.com/index....e-and-number-of-trades.1827/page-3#post-12633. We're fairly confident that we now understand how the world map is generated piecemeal, and that the program has no awareness of the emergent clockwise hexagonal spiral that's obvious to human observers.
  • The program has no sense of the emergent relic diagonals and other metafeatures on the world map, so I'm abandoning the "move closer to the center and preserve the neighborhood" concept. It's not feasible.
  • If premium and/or developed but inactive cities are being archived, then we won't need to worry about "recent activity level" because every city on the map will have recent activity.
  • Identifying isolated cities will be easier than I expected. While I'd still prefer to consider the 18 nearest cites, I'd be very nearly as happy with a % of the 200 traders or with just the accumulated scores of the six nearest neighbors.
  • Rebuilding the indexes for a player's instance of the world map, should be much easier than I'd anticipated, because the build order is iterative, and it's likely always the same for every player, regardless of their discovery sequencing.
  • We still need to verify exactly how many trading partners are available to a city that's on the edge of the world map, but it's a minor issue because isolated cities on the edge of the map should be shifted into the interior of the map in any case.
The post in the EN forum was a "thought experiment" that assumes the Elvenar world map is created piecemeal, using two very simple algorithms. Further, the program needs no awareness of spirals, rhomboids, nor of hexagonal rings that contain more than 6 relic sectors and/or 6 cities.
  • We'll assume that there's a comprehensive set of master records for each world map, and that your particular version of that map is mostly pointers to the master map. The creation of your private instance uses the same procedures.
  • The city in the exact center of the map is seeded, but thereafter cities are processed in IDentity order.
    • Starting at 12 o'clock in the adjacent hexes, Relic sectors are assigned in Ring 1, using a clockwise rotation.
      See R001 - R006 in the following diagram.
    • Starting at 1 o'clock in the adjacent hexes, once removed, City sectors are assigned to the odd numbered positions in Ring 2, using a clockwise rotation.
      See C01 - C06 in the following diagram.
    • If a sector has been previously claimed, it is simply skipped.
Here's the chart from processing the first 37 cities. (If you want a closer look, Ctrl+ScrollWheel will zoom the window in most browsers.)
NotASpiral 2016A29.png

Ring City Ring City
Ring 0 C00 Ring 6 C19
Ring 2 C01 Ring 6 C24
Ring 2 C02 Ring 6 C27
Ring 2 C03 Ring 6 C30
Ring 2 C04 Ring 6 C33
Ring 2 C05 Ring 6 C36
Ring 2 C06 Ring 6 C40
Ring 3 C08 Ring 6 C41
Ring 3 C09 Ring 6 C46
Ring 3 C11 Ring 6 C50
Ring 3 C13 Ring 6 C54
Ring 3 C15 Ring 6 C58
Ring 3 C17 Ring 7 C38
Ring 4 C07 Ring 7 C39
Ring 4 C10 Ring 7 C42
Ring 4 C12 Ring 7 C43
Ring 4 C14 Ring 7 C45
Ring 4 C16 Ring 7 C47
Ring 4 C18 Ring 7 C49
Ring 5 C20 Ring 7 C51
Ring 5 C21 Ring 7 C53
Ring 5 C22 Ring 7 C55
Ring 5 C23 Ring 7 C57
Ring 5 C25 Ring 7 C59
Ring 5 C26 Ring 8 C37
Ring 5 C28 Ring 8 C44
Ring 5 C29 Ring 8 C48
Ring 5 C31 Ring 8 C52
Ring 5 C32 Ring 8 C56
Ring 5 C34 Ring 8 C60
Ring 5 C35 Ring 9 C62
~ ~ Ring 9 C63
~ ~ Ring l0 C61
The IDentity space is pointy-topped, but it's flat-bottomed, and the City IDentities oscillate near the 1 o'clock corner, all of which we have previously observed in the data, as anomalies. Vacating cities and assigning them to new immigrants, pretty much ring by ring, requires nothing fancier than walking down a (perhaps filtered) list that's in City IDentity order.

While I only processed the first 37 cities, turning the crank to find all 200 trading partners would just be more of the same. You'll note that the IDentity space is extra wide at the equator, it's a bit pear-shaped, and C41 and C49 are in EXACTLY the right positions to account for Rob15 and Adryell, the out-of-bounds traders that we were complaining about earlier.The IDentity space is pointy-topped, but it's flat-bottomed, and the City IDentities oscillate near the 1 o'clock corner, all of which we have previously observed in the data, as anomalies. Vacating cities and assigning them to new immigrants, pretty much ring by ring, requires nothing fancier than walking down a (perhaps filtered) list that's in City IDentity order.

While I only processed the first 37 cities, turning the crank to find all 200 trading partners would just be more of the same. You'll note that the IDentity space is extra wide at the equator, it's a bit pear-shaped, and C41 and C49 are in EXACTLY the right positions to account for Rob15 and Adryell, the out-of-bounds traders that we were complaining about earlier.
 
Last edited by a moderator:
Top