Author Topic: [ADDED] Queue skill assignments for a few frames [SUGGESTION] [PLAYER]  (Read 2410 times)

0 Members and 1 Guest are viewing this topic.

Offline Nepster

  • Posts: 1829
    • View Profile
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.
« Last Edit: October 23, 2016, 12:16:55 PM by Nepster »

Offline mobius

  • Posts: 2747
  • relax.
    • View Profile
Re: Queue skills assignments for a few frames [SUGGESTION] [PLAYER]
« Reply #1 on: October 17, 2016, 10:00:12 PM »
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


Offline Nepster

  • Posts: 1829
    • View Profile
Re: [ADDED] Queue skills assignments for a few frames [SUGGESTION] [PLAYER]
« Reply #2 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.
- 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.

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: [ADDED] Queue skill assignments for a few frames [SUGGESTION] [PLAYER]
« Reply #3 on: October 23, 2016, 01:12:42 PM »
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 Lemmings 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)

Offline IchoTolot

  • Global Moderator
  • Posts: 3608
    • View Profile
Re: [ADDED] Queue skill assignments for a few frames [SUGGESTION] [PLAYER]
« Reply #4 on: October 23, 2016, 01:58:34 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.





Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: [ADDED] Queue skill assignments for a few frames [SUGGESTION] [PLAYER]
« Reply #5 on: October 23, 2016, 02:00:21 PM »
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 Lemmings 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)

Offline Nepster

  • Posts: 1829
    • View Profile
Re: [ADDED] Queue skill assignments for a few frames [SUGGESTION] [PLAYER]
« Reply #6 on: October 23, 2016, 02:07:43 PM »
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 ;)

Offline IchoTolot

  • Global Moderator
  • Posts: 3608
    • View Profile
Re: [ADDED] Queue skill assignments for a few frames [SUGGESTION] [PLAYER]
« Reply #7 on: October 23, 2016, 02:10:57 PM »
Very good! :thumbsup:

Then it is a very useful feature! :thumbsup: