Author Topic: Is this possible to limit characters to four directions?  (Read 538 times)

0 Members and 1 Guest are viewing this topic.

Offline Kitsune

Is this possible to limit characters to four directions?
« on: July 15, 2024, 08:09:05 AM »
Hi,

Is it possible with the SCI engine 1.1 or maybe the first SCI to only use 4 directions instead of eight? It's about limit the sprites production to gain some times.

I thinks about something similar to Lucas Adventure game moves.

Thanks for reply.



Offline Kawa

Re: Is this possible to limit characters to four directions?
« Reply #1 on: July 15, 2024, 09:05:29 AM »
By default, an actor has no Looper assigned to it. The Motion class will either call the actor's looper to determine which loop to use, or ask the engine with the DirLoop kernel if it's that default null value. That kernel function is the only point where four-directional views are strictly hardcoded. If you want another amount of loops, or in a wildly different order in the view resource, that's where custom loopers come in.

The only reason characters in SCI 1.x (and rarely SCI 0.x like in Codename Iceman) turn around on the spot all smoothly-like before moving is specifically because they have a custom looper assigned: GradualLooper or Grooper for short. Grooper too can handle either four or eight directional views.

The logic for DirLoop is as follows:
  • If the angle given is between 315 and 45 degrees, use loop 3 if the number of loops is four or higher, or keep it the same otherwise (up, north).
  • If it's between 135 and 225 degrees, use loop number 2 if we have four or more (down, south).
  • If it's less than 180 degrees, use loop 0 (right, east)
  • If it's any other range, use loop 1 (left, west).

(Edit to clarify: that means if you have two loops in your view, they'll be left/right, and going up or down just uses whichever loop was used last.)

Grooper does similar checks but specifically doubles up the amount of angle ranges, next to the whole smooth turnaround thing.

This is why Larry in LSL2 and 3 has no looper set, or even a cycler. In fact if you were to play LSL5, or 6, and somehow cleared Larry's looper and cycler properties (say by typing "send ?Larry loop 0" in the ScummVM debugger), you'd find he suddenly walks in only four directions again, like he did in earlier games.
« Last Edit: July 15, 2024, 09:19:14 AM by Kawa »

Offline Kitsune

Re: Is this possible to limit characters to four directions?
« Reply #2 on: July 15, 2024, 10:27:41 AM »
Ok thanks for all these details that's seem in brief be a "Yes it can". Sorry but I'm quite new about this game engine cause I never going deepest in this one. I just wanted to be sure it can be done before envisaging to create a game on it.


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.066 seconds with 23 queries.