Sorry for being somewhat late to the party...
closed v10 subforumAs far as I can see, the "levels for V10" subboard is not locked at all. Has someone opened it in the meantime? I am totally ok with it being open.
Ghost as a skill - Do we need less code or will it be better readable?I really don't see the big difference between having them as a skill and as a feature like zombies from a code-perspective. As a skill requires marginally less code for reading level files, but all the other code would basically be the same. Especially the interaction code of ghosts with skills, objects, normal lemmings, ... would be exactly the same - and this part was the major cause of pain in NeoLemmix V10.
Ghost as a skill - Does it really act like a skill?If ghost would be implemented as a (permanent) skill, then you would get lots of weird interactions, because currently no lemming can use two skills at the same time. Permanent skills are only used to change the skill state under certain conditions: So either we would have some state "ghost" for lemmings, which would mean that ghost could do nothing else (and would even transform to usual lemmings upon falling down). Or the permanent ghost skill would trigger some state change upon certain conditions, like finding some trigger area, but this has two problems: In all other states it would be a perfectly normal lemming (so we can't implement fear e.g. and there might be a lot of other more subtle issues) and secondly it is not obvious to what state it should transform to? Even if we add another ghost state just for that purpose, then it would simply stop doing any other skill when encountering such a trigger, which we certainly don't want. And even more problematic is transforming from the "falling" state to the "ghost" state...
What I want to say with all of this: If we want ghosts as a skill, they will have to behave drastically different from the old ghosts. Otherwise the base assumptions about what a skill is will be violated.
Just copy-paste the codeEven in Python this wouldn't work nearly as well as you would think: There are a lot of other classes that tie in with the lemmings, which would have to behave differently when encountering a ghost. Even ignoring that lemmings currently aren't even honest objects and assuming you could just subclass them to create ghosts (which would be a LOT better than just copying the code and would fix most the copy-paste problems Simon mentioned very early on in this thread), you would have to:
- Of course overwrite all the object interaction code, as you already mentioned.
- Overwrite a lot of the recoloring code: First of all to create the usual ghosts sprites, then to get variations on special occasions like when hovering over them with the mouse cursor.
- Overwrite a lot of the lemming counting code, e.g. to determine when there are still enough lemmings around to complete the level, when to quit a level as there are no more living lemmings, ...
- Overwrite a lot of the lemming state change code, e.g. because ghosts will not drown when falling into water and will not splat when hitting from high above assuming they land in water.
- Add a lot of to the general skill-handling code: From displaying a skill image in the skill bar to checking for this skill in talismans, there are a lot of places, where new skills have some impact. Most of them will automatically adapt once you add the ghost skill to the correct enums, but there are a few cases, which need manual modifications.
- If you code the "fear" aspect (which was in my opinion the major point in favor of keeping ghosts in the first place, because it was something really unique), you would have to write a lot of completely new code to handle this, or you would have to copy all the zombie trigger area map and adapt to to the fear aspect. But this would mean copying a lot of code, which is distributed among a lot of different methods and is not at all in one place.
Even then you will have to make sure this code is bug-free. And given all the problems and glitches we had with getting
static force fields working correctly, I really don't want to deal with
moving ones...
Lemmings code is really stable now - Is it really?Physics-wise it probably is, though you would still have to do a major change to the copied code once the shimmier comes out, because the shimmier requires changes to a lot of other skills to define the correct skill (state) interaction. If you then had modified any part in the ghost code, I wish you a lot of happy merging all the changes.
(or rather
)
However there are still quite a few bugs in the sourrounding code, which might require changes to the lemmings code: IchoTolot found a bug recently, that allows you to assign two skills on the same frame, if you edit the replay file. If you copy the ghost code, are you really sure that any fix for usual lemmings would automatically avoid assinging a skill to both a normal lemming and a ghost in the same frame?
TL;DR: I don't think "ghosts" will work as a skill in the gimmick fashion at all, due to the definition of a "skill" that NeoLemmix uses. Moreover the "fear" mechanic would be incredibly susceptible to glitches in corner-cases, so would need a lot of work.
PS: At the time when we were discussing culling the ghost gimmick, I initially argued for
keeping ghosts as I felt it had even more potential than zombies. However due to the code mess and the possible glitch problems, namida and others convinced me that removing it was (and still is) the correct decision.