Currently Online

Latest Posts

Topic: Using artifacts as a goal for military

sheckley666
Avatar
Topic Opener
Joined: 2021-11-01, 09:33
Posts: 3
OS: Kubuntu 22.04
Version: b21
Ranking
Just found this site
Location: Germany
Posted at: 2023-06-21, 10:05

Hi,

I'm Frank. As a young man I loved to play Die Siedler I and II. In 2021, I discovered widelands and since then I have played it occasionally. I'm really thankful for the great work you have done and still are doing, it enriches my life.

I dare to come up with a suggestion for an improvement. (I guess, you have a bunch of bored devs sitting idle and waiting eagerly for new work to come in face-wink.png )

One of the small disadvantages is that either at a point you will have to destroy other players' work and your own work is in danger of becoming destroyed, or you have to play in peaceful mode. In peaceful mode, the whole military becomes too unimportant, and actually you lose a part of the game.

Therefore I think, a different purpose for the military other than destroying could be an improvement, and that the artifacts could be used for it.

Two possibilities:

1st Artifacts cannot be seen by anybody who comes across them, but they have to be searched for by military people. The chances for a soldier to find an artifact should be the higher the better trained the soldier is. So you need many well trained soldiers to have a good chance finding all the artifacts hidden on your ground.

2nd Artifacts can be seen by anyone like today, but they cannot simply be collected, instead need to be conquered. Artifacts are protected by a tribe who builds nothing and needs no space to live on. Let's call them druids. These druids are living inside the artifact as in a headquarter. To conquer the artifact, you have to attack it like a military building. Then, the druids come out and try to defend the artifact.

With the 2nd solution you can keep the graphics of fighting soldiers, but the players are not forced to destroy things others have built up with much effort, something I always hate to do, even if the other player is a KI.

Feedback, including negative, is welcome.

best regards, Frank


Top Quote
aDiscoverer
Avatar
Joined: 2022-10-29, 13:23
Posts: 19
Ranking
Pry about Widelands
Posted at: 2023-06-22, 17:10

Hi Frank (or sheckley666)

I am not a programmer of widelands, but I wrote first addons (a win condition called "explorer wins" and just today "time limitted peaceful").

I can imagine this win conditions could be fun. So I was reflecting about your ideas and how they could be implemented. (I would start with an addon. It could be included later in the base game if it is great.)

2nd, artifacts defended by soldiers

  • Could basically be implemented as addons, probably a win condition and one for the tribe.
  • The tribe addon would define the special artifacts (which can contain soldiers, technically they are buildings looking like normal artifacts except of the flag). A special tribe is optional, existing ones could be used.
  • The win condition would add the defending player (allow it to be attacked even in peaceful mode),
    adapt the map (replace the existing artifacts with the matching special one, place some soldiers in it)
    and then basically run the same code to detect winning as for normal artifact.
  • The win condition would probably replace the special artifacts with normal ones when they are conquered, so that no soldier of a player moves in.

I have some implementation problems, more could follow:

  • Show stopper: How can I add an additional player (the defending one) and select its tribe? (Using one ai player from the map would not work.)
  • In case this player could be created, would it loose directly because it has no warehouse? (So an invisible warehouse would have to be placed somewhere.)
  • Unhandy: Unfortunately include(xxx) does not return any value. So how can the code of artifacts.lua be reused?
    (I found out normal lua supports require(xxx) which returns what the script returns and only includes the script if it is not yet imported. Maybe somebody could teach include() this two things.)
  • Can I define a tribe in a win condition (like in a map in scripting/tribes)? It looks like I can modify a tribe in init() (with modify_unit("tribe", ...)) but I doubt it can add buildings. So it needs two addons.

1st, hidden artifacts

Here I first have some questions about how this should look like generally.

  • Soldiers sit in a building usually. So how should they find artifacts? Should the user send them around between buildings? Should they be sent around automatically? Should they detect artifacts from far away?
  • Imagine a player has built something on the hidden artifact (any building, a street, a flag, ...). What shall happen then? Should the artifact move to a free place nearby? Would it be detectable but stay invisible below the thing? Should the thing be destroyed once it is detected?
  • Users could look at the map before (in the map editor) and see where the artifacts are. Does this matter?
  • Could you invent a nice story why mainly strong soldiers can find artifacts? This would be for the description of the win condition (once it would get implemented).

Implementation questions would follow later...

side note

The win condition from addon first heros win combines some military with winning.


Top Quote
sheckley666
Avatar
Topic Opener
Joined: 2021-11-01, 09:33
Posts: 3
OS: Kubuntu 22.04
Version: b21
Ranking
Just found this site
Location: Germany
Posted at: 2023-06-25, 09:05

Hi aDiscoverer,

thanks a lot for your detailed answer and the many thoughts you put in my humble idea.

Unfortunately I cannot help you with the coding. Although I do have some experience in coding, I'm retired now and I do not feel ready yet to have coding back in my life.

Ad your questions about the search for artifacts:

  • Soldiers sit in a building usually. So how should they find artifacts? Should the user send them around between buildings? Should they be sent around automatically? Should they detect artifacts from far away?

I had not imagined to send out the soldiers like a scout. I thought to define some kind of a probability density (probability per time). For every artifact, the algorithm should sum up all training points of all soldiers in all military buildings that have the artifact in sight. This sum is divided by lets say 10,000, giving a number much smaller than one. Once in a minute, this number is taken as the chance for the artifact to be discovered.

  • Imagine a player has built something on the hidden artifact (any building, a street, a flag, ...). What shall happen then? Should the artifact move to a free place nearby? Would it be detectable but stay invisible below the thing? Should the thing be destroyed once it is detected?

Oh, I had not thought about this at all face-sad.png But I think your suggestion is good. It even would be possible to find a new place for the artifact anywhere on the map.

  • Users could look at the map before (in the map editor) and see where the artifacts are. Does this matter?

I can only talk for myself: Looking into a map before playing it destroys most of the fun anyway. So no, this doesn't matter.

  • Could you invent a nice story why mainly strong soldiers can find artifacts? This would be for the description of the win condition (once it would get implemented).

Arrgh. Inventing stories is really not my biggest strength.

best regards, Frank


Top Quote
aDiscoverer
Avatar
Joined: 2022-10-29, 13:23
Posts: 19
Ranking
Pry about Widelands
Posted at: 2023-07-04, 20:32

sheckley666 wrote:

2nd, artifacts defended by soldiers

According to https://www.widelands.org/forum/post/40422/, it is not possible to add a new player to an existing map. Therefore I see no way to make this. (Maybe an ai player from the map could play this role. But then it only works for maps with at least 3 players, and it always has one (official) player less than planed by the map author, ...)

1st, hidden artifacts

Ad your questions about the search for artifacts:

  • Soldiers sit in a building usually. So how should they find artifacts? Should the user send them around between buildings? Should they be sent around automatically? Should they detect artifacts from far away?

I had not imagined to send out the soldiers like a scout. I thought to define some kind of a probability density (probability per time). For every artifact, the algorithm should sum up all training points of all soldiers in all military buildings that have the artifact in sight. This sum is divided by lets say 10,000, giving a number much smaller than one. Once in a minute, this number is taken as the chance for the artifact to be discovered.

I wondered if the soldiers should walk between the buildings. But only using the military buildings sounds simpler. (It matches the "story" I made up.)

  • Imagine a player has built something on the hidden artifact (any building, a street, a flag, ...). What shall happen then? Should the artifact move to a free place nearby? Would it be detectable but stay invisible below the thing? Should the thing be destroyed once it is detected?

Oh, I had not thought about this at all face-sad.png But I think your suggestion is good. It even would be possible to find a new place for the artifact anywhere on the map.

I do not yet know how difficult it is to find a new place for an artifact. I imagine it could end up in an unreachable place. (On a point on an island which can not be seen on maps without seafaring, on a plateau in the mountains out of sight) But I do not yet have a better idea.

  • Users could look at the map before (in the map editor) and see where the artifacts are. Does this matter?

I can only talk for myself: Looking into a map before playing it destroys most of the fun anyway. So no, this doesn't matter.

I was wondering if moving the artifacts randomly at start would be much more difficult than moving them only after a building or a road is constructed on them. But lets keep it simple initially.

  • Could you invent a nice story why mainly strong soldiers can find artifacts? This would be for the description of the win condition (once it would get implemented).

Arrgh. Inventing stories is really not my biggest strength.

I came up with an idea of a short story for the description of the win condition: Warriors hear a lot of old stories during their training. Therefore most of them use their leisure time in their houses to look for old hidden artifacts.

(This should give enough reason why warriors do this and not other workers. Of course the text can get nicer.)

best regards, Frank


Top Quote
aDiscoverer
Avatar
Joined: 2022-10-29, 13:23
Posts: 19
Ranking
Pry about Widelands
Posted at: 2023-11-16, 16:27

Hello Frank, shall I credit you as Frank or as sheckley666? I have a halfway working addon for 2nd, artifacts defended by soldiers.


Top Quote
sheckley666
Avatar
Topic Opener
Joined: 2021-11-01, 09:33
Posts: 3
OS: Kubuntu 22.04
Version: b21
Ranking
Just found this site
Location: Germany
Posted at: 2023-11-17, 07:15

aDiscoverer wrote:

Hello Frank, shall I credit you as Frank or as sheckley666? I have a halfway working addon for 2nd, artifacts defended by soldiers.

Oh wow, a credit :) Please use sheckley666. Thank you for crediting me and your work so far.

regards, Frank


Top Quote