Jump to content

Moon Hotspot


AirMe

Recommended Posts

  • Replies 1.4k
  • Created
  • Last Reply

Top Posters In This Topic

  • 5 weeks later...
  • 4 weeks later...
  • 5 weeks later...
On 4/2/2024 at 2:52 AM, Colin Myrhh said:

Thanks Luna.

 

[edit:] how did you figure that one out?

The copy of the spreadsheet that I have does not even have that as tracked possibility.

 

Falling back to older code I wrote, but which runs locally on my computer.

I got chatgpt to write some code a couple of days ago which pretty much does the same thing as my old code. Could be useful if other people want to join in on the hotspot finding, or maybe even turn this into a basic website, as the spreadsheet may continue to be broken depending on exactly what change the admin made. We'll have a better idea next month or maybe later of what admin's change was.

 

Here's the code from chatgpt, with minor edits:

 

import math

class TestPoint:
    def __init__(self, lat, lon, effectiveness):
        self.lat = lat
        self.lon = lon
        self.effectiveness = effectiveness
        
class PossibleHotspot:
    def __init__(self, lat, lon):
        self.lat = lat
        self.lon = lon

def calculate_distance(test_point, hotspot):
    lat1 = math.radians(test_point.lat)
    lon1 = math.radians(test_point.lon)
    lat2 = math.radians(hotspot.lat)
    lon2 = math.radians(hotspot.lon)
    
    d = math.acos(math.sin(lat1) * math.sin(lat2) + math.cos(lat1) * math.cos(lat2) * math.cos(lon2 - lon1))
    return d

def calculate_effectiveness(test_point, hotspot):
    distance = calculate_distance(test_point, hotspot)
    effectiveness = (distance * 124.362 / math.pi) / 100
    effectiveness = 1 - effectiveness
    effectiveness = max(math.floor(effectiveness * 100), 50)
    return effectiveness

def find_matching_hotspots(test_points):
    possible_hotspots = []
    for lat in range(-84, 85):
        for lon in range(-179, 180):
            hotspot = PossibleHotspot(lat, lon)
            match = True
            for test_point in test_points:
                if test_point.effectiveness != calculate_effectiveness(test_point, hotspot):
                    match = False
                    break
            if match:
                possible_hotspots.append(hotspot)
    return possible_hotspots

# Example test points
test_points = [
    TestPoint(80.00000001, 103, 89),
    TestPoint(77, 22, 98),
    TestPoint(78, 17, 97)
]

matching_hotspots = find_matching_hotspots(test_points)

for hotspot in matching_hotspots:
    print(f"Matching hotspot: lat={hotspot.lat}&lon={hotspot.lon}")

 

You don't even need to run it locally. You can run it in any online python evaluator like this one: https://www.online-python.com/

 

In case you're curious what my prompt to chatgpt was, which explains how the moon & mars effectiveness calculation works:

i3nOVgs.png

 

AI has gotten so good over the past few years. I wonder how differently the whole process of finding the hotspots would have gone if AI could write code like this back when the moon & mars wonders were first introduced.

Link to comment
Share on other sites

  • 2 weeks later...

tl;dr: There's a new tool to find the moon & mars hotspots. Here it is: https://www.cnhotspotfinder.com/ Thanks to riser for collaborating to create it. The Google sheet isn't working anymore and I don't know yet whether it will be fixable, or even worth fixing.

 

So the admin recently made a change to the CN server-side code for choosing the location of the moon & mars hotspots every month. This broke the spreadsheet I made as the hotspots no longer lie on the same neat line that they've always been on.

 

So basically we've had to fall back from only searching a narrow line of points to searching all integer coordinates across the entire sphere, for both moon & mars (and also decoupling the Moon & Mars so test points on one don't narrow down the possibilities on the other). While this in theory is possible with Google sheets, well, narrowing down 169*359 possible hotspots in a spreadsheet is pretty unwieldy. Back when we had the possibilities narrowed down to a line there were only 1218 possible hotspots which can be done with Google sheets reasonably well.

 

So time to use code rather than sheets. I had ChatGPT write code to search through all the possible integer coordinates and list the ones that match the points that have been tested. Look here for a post I made on that. And riser made a website using the code and hosted it. Here it is: https://www.cnhotspotfinder.com/.

 

Keep in mind that the Moon and Mars are now decoupled, so you can use the website for the Moon only or Mars only (or have two instances of the website open in 2 tabs if you're trying to find both). Points from one will no longer help with the other like I said.

 

We only have 1 month of data so far (April 2024) from after admin's change. Maybe with more months of data a pattern will emerge similar to the line from before the change. For now it may take some extra guesses to the find the hotspots each month since there is no such pattern helping us out. And of course there is a possibility that the server is just picking integer coordinates completely randomly now with no pattern in which case things will stay that way. Time will tell.

Edited by Luna
Link to comment
Share on other sites

  • 3 weeks later...

100% at:

Lat    37.00000
Lon   33.00000

(used Luna's link and existing old location + 1 new location, to get list of possible results; tried first result, 100%)

Link to comment
Share on other sites

2 hours ago, Arcane said:

 

So.... this is basically a copy of my tool

Yes, with some code cleanup and minor changes (due to my personal preferences to how it looks and behaves).

 

I included attribution to you.

 

See our PM exchange in June last year where I asked for permission to do so.

 

Regards,

riser

Link to comment
Share on other sites

I remember the exchange--I thought you were modifying it for your use or your AA's internal use.  Seems weird to just have reskinned it and republished it here.  

 

EDIT: Just removing the screenshot of our conversation.  It's not a big deal, just was surprised to see it in the thread without any attribution in the thread itself.  I realize you're just adding value to the CN community. 

 

Edited by Arcane
Link to comment
Share on other sites

1 hour ago, Arcane said:

I remember the exchange--I thought you were modifying it for your use or your AA's internal use.  Seems weird to just have reskinned it and republished it here.  

 

EDIT: Just removing the screenshot of our conversation.  It's not a big deal, just was surprised to see it in the thread without any attribution in the thread itself.  I realize you're just adding value to the CN community. 

 

My bad.  Been so long since we talked about it.  I'm happy to add anything else you would like to the page.  I did reskin it and also make some code tweaks to make it more easily maintained for myself.

Link to comment
Share on other sites

57 minutes ago, riser said:

My bad.  Been so long since we talked about it.  I'm happy to add anything else you would like to the page.  I did reskin it and also make some code tweaks to make it more easily maintained for myself.

 

Nope, it's all good.  Just caught me off guard.  I appreciate the attribution on the page and good to see the dedicated URL.  

Link to comment
Share on other sites

On 5/1/2024 at 6:59 PM, riser said:

You can also use the CN Wonder Mover tool to make the moves easily: https://www.cnwondermover.com

 

I just want to make a note for anyone using this that if you copy your URL to generate a new resource or relocate population from your Mine or Colony this tool will not account for that and only generates the link for moving the wonder to the co-ordinates provided.

 

If you want to relocate population/generate a random resource you will need to add "&Upgrade=1" as a modifer for the generated URL in between when "nation_id" ends and "Location" begins. This is how the part of the URL I'm talking about should look if I wanted to and generate a new resource or relocate the population for my Moon wonders:

 

Quote

Nation_ID=83518&Upgrade=1&Location=Moon

 

It'll be the same modifier in the link for both the Colony or the Mine and whether it's on Mars or the Moon. I

 

However if you simply want to move your wonder to the hotspot co-ordinates then this link generator will do that just fine for you!  Thanks for making this quick tool that does this for me, now I don't have to faff too much by editing the co-ordinates into the URL myself and realising too late that it's a negative numbered latitude and I've totally messed it up 😅

Link to comment
Share on other sites

On 5/3/2024 at 1:52 PM, Johnny Apocalypse said:

 

I just want to make a note for anyone using this that if you copy your URL to generate a new resource or relocate population from your Mine or Colony this tool will not account for that and only generates the link for moving the wonder to the co-ordinates provided.

 

If you want to relocate population/generate a random resource you will need to add "&Upgrade=1" as a modifer for the generated URL in between when "nation_id" ends and "Location" begins. This is how the part of the URL I'm talking about should look if I wanted to and generate a new resource or relocate the population for my Moon wonders:

 

 

It'll be the same modifier in the link for both the Colony or the Mine and whether it's on Mars or the Moon. I

 

However if you simply want to move your wonder to the hotspot co-ordinates then this link generator will do that just fine for you!  Thanks for making this quick tool that does this for me, now I don't have to faff too much by editing the co-ordinates into the URL myself and realising too late that it's a negative numbered latitude and I've totally messed it up 😅

I added new check boxes to indicate inclusion of generating new citizen storage for the Colony and generating new resource for the Mine.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...