#Generate province looking shape on 2d array (grid)

1 messages · Page 1 of 1 (latest)

woven storm
#

Okay so bascially I have a 2d array (practically a grid), and I want to generate province looking shapes on this grid. I have one starting tile, pretend the red is the starting area, and the blue is some random height I want to generate on top of it to generate a province looking shape.

dry pawn
#

cool

ruby moss
#

uh whats a province 💀

woven storm
dry pawn
#

I wanna do the same on my auto generating map but don’t know how so I’ll watch this thread

dry pawn
woven storm
#

a principal administrative division of certain countries or empires:

ruby moss
#

??

#

like ik about canada

woven storm
dry pawn
woven storm
#

they look something like that

dry pawn
woven storm
#

now i need to generate a shape similiar to this randomly

ruby moss
#

a puzzle piece

woven storm
#

kinda

#

u can tink of it that way

#

except its not square

ruby moss
#

hmmm

#

you could have like a million custom pieces

#

and randomize

#

it

#

through an array

woven storm
#

okay so here is the issue with that

dry pawn
woven storm
#

how would these provinces connect

dry pawn
#

it’ll be completely random

#

meaning it won’t be in blobs

ruby moss
dry pawn
woven storm
#

yes

ruby moss
#

i think thats better

#

because

woven storm
#

i use to think ron used real world data till i realized he just uses blender

#

but that wont work in this case

#

since only ai fighting

#

and its tile base simulation

ruby moss
#

an alternative is to make a big flat square and draw lines though it

woven storm
#

:/

ruby moss
#

squiggly lines

woven storm
#

i dont think u understand

#

lemme get roblox studio open and show u

#

k almost got it

ruby moss
#

no

#

what if

#

you have an ai

#

and make it run around

woven storm
#

the blue is the country i made

dry pawn
woven storm
#

the red is sorta what i wnt to generate

ruby moss
#

yes

#

you can do that

#

..

woven storm
#

to make a region

ruby moss
#

what about the blue

dry pawn
woven storm
#

the blue is the country

ruby moss
#

..

#

what

#

im confused i dont have good vocabulary :p

#

and i dont live in canada

woven storm
#

ur not english natively?

dry pawn
ruby moss
#

i am

ruby moss
dry pawn
#

think of it like states

woven storm
#

u should look at maps more

dry pawn
#

but less straight lines

ruby moss
#

😔

#

okay

#

i dont see the point but wtvr

woven storm
#

...

#

anyways

#

does anybody have an idea of how to do this

ruby moss
#

what if

woven storm
#

i pretty much just need to round random height around the already owned lands

ruby moss
#

lets say you made a gui first

dry pawn
woven storm
#

mhm

woven storm
#

@ruby moss with your logic i might as well make an entire political system ai that determines the borders of a province based of resources, history, and geography

ruby moss
#

so if you went to pick a random offset pixel and then using a script picked another one thats within one pixel of it then you will make either an undefined, pos, or negative slope right

#

and you can repeat that proccess

#

but

#

set a maximum to where it can go vertically

#

so its not a line

#

and then somehow capture that?

woven storm
ruby moss
#

lol idk

dry pawn
#

Have it select a random point on the map, and have it change into whatever color, use the function that detects everything around it and use math.random to create a semi squiggly circle. Repeat the process till all squares are covered. When a square is covered, create a value for that part where if the value is true, that part cannot change colour another time.

woven storm
#

oh wait i got an idea

ruby moss
#

and a minimum too

#

so its not just one pixel

dry pawn
ruby moss
#

if u get unlucky

woven storm
#

heresmy idea

woven storm
ruby moss
#

it worked?

woven storm
#

heres my idea tho

#

i select a region

#

this is sorta lot potat idea but a different

#

so i have a width and height

#

ill go to each edge

#

and inset it a bit

ruby moss
#

oo i see

woven storm
#

the blue is a number between 1 and something

#

but heres the issue i see with this

#

it might make a weird shape

#

and less province like

ruby moss
#

u can fill it in

woven storm
#

yeah i could

ruby moss
#

check if there is one part alone

#

not next to something else

woven storm
#

yeah check if its an island

#

well yeah but their called islands wen working with arrays

dry pawn
#

studio** You are now Level 3! **studio

woven storm
#

but the issue here now

#

or another ting to solve

#

is connecting provinces when there next reated

#

created

ruby moss
#

o

woven storm
#

say we re making another province

#

were gonna generate and add offset

#

but we need to know where to place it so it connets

#

so idk

ruby moss
#

um

#

you could make one big province

#

and seperate it

woven storm
#

?

ruby moss
#

hmm idk

#

did u try googling it

#

the dev forum might have something

dry pawn
#

think of the whole plate as already a big province

#

what we are trying to do is separating

ruby moss
#

no i mean

#

nvmnvm

#

its the same as the gui idea

dry pawn
#

ok

woven storm
#

what