Author Topic: SCI32 Source Code  (Read 6168 times)

0 Members and 1 Guest are viewing this topic.

Offline Kawa

Re: SCI32 Source Code
« Reply #30 on: April 22, 2020, 07:08:14 AM »
I'm okay with using A*, ScummVM uses it to great effect. My problem then is creating the graph for A* to use.

Allow me to steal an old picture from Phil's blog.


The yellow lines, as I understand it, are key to the A* phase.

Great. Now I have to merge polygons together for use and somehow build a web of edges for A* to use.

Offline Fox

Re: SCI32 Source Code
« Reply #31 on: April 23, 2020, 12:28:14 PM »

AAAA 00XA X000 XAAA 000X AX00 AAAA AAAX
XXAA  00XA AX00 0XAA 00XA AX00 AAXX AAX0
00XA  0XAA AAXX 00XA XXAA AAX0 AX00 AX00
000X  XAAA AAAA 00XA AAAA AAAX X000 AX00


A = walkable area
X = white border line

My suggestion:
1) detect 'blunt' edges in the walkable border lines (the white lines) using possible byte masks above
2) when a blunt edge is detected generate a node in the A* Graph
3) Try to connect all the found blunt edges via yellow edges with other blunt edges these form the transitions to other nodes in the A* Graph. A yellow line can not cross a white line. Note that the sharp edges don't have yellow lines.
4) Make a function to determine which graph points surround ego, make the node lying most in the direction of the mouse click the start node
5) Run the A* algorithm with heuristic that ego likes to walk straight in direction of the target
6) The A* algorithm finds the edge point lying most close to destination point.
7) A simple moveTo can be made from last edge point to destination point.


Offline Kawa

Re: SCI32 Source Code
« Reply #32 on: April 23, 2020, 03:47:28 PM »
I think you may have misunderstood the picture.

Though it looks like SCI0, which had no polygons, Cascadia Quest is not in fact SCI0 and does have polygons. Phil added SCI11-style polygon support himself. The white lines in the picture are not like the white lines on the SCI0 control screen. They are just a visualization of the SCI11-style polygons.

And SCI11-style polygons are what I'm after for my engine.

Offline troflip

Re: SCI32 Source Code
« Reply #33 on: April 23, 2020, 05:00:32 PM »
There are two tricky parts:
- coming up with the graph of edges
- dealing with all the floating point issues

On my blog, for the first one I talk about:

Quote
Another possibility is to use the concave vertices of a polygon. David Gouveia has a good article on this. Basically, by determining the interior line-of-sight connections between the concave vertices, you have all you need for pathfinding. Your start and end points (as long as they are within bounds) are guaranteed to connect to one of the concave vertices.

But it looks like that link is now broken lol...
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline troflip

Re: SCI32 Source Code
« Reply #34 on: April 23, 2020, 05:01:08 PM »
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: SCI32 Source Code
« Reply #35 on: April 23, 2020, 07:53:50 PM »
I've gone over that page four times now. It still won't click for me how to actually do those things.

Edit: David Gouveia's page mentioned two parts of Game Programming Gems 1 and 2. I acquired copies and checked out the parts about pathfinding and... I'm still lost.
« Last Edit: April 23, 2020, 09:50:13 PM by Kawa »

Offline EricOakford

Re: SCI32 Source Code
« Reply #36 on: August 15, 2020, 06:44:56 PM »
I've put together a barebones template in SCI32. It was built from the Torin's Passage demo. Download it here.

All system scripts are based on the 10/12/1995 source.

I was pleased to find that the interpreter for the Torin demo appears to have no version stamp check. So that's one obstacle cleared.

There's still one other issue: if the resource file is modified, SCICompanion mistakenly auto-detects the resource.map format as SCI1.0 and no LOFSA absolute. This results in errors relating to offsets if the resource file is altered any further!
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline MusicallyInspired

Re: SCI32 Source Code
« Reply #37 on: August 15, 2020, 09:17:52 PM »
Does the Torin's Passage demo interpreter still support MIDI-based sound resources?
Brass Lantern Prop Competition

Offline EricOakford

Re: SCI32 Source Code
« Reply #38 on: August 15, 2020, 09:27:03 PM »
Yes, the interpreter still has MIDI support; I tested it myself. But since the music drivers weren't included, I grabbed the ones from the SQ6 demo.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline Collector

Re: SCI32 Source Code
« Reply #39 on: August 16, 2020, 02:21:02 PM »
Nice, but wouldn't Companion need to be updated to handle things like V56 and P56 resources? Would the compiler need to be updated? It would be nice to be able to build SCI32 games.
KQII Remake Pic

Offline Kawa

Re: SCI32 Source Code
« Reply #40 on: August 16, 2020, 04:56:30 PM »
Nice, but wouldn't Companion need to be updated to handle things like V56 and P56 resources? Would the compiler need to be updated? It would be nice to be able to build SCI32 games.
Both seem to work fine... except that you can't edit P56 resources. The compiler seems to work too... it's just that map format thing that's the worst issue here.

Offline EricOakford

Re: SCI32 Source Code
« Reply #41 on: August 17, 2020, 11:53:51 AM »
One thing I did notice in regards to the view editor - if you modify a view, there's a risk of it not displaying properly in the game. I discovered this when removing the embedded palette from the stock arrow cursor - the lower half of the cursor is gone in the game, but it is shown properly in the view editor.

On the plus side, SQ6 Roger looks simple enough (mostly solid colors instead of being really pixellated like GK1 Gabriel) to recolor into a generic ego. Sometimes the cartoony look pays off...
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned


SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.113 seconds with 23 queries.