Help Needed - World Cities Placement With Position, and Population

I am currently working on a world war strategy game called World of War. I recently have been placing parts which act as cities manually around the map with their own name and population, but after manually placing ~350 one by one, I realized it will take way too much time since I am planning on placing ~1500 - 2000 cities. There is a game called Rise of Nations by @hyperant that has around 1400 cities in the same exact style as me. I know for a fact that they have a script that places the cities themself, but I am unsure on how they did it. If anyone has any information, ideas, or help on this matter please reply.

Picture of the cities I manually placed so far:
image

1 Like

Do you need the parts to mimic real life cities? For example would there be a paris and london in this map.

I would need every capital city, and a good amount of cities everywhere else (Not alot, since there are millions in real life)

If you dont need it to mimic real life you could write a for loop that goes through all the parts finds a random position on that part and places the city piece

My guess is there is a database that collects the city information somewhere.

1 Like

It needs to be accurate to real life, the game mimics the real world.

in that case (unless there is a database online with positions on a map the size of yours) I dont believe there would be any automatic option

The game I mentioned before does it somehow

Well its possible that the map they have is scaled to fit real world cords, in that case it would be very easy to find a database online that you could copy and paste all the real world cords into the map

The issue is how would I import it in?

well you could create a table with all the cords, loop through all of them and place a part on all of the positions

Found a database btw

Not sure how to do that lol, I am unfamiliar with strings, tables, etc.

This one is better, it has coords and everything

My guess on how the script would look (I am just guessing):

local list = {
Athens, Population, X,Z;
Istanbul, Population,X,Z;
}

for i,v in pairs(list) do

end

again this is just a guess, I am unexperienced in looping through tables

This is not a perfect example but try this out (server side)
oh btw the positions are in the same place currently so the two parts are going to be in the same spot lol

local cities = 
	{
		{"Tokyo",35.6839,139.7744}, -- [city name], [lat], [long]
		{"London",35.6839,139.7744},
	}

for index,city in pairs(cities) do -- loops through all the cities
	local CityName = city[1]
	local Lat = city[2]
	local Long = city[3]
	local city = Instance.new("Part")
	city.Size = Vector3.new(1,1,1)
	city.Parent = workspace
	city.Name = CityName
	city.Position = Vector3.new(Lat,0.5,Long)
end

Just wanted to say you are missing Liechtenstein, between Switzerland and Austria.

if you do not have a deadline, why not make like 50 cities every day?

you can pick any number that works for you, and eventually it will get done after a few weeks or months.

yes, it will take a while but good games take time to do.

if you really want you can do like 150 every day (or some higher number, I do not know how long it takes per city) and get it done faster but still not overworking.

It may also seem very annoying to do, but works faster and easier then you think.

Great idea, but unfortunately I have a deadline though

This works, thank you. I am now trying to find a way to implement the data into the “cities” list as they are not formatted appropriately.