How can I make this Grand Strategy game I have in mind?

Godot Version
4.2.2

Hi! I am new to Godot. I have some experience with coding and generally, with some time and practice, I’m able to learn. For a while, I’ve had this idea of making a Grand Strategy game that is similar to the game Hearts of Iron 4 and Ages of Conflict. I have a lot of ideas for the final product, but at the moment, the goal is to create a very simple version of my idea that mostly takes its cues from Ages of Conflict

This is the map I’m using. What I want to do is to put two countries on the map. Neither of them will fight each other unless I make them. When they fight, whoever is winning will convert the losers pixels into the color of the country that is advancing, with a few white pixels appearing on the border as a cosmetic feature to make it look like both sides are fighting. The white pixels on the map are basic land and the gray pixels are the river. *note that the gray used for the river is different from the ocean. Taking Grey pixels will be 50% slower than basic land. Let’s say that it takes 6 seconds to take basic land. Any land that doesn’t belong to any country will be taken by bordering countries. As for fighting, I want to make an option in a menu that will change how effective that country is at fighting. 3 being the highest and 1 being the lowest. If two countries that are fighting have the same level of effectiveness, then neither side will take a lot of territory. This is essentially a copy of Ages of Conflict. But if I can learn this, it’ll teach me some of the basics for making a map and nations, which is the main thing I’m focused on. So, if you have any advice or tutorials to recommend me than please send them to me! And if you have any experience working on something similar to this, then I’d also appreciate any in details you could give me! And please do not be afraid to go in depth, as I’m still learning the coding language and the engine as a whole.

I’d suggest building a tech demo with a much simpler map to start with. Maybe just four squares.

You could set each as an area2D and use a Godot feature to set the color depending on a variable.

Break down each component in to as much detail as possible in a document - then figure out how to do each part as you go.

1 Like

it’s called Risk

I thought of that! However, a goal of the game is to have User created maps using pngs just like how Ages of Conflict does it

Sounds like a cellular automata to me.
To actually draw the result of this automata, I would use just an Image class, in which you can set_data() to put the resulting array of pixels altogether, or set_pixel() to assign them one by one.

ah interesting! So doing this would create something close to the end result? With the countries on the map and all?

Applying cellular automata simulation principles to your idea, you could just “draw” as many countries as you want as the initial state of a map (which is an Image, a set of pixels – cells).
Each country = a unique state of cells it’s occupying.
Each state cares a weight (strength) value with it.
If two different-stated cells are touching, you compare those weights to determine, which cell should be “captured”. In this case, actually, you can even compare the sum of multiple cells weights in some area around, so if there’s an alone cell of 10 strength (weight) but there’re at least 6 cells of 2 weight around (so 12 in total), it will be captured.

That is great! Thank you for the info! Though I do wonder how one will control that country. I suppose that the way I could go about doing things is to make it so Left clicking on the country will simply change the hud to display their stats and Flag. And right clicking can open the diplomacy tab.

What kind of controls are you referring to?
The country class can have a list of diplomatic statuses with other countries and an array of its cells/pixels on the map, so if cell touches other country’s cell it can get current diplomatic status with this country and decide whether it should “attack” or not.
And making diplomacy choices is as trivial as opening a dialog window for political event and changing relationships depending on the picked action.
Tho I cannot tell, what kind of Nodes you should use for those applications – I’m a newbie in Godot too :slight_smile:

Well my idea would be that once a country is selected as the player’s, which I would want the player to be able to switch on countries on the fly because this game is, in all honesty, more of a Grand Strategy Themed Sandbox God Simulator. But when a country is selected, you would be able to control its military, and disable the ability to control other militaries. Though, I think this can be done with a simple button that just turns off the ability to control other nations once you’ve selected the one you want to play as. Though, how to do that, I’m not sure. But I imagine it would be rather simple. Either way, thank you very much for your input! I now have a better idea of what I am doing. I’ll try and work with Cellular Automa when I get up tomorrow and I’ll provide updates! Thank you very much! :slight_smile:

1 Like

There’s nothing wrong with having an end goal, but sometimes you need to start smaller so you can learn the pieces you need to build your masterpiece.

I had to do that with the RPG I’m writing. I built some smaller projects to learn my way around Godot and improve my coding skills.

You are correct! But I am simply too determined to get this idea done

I’d suggest you also look around sites like itch.io to see if anyone has done anything similar and ask them how they built their game.

  1. I’ve posted my items there for the same reason.

I actually tried that today! I commented on the Ages of Conflict page asking the creator how they were able to code the map

1 Like

Ok, so through an entire day of on and off research and contemplation about my creation, I have created this example image

that represents the basic idea of how territory would be transferred during a war. In the final product, territory transfer during a war would happen with Divisions. But as I’ve said before, I’m trying to copy Ages of Conflicts method of War for simplicity. Though that is very much subject to change. That aside, you think this could be done with Cellular Automata? If so, what rules do you think would work? And is there any good material for coding Cellular Automata? Or hell even your own examples if you have any experience coding it? Or is there another method that you think could work? Oh, and keep in mind, I am trying to make it so that anyone with something as simple as paint can make a custom map, just like in Ages of Conflict.

As for the approach, I cannot imagine anything else than CA for the algorithm behind Ages of Conflicts. Maybe I’m confusing definitions, I’m not an expert of any sort, but it seems to be quite right.

Cannot recommend any particular guides neither show something myself, because I wasn’t enough interested in this topic at any point in my life. But first couple link for the “cellular automata in godot” looks fine at the first glance:
CA via Compute Shaders asset for Godot
Game of Life guide
Procedural caves via CA

Importing images (png’s, jpeg’s) and converting them to maps shouldn’t be that hard of a task after making everything else. I imagine it that way: user should draw an image, then they upload the image and the game asks to pick a pixel, which color represents land, then water, etc. And then game converts the image into actual map data pixel by pixel.

I made a simple example (in excel :sweat_smile:):

  • Red (1):
    Defending power: self_defense + neighbor_defense / 2 (half of it) * 3 (two ally neighbors) = 10 + 10 / 2 * 3 = 25
    Attackers potential: greens_attack * 5 (five green neighbors) = 10 * 4 = 40.
    So, in theory, red (1) shoud die and become empty land, but because greens are “pacifists”, you can make something else from it.
  • Yellow (1): dies because 90 (attackers) > 60 (defenders) and because attackers are “aggressive”
  • Green (2): might actually survive due to the fact, that they are allies with yellows (or, perhaps, just not in war), so it would be 90 (attackers) < 110 (defenders)

That’s my vision on how it should work. And I think CA is the way to go.

1 Like

This does look promising! I wonder what rules the cells would use. Oh and as for Ages of Conflict, I talked to the creator on Itch.io and they said that AoC uses “AI” for the cells. Like, each cell has its own “AI” that determines what to do. As the creator put it. It’s rather interesting