amiga-news DEUTSCHE VERSION
.
Links| Forums| Comments| Report news
.
Chat| Polls| Newsticker| Archive
.

[Login] [Register] [Forgot your password?]

< Next messagePrior message >
18.Feb.2023
TheoTheoderich


Developer log: Single player mode in "Settle the World"?
A week ago, Christian 'TheoTheoderich' Wiegel published an intro update for his turn-based building and trading game "Settle the World" (amiga-news.de reported). In the feedback, the wish was expressed to integrate a single-player mode including at least one computer opponent into the game.
In a recent developer log, the programmer now outlines how this could be implemented:

"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.
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..." (dr)

[News message: 18. Feb. 2023, 08:20] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
< Next messagePrior message >

.
Masthead | Privacy policy | Netiquette | Advertising | Contact
Copyright © 1998-2024 by amiga-news.de - all rights reserved.
.