Author Topic: Storymod Chapter 2: War Feature Brainstorming  (Read 14374 times)

Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Storymod Chapter 2: War Feature Brainstorming
« on: January 12, 2007, 08:26:35 PM »
Hullo chaps,

I'm soliciting implementation ideas for several features of the Storymod war system. There are some things I'm trying to fit into the war system, but I'm not sure how they would best be represented. This thread is where you should post your ideas.

The features I'm currently working on or thinking about:


1) Party morale system. This would be a party slot, tracked by triggers with various consequences. It would be generated at spawn for each individual party. Possibilities are to:

  :!:  Randomly generate morale number in a range for each party. Number is completely random.

  :!:  Randomly generate morale number in a range, where the range is defined by party template. More disciplined templates would get more points.

  :!:  Generate morale number from troop composition, with each troop type being worth X morale points.


2) Villages and the town food system. Currently towns receive food when not under siege, equal to 1 unit every 12 hours + the number of intact villages associated with that town. This is good for giving villages significance in the war, but I would like them to have even more importance.


3) Castles. Currently the front moves on after all towns on a front are seized. This does not feature castles, and I'm still thinking about ways to implement them.

One idea is to have them count as towns for the front system, so the front could move on when a faction controls a number of towns and/or castles equal to the number of towns on that front, not just when a faction controls all the towns on that front while ignoring castles. Of course, this would require some recoding of the front system, but I'm going to have to do that anyway to make castles work.

Feedback on these ideas and your own brainstorms are welcome.

Cryptically,
Winter

[EDIT]

The war system has undergone significant changes, and here's the new post regarding it:

Since the war system has changed significantly with the new version, some more brainstorming is required. :P

The system is the same with regards to siege camps and slowly starving towns into submission, but it now operates on territories, with each town and castle having its own territory and several neighbouring territories. Only neighbours can be attacked; I don't think we'll ever have effective support for behind-enemy-lines operations.

Castles have also been incorporated into the system, and drain food from surrounding friendly neighbours because they have no villages of their own.

Staging areas will be coded in soon, so that multiple parties can gather and attack a single target together.

What other features do you think are needed for the war system?
« Last Edit: May 04, 2007, 01:16:44 AM by Winter »

Offline Hellequin

  • Journeyman
  • ***
  • Posts: 254
    • View Profile
Re: Storymod Chapter 2: War Feature Brainstorming
« Reply #1 on: January 13, 2007, 01:30:17 PM »
Just as a thought for #3... a captured village in the shadow of a non-captured castle is a lot less valuable, arguably nigh worthless for defining a front.  So my suggestion would be that each castle projects a radius of influence (perhaps based on its troop strength, for example), and enemy-owned towns within that radius add to neither force's efforts to move the front - they're taken out of the equation.

Or, as a slightly different perspective on the idea, perhaps instead of one front, each castle projects a separate (possibly overlapping) front, based on its surrounding villages.  "The front" is a composite of the fronts of all of the associated castles.  I could do you some algorithmic "smoothing" of a multiple-overlapping-circles front, if desired.

Just some thoughts to stir the pot.
- Hellequin

Offline Fisheye

  • Blues Brother
  • Guildsman
  • ****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
Re: Storymod Chapter 2: War Feature Brainstorming
« Reply #2 on: January 13, 2007, 03:40:48 PM »
Please explain the front system, how does it work?

Also I just checked your old thread on War Feature brainstorming and you mentioned making troops of opposite faction into prisoners via a trigger. That was before v0.8.

You may already know that as of v0.8 we can (also) do this at the capture screen. I've got it implemented in Band of Warriors: if you liberate troops of a faction that you have hostile relations with, they become available as prisoners, not as recruits.

It's just a cut-and-paste and a couple of lines of code. I can post the how-to in the relevant subforum if anyone needs it explained.

Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Re: Storymod Chapter 2: War Feature Brainstorming
« Reply #3 on: January 13, 2007, 05:47:38 PM »
Please explain the front system, how does it work?

Also I just checked your old thread on War Feature brainstorming and you mentioned making troops of opposite faction into prisoners via a trigger. That was before v0.8.

You may already know that as of v0.8 we can (also) do this at the capture screen. I've got it implemented in Band of Warriors: if you liberate troops of a faction that you have hostile relations with, they become available as prisoners, not as recruits.

It's just a cut-and-paste and a couple of lines of code. I can post the how-to in the relevant subforum if anyone needs it explained.

Not quite all what I meant. I've upgraded that idea to doing it for all AI parties, continually.

It's very simple. The front system keeps track of batches of vertically-arranged towns. Once all towns on a front are captured, the system moves war script inputs to the next front. Not much to it.

Intimately,
Winter

Offline Fisheye

  • Blues Brother
  • Guildsman
  • ****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
Re: Storymod Chapter 2: War Feature Brainstorming
« Reply #4 on: January 13, 2007, 05:53:58 PM »
I'm saying you don't have to do it continually. The troop-redistribution-after-victory script for AI vs AI is called from simple_triggers, and the same is called for player-vs-AI from game menus. You can add an extra check in the script for faction relations, straightforward, no continuous triggers iterating over every single party on the map every second.

For the fronts thing, I'm wondering why not have dynamic fronts? Like, a game of Risk rather than American Football (territories vs 50 yard line).



Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Re: Storymod Chapter 2: War Feature Brainstorming
« Reply #5 on: January 13, 2007, 09:33:04 PM »
I'm saying you don't have to do it continually. The troop-redistribution-after-victory script for AI vs AI is called from simple_triggers, and the same is called for player-vs-AI from game menus. You can add an extra check in the script for faction relations, straightforward, no continuous triggers iterating over every single party on the map every second.

I've not yet looked at any of the Native code apart from the stuff relevant to Craftmod. That does sound like a better way to manage it, though.

Wanna come back to the Storymod team? We sure could use you. ;)


Quote
For the fronts thing, I'm wondering why not have dynamic fronts? Like, a game of Risk rather than American Football (territories vs 50 yard line).

There's two reasons why I went with this system, at least when starting out.

1) It's very quick and easy to code compared to other systems, and allowed me to get straight to the AI code to see what kind of use I could get out of that.
2) It forces sides to move slowly and strategically, protecting their lines of supply and so on. Territory-based systems can end up with (for example) two chains of territories leading directly to the capital cities of both sides, a completely impossible tactical position. Basically they're not very realistic.

Mystically,
Winter

Newhelper

  • Guest
Re: Storymod Chapter 2: War Feature Brainstorming
« Reply #6 on: January 15, 2007, 07:58:15 PM »
I am new to this but I would like to help out if I can.

First I would like to understand what exactly you are trying to do.  I mean are you trying to make it where the player tries to take over the world or just extra stuff for them to do.  Also on the supplies are you trying to make it where the player can lay siege to castles and take them over for themselves or where they join one of the countries in taking over castles for that county.  Along with the siege are you making it where the player can just sit outside of the castle and let the garrison starve or where the player has to storm the castle like the last storymod when the dark knights are attacking or like the native map for culmarr castle and rodaghir castle.  Also are you going to make it where the player can modify their castles to suite their liking and to make a stronger castle.  Furthermore are you going to make some castles better than others.

P.S. I also don't understand how to get things to work I just want to see if I can give good ideas for you to use.
« Last Edit: January 15, 2007, 08:04:57 PM by Newhelper »

Offline Fisheye

  • Blues Brother
  • Guildsman
  • ****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
Re: Storymod Chapter 2: War Feature Brainstorming
« Reply #7 on: January 16, 2007, 11:09:12 AM »
I'm saying you don't have to do it continually. The troop-redistribution-after-victory script for AI vs AI is called from simple_triggers, and the same is called for player-vs-AI from game menus. You can add an extra check in the script for faction relations, straightforward, no continuous triggers iterating over every single party on the map every second.

I've not yet looked at any of the Native code apart from the stuff relevant to Craftmod. That does sound like a better way to manage it, though.

Wanna come back to the Storymod team? We sure could use you. ;)

I'll contribute snippets when I can... which is hardly ever. Here's a snippet for your perusal.

  #BoW: script_party_add_party_prisoners
  # Troops that have poor relations with player will not join.
  # INPUT:
  # param1: Party-id to add the second party
  # param2: Party-id which will be added to the first one.
  # reg1 : Faction of victorious party who will be collecting these liberated prisoners
  # "$g_move_heroes" : controls if heroes will also be added.

  ("party_add_party_prisoners",
   [
      (store_script_param_1, ":target_party"), #Target Party_id
      (store_script_param_2, ":source_party"), #Source Party_id
      (assign, ":winner_faction", reg1),
      (party_get_num_prisoner_stacks, ":num_stacks",":source_party"),
      (try_for_range, ":stack_no", 0, ":num_stacks"),
        (party_prisoner_stack_get_troop_id,     ":stack_troop",":source_party",":stack_no"),
        (this_or_next|neg|troop_is_hero, ":stack_troop"),
        (eq, "$g_move_heroes", 1),
        (party_prisoner_stack_get_size,":stack_size",":source_party",":stack_no"),
      # Added in BoW:
      (store_troop_faction, ":troop_faction", ":stack_troop"),
      (store_relation, ":troop_relation", ":troop_faction", ":winner_faction"),
      (try_begin),
         # "amoral" troops will join you regardless of your standing with their faction
         (this_or_next|eq, ":troop_faction", "fac_outlaws"),
         (this_or_next|eq, ":troop_faction", "fac_commoners"),
         (this_or_next|eq, ":troop_faction", "fac_innocents"),
         (this_or_next|eq, ":troop_faction", "fac_neutral"),
         (ge, ":troop_relation", 0),
         (party_add_members, ":target_party", ":stack_troop", ":stack_size"),
      (else_try),
         (party_add_prisoners, ":target_party", ":stack_troop", ":stack_size"),
      (try_end),
      # End BoW:

       (try_end),
    ]),


Usage example: in module_simple triggers.py, under ti_simulate_battle... addition of a single line makes the above work. You can see Armagan already intends to do the same thing since he has code reading the party faction but he doesn't do anything with it yet.

         (store_faction_of_party, ":faction_receiving_prisoners", ":nonempty_winner_party"),
         (store_faction_of_party, ":defeated_faction", ":root_defeated_party"),

         (party_clear, "p_temp_party"),
         (assign, "$g_move_heroes", 0), #heroes are already processed above. Skip them here.      
# BoW:
         (assign, reg1, ":faction_receiving_prisoners"),
# End BoW:
         (call_script, "script_party_add_party_prisoners", "p_temp_party", ":collective_casualties"),


You'll have to do a search for call_script, "script_party_add_party_prisoners" to set the faction of the receiving party for each call, but it's just 1-2 lines extra each time this call appears (about 4-5 times in module_game_menus.py).
« Last Edit: January 16, 2007, 11:12:22 AM by Fisheye »

Offline Hellequin

  • Journeyman
  • ***
  • Posts: 254
    • View Profile
Re: Storymod Chapter 2: War Feature Brainstorming
« Reply #8 on: January 16, 2007, 12:25:29 PM »
Or you could just put a call to (store_faction_of_party) right in the add_prisoners script, and not have to bother. :P

Offline Fisheye

  • Blues Brother
  • Guildsman
  • ****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
Re: Storymod Chapter 2: War Feature Brainstorming
« Reply #9 on: January 16, 2007, 12:40:18 PM »
Or you could just put a call to (store_faction_of_party) right in the add_prisoners script, and not have to bother. :P

Store faction of which party? p_temp_party? That wouldn't be very informative.

Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Re: Storymod Chapter 2: War Feature Brainstorming
« Reply #10 on: January 16, 2007, 06:28:13 PM »
Or you could just put a call to (store_faction_of_party) right in the add_prisoners script, and not have to bother. :P

Wouldn't work due to the extensive use of local variables. Fisheye has it arranged properly.

Polarimetrically,
Winter

Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Re: Storymod Chapter 2: War Feature Brainstorming
« Reply #11 on: April 26, 2007, 01:09:42 AM »
Since the war system has changed significantly with the new version, some more brainstorming is required. :P

The system is the same with regards to siege camps and slowly starving towns into submission, but it now operates on territories, with each town and castle having its own territory and several neighbouring territories. Only neighbours can be attacked; I don't think we'll ever have effective support for behind-enemy-lines operations.

Castles have also been incorporated into the system, and drain food from surrounding friendly neighbours because they have no villages of their own.

Staging areas will be coded in soon, so that multiple parties can gather and attack a single target together.

What other features do you think are needed for the war system?

Marauder777

  • Guest
Re: Storymod Chapter 2: War Feature Brainstorming
« Reply #12 on: April 27, 2007, 12:24:31 AM »
Sabotage water supplies?
Poison or divert away from the city.

Siege engines before the battle?
Maybe have an option to buy them and have them present when the siege begins (towers, ramps, ladders, tunnels).
Battering rams... make the doors immobile "people" in a door skin with some sort of insane defense rating so normal weapons will do no damage.  You cannot walk through a person until after they are dead, so it could serve that purpose... give it a death animation of falling down. 

Flaming arrows/pitch/rocks dropped from the walls?


Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Re: Storymod Chapter 2: War Feature Brainstorming
« Reply #13 on: April 27, 2007, 04:54:37 AM »
When I'm talking about the war system, I mean the AI-vs-AI system on the overland map. We already have plenty of unimplemented ideas for player involvement.

Marauder777

  • Guest
Re: Storymod Chapter 2: War Feature Brainstorming
« Reply #14 on: April 27, 2007, 11:06:44 AM »
Oh, ok.  Well count me out for this thread.   :green: