swfans / swars

Syndicate Wars port, alternative binary for the classic Bullfrog game
Other
87 stars 14 forks source link

Unguided Campaign Discussion #58

Open Moburma opened 1 year ago

Moburma commented 1 year ago

An issue to discuss and plan on making an Unguided campaign. At the moment the focus should be on getting levels together and fixing what is there, with an eye to making new levels (will need proper tooling for that). Also just general ideas what the campaign should be about/how it should play compared to the existing ones. I recommend you read this this to get an overview of levels (full disclosure - I wrote it). Also if you want to see the existing levels being played to completion, check out my YouTube channel here.

Unique Selling Point

What is the Unguided's USP - why bother with an Unguided campaign? I think this is important to consider beyond simply "more levels is cool!" The Unguided themselves are not that interesting from a gameplay point of view - they have less health and are weaker, and don't have special unique weaponry. From the coverage in Maximum magazine, it suggests that the Unguided campaign was to be an expert mode unlocked by beating one of the two other main campaigns first. It also suggests there would not be normal progression in this mode, something heavily backed up by the level load outs (limited numbers of units and usually basic weapons). My vision of this would be that the campaign if possible (and there is a technical limit here, the other campaigns do not work this way) should NOT have research and inventory screens, with that aspect of the game deliberately removed. Instead each level would have a set inventory the player must get the most out of. The advantages of this would be: a) more strategic gameplay. You can't just give your units the best guns anymore, forcing the player to learn new strategies and to use things like support weapons that otherwise come too late to be useful in the final game. b) allow the use of items in ways that would break the normal progression of the game. Want to give the player a Graviton Gun as a reward on the first level? You can now, without breaking the game. This makes things like the Chromotap and Displacertron actually viable and shows the player a side of the game they probably ignored in the main campaigns. c) Asymmetric weapon load outs. Putting the player into deliberately challenging and interesting situations they would not knowingly ever put themselves into.

In the game's campaigns, the Unguided have an anarchic trickster feel to them, using things like KO or Psycho Gas or Razorwire, this would also be interesting to play with. The limitation of weapons also has precedence in Bullfrog's games - Magic Carpet used this extensively, abandoning the traditional progression system for fixed loadouts as the game went on. Dungeon Keeper also used this to great effect by frequently limiting what skills, rooms and creatures the player could get between levels.

Lore

The game's plot states that essentially Eurocorp's elite scientific research team find alien artifacts. The leader of this group is Ko-Paull Vissick, who falls out with the rest over augmenting their brains with alien technology. This causes them to go insane, and him to sabotage their lab. They become the Nine, and he joins with the existing Unguided faction to become their leader. He seems to be some kind of bizarre quasi religious guru character, with Eurocorp questioning his sanity too (although what he says about the intentions of the zealots is proven to be 100% correct). It's obvious briefings would come from him, just not at all clear what his character would be. Mad religious leader (sounds a bit too similar to the zealots)? Cyberpunk hacker? Cerebral scientist?

From the final game Eurocorp briefings, the Unguided hole up in Delhi and attempt to flee to Tibet, where somehow they would survive the Zealot attack. Both locations also have mystical overtones, hinting at the guru/religious leader angle.

There are also obvious allusions to the manga/anime Akira with the biker gangs (there's even a suspiciously Kaneda-like NPC just to make it even more on the nose) and the apocalyptic religious cult rising up.

From a plot point of view there is a need to plan out what and where the Unguided and Vissick are said to do things to make any new campaign plot mesh with them. Can also be used for levels with reversed perspectives (e.g. you as Unguided defend against Eurocorp on levels where you attacked them in the original campaign).

Current Levels

In rough order I think they should go in, and my comments on bugs and how fun I think they are:

Index 68 Zealot Attack Rating 3/5 This makes sense to be the first level, as it directly follows on from the start of the Zealot campaign. Very simple level (maybe too simple), but shows shortcomings of the follow command for the punk followers - a winning strategy is getting into the zealot's car, but if this is done your followers can't get in in and just get run over. Complete Level

Index 80 Clean-Up Rating 2/5 As an aside I don't think the level set here actually maps with description. Either way this is an extremely hard level that I think is actually impossible as-is. The basic idea - splitting up your group to cover two areas, and also defending civilians - is a really good one. Unfortunately provided equipment is insufficient. Not sure if this is actually salvagable as a level idea at all though, being frank. Update: Tried quite a few things with this level, but while it's a great idea, the concept really doesn't work, should just be left out.

Unfinished level

Level C007L007.D1 Rating 4/5 This is a loose level with no objectives set. A lot of effort has been put into it and it seems finished. It's seemingly a simple kill everything mission, but it's very challenging, which is fun and the kind of thing I think the campaign should be angled towards. Looking at it more closely it's clearly is just a kill everyone level, the only ambiguity is whether the zealots on the map should be also be killed or not. My hunch is this was actually the level called "Clean up" originally, as it matches the text description of the slot (correct map and concept). Finished level, but needs objectives/mission index entry created

Index 77 & 60 Guns Guns Guns Rating 4/5 for 60, 3/5 for 77 Two versions of the same level. 60 is a mostly complete early version, but it seems this was rejected for a later much simpler version (77). That said the later version seems again impossibly hard, and also a bit boring in comparison to the early one. The later one could be interesting with some tweaks, it needs more weapons or something. The early version has problems with things like the person stuck in the wall, but this is fixed now. The early version is also missing objectives, but it's quite obvious what they would be. Killing the final scientist in the later version gives the player a sniper rifle, much like the level below - this could be a sign there WAS progression in the campaign. Both levels seem unfinished and 60 needs objectives/mission index entry created

Index 64 Rating 4/5 Again there are two versions of this level. There is a mistake in the .miss file here and the wrong level is set. The objectives set in the file are for the level file c003l007.d1. This is a no brainer substitution, as this is a polished final game level, whereas the other version (which is wrongly set) is an early level file and nowhere near as good (and missing objectives). The final version also grants a sniper rifle for killing the scientist, like the level above, some kind of thematic connection between the two. Finished level, needs .miss file corrected to point to level file c003l007.d1

Level C047L015.D1 Rating 2/5 Totally cut level that is quite polished but a little light on things to do do. That said there is quite a bit setup in this level, so could be stretched out to be more interesting. As it's totally cut has no mission objectives, but seems to just be an assassinate mission against Eurocorp. Finished level, but needs objectives/mission index entry created

Level C004L007.DAT Rating 3/5 Totally cut level. The objectives here seem quite obvious - there is a group of soldiers by a bank. Attacking them causes some of them to break off and flee in vehicles. They ride to the top of the freeway and head to a getaway flying car. This then flies to the edge of the map and then stops. Therefore it's a an assassinate mission with a twist to take out the baddies before they escape off the map. Works well, but it's a bit too simple once you understand what to do. There's also a problem that there seem to be no vacant cars, so the player can't get into an exciting chase with the soldiers, the only solution at the moment is to sprint to their cars and steal one, which ends things quickly in quite a dull manner. Also there is a big group of Zealots that could be interesting as a secondary objective. Finished level, but needs objectives/mission index entry created

Index 78&61 Communications Rating 3/5 Two versions of this one as well. I am pretty sure these are set to the wrong map file. Experimentation has shown that there doesn't actually seem to be a matching map for this level. If they are renamed to use map 79 Reykjavik, they just about work. If this is done they are quite interesting complex and very difficult (but doable) levels. Could be something really good, but needs a lot of work to make them playable. Finished levels(?) but for a missing map, needs a lot of work to be coherent in the final game

Index 70 Rating 3/5 This is a simple and quite fun early level. Works perfectly, but could perhaps be improved by using flag1/2 objectives to draw the player's attention to the chemical plant where the essential grenade is (although a briefing could explain this as well). Finished level

Index 66 Rating 3/5 This is an early level that is a good idea, but seems a bit rough. Odd stuff like the player starting with a useless persuadertron - was the idea to gather the other unguided together? Feels like it needs something else added to really shine. There's an older version of this, but it's the same only clearly more unfinished. Finished level - barely

Index 81 Godfather Rating 3/5 Interesting and quite polished level, but not that much to it, which lets it down a little. Finished level

Index 62 Rescue Rating 3/5 This is a weird one. Doesn't make much sense to play, either needs a briefing to hint at what to actually do, or needs changing. Seems not quite finished. Unfinished level

Index 82 Dumped Rating 3/5 Another very hard level. Seems pretty finished, but either I'm missing something or it needs rebalancing as it's brutally hard (think it MIGHT be possible if you're really good/lucky though). Also seems to have had a wacky plot originally. The thing with the cars at the start blocking each other needs fixing. Finished level

Index 65 Massive Assault Rating 2/5 This seems good on paper, but it's actually too simplistic to really be fun. While it's marked as a late game level, some of the earlier .miss files have it as an early level (even the first!) and it seems to fit in better there, checking the make up of characters (no mods) and overall tech level this is clearly supposed to be an early game level. There's a bug where the wrong group is targetted that is trivial to fix, but it's just a boring easy kill everyone level. In the older files there are other objectives to get a weapon and take it to a location, but this is hardly thrilling stuff either. Either use as early filler, or needs radical rework. Finshed level

Index 75 Ferocity Rating 4/5 Important level that concludes the trilogy of similar levels in the other two campaigns. Feels a little rough in comparison, but works quite well. Finished level

Index 67 Talks Ambush Rating 4/5 I really like the idea of this one. With the fixes to items in the port this now works perfectly, the only issue with it is it clearly pushed the pre-alpha format to its limits, doing clever things like hiding the agents in cars because there was no Flag2 yet. As such it could be made better by doing a more modern pass on it by converting to a newer format, and genuinely hiding the supposedly hidden NPCs (both agents and punks) using flag2. The end clean up is also a bit too monotonous and could be made more interesting. Finished Level

Index 69 Trash Church Rating 1/5 An intriguing but barely even started level. Doesn't work in the final executable due to no player characters in the level. There is only even one enemy to kill. An all out war to blow up a zealot church sounds like an exciting idea for a level though. Checking the level in depth this was a very early level that looks like was deliberately restarted due to how simplistic it was, concept is good, but pretty much everything else should be scrapped. Unfinished Level

Index 103 A Tale of Two Cities Rating 5/5 This was clearly going to be a demo for the Unguided campaign. Very polished and clever level full of surprises. Also lots of interesting stuff unused in the actual mission that could be spun off to another one - it's clear it was intended for the player to assassinate the scientists in the base near the start as well as destroy the buildings. Finished Level

Next Steps

My feelings are a) obviously there need to be more levels to be a proper campaign and b) a lot of these are not actually that great, they're clearly first drafts or unfinished and don't push the game's envelope much. The simplest first step forward would be to get objectives created for the totally cut levels, and try to fix the unfinished/broken ones. I think I will try and make a simple level editor like my Magic Carpet one, but my limited ability and the nature of this game means it's less suitable for that approach (really needs a realtime 3D view - someone with skills in e.g. Unity could make something out of this project.

mefistotelis commented 1 year ago

Some mission indexes currently have hard-coded properties. Ie. if you try -m 3,10 the map will be damaged because there seem to be special patching for mission 10. The same map and level file moved one index up or down will load properly.

So in case something behaves strange, one thing you should try is to switch the mission index. (though I will try to weed out such hard-coded fixes)

Moburma commented 1 year ago

That's a good shout. I tried moving the mission to a new slot (it's mission 67) but that didn't work. It's something to do with the GAME_OBJ_GET_ITEM objective. These seem right at first glance as they point to the correct objects, but as you pick them up they do odd things and the marker gets moved to surrounding buildings. The first item objective has a coordinate set (although that doesn't work right either), so I don't know if this would be a way around the issue. The same problem occurs if the BEN .miss file is used to play mission 65. In this version it had an objective to pick up an Uzi, but this similarly goes mental and shifts the objective to part of the scenery once collected. Both are original game bugs, possibly just how the objectives are set out here. Do you know the second number of GAME_OBJ_GET_ITEM should be? The first is clearly the ThingOffset of the item, is the second a uniqueid (seems like items don't have uniqueids!)?

mefistotelis commented 1 year ago

it had an objective to pick up an Uzi, but this similarly goes mental and shifts the objective to part of the scenery once collected

Ha, makes sense. If you pick up a weapon, it's no longer a stand-alone thing - the Owner should then be used as the target.

I might fix it later; currently I'm seeing an issue with last level, probably caused by the move to text mission list.

the second a uniqueid (seems like items don't have uniqueids!)

Sometimes there are parameters set which are unused. That's probably because type of item was changed within the editor, so at some point it was pointing an object which had UniqueId.

mefistotelis commented 1 year ago

Do you know the second number of GAME_OBJ_GET_ITEM should be?

Here's an implementation for checking the objective:

        case 13:
          p_sthing = &sthings[p_objectv->Thing];
          if ( p_sthing->Type != SmTT_CARRIED_ITEM
            || things[p_sthing->U.UWeapon.Owner].U.UPerson.Group != things[players[local_player_no].DirectControl[0]].U.UPerson.Group )
          {
            return UNDECIDED;
          }
          p_objectv->Status = 2;
          return MET;

Doesn't look that bad, other than types of things are not really checked. And for some reason the game uses your first agent to get the group ID for local player - what if you didn't had that agent?

Anyway, showing the objective on radar has a separate implementation - so maybe there's a bug there.

During the gameplay, ThingId is typically used to check objectives; but the ID isn't necessarily the one from objective definition in mission file, as under some conditions the game updates the IDs based on coords (it searches for matching thing around given location, and overwrites the ID with that). The ThingId update happens once, during level load.

Moburma commented 1 year ago

I did more playing around with this mission and its objects. One thing I discovered, the first of the item objectives must be nonsense. It's referencing coordinates (16128,0,7914), which if placed as a GoToLocation objective type shows this is clearly a repurposed/early version of the very first mission objective (where you have go to the entrance of the ambush area). I thought maybe it was some way of making the game check for the object ID in the area of the weapons, but it's clearly just junk data (and why the other items don't have coordinates). There's only one other level in the game with an object collection objective that uses coordinates and that's cut, so it's probably a sign this argument doesn't actually work/do anyhing.

Your above explanation seems to be correct as to what happens - the player collects the items, but it then can't find where they have transfered to, and they get transposed on top of pieces of scenery (and dropped enemy items if they are killed). This definitely isn't just cosmetic (i.e. just the radar) as the objective doesn't complete (or are completing objectives part of that code?).

I just can't see why it doesn't work. The second number is definitely the uniqueID of the item. This isn't defined in the level file, but they must be right, as the objective points to the correct object. If I switch these around it will point the scanner blip to the corresponding other item object, and if I use random numbers it doesn't work at all, so it's not blind luck that it initially identifies the item. So clearly it's something to do with the player taking the item and it being unable to figure out where it's gone. But I don't see anything special here compared to a final game level, we're just giving it two arguments, and they both seem to be correct, but the behaviour is wrong. I've also seen this happen before with mission 65 when using the .ben objectives, but that level file is not even an alpha period one, it's a final game one, so it doesn't even look like it's a final game level format difference?

mefistotelis commented 1 year ago

We're not far from being able to fix all the unfinished objectives. Please provide a reproduction level, and I will look into this.

Having Unguided Campaign with objectives which do not exist in the base game would definitely make it more interesting to play.

Moburma commented 1 year ago

It's mission 67 aka level c026l004.dat. i.e. /m 2, 67 The mission starts with an objective to go into the entrance of an enclosed area, that then triggers the item collection objective. to debug the level I usually just use the teleport cheat to get my agents next to the items, teleport one into the entrance, and then teleport him to the items and do what I was planning to do. Looking at the objectives and commands, what is supposed to happen is:

  1. The player goes to the first objective at the mouth of the "tunnel" First Objective
  2. The unarmed agents waiting unarmed for the peace talks grab their guns and attack
  3. The player has to run to their hideout across the map unarmed
  4. Player grabs their guns from the ground (hint: give a plasma lance to two unguided and the two launchers to the other two) Second objective
  5. Once this is completed (currently impossible) it seems the unguided hiding in the buildings should pour out and attack (not sure if this works or not, they are waiting for objective 3 to be completed (WAIT_OBJ), but the base is 0 and only goes up to 2 - does 2 count as 3 from base zero?). This should probably be changed to 1.
  6. The player and new friends must hunt down the much tougher second wave of plasma lance equipped agents in cars. Third objective

Only up to 3 above works.

I thought you did a .BEN file version, if you run mission 65 (c040l015.dat) with that set of objectives (and only that one) it gives you an extra objective to grab an uzi compared to the final version of the level, which must then be taken to the exit. This fails in the same way, mapping randomly to some piece of scenery once collected.

mefistotelis commented 1 year ago

Well this is confusing. I though pickups are SmTT_CARRIED_ITEM = 0x1A,, but the ones Agents pick are SmTT_STATIC = 0x5,. I though these are static lights...

And the ones Unguided pick are different for some reason? they're SmTT_MINE = 0x19,.

I am confused. I clearly misidentified some thing types.

Moburma commented 1 year ago

Hmm, in all the levels I've seen, floor items seem to have a Type of 25 (0x19 in hex). Here's my tool's output of the level:

<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

Parent | Next | LinkParent | LinkChild | SubType | Type | State | Flag | LinkSame | Object | Radius | ThingOffset | X | Y | Z | Frame | StartFrame | Timer1 | StartTimer1 | WeaponType | ItemName | LastFired | Ammo | Owner | OnFace | DummyData | field_38 -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- 0 | 0 | 0 | -356 | 0 | 25 | 1 | 67108868 | 0 | 0 | 0 | -580 | 7224576 | 0 | 4849408 | 3563 | 1003 | 5 | 5 | 2 | Minigun | 0 | 0 | 0 | 0 | 0 | 393216 0 | 0 | -580 | -190 | 0 | 25 | 1 | 67108868 | 0 | 0 | 0 | -356 | 7220736 | 0 | 4579328 | 3563 | 1003 | 5 | 5 | 2 | Minigun | 0 | 0 | 0 | 0 | 0 | 458752 0 | 0 | -356 | -521 | 0 | 25 | 4 | 67108868 | 0 | 0 | 0 | -190 | 7135744 | 0 | 4791552 | 3563 | 1003 | 5 | 5 | 5 | Launcher | 0 | 0 | 0 | 0 | 0 | 524288 0 | 0 | -190 | -407 | 0 | 25 | 4 | 67108868 | 0 | 0 | 0 | -521 | 7131904 | 0 | 4633344 | 3563 | 1003 | 5 | 5 | 5 | Launcher | 0 | 0 | 0 | 0 | 0 | 589824 0 | 0 | -521 | -140 | 0 | 25 | 7 | 67108868 | 0 | 0 | 0 | -407 | 6900992 | 0 | 4780032 | 3563 | 1003 | 5 | 5 | 8 | Flamer | 0 | 0 | 0 | 0 | 0 | 655360 0 | 0 | -407 | -146 | 0 | 25 | 7 | 67108868 | 0 | 0 | 0 | -140 | 6897152 | 0 | 4641024 | 3563 | 1003 | 5 | 5 | 8 | Flamer | 0 | 0 | 0 | 0 | 0 | 720896 0 | 0 | -140 | -139 | 0 | 25 | 16 | 67108868 | 0 | 0 | 0 | -146 | 6897152 | 0 | 4930304 | 3563 | 1003 | 5 | 5 | 17 | Plasma Lance | 0 | 0 | 0 | 0 | 0 | 786432 0 | 0 | -146 | -141 | 0 | 25 | 16 | 67108868 | 0 | 0 | 0 | -139 | 6893312 | 0 | 4506112 | 3563 | 1003 | 5 | 5 | 17 | Plasma Lance | 0 | 0 | 0 | 0 | 0 | 851968 0 | 329 | -139 | -440 | 0 | 25 | 1 | 67108868 | 0 | 0 | 0 | -141 | 1903360 | 0 | 1867520 | 3563 | 1003 | 5 | 5 | 2 | Minigun | 0 | 0 | 0 | 0 | 0 | 66256896 0 | 328 | -141 | -565 | 0 | 25 | 1 | 67108868 | 0 | 0 | 0 | -440 | 1905920 | 0 | 1945600 | 3563 | 1003 | 5 | 5 | 2 | Minigun | 0 | 0 | 0 | 0 | 0 | 66322432 0 | 327 | -440 | -138 | 0 | 25 | 1 | 67108868 | 0 | 0 | 0 | -565 | 1905920 | 0 | 2016000 | 3563 | 1003 | 5 | 5 | 2 | Minigun | 0 | 0 | 0 | 0 | 0 | 66387968

Another example, c040l001.dat:

<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

Parent | Next | LinkParent | LinkChild | SubType | Type | State | Flag | LinkSame | Object | Radius | ThingOffset | X | Y | Z | Frame | StartFrame | Timer1 | StartTimer1 | WeaponType | ItemName | LastFired | Ammo | Owner | OnFace | DummyData | field_38 -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- 0 | -588 | 0 | -590 | 0 | 25 | 1 | 67108868 | 0 | 308 | 64 | -591 | 1028608 | 0 | 2159360 | 4411 | 1003 | 5 | 5 | 2 | Minigun | -2000 | 0 | 4763 | -46 | 23554 | 73859393 0 | 0 | -591 | -589 | 1 | 25 | 6 | 67108868 | 0 | 256 | 64 | -590 | 6230784 | 4.29E+09 | 5697024 | 4411 | 1003 | 5 | 5 | 0 | Briefcase | -32 | 0 | 5 | 3 | -22 | 71827698 0 | 225 | -590 | -588 | 0 | 25 | 1 | 67108868 | 0 | 256 | 64 | -589 | 975616 | 0 | 2061056 | 4411 | 1003 | 5 | 5 | 2 | Minigun | -32 | 0 | 321 | 3 | -22 | 73793778 -591 | -584 | -589 | -587 | 0 | 25 | 1 | 67108868 | 0 | 308 | 64 | -588 | 1028608 | 0 | 2159360 | 4411 | 1003 | 5 | 5 | 2 | Minigun | -2000 | 0 | 4763 | -46 | 23554 | 73859393 0 | 220 | -588 | -586 | 0 | 25 | 1 | 67108868 | 0 | 256 | 64 | -587 | 1001216 | 0 | 2745088 | 4411 | 1003 | 5 | 5 | 2 | Minigun | 0 | 0 | -11 | 0 | -12 | 74055919 0 | 221 | -587 | -585 | 0 | 25 | 1 | 67108868 | 0 | 256 | 64 | -586 | 1023488 | 0 | 2906880 | 4411 | 1003 | 5 | 5 | 2 | Minigun | 0 | 0 | -17 | 0 | -1 | 74121455 0 | 224 | -586 | -584 | 0 | 25 | 1 | 67108868 | 0 | 256 | 64 | -585 | 1008896 | 0 | 2276864 | 4411 | 1003 | 5 | 5 | 2 | Minigun | 0 | 0 | 13 | 0 | -10 | 74252288 -588 | 226 | -585 | -583 | 0 | 25 | 1 | 67108868 | 0 | 308 | 64 | -584 | 1028608 | 0 | 2159360 | 4411 | 1003 | 5 | 5 | 2 | Minigun | -2000 | 0 | 4763 | -46 | 23554 | 73859393 0 | 217 | -584 | -582 | 1 | 25 | 30 | 67108868 | 0 | 0 | 0 | -583 | 2686464 | 0 | 2999040 | 4616 | 1056 | 5 | 5 | 31 | Epidermis 4 - Stealth Skin | 0 | 4 | 0 | 0 | 0 | 74579968

I thought they were always Type 25, and then Subtype 0 for weapons, 1 for generic items (generic briefcases and epidemises) and 2 for money briefcases, unless I'm missing something.

mefistotelis commented 1 year ago

Yes, you're right.

So it looks like two of the three TNG_CMD_GET_ITEM commands were working for similar reasons as boarding the mech - the thing index was incorrect, but when the game loaded the level completely, it matched.

I guess after my fix, no Agent will be able to pick up the gun. For that to work, the level needs to be updated.

Currently what the agents are trying to pick up are:

Sync: SWars: fix_thing_command_indexes: Thing-141 at (1620,0,4941) type=5,2
Error: SWars: fix_thing_command_indexes: Cmd46 = TNG_CMD_GET_ITEM target person/vehicle/item -141 not found
(points to a static light rather that dropped item)

Sync: SWars: fix_thing_command_indexes: Thing-440 at (29221,0,22316) type=5,2
Error: SWars: fix_thing_command_indexes: Cmd52 = TNG_CMD_GET_ITEM target person/vehicle/item -440 not found
(points to a static light rather that dropped item)

Sync: SWars: fix_thing_command_indexes: Thing-565 at (0,0,0) type=0,0
Error: SWars: fix_thing_command_indexes: Cmd53 = TNG_CMD_GET_ITEM target person/vehicle/item -565 not found
(points to a non-existing thing)
mefistotelis commented 1 year ago

Is GAME_OBJ_PKILL_G used anywhere? Does it work?

Because the implementation is strange. It checks only first (the last added) member of the group. Shouldn't that check if at least certain amount was killed?

Moburma commented 1 year ago

Checking today after your latest commit, the items bug here is fixed! Level seems to work great now, the objective completes and the other unguided DO all come out once the player has all the guns.

As for GAME_OBJ_PKILL_G, it is used in the .ben file. I need to dig out my exports, but I'm pretty sure it was originally used in the demo level there. It changes after that, so I can only assume it did not work very well as it never appears again afterwards.

EDIT: Actually it looks like the first level used it at some point in the .BEN file:

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

Next | Map | Level | Status | Type | ObjName | Flags | Thing | X | Y | Z | Radius | Pri | Arg2 | StringIndex | UniqueID | ObjText | field_1B | field_1F -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- 121 | 30 | 1 | 0 | 18 | PKILL_G | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 0 | 30 | 1 | 0 | 18 | PKILL_G | 2 | 9 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 31488

mefistotelis commented 1 year ago

As for GAME_OBJ_PKILL_G

Yeah, I don't see how the current implementation would be useful. "Kill one group member, but not any member, it must be the one which was added there last" doesn't seem useful to me. There is a separate objective for killing specific person.

I will fix that command into GAME_OBJ_PKILL_MEM_G - kill given amount of group members.

EDIT: Also GAME_OBJ_PROTECT_G doesn't seem very useful to me.. maybe it should allow to specify how many group members need to survive?

EDIT2: Still not implemented:

GAME_OBJ_USE_ITEM:
   Use for what? You do not use items in the game, other than weapons.
   (but weapons actually stop being items when picked up..)
GAME_OBJ_FUNDS:
   This could be interesting.. gather at least given amount of credit reward?
   We could detach the reward counting function from level ending code, and
   re-use it here to know exactly how much we get from persuading folks and items.
GAME_OBJ_USE_PANET:
   No PAN implemented, so no idea.

If you'd use any of these, or have an idea for a new one - you can create an issue for that.

mefistotelis commented 1 year ago

Idea: Maybe Punks should be able to hack/persuade spiderbots or deployed IFFs?

Moburma commented 1 year ago

Hmm, I'm not that keen on that idea. One thing I think the best Bullfrog games do is take their mechanics to their logical conclusions, with levels that stretch out everything that is possible with a specific mechanic. Magic Carpet, Dungeon Keeper and the American Revolt expansion for Syndicate do great jobs of these, with perhaps Magic Carpet being the poster child for this thinking, deliberately restricting your weapons to make the player deal with levels in certain interesting ways rather than just using the best weapons etc all the time. Syndicate Wars is notable for not really doing this, you don't need to understand how weapons like KO/Psycho Gas or the Displacertron as they're worthless when you have pulse lasers or plasma lances. That for me would be what I want to go for, there are so many mechanics available in this game that 95% of players will never even touch, so having levels that require mastery of them is interesting.

Imagine a level with a single unguided with no weapons apart from a clone shield, with the player having to sneak past agents with it like a Commandos game. Lots of untapped possibilities are left without adding in new mechanics.

In other news, I was testing M 2, 67. It works much better with the new item code, BUT unfortunately it screws up after a restart. The first run is perfect, but after a restart when the items have already been collected, it can't find them anymore and the objective screws up, with the scanner pointing off map for all items.

mefistotelis commented 1 year ago

Oh, I see the problem - we've loaded mission INI file, but then we did fixups to it. So with the fixed data, we cannot expect that it will survive re-applying fixups on an already "fixed" set of data.

For the hacking - maybe it would match more as a scripted event rather than generic game mechanic. Ie. in Unguided version of the mission where you kill a hacker, a spiderbot changes its group assignment and start attacking Zealots.

Moburma commented 1 year ago

That's a much better idea! I think that is another angle that would be interesting and is already present in the final game, the idea that because the Unguided are fundamentally weak (they're just normal people, not cybernetically enhanced killing machines) they use "tricky" tactics like this. Would be a fun mission objective to turn the tables on enemies this way and fits in with psycho gas as well.

mefistotelis commented 1 year ago

So it looks like two of the three TNG_CMD_GET_ITEM commands were working for similar reasons as boarding the mech - the thing index was incorrect, but when the game loaded the level completely, it matched.

This turned out to not be true - the index was correct! There was just a sneaky bug in the code. Now all the 3 guns are picked up correctly (in -m 2,67).

Moburma commented 1 year ago

Awesome! I actually made a video of the level last night : https://youtu.be/Hcn3_VQFiHc It's a really fun level and works perfectly now. Brutally hard (you do not want to know how many attempts this took to beat...), but then it is meant to be late game. Also makes me think how useful the Chromotap would be for Unguided levels, would be a good reward/starting kit on late levels to make up for their pitiful health and no mods. Another example of an existing but undervalued game item that could play a major role in the campaign.

Moburma commented 1 year ago

One question, do you know how M13 (m 1,13 in port parlance) works weapon wise? Specifically it's the Mirabelle Lucy de Saxo level, which forces the player to only one unit, and the inventory set in the level file. I can't see anything that does that in the .miss file, so I assume this must be hardcoded? Might be nice to have as something that can be set at the .miss level, and would be great for my idea for the unguided campaign.

mefistotelis commented 1 year ago

I can't see anything that does that in the .miss file, so I assume this must be hardcoded?

No, it's not in the code. Who you control depends on the default group. If there are Agents/Zealots in the group, they are replaced by your team. If not - you control whatever was in there.

I did a modification there: if there's no person in the group, the game tries to fix player group index by finding a better one. If even that fails, it duct tapes an agent in there. This way, the game does not crash due to no group - this fixed several unfinished missions.

If there is more than 4 people in the players group, the rest is probably quasi-deleted.

Moburma commented 1 year ago

Ahh of course that makes sense. I saw the adding an agent addition, that was helpful. It's interesing as this WAS already a feature of the beta version, if a level has no player units in that build it puts in 4 Syndicate agents at a fixed place in the level. They must have taken that out for the final game, in a similar way to how the simulated levels degraded for the final (probably as both were debug functionality they didn't want players messing with).

mefistotelis commented 1 year ago

De-persuasion idea:

Your mission is to get into a compound, separated by gate. No empty cars around, and no explosives. The mission inside can be either assassinate or get item.

Zealots are persuading people in the area. They have a car, but there's always someone inside - you cannot steal it. Your mission is to allow one of your punks to get persuaded, and this way he can be transported (with the rest of the crowd) via car to a separate Zealot compound. After he is there, you must somehow help him de-persuade (maybe there's a fellow punk with Disruptor who will help him?), then do the mission, and escape.

Moburma commented 1 year ago

I think that's a neat idea, do you know if the game can even handle your units being persuaded? I think de-persuasion and the disruptor are also really overlooked mechanics in the game, could easily create a level around getting people back who have been persuaded by Zealots, especially if the targets are weak and prone to dying in combat, dissuading just blasting the zealot.

mefistotelis commented 1 year ago

do you know if the game can even handle your units being persuaded?

I don't see why it wouldn't. Haven't tried though. You definitely need more agents, as if all are persuaded that's game over.

Moburma commented 1 year ago

Something I have been working on:

Early days yet, doesn't do much useful, but it will. I didn't want to do it in bloody PowerShell again, but I got bogged down learning C# and wanted to make some progress so started in it anyway. Someone is helping me move my Magic Carpet editor to C#, so I will use that as a template and eventually move this to it as well.

mefistotelis commented 1 year ago

Looks nice.

I looked into objectives which are build into levels - looks like they're outated version of the ones from missions. But just for reference, here are all of them. Only few levels even have those:

-m 0,4
P00 = GAME_OBJ_PERSUADE_ALL_G( Group(1), Arg2(1) )
-m 0,23
P00 = GAME_OBJ_PERSUADE_P( Thing(743,1), Arg2(1) )
P00 = GAME_OBJ_P_ARRIVES( Thing(749,7), Coord(15171,0,27653), Radius(19) )
-m 0,59
P00 = GAME_OBJ_MEM_G_ARRIVES( Group(0), Coord(30649,0,29872), Radius(7), Amount(1) )
-m 0,88
P00 = GAME_OBJ_GET_ITEM( Thing(-98,1083) )
-m 1,40
P00 = GAME_OBJ_GET_ITEM( Thing(-740,1109) )
P00 = GAME_OBJ_PERSUADE_P( Thing(18,1137), Coord(5862,0,31284), Radius(24) )
-m 1,44
P00 = GAME_OBJ_ALL_G_ARRIVES( Group(0), Coord(15241,64,7036), Radius(13) )
P00 = GAME_OBJ_DESTROY_OBJECT( Thing(43,0), Coord(17996,7,953) )
-m 2,67
P00 = GAME_OBJ_NONE(  )
P00 = GAME_OBJ_NONE(  )
P00 = GAME_OBJ_GET_ITEM( Thing(-459,12), Arg2(17) )
P00 = GAME_OBJ_GET_ITEM( Thing(-456,9), Arg2(5) )
-m 2,78
P00 = GAME_OBJ_DESTROY_OBJECT( Thing(583,0), Coord(20117,0,17561) )
P00 = GAME_OBJ_MEM_G_ARRIVES( Group(0), Coord(8021,384,28268), Radius(10), Amount(1) )
-m 2,82
P00 = GAME_OBJ_DESTROY_V( Thing(116,1004) )
P00 = GAME_OBJ_DESTROY_V( Thing(116,1004) )
P00 = GAME_OBJ_DESTROY_V( Thing(116,1004) )
P00 = GAME_OBJ_DESTROY_V( Thing(116,1004) )
-m 3,17
P00 = GAME_OBJ_PERSUADE_P( Thing(296,1), Arg2(1) )
-m 3,42
P00 = GAME_OBJ_GET_ITEM( Thing(0,1000) )
P00 = GAME_OBJ_GET_ITEM( Thing(0,1000) )
P00 = GAME_OBJ_GET_ITEM( Thing(0,1000) )
Moburma commented 1 year ago

Ahh, that's very interesting, I never noticed them before. I always thought it was a bit of a strange idea to take the objectives out of the level file in the first place... As far as I can tell the PS1 version DOES (or at least can) use objectives inside the levels files, it only seems to use .mis entries for the initial objective text when you start a level, but it correctly tells you what to do if you rename level files to play them.

On the topic of level structure, I have a couple of things I wonder if you know about:

mefistotelis commented 1 year ago

I always thought it was a bit of a strange idea to take the objectives out of the level file

There clearly was an idea with some of your changes to the level being transferred to when you re-visit the city. Though the idea wasn't well thought through.

Some levels have some kind of header or data after the command data and before the group names

There's 1320 bytes of data there; not sure what it does, but it's stored in a similar manner to level names - I guess it's a scratch space for unimportant stuff.

Some levels have what looks like 4 bytes of data at the very end of the file - but many others don't.

Aha.

    if (fmtver >= 16)
        LbFileRead(lev_fh, &dword_176D58, 4);

I didn't gave it any name proper name, so I didn't figured out what it does. Looking into it now, this seem to be used around drawing angle computations. initial camera angle?

There doesn't seem much rhyme or reason to how much zero byte space there should be at the end of a level

    if (fmtver >= 10)
        LbFileRead(lev_fh, game_level_miscs, 4400);

Just looked into this one. It's some kind of array which can be set to influence buildings on the map. Actually only one Type of the field is implemented, and that type (=1) seem to search for Mounted Guns on the map and select which weapon is mounted on top. So apparently, mounted guns can shoot with any weapon.

Moburma commented 1 year ago

Another question, do you know how/where the scanner minimaps come from? Are they stored in the map files (or elsewhere), or are they generated by the game based on the actual map? The reason why I ask is that of course there are not .SCN files for all the levels, so for example there is no scanner map for Anchorage, which would be needed for the Tale of Two Cities level in the Unguided campaign.

mefistotelis commented 1 year ago

If I remember right, menu uses SCN files while within the 3D engine the game generates a scanner bitmap at start, from the actual map data.

The generation is quite computation costly, so it is done only at start of the level, and rectangular updates are done after a building gets destroyed.

To get the missing SCN, you'd have to just write it to file after it's generated.

EDIT:

Array to write: SCANNER_data size=256*256

Functions to use - you can use standard C or the ones from bflib: fh = LbFileOpen(fname, Lb_FILE_MODE_NEW);/LbFileWrite(fh, data, size);/LbFileClose(fh);

Moburma commented 1 year ago

I've got the file handler working and outputting data, but... I don't understand where to get the data from! I can't see SCANNER_data defined anywhere and I can't figure out which of the scanner functions draws the map (SCANNER_init?). Sorry if it's obvious, but I can't work it out, could you hand-hold a little more if you have time?

mefistotelis commented 1 year ago

I don't understand where to get the data from! I can't see SCANNER_data defined anywhere

Oh right, that makes it a little more complicated.

  1. You need to export the SCANNER_data symbol from assembly - in swars.sx, replace all uses of SCANNER_data with EXPORT_SYMBOL(SCANNER_data).
  2. And the last use will be the actual data definition - SCANNER_data:. This one, you need to replace with GLOBAL (SCANNER_data). Note that the : needs to disappear.

After that is done, the code should compile like normal.

  1. Now you can define that variable in C by using:
extern ubyte SCANNER_data[256][256];

Why all that is needed - in C, symbols are "decorated" meaning some prefix and/or postfix is added to them. In assembly, you work on raw symbols - no decoration is applied. So if you have some data defined in ASM, and you want to see this data in C, you need to decorate the symbols in the same way C compiler does that.

More on that: https://en.wikipedia.org/wiki/Name_mangling

Moburma commented 1 year ago

That did it! I had a few compile errors so I had to revert some references to SCANNER_data, but it worked!

MAP060 Desktop-Screenshot-2023-09-02-18-53-32-45

I've now got .SCN files for Anchorage and the Moon. Do you want them in the Levels repository? I also got one for the early version of Anchorage, but I get the impressioin that's not really supposed to have been included with the game.

mefistotelis commented 1 year ago

now got .SCN files [...] Do you want them in the Levels repository?

No; I think we'll have the .SCN files auto-generated at some point, so no need to have them within the repo. (unless the generation won't be ready on time, then we'll add them temporarily)

Moburma commented 12 months ago

A few things: I see you put basic objective text for the unguided levels, what I was planning to do was write up some basic step by step objectives for each level. This would just be matter of fact, no attempts at story or charaterisation, just a matter of fact list of "1) kill the Agents 2) get the briefcase" etc. The idea this would be so people could playtest levels and know what they are doing (something essential for e.g. the "Rescue" level that makes no sense without a briefing). I might start on this tomorrow, it won't take long

I reached out to Sean Masterson who wrote the story for Syndicate Wars to see if he remembers about the game and especially the Unguided campaign. I don't know if I'll get an answer, but you can but try with these things. If he does hopefully I can get some mysteries solved.

Did you mean to put the new Unguided level names in the main NAMES.TXT? Sorry if I missed something, but it looks like some of the original level names are replaced as a result (e.g. the first eurocorp mission Executive Alert). Also we should use the demo version of this file that includes The Shining. I can do a pull request for it.

mefistotelis commented 12 months ago

I was planning to do was write up some basic step by step objectives for each level. This would just be matter of fact, no attempts at story or charaterisation

Yes, I was thinking about the same - we first need a "tactical level" description, then we may (if we'll get there) add a story (aka "strategic level") to it. The tactical descriptions would not only allow to play the levels right now, but also would help in creating the story.

Did you mean to put the new Unguided level names in the main NAMES.TXT? Sorry if I missed something, but it looks like some of the original level names are replaced as a result

What I want to do is create separate WAD/IDX for each campaign. As it is right now, there are some issues. But I did forgot about level names; this can be fixed by commenting out the problematic strings from Unguided file. (the other issues are with weapon descriptions in non-english translations, due to translated weapon name being used to find the description)

Moburma commented 12 months ago

Prepare to have your mind blown. From Mr Masterson himself:

"I remember the outline with which I am sure you are already familiar: the Unguided are an unforeseen consequence of Eurocorp losing its grip on elements of the populace at large (thanks to the efforts of the Church of the New Epoch, which has also failed to foresee the rise of the punks). However, given the sneakiness of characters like the double agent, Lucy de Saxo, I am certain that we had some plot-twisty plans for the Unguided. What exactly they might have been is almost certainly lost to time now.

I also remember another thing. Are you familiar with the Public Access Network elements? These were never properly developed due to time constraints but they were originally intended to be Easter-egg-like sources of bonus mission goals. And I believe we intended the mechanic to feature heavily in the Unguided campaign.

As with any game development, we sometimes had to abandon ideas that were too grandiose, due to time, budget or technology. So, while there was talk of the Unguided campaign being unlocked after completing the central storyline, we entertained other possibilities. Imagine choosing to play as Church or Syndicate but, whatever your first mission, if you accessed a PAN node (by accidentally causing an Unguided character to pass too close to one), you would open up an alternative, Unguided-focused mission objective and, consequently, the rest of the Unguided campaign. Because, let’s face it, Church or Syndicate, whichever side wins, it’s not going to spell Happy Ever After for the serfs. But developing that? Technical challenges aside, we would never have had the time or budget. "

He said he wouldn't mind answering other questions, so let me know if you have anything particular to ask him. I've got loads of things already to ask, but want to make the most of his kindly offering to dredge his memories.

mefistotelis commented 12 months ago

Yeah, I was thinking about the plot twist. There should be one. There are many missions with prof. Drennan, so maybe he could be used for that - but he does die, finally. I didn't come with anything very interesting.

For PAN - well I did had a different view at it. I was imagining something like the game "Uplink", where you hack servers and play minigames to do so. Unlocking the Unguded the Masterson way suggests that the player is a double agent as well. That is an interesting twist by itself.

I'd ask about any old disks he has - for DK we were able to get some, and while it didn't helped with reversing the game, it was interesting to see various experiments - ie. tries to make creatures switch weapon and armor (the Armory building was intended as storage for such items, and creatures would go there to get dressed for combat). If the disks have bad sectors, it doesn't matter - we can restore the content, reading raw sectors.

For the Punks - I wonder if the player was supposed to choose, like in "Original War", whether to go with original agenda or switch to Punks for few last missions. Because if there is no clear branch point, it's also possible the player would just get alternate objectives - ie. you get an email with assassinate mission, plus additional Unguided email about persuading the target and escorting to a building instead.

Moburma commented 11 months ago

Yeah, I edited that bit out, unfortunately he already said he doesn't have any development materials from those days. PAN I always thought it would just work essentially like a switch in-game to open doors or something, and to unlock some kind of extra lore info in the menus, but it seems I was totally wrong. This game is quite the rabbit-hole.

Oh, and twists - I guess the Talks Ambush level would be part of that. at face value it seems an obvious ruse, but I guess there could be some way to build up to it to write it that the player could genuinely believe that Eurocorp would surrender. Maybe they're getting battered by the Zealots and appeal to the Unguided to work together for the good of mankind, or the Unguided abduct some essential high ranking executive they can't function without.

mefistotelis commented 11 months ago

I guess there could be some way to build up to it to write it that the player could genuinely believe that Eurocorp would surrender

In Eurocorp campaign we do get rid of parts of our Syndicate which have rebelled, or even not rebelled but they might do that, so we clear them just in case ("we will replenish the human resources when our cloning facilities are back on-line" or something along that).

mefistotelis commented 11 months ago

For some reason, in Unguided campaign, city names are shifted by -1 (ie. Detroit(1) becomes London(0)). Wierd.

Moburma commented 11 months ago

Ahh, I noticed that last week, I assumed you just weren't finisheed working on it, I didn't realise this was actually how the game was. Guess this probably dated back to pre-alpha times.

mefistotelis commented 11 months ago

I assumed you just weren't finisheed working on it

Well that's true. Regardless, I figured it out - the issue is with translation text files, not with list of cities. The text file starts with names of city properties, but there are only 2 sets of these, so the 3rd campaign consumes the first city as the names of properties.

mefistotelis commented 11 months ago

With the latest commit, the campaign no longer stops at the city of Anchorage with older map - it now considers both 52 and 60 to be the city of Anchorage. So the campaign should now be passable, from the missions flow standpoint.

Moburma commented 11 months ago

That's cool, although actually I'm not sure it's needed - I think it's best to consider map 52 as unused. No actual levels use it, C052L001.DAT and C052L007.DAT are completely unplayable as - is as the Thing placement cannot ever match the terrain, therefore they need to be transplanted to a new map to work (map 79 was the only I found that made sense). Having said that, I could see in the future maybe something like radically different versions of the same map with say large parts of the terrain destroyed that the player returns to that this would be great for.

Moburma commented 9 months ago

I have updated the Unguided campaign to now have mission objectives for all levels (such as where they were never set by Bullfrog) and simplistic briefings that just list what must be done, as well as netscan entries to draw attention to points of interest. This process also revealed a few things about some levels: Mission 80 (aka Clean up) is a weird one. I realised there is actually a third group of protesters walking around in circles towards the left hand edge of the map, but this just seems to be a leftover from experimenting rather than having any meaning. Still not sure what to do with this level, it could be good as maybe some kind of Tower-defencey style thing where you have to use Cerberus IFFs to stop Agents on foot attacking, but at the moment they just fly in and either have to be killed instantly or they just massacre the civilians making it impossibly hard and quite simplistic anyway. Also Mission 60 (early version of Guns Guns Guns) doesn't really work. Looking at it more closely, it's obvious that the map must have been different at some point, and the soldier at the bottom wall of the base must have been standing at some kind of door or other building. It makes no sense for him to be stuck in a wall, and also exposes another problem - I set mission objectives to get the items there, as that is clearly the intention of the level (going there triggers the counter-attack from agents). However, as you have to currently destroy the wall to get in, this also destroys the items. This in turn breaks the objectives to pick up the now gone items! The deeper I got into it, the more I realised it was a mess. I quite like the level, so I guess what needs to happen is to move the soldier into the base. I do wonder if he is actually even meant to be in the base, as there is usually an agent trying to shoot him through the wall, so perhaps they were supposed to an unaffiliated group who you would get weapons from first, then attack the base? Something changed at some point though, and it just makes no sense now. I also see the second group of punks have logic to do something, I need to work out why that keeps failing.

I also need to dig out my old edited version of the newer Communications level that I hacked up to work on the Rekyavic map. I moved the grenade item down so it could be collected, but the item object bug kicked in so the objective never completed. That should work now, but I guess the destroy building objective will likely be wrong as it's clearly for some other map. Therefore some building would have to be chosen as the new target. Might be salvagable, though.

I also did a lot of research into the characters and plot I need to write up here, such as Unguided characters mention in the other campaigns.

Moburma commented 9 months ago

Actually, Communications works pretty good now on the Reykjavik map. With the item bug fixed, it actually choses an entirely appropriate building as the bombing target on the explovies are collected - a bunker in the middle of the level. If I didn't know better I would swear it was always intended to run on this level. There are still lots of enemies stuck in walls, but it plays pretty good. Also made me realise a) the trees on that map are the same ones from the early Magic Carpet build (actually from Populous I believe) and b) that the fact you can set trees on fire and they kill people is also an idea from Magic Carpet.

Moburma commented 9 months ago

Something else that needs doing - if there is to be no research in the campaign (which is my preference), then it needs to be rewarded via the campaign options at certain levels. Otherwise because we're in campaign mode the player units don't have proficiency with the later weapons will randomly lose all weapon energy on firing, which considering how brutal the later levels are, is quite infuriating, to say the least.

mefistotelis commented 9 months ago

you're right. Weapons can already be given as "researched". See how Persuader II is given to the player in Eurocorp campaign.