Navigating an AI that shouldn’t take the shortest path but the scenic route instead (e.g. fish)

I’m working on a sidescrolling game with an underwater "fish-like" AI that has some goals (interacting at various locations) and things to avoid (player).

  1. Started of with a Navmesh and simple straight line navigation but since algos like A* always take the shortest path what ends up happening just doesn’t look good.

Straight line navigation

  1. To solve this, I thought I could add some random area penalties to the navigation nodes (currently a grid). I generated these penalties using perlin noise, which did curve the path, but the effect is very minor, because again A* does not like to deviate from a straight line even with big penalties. If you make them too big, it’s gonna act like obstacles, which isn’t very usable either.

Noise penalties

  1. So the question is – how do I achieve something like this?

The dream


importrange – Google sheets custom function runs when it shouldnt

I have a google spreadsheet that I used an importrange function to get addresses from another sheet. Then I added this into the script editor to convert those addresses to coordinates using a custom function:

 * Returns latitude and longitude values for given address using the Google Maps Geocoder.


 * @param {string} address - The address you get the latitude and longitude for.

 * @customfunction


function GEOCODE_GOOGLE(address) {

    if ( {


    } else {

        var r = Maps.newGeocoder().geocode(address)

        for (var i = 0; i < r.results.length; i++) {

            var res = r.results(i)

            return + ", " + res.geometry.location.lng




And when I put into the cell the function =geocode_google(L3), where L3 is the full address joined together from a function using the street number and street name from importranage, it spits out the coordinates in one cell that I then use another function to split into 2 separate columns. And then I autofilled that formula to the next approximately 350 addresses. The problem is that when I first did it it worked great but now its saying the service is being invoked too many times in a day for every single cell I have that custom function in except maybe 3 or 4 cells. I know there’s a limit of 1000 per day times I can use the google geocoder service but the original spreadsheet only changes maybe 1 address every 3 days and I don’t see why all the cells from the beginning of the sheets containing the custom function would come up as being invoked too many times.

Is it because the importrange fucntion refreshes every 30 minutes even though the values of the cells doesn’t change and that triggers the custom function which causes it to run every 30 minutes and hit that 1000 max per day?

Is there anyway to limit the custom function to run only when the value of the full address cell changes or any other work around?

I also tried to use this code as well:

function myFunction() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Geo 4')

var range = sheet.getDataRange();
var cells = range.getValues();

var latitudes = ();
var longitudes = ();

for (var i = 0; i < cells.length; i++) {
var address = cells(i)(11);
if (address == "") {
} else {
var geocoder = Maps.newGeocoder().geocode(address);  
var geocoder = Maps.newGeocoder().geocode(address);
var res = geocoder.results(0);

sheet.getRange('M1').offset(0, 0, latitudes.length).setValues(latitudes)
sheet.getRange('N1').offset(0, 0, latitudes.length).setValues(longitudes);

But it wasn’t recognizing some of the addresses so I don’t run it anymore and I prefer the custom function because I can see if there’s a specific address not being found instead of the code just not running .

Is there any other workaround to just import addresses and get the latitude and longitude as the addresses change? Thank you!

identity – Should or shouldn’t I show a serial number, MAC address and other product ID when I sell it online?

I want to sell online some of my electronic stuff that I don’t need anymore, such as my ASUS Wi-Fi router, and I’m wondering when I upload photos of it should I leave its serial number, MAC address and pincode written on the back of the device visible or should I photoshop it out. I checked other people’s stuff pages and many of them take explicit photos of their devices’ serial numbers, MAC addresses etc. Why?

Furthermore, some potential buyers don’t want to buy your product if ID numbers are blurred out. Why so, why do people need to see those numbers of the products they don’t own yet, and do they actually need to? Is it safe for me to publish such data? Theoretically someone can go into their ASUS (or other brand) account and register a product with my serial number, if I haven’t registered it myself, right?

permissions – Why shouldn’t I give everyone sudo?

My department used to be a small department. As is common with small groups, system security wasn’t really enforced. In short, everyone used the same login account and had root access.
As the department has grown (about 50 people and still growing) and we’ve moved on to more of a production role, we’ve had to adjust our habits.

We recently implemented network logins. With this came noone has root access (or sudo).
The amount of pushback I have received from this is tremendous (as is expected) as not everyone can just sudo fix problem. However, sudo is dangerous, and most users are electrical engineers who aren’t unix savvy. After explaining why we will not be getting sudo back, their is still tremendous pushback.

This is where I turn to stack exchange. As I have looked on google for why not everyone should have root access. And surprisingly, this information is hard to come by. I have tried making a list myself, but it would be good to have another online source backing up what I’m saying, which I thought there would be a plethora of articles for!

Here are some of the reasons they want sudo access back, and how I addressed their concerns:

  1. Can’t edit other user’s files in a shared directory
    • Don’t use shared directories to edit your code. Everyone should be editing in their own home directories and pushing to git. Let git do it’s job and merge stuff.
    • If for whatever reason you need to use shared directories, have the directory owner give the group write permissions
  2. While using a shared directory, if one person compiles, the others can no longer compile as they’d have to remove the first binary
  3. If one person pushes to git with no group write permission, the others cannot push to git
    • For now, set your umask (i told them how to do this). Soon, IT will be taking over all git remote ownership and will be setting up shared permissions properly

Some other reasons I have come up with for why sudo access would not be good.

  • We can’t accidentally delete customer data forever (this has happened)
  • We can’t sudo reboot and kick everyone off whos remotely logged in (someone kicked me off a few times and I lost my work)
  • It restricts what we can run (in a good way!). One time someone installed Debian GUI libraries they found online, but we run CentOS.

Can anyone point me to where I can find an article stating why multiple users having sudo/root is a bad idea.

operating systems – Is there any reason I shouldn’t use a LInux host for a Linux guest VM?

I’m a developer and my typical environment is to use is a Linux guest OS running inside VirtualBox on a Windows host. Most software companies don’t allow developers to install Linux bare metal on their machines. The Windows host/Linux guest solution is a good compromise.

My new workplace is different. They’ll let me use any kind of set up I like. I’d still like to use a VirtualBox as I can simply import my existing VM to save the hassle of setting up my entire development environment from scratch.

I have 2 questions:

#1 Is there any reason I should not use a Linux host/Linux guest arrangement? #2 Which Linux OS would you recommend to use as the host?

Thanks :]

rop – Is it possible to run with orp attack legitim function that shouldn’t run even if stack is not executable?

I read about the hardware protection that blocks the CPU from jumping to stack address. But hacker may still edit the return address to an address in code memory that shouldn’t run at that moment.

For example;


    void ath_secuss()
        printf("You have successfully logged inn");
    int main()
         char password(10);

Can the hacker edit the return address to ath_sucess()? Also, does the return address allays in the end so we can check the data that coming in is not bigger then the ebx-1 register?

mobile – Why shouldn’t I release my app to all countries?

When releasing a mobile app on iPhone and Android, you can specify which countries you want to release your app to. Intuitively, you may want to just release it to all countries.

One example of why you should not release it to all countries (with made up numbers):

Your app uses ad revenue. You gain $0.03 per user in the United States. You gain $0.01 per user in India. Your server costs you about $0.02 per user. So you would want to release in the United States, but not India in this case.

Why else shouldn’t I release my app to all countries?

Disclaimer: This is not specifically a game development question, but it was the most fitting site I found.

8 – Mass Contact shouldn’t be applying Glossify filter

I’m working on a Drupal 8 site which is both sending out emails with Mass Contact and uses the Glossify plugin filters in a different part of the site. However when sending emails using an “email” text format that doesn’t include the Glossify filters, the Glossify filter is still being applied to the text sent by the email. It’s picking up terms and turning them into a hyperlinks like we have Glossify set up to do. It’s strangely not showing up in the “archived” email on the site, but it is showing up in the actual emails that are sent out.

Could there be something misconfigured or is it likely a bug in one of the modules? If it’s probably a bug would it be a bug in the Mass Contact or the Glossify module?

I’ve started to try to look into the code of the modules themselves, but I’m not an expert in Drupal modules so any help would be appreciated.

ux field – If I will create an application like “Uber” why i shouldn’t use the map satellite view instead of the plain one?

From UX Perspective, If I will create an application like “Uber” why i shouldn’t use the map satellite view instead of the map one?
Is it because it is crowded with data and the user will not be able to distinguish the road, or is there another reason that it has to do with the performance?