Help Paradox game!

hello , im Andrea , im italian ,i have started to learn defold recently.
i am very interested in grand strategy wargame like europa universalis and victoria and heart of iron game .
So can i make similar game in defold ?
how i can move along a path my units? how can i manage Ai ? how can i create an interactive map ?
i am a beginner, and i dont understand how make a star pathfinding and other mechanics in game but i like are based game. :grinning: :grinning:

Yes you can! Warnament is a new grand strategy game made with Defold:

The main developer @Denis_Makhortov is active here on the forum.


There is also a ready-made extension for A* pathfinding which you may find useful.

If you’re a beginner, you might try making a smaller game first!

1 Like

yes , how can i make game like this ? there is a tutorial?

thk , but how can i use this plugin?

There is no such tutorial. Your best course of action is to start by learning Defold through the tutorials (Defold tutorials). Once you have a better understanding of Defold in general it will be relatively easy to transfer documentation about path finding etc to Defold and Lua.

okk thanks

So can i make similar game in defold ?

Hi. Yes, it’s possible to create grand strategy using Defold engine

how i can move along a path my units?

Just use some pathfinding algorithm

how can i manage Ai ?

AI is just set of lua modules. You need to write logic for bots behavior.
I recommend work on bots later, when you will have working playable version. First, create core functions (declare war, move army and others)

I implemented module called actions. When player wants to move army, game calls core.actions.move.on(land, from_province, to_province, army_type, count)
When bot wants to move army he calls the same function.
So there is no difference for game’s logic: is it player or bot.
They just use standardized set of functions

Bots modules just have some logic:
If I have bad relations with other country, I need to prepare to war and may be even attack first

Of course, it’s more complex in game. But basically the principle is the same as in all other games.
In strategy you just need to handle it in different levels:

  1. In level of diplomacy you need to handle: what countries do you want to see friends and what countries do you want to conquer
  2. In level of production you need to understand what buildings do you need to build
  1. In level of war you need to understand when you need to call allies to war or sign peace
  2. In level of each army you need to understand what do you need to attack now. Or may be it’s better to defend

I add some element of random in calculations of bots in all my games. It’s to make each session unique and more interesting

how can i create an interactive map ?

It depends. I will write how we handle it in Warnament
Map Engine works with vertices. Each province has set of polygons (it’s more difficult, but it is implemented to support enclaves). Polygon is set of vertices.
Map Engine draws map at runtime using mathematics and vertices data

Example of .map file
// Enumeration of regions and their vertices
regions = {
  [1] = {1, 2, 4...}
  [2] = {4, 2, 5...}
// Vertex coordinates
vertices = {
  1 = {0, 0}
  2 = {3, 0}
  3 = {16, 14}

How to handle click?
It’s too slow to check if a vertex is inside a polygon or not (Especially if you have a lot of polygons)
Warnament Map Editor generates buffer 4096x4096 (max size of map). Each element of this array is ID of province
I just convert clicked coordinates to coordinates of clicked point in map. Later I just check it.

local clicked_province = mapengine.get_clicked_province(x, y) -- it will return map_data.province_bytes[y][x]
-- map_data.province_bytes is generated by Map Editor buffer with province ids in each pixel

I also advise all strategy fans of this forum to join our active discord server:

There is a lot of interesting content from the community. We have interesting stories from development and conversations about how this is implemented in the game (for example, a map or multiplayer)
There are at least two players who are trying to create their own game (but they are trying to do it on Godot :confused:. Sorry, @britzl)


ok but all of this is overwhelming for me , i start using defold and after a month you can teach me all of this mechanic.

1 Like