Turn Based Strategy Game (Civ like)

Monkey Archive Forums/Monkey Projects/Turn Based Strategy Game (Civ like)

Pakz(Posted 2015) [#1]
Years ago I got quite addicated to civilization. Ever since that I wanted to make games like that to. The things I make I sometimes are what can be used with a more complete strategy games.

When I have gotten a good amount of code ready then I will be creating a larger strategy game. For now I am creating smaller parts of a strategy game.

Below here is a link to a map generator that I learned to make not to long ago. It is not that complex but it can create maps that are useable.
Flash applet / code - Click here

Here is a post from my blog where I show how to floodfill maps to be able to use that data for the game ai and such.
Flash applet / code - Click here

Here is a post from my blog with a 2d map with minimap Click here
Here is a post from my blog with a isometric map Click here

I also already made a a* pathfinding algorithm Flash applet / code - Click here that I wil be using.

With Blitz basic I already made several programs with the settler/engineer/worker ai that uses pathfinding. I still need to make more versions with more features that I need to test. I wil need to add more planning for the worker units. ea Not travel to far and let closeby units handle improvements later on.

Here a link to the worklog on blitzbasic.com Click here
Here a link to the worker automation worklog on blitzbasic.com Click here

A number of days ago I decided to invest in my knowledge and bought 4 game ai books. I hope I will learn things from it that wil make my future games better.

I already found a chapter in one book on how to do the transporting of units. This is something that I need to get a hang of. I wil probably make several smaller programs to get a hang of that.

I have no idea when I will get a more complete playable game finished. I tried once to get far with a game like that but it just was not fun to play.


Pakz(Posted 2015) [#2]
The last post I made here gave me a error message. I send it to support and they are working to fix it.

I checked how much room I have on google sites for hosting flash applets and there is 100 mb available. The maximum size of a file is 20mb. So I wil be able to make and host a lot of things with it. Flash applets are pretty small when compiled. About 25 kilobytes for a few hundred lines of code.

I want to spend more time learning how to code in Monkey before I create larger things. When I started 2 months ago I was still doing procedural things and now I am more and more creating classes and putting code in that. I wil make smaller tbs things to get experience for making a larger tbs game.

Here is something related to my strategy game that I made recently :
maps with shores

Its a simple map editor with shore tiles. I do need to learn more about Monkey arrays becourse instead of using a int array I used a string array to store the shore location data. I put a question in the beginners forum and hope I wil learn it soon.


tiresius(Posted 2015) [#3]
Your doing all the right things, making small demos to learn concepts and building small parts to incorporate into a larger game.

While making 2D or 3D arrays can make sense in someone's brain, in certain targets (Android?) this type of data structure is not very well optimized.
In lieu of multiple dimensions a 1D array is used and then some math is performed to find the 2D coordinate position. There must be examples somewhere on the forum ...

Just something to think about, especially if your maps are going to be large.


therevills(Posted 2015) [#4]
Looks like a cool project!


Pakz(Posted 2015) [#5]

While making 2D or 3D arrays can make sense in someone's brain, in certain targets (Android?) this type of data structure is not very well optimized.
In lieu of multiple dimensions a 1D array is used and then some math is performed to find the 2D coordinate position. There must be examples somewhere on the forum ...



I started in Monkey with 1d arrays until I found how to do more dimensions. 1d arrays were not that difficult unless I used 3 dimensional arrays, I could not figure that out. I wil use mutliple dimension arrays for now and if I get into speed trouble then I wil profile with the google chrome html5 profiler. Someone tought me how to do that on google+ (SetColor was a speed problem then) The smaller tests/experiments wil probably show me what the slow parts are.

The speed problems I think where I really need good solutions for is the amount of units and the ai on larger maps. In civilization 3 I remembered having to wait a lot of minutes for the ai to be finsihed on larger maps. But I have 5 or 6 game ai books that have information in it about optimalization and tricks ect. (still need to spend more time with them :) )


Pakz(Posted 2015) [#6]
I was reading through the book Ai game programming wisdom 2 and it had a chapter on map generation for strategy games. It mentioned something called clumps, They are areas on the map that grow until they get near another clump. I then created a small experiment to see on how to use that and ended up with a new map generator.

This is the result so far: (flash)
Map generator using clumps

Here a screenshot of one map :