• Advertisement

Archived

This topic is now archived and is closed to further replies.

Pathfinding in 2D SCUMM Like Graphic Adventures

This topic is 5500 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Doing some research i found that the way the so loved Lucas Arts SCUMM Engine (well actually called SPUTM, SCUMM was the scripting language), handled the character walking, was using WALKING BOXES (box or trapeziums), and a BOX MATRIX, to have some control on where the character could or could not walk. My question is, is there another aproach? Like using a bitmap with different pixels colors representing depth or something like that, and the using an algorithm such as A* to find out the shortest path? Any kind of documentation regarding a suitable implementation for 2D Graphic Adventures, will be more than welcome. Thanks in advance, Alan // PS: Here''s an extract from some documentation about the LFL format (the level format used for lucas arts adventures) ------------------------------------------------------------- BOX MATRIX The box matrix tells the interpreter how to make an actor walk between boxes. For example, if two boxes are reasonably close, but there is a fence in the way that should prevent them from walking that way, then the actor needs to walk around the fence when the box on the other side of the fence is clicked on. The left side of the matrix is the ''from'' box and the top of the matrix is the ''to'' box. For example, To F 00 01 01 01 r 00 01 02 02 o 01 01 02 03 m 02 02 02 03 To walk from box 3 to box 0, you have to firstly walk through box 2. To then walk from box 2 to box 0, you have to walk through box 1, and finally to walk from box 1 to box 0, you simply have to walk straight to box 0. Now, matrices of the pattern above are for rooms that have there boxes nicely joined in a row like so: +------+ +------------+ +------+ +------+ | | 0 | 1 | 2 | 3 | +------+------+------+------------+ However, a lot of rooms have a fairly complex walking space which gives rise to larger matrices with more complex patterns. +--------+ | 4 | +-+----+-+ +-------+ | 2 | +-----------+ | 0 +---+----+---+ 3 | | | 1 | | +-------+------------+-----------+ For example, the layout shown above would produce a matrix as follows: 00 01 01 01 01 00 01 02 03 02 01 01 02 01 04 01 01 01 03 01 02 02 02 02 04 The data above would be stored in the LFL file as: 00 01 01 01 01 00 01 02 03 02 01 01 02 01 04 01 01 01 03 01 02 02 02 02 04

Share this post


Link to post
Share on other sites
Advertisement
I implemented this method with a) some hacking of the SCUMM interpreter (don''t tell their legal department) but most of all

http://2dnow.zenzer.net/viewtopic.php?t=23

this document describes how you would do it.

2DNow - Specializing in yesterday''s technology today!

Share this post


Link to post
Share on other sites

  • Advertisement