Algorithm – simple 2D city simulation

everyone. I want to create a small simulation of the city. Let me explain what I have and what I mean …

For starters, everything will be more abstract. So my city consists of a series of rectangles – "houses" (conflicts that are fairly easy to manage) and a series of points – "peoples". All of this will be in 2d.

Since I have dots (they will move because the residents also move around town, right?) And rectangles, I chose the Quadtree.

сity quadtree

So the general plan of what I want to get.

  1. Points should run through the city (of course yes? but not like that
    easy) during such walks (and points – residents, should not go
    all in the same direction) points would go in different rectangles
    (It looks like you're going to work or shopping).
  2. Alternation of day and night. Suppose I have a stop button (after that
    Stop all points – the city stops) and the start button (all
    Points start to run). I wish every point had a home (sounds good, didn't it?). For example, suppose the day lasts 30 seconds. At the beginning of this time, the point comes from his house (rectangle), which was predetermined somewhere. It starts walking through the city (see point 1 above) and at the end of the day it goes home to its rectangle. ("House")

For the sake of simplicity, we assume that not all houses move and are defined in advance.

My main problem is that I don't know how to do paragraph 2.
I don't know how to do a "point hike" in the city. There can be quite a few points (for example 5000) and counting with good fps for each point would make the route difficult. Perhaps it is worth creating "common routes", a few lines around the rectangles that go through the most points.

I have an idea of ​​how to "let" a point go into a rectangle sometimes. So that each rectangle has a radius and with a certain probability every point is forced to enter a rectangle (house) every second.

Now a little bit about the code:

What we have is a standard quad tree with standard methods (e.g. inserting points). The structures responsible for dots and rectangles:

struct Point {
   x int;
   y int;

functions for Point {
   moveTo(x int, y int){
      p.x = x;
      p.y = y;
struct Rectangle {
   x int;
   y int;
   width int;
   height int;

Our entire drawing field is determined. For the sake of simplicity, let's say canvas x 1000 x 1000 pixels.
And each point is just a separate pixel.

What else can we do? We can make "street" a distance of 9 pixels between houses:


I hope for your help and advice!

dnd 5e – Mechanics of a city where magic doesn't work

This is a cool idea, but I don't think there is an answer that doesn't include a story element from which players are distracted / trying to turn to their advantage.

If you don't want it to be something that players can remove, remember to have a natural trait that only applies to that particular area that creates the zero magic zone. Options include:

  • In the distant past, there was an intense magical battle so violent that it permanently disrupted the tissue of magic in that area

  • There is a kind of strange crystal growth in and around the city and they have a kind of radiant aura that disrupts the magic. All attempts to harvest them using traditional means have so far failed. Due to its incredibly tough structure, even adamantine has proven ineffective as it scratched the surface.

  • There is a curse in the city, but it requires something that is almost beyond the reach of mortals to be broken.

It does not have to be something that actually exists in a rule book, after all it is a structure of the world, you can think of something.

Google Sheets – match string from list to cell containing string (extract city from company name)

Sheet A contains a list of restaurant names from across the country:

Restaurant               | City
The Bar and Grill Tampa  | ...
Oklahoma City's Best Bar | ...

Sheet B is a list of all US cities:

Oklahoma City

How can I insert the correct city in the "City" column on sheet A? This shouldn't be complicated since I basically said look at Sheet B. If Sheet A contains a city from Sheet B, list the city on Sheet A. But I can't find a solution anywhere that works.

For this reason, this president is absolutely unqualified to be president and would be challenged with a city of 500,000. Do you see that?

Nothing you just said does not suggest that he is underqualified. It just shows that you have TDS.

They demonstrate exactly why the people on the right don't even have left-wing arguments about what Trump could do better. Countless idiotic statements where leftists don't do anything expect Trump to do what he's unable to do (like nearby schools), and even leftists who blame Trump for the corona virus.

There are things Trump could do better. Of course, that's not the point at which you line up a communist and someone with senility to act against him.

You could have made a STRONG case with Andrew Yang, Tulsi Gabbard and Tom Steyer about how fit Trump is to lead. If you line up Bernie and Biden … I'm sorry, but you obviously don't care if you line up someone who is capable of leading. So if you don't want to give helpful advice on how to improve, go away.