DEV Community

Cover image for Imperial Dynamics
No_Arms_studio
No_Arms_studio

Posted on

Imperial Dynamics

< In my quest to make My map building project as detailed as possible I am in addition to working on my indie game creating a system for imperial dynamics. Which if you don't know it is basically simulating kingdoms rising and falling. I have a very simple start right now with just fighting and not good fighting at that.
In the beginning the nations which is an adjustable setting will spawn in as just 1 pixel, overtime the nations will grow in size if their neighbors are free. Here comes in the simple fighting, when a nations has a place it can concur it has a small chance to concur that nations space, same with the other. Of course they won't concur their own land as it that's treason.
The code for this checking is:

    Check
        point in direction (90)
        repeat: 4
            move (Tile Size)
            if: touching (empty space) and not (touching (own color))
                add (x) to (Grid x)
                add (y) to (Grid y)
                stamp
                move (-Tile Size)
            else:
                If: rnd(1 - 2) = 1
                    add (x) to (Grid x)
                    add (y) to (Grid y)
                    stamp
                    move (-Tile Size)
        end
Enter fullscreen mode Exit fullscreen mode

< In the end it starts to look like a kind of mold trying to take over each other, as a future improvement for this engine I might add structural integrity of a country to better simulate that countries downfall. But anyway, thanks for reading, this one was a little late today, sorry about that, but anyway have a great day.

Top comments (1)

Collapse
 
no_arms_studio profile image
No_Arms_studio

Yey :)