swfans / swars

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

levels: Should the Moon Mech have an enemy driver #61

Open mefistotelis opened 1 year ago

mefistotelis commented 1 year ago

With the commit swars: Switched implementation of fix_thing_command_indexes(), some of the commands given to people (NPCs) started working better.

This includes entering a car. And now in the final moon level, both Eurocorp and Church, there's a Zealot entering the Mech. Meaning the Mech is now an enemy, firing towards the player group.

Also as long as he notices the player, he doesn't seem to care much about the range - continues firing.

So it looks like the level was made harder. We may want to edit the level and remove the USE_VEHICLE command. Unless we consider it better to have the mech in use.

Moburma commented 1 year ago

I actually wondered about this myself - if you look in the ending CGIs it shows the mech destroyed behind the player's characters - why would it be destroyed if it's friendly? Having said that, can the AI fire the homing lasers/graviton gun the mech has? Because that would basically be instant game over if it can!

mefistotelis commented 1 year ago

can the AI fire the homing lasers/graviton gun the mech has

Yes. Though this has a max range - it is possible to escape. You'd have to be really fast when the Mech starts to telegraph the attack to actually escape. Good that it is at least contained to the cage and cannot follow you.

mefistotelis commented 1 year ago

Btw, if you want to still enter the mech, press F while the level is loaded (ie use -m 0,102, then during the intro press F and holding it down press space to skip the intro).

I'm not sure what it does exactly (sets a flag in all commands), but it seem to pause all commands given to people. So everyone will just stand in place, and noone will enter any vehicle.

geist22 commented 1 year ago

So does this change AI behaviour or was he always going to enter the mech but couldn't?

While I do think that this is really cool, I also think that changes that can have significant impact on gameplay should always be optional. I tried it out a little bit, and you can't properly target the mech because it's behind the walls, though the Plasma Lance does damage through solid terrain. It seems to take very low damage from the Graviton Gun homing projectiles (or does it just have that much health?) so I found my group wiped out rather easily once the mech stops spamming rockets and uses the homing projectiles.

Moburma commented 1 year ago

So does this change AI behaviour or was he always going to enter the mech but couldn't?

Yes and no. It's this command in the level file here:

<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">

CommandNumber | Next | OtherThing | OtherThingName | X | Y | Z | Type | CommandName | SubType | Arg1 | Arg2 | Time | MyThing | Parent | Flags | field_1A | field_1E -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- 136 | 305 | 126 |   | 30825 | 0 | 15517 | 23 | USE_VEHICLE | 0 | 0 | 49 | 1 | 0 | 199 | 136 | 0 | 0

What's signifcant is that there are three USE_VEHICLE commands in the level, two for the shuttles, and one for Thing 126. There is no Thing 126. However, Thing 125 is the Mech (there is a big gap in numbering after this so it can't be something else). So it seems it's very likely it was intended for the mech to be manned, but either they deliberately removed this, OR it's just a straight up bug (in the final game the zealot is being told to board a vehicle that does not exist, which is why nothing happened before).

It also makes sense why there are sound effects for the mech to roar in the German and Japanese versions, if it's an enemy (and it seems would literally be the final game boss based on how tough it is and the FMVs depicting it destroyed). It's pretty likely this just wasn't finished in time so they cut it.

geist22 commented 1 year ago

I see. Fighting the mech while it's enclosed behind the walls with no proper line of fire didn't really work out well in practice for me. Not in the sense that my agents get annihilated, but in the sense that with the wall in the way, it just feels bad and not like a fight should be. Though I only gave it a few quick tests, might try something more serious later.

mefistotelis commented 1 year ago

(in the final game the zealot is being told to board a vehicle that does not exist, which is why nothing happened before).

Well, yes, but the road there is more convoluted. When the level is loaded, the game searches for every thing which is mentioned in commands, and fixes incorrect indexes. For the Mech, it is unable to find it, so it overwrites the value with 0. This is what effectively disables the command.

My code just removed the overwrite - if not found, the index is left as it was. And since the map was last saved in a version close enough to the final game, the old thing indexing matches.

The fact that the specific thing does not exist has to do with how tanks and mechs consist of several parts; there are issues in the game caused by incorrect order of operations - ie. originally "PreProcess" wasn't working because of when players were initialized. Similarly, when Command array items are getting fixed, the Tanks and Mechs do not have all of their parts created yet - only the base.

So it seems it's very likely it was intended for the mech to be manned, but either they deliberately removed this, OR it's just a straight up bug

From the code, it's clearly a bug. With the amount of command types, they were unable to handle them correctly. To not run into such a problem, I prepared a "Command Definition" struct, which stores properties of every command.

Also note there's the Zealot just next to the mech at level start. It doesn't have to run to the mech from somewhere else, it stands just next to it (this is the case for all levels with vehicles, they are all empty and have the drivers next to them with USE_VEHICLE command).

Still, this is a bug which was probably noticed in the QA tests, and is a part of the original game balance.

Btw, many levels contain Commands which are unused - the new code logs an error when cannot match these to things.

Moburma commented 1 year ago

Playing with this now, it's pretty much impossible to actually kill the mech, because it's trapped in its starting area there is no line of sight for e.g. Plasma Lances (but it can hit you fine!). From experience it is actually possible for the mech to get out of the area if it moves to the little ramp area, but I don't know if that's intentional, and I doubt the AI could do it. As such it would probabaly make more sense to remove the command (or possibly move the mech starting point to outside its "cage").

mefistotelis commented 1 year ago

Ok then. We're going for having the mech empty.

I was planning to introduce additional verification of target thing type - we will see it this is enough to remove this command.

If it is not, or for long-term (when I will fix the order so that mechas will be treated in the exact same way as vehicles) - we need to have modified levels to keep it disabled.

geist22 commented 1 year ago

Spent some more time with it, here are my observations from playing:

  1. Because the objective to clear the mission is to kill the 9, fighting the mech is not required
  2. The rockets have an insane range, like over 2 times that of the LR rifle
  3. If you approach from the crowded side of the map (where the ramp is) it can get out, otherwise it's stuck moving against the walls
  4. It changes targets at least while moving, so it sometimes cannot be cheesed like other vehicles by having them aggro on one agent and attack with the other 3
  5. When it moves, you see red lines on the ground for the path it will take
  6. When you approach from the empty side of the map, it's still possible to kind of cheese it by having it aggro on one agent, then run up the ramp with another one (the one with level 3 skin so he doesn't die instantly to the projectiles) and attack while it's stuck running against the wall and shooting rockets
  7. I was able to kill it by fighting head-on with one agent and repeatedly doding rockets, fighting it with multiple agents at once seems counter-productive and only gets them killed

I haven't figured out what makes it switch targets or choose the homing projectile attack over rockets. Might be proximity.

Now I actually like the new complexity and challenge it adds, but this mission can already be pretty hard without it, so my opinion stays the same: off by default, but an option to enable it for those who want it, if that's possible.

mefistotelis commented 1 year ago

but an option to enable it for those who want it, if that's possible.

In Dungeon Keeper, that was solved by creating a tougher version of the campaign, for veterans only. We will probably have to do the same here.

Moburma commented 8 months ago

I spent some time working on this, and present new versions of both ending missions:

https://filebin.net/idix4ziswk9fq7r1/c065l002.dat https://filebin.net/8hgh9sgdya06fugd/c065l003.dat

What I've set to happen is the mech driver gets in the mech, then drives it out of the enclosure and into the central area with the scientists before engaging the player. This stops it getting stuck inside and so makes it a fairer battle, but also makes it harder as it has extreme range and is relentless! I meant to release this a while ago, but it stopped working as the mech was getting stuck in the start area. Then thanks to @mefistotelis I realised why - I was using the Korean version of Map 65, only this one has the deliberate hole in the top to allow the mech out. Thererefore you MUST have that version of the map to use these levels, or the mech gets stuck.

It's also interesting how this changes the level. I usually went to this area first as it's toughest, but actually now I think you were intended to get the Graviton Gun first by going the other route so you're better prepared for this monster. The PS1 version confirms this IS how the game is meant to end, but in that version it's only a crappy claw mech in the "cage" and also it escapes by driving over the ramp bit to the right rather than the top, so the PS1 map must be different still.