Campaign victory conditions

As you can see, campaigns are mostly finished. One important thing to do is support for campaign-specific victory conditions (those that are not available in map editor). They’re hardcoded in OH3. Could anyone help me and write which campaign/scenarios have them (and how they work)?

guidesarchive.ign.com/guides/134 … dness.html
Scenario 4
guidesarchive.ign.com/guides/134 … flife.html
Scenario 2

Just these two? Nice.

Armageddon’s Blade campaign. Mission where you need to find 3 artifacts to forge Blade.
(Mission 3: Seeking Armageddon)

There is also Yog who can’t use magic book and (very minor) Gem from New Beginning with class renamed to “Sorceress”

Warmonger’s site says that specific hero needs to have these 3 artifacts:

so I’ll do it this way. So, that’s all?

That’s all I know about.

I also found quite a lot scenarios where there is one of normal loss conditions AND lose hero(s)

AB: Mission 7: To Kill a Hero

  • lose Gelu, Roland or Catherine to lose the mission
    Similar in mission 8:
  • capyture Kreelah with Gelu in under 60 days to win
  • lose Gelu, Catherine or Roland, or exceed 60 days to lose the mission

Note “with Gelu” part - AFAIK he wears non-removable Blade so victory condition by itself can be standard (bring artifact)

Festival of Life, Mission 1: Razor Claw
Lose hero OR time expires

Playing with fire, 2: March of the Undead
Lose hero OR time expires

Will post if I’ll find anything else.

UPD:
Logic looks to be like this:

  1. All main heroes must survive. This includes secondary heroes in Kilgor campaign but excludes heroes in Long Live the Queen (and probably several other)

  2. If quest is to deliver artifact (to Seer Hut or town) AND player have artifact(s) on start - losing artifact mean end of game.

Not that simple actually. I feel tempted to use ALSV(FD) to describe victory/loss conditions :P.

Actually this is not the only remaining problem with campaigns. I wanted to make prologue/epilogue screen (seems easy) but I can’t find many videos for those screens. And those that are there are smaller (the ones that are used in campaign selection screens). I haven’t looked at music yet.

Shouldn’t this be scriptable or at least have a script hook so that modders can add new victory conditions?

Ending up with a bunch of hardcoded lists for this stuff seems suboptimal. How about a piece of code that runs on the end of a turn and returns some data; WIN, LOSE, GOTO SCENARIO whatever.

Of course, if your engine is all data currently, i can understand you might want to go to the ‘prepackaged conditions’ route. But that will never touch the flexibility of a scripting interface, like LUA or python with interface hooks into the game engine for modding.

Say if someone insane wants to add a new ending; dig for the grail. Or adds a new feature (somehow) and adds a new losing condition related to that, for instance, land on dry land while on a ship (though that example shows a weakness of the ‘end of turn’ model). Ideally, on such models, there is at least introspection of game data structures, and even better, changes thereof - for instance, turn a cove town into a inferno town, things like that).

  1. Original campaigns are not scripted either and need to be handled by hand
  2. Scripting engine is a BIG task, needs everything else ready in first place and will take years to complete from now. It’s not like you’re the first one who proposed it :stuck_out_tongue:

Tow dragon,
GOOD1A.SMK - first scenario from Long Live the Queen (GOOD1.h3c)
G1A.wav is voiced intro for this scenario

For AB music is prefixed with AB, for Sod prefix is H3X2
Video prefixes are H3AB and H3X2

Unfortunately it seems that naming rules are different between expansions and information in h3c is not complete (no voice information) so generating names in runtime won’t work.

i30817, problem with such scripts is that they must be called literally always.
Hero picked up artifact? Call script. Hero visited town? Call script. Player built something? Call script…

Having scripting engine would be great but it is not something you can add whenever you want.

Years?
Look at these pages in order:
docs.python.org/3/extending/extending.html#
docs.python.org/3/extending/embedding.html

Doesn’t look to me like it would take more than a month, tops, if you have the querying functions ready and define some sort of callback/event bus API. Modification functions are another kettle of fish of course.

Years may be overestimation but there is a difference between executing random bits of (python/lua/etc) code from C++ and full scripting system attached to engine with reaction on game events, passing complex data structures to each other and so on.

That’s why god invented the listener/observer pattern, you only propagate events that have listeners registered. The question is deciding which ones you want to provide as a API.

The ‘normal’ observer/eventbus pattern DOES have a problem of being far too ‘time agnostic’, where the user doesn’t have the notion of precedence of the events if he depends on that except if he does the timekeeping himself. A modification where the user could define a sequence (ex: visit city A then visit city B) and the game does the precedence bookkeeping and only present the ‘final’ event would be very helpful (being able to remove events/mark ‘only once’ is also a must).

Also the notion of user (modder) configurable events can be useful too. Imagine ‘send a event every 5 turns/steps/seconds(evil)’ (which i will use to check if the hero still has a bit of anti-venom and bottle–; it). Or ‘start a invasion +5 turns from now after picking up the sword of doom’, for a runtime modification example.

I was very impressed by heroes 3 modding diversity, as well as equally horrified by the means to get that (process direct memory editing… really?). So it would be a shame to deliver something less flexible for ‘years’, which will only make modders continue using those hacks and vcmi getting ‘ports’ (if any), not being the focus of development.

To make it clear:

  • Someone will need to implement this. Our project is quite small so finding someone who wants to work on this AND have free time may not be that easy.
  • Configurable win\lose conditions by itself are useless - we don’t have working map editor where this conditions could be set. Original format is binary so it is not easy to edit.
  • “Would be cool to have X” discussions are fine but don’t expect any of this to be implemented soon.

About the second point: nothing stops you from expanding the supported file formats (i guess you already are anyway, with all the json files). So another way to specify maps, that is text editable, seems like a good idea, once you get to the point you have things to edit.

See what ALSV(FD) means (I’ve written about it two posts above yours) before going into discussion any further. Much more simple and AI-friendly. I think it would be good for AI to understand victory and loss conditions.

Where is this file? It seems my installation doesn’t have good1a.smk.

Json files are there to configure game rules. Sometimes they fill missing original configs, sometimes they fill gaps and sometimes they may be used to replace old OH3 configs. Enhancing maps with json files is a horrible idea. We in VCMI do not circumvent limitations like WoG does. If we are concerned about certain limitations, we try to make them nonexistent from the beginning. And we are concerned about mapping. A new map editor is going to be made and on top of it new map format will be created.

I think those videos were on separate file on CD and may not be installed on hard drive. Same goes to voiced intros.

Check “game CD” for this files:
/heroes3/Data/Heroes3.vid
/heroes3/Data/Heroes3.snd

I have Heroes3.snd on my old installation, but no Heroes3.vid. GOG.com version of H3 doesn’t install Heroes3.vid (and there is no CD, of course), but it has much bigger video.vid file (seems to contain these campaign videos).

Yes, in GOG.com version, the videos are in the game directory, in Heroes3\Data, and in there, there are Heroes3.snd and Heroes3.vid. Are you planning on implementing them? Do you need anything else? Because I know most of the files in all of the archives.

Also, if it’s of any use to you right now, in SoD campaign Unholy Alliance, in Scenarios 9 and 10(I and J marked in editor), you have a victory condition of 3 artifacts, and a loss condition of 2 heroes.