First tiny step in direction of a computer controlled opponent
The most frequently expressed wish is the integration of a real single-player mode including at least one computer opponent.
In the last few days I have been thinking about whether and how it would be possible to include such a computer opponent in Settle the World.
To say it in front...this will not be easy.
Settle the World was an entry for BlitzBasic Jam 2022 and was supposed to be finished within six months.
It was designed as a purely local multiplayer game due to the tight time constraints of the competition.
Unfortunately, this ensures that visual feedback for players is actually stored everywhere in the programme code.
This means, for example, that a window appears when a unit has no more movement points, or a window appears when a Pioneer has no more tools, etc.
The calls to these information windows are built into the programme parts of the units and may of course not be called up during movements of computer-controlled units.
Either all program parts will now be rewritten for universal use by players and computer opponents, or the computer opponents will receive their own program parts, which will, however, massively increase the file size of Settle the World (and with it the Fast RAM requirement).
Unfortunately, I realised yesterday that many Statements and Functions cannot simply be rewritten for shared use.
That would be equivalent to a complete rewrite in many parts and so I won't be doing that.
It would probably lead to a mess in the code that I wouldn't understand after a few weeks and so I would stop the project.
Like dozens of projects on Amiga and PC in the last 20 years.
Settle the World should be saved from this "fate", however, because the game is really close to my heart. ❤️
So I will include the part of the computer opponents as additional program code, which is mostly separate from the actual code.
This won't be easy, I've never done anything like this before.
To get a feel for what work is needed, I just started over the last two days and marked one of the players as a computer opponent. This opponent doesn't start with loaded ships like the player, but directly with a first city.
So I wrote a function that determines a "perfect" position for a city.
The basis is the starting position of the respective player, i.e. the position where the player's ships normally spawn.
Now all fields in a radius of 12 fields are checked for a suitable position.
For this purpose, the surrounding fields of each land field are rated according to certain criteria.
How it works:
- Each type of terrain gets points for its relevance. Fertile farmland gets a lot of points, tundra or desert give no points.
- Bonus and river fields give extra points.
- There are three additional criteria.
- Does the checked position on the map have access to wheat, wood and/or ocean?
- If yes, the first field that fulfils one of these criteria gives extra points.
- If it is the first city of a player, access to the ocean gives a lot of extra points to make sure that the first city is built by the sea.
- Does the checked position on the map have access to wheat, wood and/or ocean?
Then a city is built at the position with the most points.
After that a Pioneer is created at the position of this first city, placed into the city and used as a farmer on a field.
So far, this works quite reliably on all the maps I have tested.
However, it has already taken me two evenings...
It's going to be a very, very lengthy project to integrate a computer opponent...
Get Settle the World (Amiga)
Settle the World (Amiga)
A turn-based building and trading game with a focus on local multiplayer for Amiga computer.
Status | In development |
Author | theotheoderich |
Genre | Strategy |
Tags | Amiga, Difficult, Local multiplayer, Management, Multiplayer, Pixel Art, Retro, Tileset, Trading, Turn-based Strategy |
Languages | German, English |
More posts
- Bugfix Update - May 2024May 20, 2024
- Video Interview & Let´s Play (in German language)Apr 24, 2024
- The Election UpdateApr 17, 2024
- Update of the development version - January 2024Jan 04, 2024
- Settle the World now works with an AROS Kick-ROMNov 22, 2023
- Development versions available for downloadNov 17, 2023
- The Farm UpdateAug 27, 2023
- Current development status of the farmsAug 01, 2023
- Improved pathfindingJul 19, 2023
- Current state of developmentJul 04, 2023
Leave a comment
Log in with itch.io to leave a comment.