loading...

Do you know the board game risk? 🌍

adam_cyclones profile image Adam Crockett ・1 min read

I have been wondering lately about the potential of making a fun little game inspired by risk.

How would I go about procedurally generate continents and countries with wobbly lined borders? I'm leaning towards SVGs btw.

Discussion

pic
Editor guide
 
 

P5 has pretty bad performance and it encourafges bad practices - coming from a guy who used to love p5

 

Yeah I've never used it, it just came to mind as a possible fit for the solution based on what I've read about it. Do you have any alternative ideas?

Pixi looks cool, but I havent tried it

 

Yeah, I watched the coding train videos, and I saw some strangeness with P5, It treats canvas as something a bit different to normal webdev.

I was asking more about the algorithm used to generate 2d terrain that looks like a map.

 

I'd try something along the lines of:

  • Pick some points to be the centers of continents
  • Place some random points clustered around each continent center
  • Use something like a Voronoi diagram to create the borders for the counts
  • Make the borders a little more wavy
 

Welcome Josh!

I think this sounds about right yes.

Architecturally I'm going to use this:

The actor model with the, and maybe challenge myself with pick.js

I will use typescript and xstate as per the video.

 

So more on the algorithm side, voronoi or centroids.