[ADDED] Queue skill assignments for a few frames [SUGGESTION] [PLAYER]

Started by Nepster, October 16, 2016, 04:05:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nepster

Note: I already suggested this (in a slightly modified version) in the thread Let's discuss skill assignments.

I suggest allowing skill assignments of non-permanent skills, even if the lemming cannot receive the assignment this frame. Then this assignment would be remembered for a few frames (e.g. 8 frames = 1/2 second) and forgotten afterwards. Each frame the game checks, whether the lemming can now receive the skill. If so then an assignment would be made exactly as if the player had assigned the skill during the current frame.

Some details:
- When queuing an assignment the skill would not yet be deducted from the skill counter. Only when the assignments takes effect, this would be done.
- A queued skill may be assigned to another lemming in the meantime. If there are no more skills available for the lemming with the queued assignment, this assignments gets ignored.
- At most one assignments may be queued per lemming. If a new assignment to a lemming is made, the old queued assignment is ignored.
- More than one lemming may have queued assignments.
- As only one assignment per frame is allowed, the player's assignment on the current frame take precedent over queued assignments (on other lemming).
- Queuing assignments of permanent skills doesn't make sense, because there is no possibility at all that this assignment will become possible in the next few frames.

This feature would help assigning skills e.g. in the following situations:
- Destructive skills on steep upwards slopes, because currently one cannot assign to jumpers.
- Constructive skills on steep downwards slopes, because currently one cannot assign to fallers.
- Assigning platformers to builders, because currently there are 7 frames (out of a 16-frame cycle) where this is impossible. For details see Relax assignment checks for platformers?
- Assigning builders at the earliest possible moment after falling down. Currently one has to hit the one frame, but with queuing one could assign the builder already on one of the last faller frames.

mobius

This sounds like an excellent idea, I like it. At first glance it sounds like it could solve a lot of problems and frustration. As stated it also could reduce the need for framestepping, which I don't like using constantly.
It also seems like something which could lead to more bugs and problems but I can't think of anything at the moment
everything by me: https://www.lemmingsforums.net/index.php?topic=5982.msg96035#msg96035

"Not knowing how near the truth is, we seek it far away."
-Hakuin Ekaku

"I have seen a heap of trouble in my life, and most of it has never come to pass" - Mark Twain


Nepster

I added this feature for the next version. If you don't like this queuing of skills or the way it's implemented, please tell me.

A few more details in addition to the ones described in the first post:
- Queuing doesn't get replayed, only the final skill assignment (if it happens) is recorded and will be replayed.
- Backwards frameskips will always forget queued assignments. Going back more than 8 frames would cancel the queuing anyway, so the only difference happens when going back very few frames. But then the game is usually paused and one can assign the skill at the correct frame easily even without queuing. On the other hand remembering queuing would lead to the problem, how to cancel a queued skill assignment.
- Queuing also is applied to loaded replays: If there was a physics change in the meantime and the lemming can no longer get the skill at the correct frame, it is queued instead. I hope that this reduces the amount of rerecording replays a bit, when minor physics changes are made.

namida

I wonder if the maximum duration a queued assignment is remembered for should be configurable? (I should be able to implement this.)

That aside, sounds good.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

IchoTolot

Quote from: Nepster on October 23, 2016, 12:12:10 PM
I added this feature for the next version. If you don't like this queuing of skills or the way it's implemented, please tell me.

A few more details in addition to the ones described in the first post:
- Queuing doesn't get replayed, only the final skill assignment (if it happens) is recorded and will be replayed.

I have a question here:

Does it mean when I queue a builder to a builder lem for example and I save the replay afterwards only 1 builder of the 2 will be remembered?
If that's the case then this feature will be useless for me as I always want to save solving replays of the levels I played and if queueing a skill means that a skill won't be remembered in it it's a to avoid feature for me.
Even if it only isn't remembered in the action replay it woud make it also completly useless for me as my progress would not be saved correctly and causes errors in my excecution + I have to remember where I used queueing.

Sry if when I did not understand the inner workings correctly here, if I'm wrong.





namida

I haven't tested out / investigated the code of this feature yet, but I assume what would happen is that, if for example, you queued an action on frame 10 and the actual assignment from it occured on frame 12, the replay wouldn't say "queue assignment on frame 10", just "assign skill on frame 12". If the queued assignment fails altogether for any reason, nothing would be saved in regards to it.

Assuming Nepster implemented this consistently with how all other skill assignments are now handled, it would be impossible to get the skill to assign without recording it in the replay in some manner.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

Nepster

You probably misunderstood me: Assume you assign a builder skill to a lemming on frame 100 and it gets queued until frame 105, where the lemming can finally receive the skill.
Then the only thing that gets saved is "builder skill assigned to lemming on frame 105". It does not save that it was queued from frame 100 on. So if you stop the replay on frame 103, the skill will not get assigned on frame 105. But if you let the replay run until frame 107, you will see the desired builder assignment on frame 105.
Now if you assign a builder on frame 100, but it cannot receive the skill in the next 8 frames and so gets cancelled. Then none of this is saved to the replay.

Summary: Only non-assigned queued skills are forgotten by the replay. If you save a replay of a working solution (that used some queuing in between) then the replay will still solve the level when loading it again.

EDIT: namida was faster ;)

IchoTolot