After a bit of searching, I found that the best way to create an Area2d using a map was the built in function to create CollisionPolygon2Ds hidden in the “Sprite2D” tab. Took a bit of looking around to find that. After doing that, I grouped relevant territories together into Area2Ds (e.g. Australia + Tasmania, most of the Indonesia islands).

The only issue I have with it now is that it combines a bunch of the countries, particularly America (the continent) and Afro-Eurasia. It was pretty bang on for most of the islands though, see Australia, Japan, Madagascar, and New Zealand. Greenland got a bit of Canada so I’ll need to fix that.

I’ve also made a small script that draws a Polygon2D with the correct map colour for . The default is red, so you can see that I have currently set America blue, Afro-Eurasia purple, the British Isles pink, Australia and New Zealand green (the latter being slightly bluer), and Japan yellow. These colours are just for testing and I think it looks pretty good.

I will probably find individual maps for each country and create collision shapes using those for the countries in Afro-Eurasia and America (i.e. almost all of them…). One thing of note, I have split the collision shape of Papua into West and East by duplicating it and manually deleting the points on either side, then putting each half into separate Area2Ds. This is obviously not feasible for Afro-Eurasia and America, but I might do that for Ireland to split the north and south.

One annoying thing is that I can’t seem to select multiple points and delete them all at once in Godot. Anyone know what button to press to do that? Is there some sort of toggle? Another really annoying thing was adding the “territory(dot)gd” script to each and every Area2D, you can select multiple objects and remove their scripts, but not attach (you have to attach one by one…).

here’s what my project looks like:

edit: replaced .gd with (dot)gd…just in case

  • sbird@sopuli.xyzOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 hours ago

    I have all the individual countries in separate area2ds! I think I have most of the colours right, what do you think? Some parts like Central America I’m not sure about so right now they are the default (255 red).

    I’ve also set the colonies to have “rulers” and their colours will be set to the colour of their ruler.

  • Michael@slrpnk.net
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    2 days ago

    Awesome job. How are you intending the final experience to be - singleplayer or multiplayer like HOI4? Just curious, no need to promise anything.

    • sbird@sopuli.xyzOP
      link
      fedilink
      English
      arrow-up
      5
      ·
      2 days ago

      Singleplayer definitely. I’m intending this game to be a weird mix of HOI4, the cold war, and Pokemon.

    • sbird@sopuli.xyzOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      2 days ago

      Yeah, there’s a bunch of ways you could do that, including with OSM. Unfortunately, I don’t think they, nor most map data providers, have data for the cold war era.

  • goatbeard@beehaw.org
    link
    fedilink
    arrow-up
    4
    ·
    2 days ago

    Great work so far. Are you doing a provinces system like PDX does? Or just full nations? I want to make a similar game but with the ancient world instead of cold war

    • sbird@sopuli.xyzOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 days ago

      Currently there aren’t any provinces, I might try to do that at some point in time. Probably not though. This game isn’t meant to be historically accurate at all, it’s going to be a mix of HOI4 and Pokemon with turn-based battles rather than moving the troops on the ground. One goal I have with this game is to make it playable on controller, so moving divisions around wouldn’t be fun with that. Pokemon-style turn-based battles were originally designed for a controller, so that’s what I’m doing. It will also make my game slightly more unique :D