Idea: Reuse wesnoth engine to simulate dynamic campaigns

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
meriton
Posts: 77
Joined: March 17th, 2007, 1:17 pm

Idea: Reuse wesnoth engine to simulate dynamic campaigns

Post by meriton »

Dear wesnothians,

Lately I had an idea that I find compelling, but that I can not hope to even partially implement because I don't have the time. Therefore I post it here, in the hope that somebody wants to implement it.

The idea aims at providing a computer-generated single player campaign by using the wesnoth engine not only for the simulation of single battles, but also for the simulation of the entire world.

The Views And Their Interaction

Game play would take place in two views, the strategic and the tactical view. In the strategic view, the "units" represent entire armies, and the "map" the entire known world (in low resolution). The player may recruit new armies, occupy cities ("villages"), move armies, and of course attack other armies. If such an attack involves the players leader army, the game switches to tactical view.

In tactical view, the "map" represents a magnified view of the theater of operations, which consists of the hex the defending army is located on on the strategic map, and the 6 hexes surrounding it. For each army in the theater of operations, a "side" is created, which starts in the appropriate location. The recruit list, hostility and starting gold of that army is determined by the army's attributes in strategic view, specifically by "unit type" and "xp" for recruit list, "race" for attitude and "hit points" for gold. The battle is then fought according to wesnoth standard rules. It ends if

- the "leader" of the player "side" is killed (defeat, end of campaign)
- the player "side" is the only "side" with a "leader" (victory)
- the player's "leader" liberates one of the 6 keeps at the edge of the map by stepping on it (and having killed any leader that started there) (flight)

Once the battle is over, strategic view is updated as follows: Every army involved in the battle is updated. If its leader was killed, so is the army. Otherwise, its "hitpoints" are updated to reflect the gold it had when the battle ended. Its experience and movement points are also updated. If the player has fled, his army unit is moved one hex in the direction he fled to on the tactical view.

Further Ideas
I haven't yet fully specified the strategic view. It might model the following aspects:
- civilian support: armies lose gold ("hitpoints") in the open, and resupply in cities ("villages")
- a "side" in strategic view represents the armed forces of an empire. Empires could have diplomatic relations affected by the player's actions in tactical or strategic view.
- advancement of armies: once an army has acquired sufficient experience it might advance.
- empire building: cities might be improved / founded.

I haven't fully specified the victory condition for the campaign either. I envision randomly generated quests to lead to victory. Examples of such quests might be:
- find the artifact located in the territory of some other empire.
- destroy a specific empire
- save a specific empire from destruction
- ...
(good ideas most welcome!)

One might also take a more real-time approach to view switching, (1 strategic turn every 10 tactical ones, for instance), allowing reinforcements to join the fight.

Preliminary Implementation Considerations

I see two ways to implement view switching:

1. View are persisted using store and unstore wml tags.
2. Both views are open side by side, but action on the strategic view is prevented using {MODIFY_UNIT moves 0}, and healing somehow disabled for the strategic part of the map.

---

As you can see, this is an idea whose implementation would require a lot of work. I think the benefit might be sufficiently high to justify the effort because it adds a new dimension to wesnoth's game play. In particular, this campaign would not be linear, and be different every time it is
played. What do you think?
User avatar
Aethaeryn
Translator
Posts: 1554
Joined: September 15th, 2007, 10:21 pm
Location: Baltimore, Maryland, USA

Post by Aethaeryn »

Wesnoth: Total War?

I think some of this could be done with advanced WML scripting. There are several user-made-campaigns where there's a "main map" that is revisited and you can teleport to various other maps (Saving Elensefar is the most popular example, where you are sailing, but I recall seeing another one once).
User avatar
Ken_Oh
Moderator Emeritus
Posts: 2178
Joined: February 6th, 2006, 4:03 am
Location: Baltimore, Maryland, USA

Post by Ken_Oh »

I've always wanted to use Wesnoth to create dynamic gameplay worlds that evolve with user interaction. I like the way you're thinking.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Well, yes, can be done.

I think randomly generating a single-player campaign is just plain boring though. There's no real plot, no real characters, etc. Fun to play for a few scenarios so you can see how it works, but probably not much beyond that.
peet
Posts: 238
Joined: October 30th, 2006, 4:38 am
Location: Toronto
Contact:

Post by peet »

The "A New Order" campaign has something like this as well.

I like the idea, but I think the best place for it would be as a part of a campaign with an actual storyline.

Peet
CarpeGuitarrem
Posts: 250
Joined: November 19th, 2007, 7:46 pm
Location: One among the Fence

Post by CarpeGuitarrem »

Aethaeryn wrote:Wesnoth: Total War?
:D The very first thought that crossed my mind as well.
User avatar
Sgt. Groovy
Art Contributor
Posts: 1471
Joined: May 22nd, 2006, 9:15 pm
Location: Helsinki

Post by Sgt. Groovy »

I've had the same idea, and I've actually done some work in WML to try out the concept. The problem is that the tactics on the "strategic map" would be somewhat different than usual, so you would have to implement a new AI (using the Python AI engine) to get the computer to play good strategy.

The campaign could either just be a "war" where you just need to defeat the enemy's armies, or there could be objectives, missions to certain places to accomplish things (mini-quests). Basically, you could make a campaign "two-dimensional" instead on "one dimensional" like the usual linear campaign is. You would have freedom in deciding the order of scenarios, and choose the army to play the scenario with. This greatly increases the replay value of campaigns. Naturally, there could also be "random encounter" type of scenarios, that spring up unexpectedly when your army crosses certain area in the strategic map.
Tiedäthän kuinka pelataan.
Tiedäthän, vihtahousua vastaan.
Tiedäthän, solmu kravatin, se kantaa niin synnit
kuin syntien tekijätkin.
Velensk
Multiplayer Contributor
Posts: 4005
Joined: January 24th, 2007, 12:56 am

Post by Velensk »

Hmmm.... Have any of you played the board game Titan? (this is relavent to this discussion because it is a very simular game to the one you are talking about and you may wish to borrow some mechanics) Esentualy the board is a bunch of nonequalateral hexagons conected so that each one touches 3 or two others each is marked with terrain type and each side had a border. The type of border affects how units move on the board, 3 arrows mean that you go in this dirrection after you first move, ridges mean that you have the option of going this way on your first move, and square ridges mean that you must move that way on your first move. Certain terrain types appear at diffrent distances from the center. You start with certain forces, and they will be split into two stacks. One will be led by your Titan and one by an angel. If your Titan dies, the game is over for you the rest of your army surrenders to the player who defeated you. The way recruitment works is after all your stacks finish moving, you look at the terrain you land in each terrain will have a list that looks something like
Marsh:
2 Ogers
2 Trolls
Ranger
what this means is that if you have 2 ogers you can get a troll or if you have 2 trolls you can get a ranger, if you have one of anything on that list it can get another of it's type.
There is a stacking limit of 7 pieces per legion to get any more you must split the stack.
The way fighting works is if on your turn, one or more of your stacks runs into another players then you bring out the map of the terrain type of what ever terrain they are on and move the peices of both sides onto it. After seeing their opponent both sides have the option of surrender if they do all their peices die, but their opponent olny gets half points.
After the fight is done, then the winning player and the winning player alone gets points for slain enemies (the method of calculating points is not realavent to wesnoth). For every x number of points you aquire A, your Titan becomes more powerfull, and B you get another angel (or every 5x number of points you get an arch angel).
Titan is an elimination game and as such it can easily last a very very long time, or an very short time (never seen it go short with more than 4 players though.
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
User avatar
Sgt. Groovy
Art Contributor
Posts: 1471
Joined: May 22nd, 2006, 9:15 pm
Location: Helsinki

Post by Sgt. Groovy »

The way I had it planned, the campaign was technically just a loop between two scenarios. The game started with a "strategic" scenario, where the units reprsented the armies. The recall and recruit lists and the gold of each army was stored in a variable. The scenario ended when one unit would attack another. The placement of units, the coordinates and the participating armies of the battle was stored and the "tactical" scenario was launched.

In the "tactical" scenario the map was either randomly generated, so that the most prevalent terrain corresponded with the terrain of the strategic map hex where the army under attack was, or a premade map was loaded if the battle took place in a specific place of interest (like a city, pass, etc.). The sides were loaded from the army variables and the battle ensues as normal.

Once the battle ends, the present compostion of the winning army is stored in its variable and the "strategic" scenario is launched again, the units on the map being loaded from the variable. The loop continues until whatever winning condition for the campaign is met. Side quests can be included by replacing the "tactical" scenario with a normal linear mini-campaign when a player army enters a certain hex on the strategic map. After the side quest is completed, the game resumes in the "strategic" scenario.
Tiedäthän kuinka pelataan.
Tiedäthän, vihtahousua vastaan.
Tiedäthän, solmu kravatin, se kantaa niin synnit
kuin syntien tekijätkin.
deonjo
Posts: 95
Joined: February 14th, 2006, 2:18 am

Post by deonjo »

hmmmmm, well I just had a really strange idea after reading velensk's post. maybe you could stack the units. You will have the unit attacking first be the symbol on the board. but when you highlight/click the unit, a screen or menu pops up, ( maybe this could be on the right menu/stats side). So you can rearrange the order at any time.

then the mechanics, is you pit each unit against each other from the list of the units stacked. if one side runs out of units, then they go back to the first unit and fight again. till the other person has had all the units attack. or, the battle can stop when the first person has attacked with all units in the stack.

Maybe there should be a rule like the first unit has to be the strongest, and you can only have as many units as the level of your strongest unit. or there could be no rule on that.

I know it's a crazy idea, but hey it's Thanksgiving! I just had to say the idea.
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

So the main question is, why would someone want to play a computer-generated campaign when one can play very finely tuned, balanced, fun, storyline-filled campaigns that people have hand-crafted? There are lots of them...

A computer-generated campaign is very likely to become very unbalanced very quickly...
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

Maybe you could get the computer generated campaign to make up storylines by pulling down random livejournal entries and replacing certain words. ;)
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
User avatar
Sgt. Groovy
Art Contributor
Posts: 1471
Joined: May 22nd, 2006, 9:15 pm
Location: Helsinki

Post by Sgt. Groovy »

So the main question is, why would someone want to play a computer-generated campaign when one can play very finely tuned, balanced, fun, storyline-filled campaigns that people have hand-crafted?
I dunno, people still play Mystery Campaign, don't they? Using this concept, one could make the Mystery Campaign with a Plot.
Tiedäthän kuinka pelataan.
Tiedäthän, vihtahousua vastaan.
Tiedäthän, solmu kravatin, se kantaa niin synnit
kuin syntien tekijätkin.
meriton
Posts: 77
Joined: March 17th, 2007, 1:17 pm

Post by meriton »

Dave wrote:So the main question is, why would someone want to play a computer-generated campaign when one can play very finely tuned, balanced, fun, storyline-filled campaigns that people have hand-crafted? There are lots of them...
Because it is new. You are right that there are quite a few campaigns out there, but every campaign, once played, is known. If I have played out a campaign on easy, I will know the storyline as well as all the random "surprises" that happen during the scenarios, the sense of newness and discovery will disappear.
A computer-generated campaign is very likely to become very unbalanced very quickly...
That would depend on how it is generated, and a lot on the influence the player is given over scenario generation. For instance, a most immediate balancing concern is that a scenario can not be won because the opposition is too tough. My idea (tries to) address this by giving the player the opportunity to choose where to move on the strategic map (and hence which enemies to fight), and by giving him the option to flee a battle.
ZooKeeper wrote: I think randomly generating a single-player campaign is just plain boring though. There's no real plot, no real characters, etc. Fun to play for a few scenarios so you can see how it works, but probably not much beyond that.
That depends on the kind of generation. For instance, the ai parameters in strategic view could be set based on faction attitude, which in turn depends on the player's success in a sub-quest. What about pacifying the elves by rescuing one of their sages who was abducted by the humans? If I say random generation, I don't rule out randomly putting together prescripted elements.
Sgt. Groovy wrote:The problem is that the tactics on the "strategic map" would be somewhat different than usual, so you would have to implement a new AI (using the Python AI engine) to get the computer to play good strategy.
Could you elaborate a bit on that? What were the specific problems you encountered?
User avatar
Sgt. Groovy
Art Contributor
Posts: 1471
Joined: May 22nd, 2006, 9:15 pm
Location: Helsinki

Post by Sgt. Groovy »

Could you elaborate a bit on that? What were the specific problems you encountered?
The basic problem is that the AI decides whether to attack or not based on damage delivered and received probabilities. It will be difficult to give the army "units" stats that reliably reflect their potency as an army against other armies in given terrain, because the armies consist of different kinds of units. The compositions of the armies changes as well, as the units in them gain experience, or if the high-level units get killed. One can count average defence and attack scores, of course, but they won't be very accurate (for example, few key units can make lot of difference in the battle). (Disclaimer: this is all theoretical, I didn't get far enough to try any of this in practice)
Tiedäthän kuinka pelataan.
Tiedäthän, vihtahousua vastaan.
Tiedäthän, solmu kravatin, se kantaa niin synnit
kuin syntien tekijätkin.
Post Reply