Resource centre for ZX Spectrum games
      using Manic Miner and Jet Set Willy game engines

 

Archive of the

Manic Miner & Jet Set Willy Yahoo! Group

messages

 

 

 

Message: 5693

Author: john_elliott_uk

Date: 09/03/2006

Subject: Re: JSWED 2.3.1: Andrew's comments (Chapter 6)

 

--- In manicminerandjetsetwilly@yahoogroups.com, andrewbroad
wrote:

> I could write another PhD thesis on some of the decisions JSWED
> makes when converting between heterogeneous formats (e.g. Fire-2
> cells map to Water-cells when converting MM to JSW48)

Or you could submit patches to change its behaviour.

For each of the four major room-formats (JSW48, JSW64, JSW2 and
Manic Miner) there's a function called normaliseCells(), whose task it
is to work out how the node should be imported.

void Jsw48Room::normaliseCells(ImportCell *p, int count)

The JSW48 one starts off by mapping all the cells to water with a
numberInRoom of -1:

for (n = 0; n < count; n++)
{
p[n].behaviour = CB_WATER;
p[n].numberInRoom = -1;
}

which means, pretty much, that everything gets mapped as water and
the cell graphic is discarded. Later on it then makes exceptions for
the specific cell types which it reckons can be represented by the
JSW48 room format; when numberInRoom is positive, it instructs the
game to import the cell graphic into the 'numberInRoom'th slot. If you
wanted secondary fire cells to be mapped as fire (which is a sensible
enough idea) then change it so all fire cells are mapped as fire and
other unknowns to water:

for (n = 0; n < count; n++)
{
if (p[n].behaviour == CB_FIRE)
{
p[n].numberInRoom = -3;
}
else
{
p[n].behaviour = CB_WATER;
p[n].numberInRoom = -1;
}
}

Voila. Well, not quite, because the Vat seems to be putting up a
fight :-)

 

 

arrowleft
arrowright