Unfinished New Game +

If you are stuck in the Dunan Unification Wars; or wish for more details on the gameplay systems, this is the place.
Post Reply
User avatar
Pyriel
Webmaster
Posts: 1227
Joined: Wed Aug 18, 2004 1:20 pm

Unfinished New Game +

Post by Pyriel »

I hate to make two topics in one night, but I thought this might deserve special placement. I'll throw up some replies after a few others comment. I think this will be a little surprise, and I don't want to ruin it by going into details.

https://www.youtube.com/watch?v=qHuF_Dg ... e=youtu.be

Edit: OK, so this was available in Europe in some form. I didn't realize that. It's still partially on the US CD, though, which is kind of cool.
User avatar
Celes
Global Admin
Posts: 1422
Joined: Sun Nov 12, 2006 6:25 pm

Re: Trial Road

Post by Celes »

Yes, this is the Demo Mode.
User avatar
sticky-runes
Posts: 1939
Joined: Wed Nov 14, 2012 2:29 pm

Re: Trial Road

Post by sticky-runes »

I got the demo disk that came with Vandal Hearts 2. Didn't know it was accessible in the actual game though.
User avatar
Sasarai10
Forum Moderator
Posts: 1743
Joined: Sat Apr 21, 2012 3:18 pm

Re: Trial Road

Post by Sasarai10 »

So you can access Demo Mode via the full game?


Gosh,never thought about this feature. :shock:
User avatar
Pyriel
Webmaster
Posts: 1227
Joined: Wed Aug 18, 2004 1:20 pm

Re: Trial Road

Post by Pyriel »

It's sort of there. I don't know why the encounters and chests are broken. I suspect the chests are just targeting a bad pointer for flags, but the encounters should be unique to the module, so there's no reason I can think of other than data was stripped out or certain classes were expanded in the release.

I'm going to turn this into a general oddities thread, since I missed the fact that the first one was a little bit known.

Image

First up, does anybody know where this is? I have a feeling it's a minor moment in the game, but I don't recall seeing an area like this.

Image

If you manage to bust into Tai Ho's house early, he apparently clones himself so he has a drinking buddy while Yam Koo is away.

Image

Everybody says this same line, if you make it into Radat a little early. Everywhere else, they usually won't talk unless certain events have transpired, or sometimes if you go into a building and come back. In the latter case, the area often reverts to an earlier state, so if you go into say, liberated Greenhill and nobody talks, it resets to Greenhill from the beginning of the game when you zone.

Image

Looks like concept or placeholder artwork for some place in L'Renouille. Riou spawns behind the image. You can move around, but as far as I can tell, you'll never see him. The area has encounters that crash too.

Image
https://www.youtube.com/watch?v=4UVavhC ... e=youtu.be

This is a fairly functional dungeon that may have been for testing purposes. If you touch that glowing circle, it will try to teleport you to Sajah, but it won't load properly. You can fight FurFurs, CutRabbits, and HollyBoys in the earlier parts, but the enemies change as you go on. I recorded video up until the point where it crashed when I tried to go through a door. You can actually get further than the video shows. I haven't fully explored it. At one point, that Sewer Rat thing from the Two River sewers shows up, and he's quite strong here.

Trial Road
Escape Talisman Teleports to AA/MM
3006AA3F 00AA
3006AA41 00MM
8006AA4E 0020 <- X-Pos
8006AA50 0020 <- Y-Pos

Replace AA (area) and MM (map) from the list below. The X and Y positions are up to you. (0000,0000) would be the top left corner of any map. I find that (0020, 0020) usually gets you somewhere you can move around, but that's not always true. Make sure you save or save state, because you can easily trap yourself if the positions aren't right. The unit is larger than pixels, so increasing the value by 0x10 will move you a fair distance.

First some interesting values
AA - MM
00 - 01 leads you to this unused script: http://www.suikosource.com/phpBB3/viewt ... =9&t=11622. It doesn't work properly, though.
01 - 14 takes you to the Trial Road from the Demo.
09 - 11 (yeah, yeah) takes you to the Unknown Dungeon area shown in the screenshot and video. 09 - 13 up to 09 - 17 take you to different parts of it.

Code: Select all


AA - MM
00 - 00: Unicorn Brigade camp (beginning of game scripts)
00 - 01: Demo ending. Loads but scripts do not run properly. If you wait around, Viki and Mukumuku will appear, though.
00 - 02: Kyaro Town
00 - 03: Intro (after jumping in river)
00 - 04: Genkaku's Dojo
00 - 05: Unicorn Brigade HQ
00 - 06: Unicorn Brigade HQ, Dungeon
00 - 07: Gallows
00 - 08: Tenzan Pass Cliff, west of Unicorn Brigade Camp (raid).
00 - 09: Tenzan Pass Cliff, daytime.
00 - 0A: Tenzan Pass entrance
00 - 0B: Genkaku's Dojo, Interior
00 - 0C: Hillside Tree (Best Ending)
00 - 0D: Rune of Beginning flashback.
00 - 0E: Genkaku's Story (flashback).
00 - 0F: Atreides Manor.
00 - 10: Rune of Beginning flashback.
00 - 11: Rune of Beginning flashback.
00 - 12: Rune of Beginning flashback.
00 - 13: Rune of Beginning flashback.
00 - 14: Rune of Beginning flashback.
00 - 15: Tenzan Pass (ending).
00 - 16: Tenzan Pass
00 - 17: Tenzan Pass, evening (ending).f
00 - 18: Tenzan Pass
00 - 19: Jillia's House (ending).

01 - 00: Riverbank (with Viktor).
01 - 01: Mercenary Fort
01 - 02: Toto Village
01 - 03: Toto Village (burned)
01 - 04: Ryube Village
01 - 05: Ryube Village (burned)
01 - 06: Ryube Woods
01 - 07: North Sparrow Pass
01 - 08: Tsai's House
01 - 09: Mercenary Fort (early morning)
01 - 0A: Mercenary Fort, Interior
01 - 0B: Rune of the Beginning Shrine, interior
01 - 0C: Mercenary Fort
01 - 0D: Mercenary Fort, interior
01 - 0E: Mercenary Fort (night)
01 - 0F: Ryube Village (in flames)
01 - 10: North Sparrow Pass
01 - 11: Ryube (restored)
01 - 12: Mercenary Fort, interior (Highland attack) (crashes)
01 - 13: Mercenary Fort (ending)
01 - 14: Trial Road

02 - 00: Muse City
02 - 01: Muse City (night)
02 - 02: Muse Jail Cell
02 - 03: White Deer Inn
02 - 04: Hillside Tree (fleeing muse)
02 - 05: Coronet
02 - 06: Muse-Highland Border
02 - 07: Jillia's Tent
02 - 08: Muse City Hall, interiors
02 - 09: Jowstone Hill Conference Room, interior
02 - 0A: Jowstone Hill
02 - 0B: Sindar Ruins Hall
02 - 0C: Sindar Ruins Hall
02 - 0D: Sindar Ruins - Twin Snake Room
02 - 0E: Empty Field
02 - 0F: Muse, deserted
02 - 10: Coronet 2nd Screen
02 - 11: Coronet 3rd Screen
02 - 12: Coronet Tai Ho's Shack
02 - 13: Outside Muse (waiting for Jowy)
02 - 14: Muse, interiors (Dr. Huan's)
02 - 15: Muse City (Highland invasion) (open gate and no exits)
02 - 16: Tai Ho's Shack, interiors
02 - 17: Muse City (escape from Highland)
02 - 18: Muse Liberation
02 - 19: Muse City, liberated
02 - 1A: Muse City hall, interiors
02 - 1B: Muse City hall, interiors (night)
02 - 1C: Hillside Tree (morning)
02 - 1D: Outside Highland camp.
02 - 1E: Jowstone Hill, liberated

03 - 00: Kuskus
03 - 01: Radat Sluice Gate
03 - 02: South Window
03 - 03: North Window
03 - 04: Genkaku's Dojo
03 - 05: Radat Town
03 - 06: Cave of Wind, entrance
03 - 07: Luca Battle, path
03 - 08: Radat Sluice Gate (night) (coin search)
03 - 09: North Window Castle, interiors
03 - 0A: North Window Castle, interiors
03 - 0B: North Window Castle, interiors
03 - 0C: North Window Castle, interiors
03 - 0D: North Window Castle, interiors (Neclord's Lair)
03 - 0E: Kuskus 2nd Screen
03 - 0F: Kuskus 3rd Screen
03 - 10: South Window Traders, interiors
03 - 11: Radat Path
03 - 12: Radat Inn
03 - 13: Kuskus SW (partial) (no exits function)

04 - 00: Greenhill
04 - 01: Forest Village
04 - 02: Greenhill Forest (initial)
04 - 03: Greenhill-Matilda Path
04 - 04: Muse-Greenhill Border
04 - 05: Greenhill Academy
04 - 06: Greenhill Academy, interiors
04 - 07: Greenhill Forest (Jowy?)
04 - 08: Greenhill Forest (staging area)
04 - 09: Greenhill Mansion, interiors
04 - 0A: Greenhill (Meg & Gadget ending)
04 - 0B: Greenhill (Squirrel ending)
04 - 0C: Greenhill
04 - 0D: Greenhill Forest (same as 7)
04 - 0E: Greenhill Forest (liberation phase)
04 - 0F: Greenhill Forest (test)
04 - 10: Greenhill Academy, interiors

05 - 00: Rokkaku
05 - 01: Gregminster Town
05 - 02: Gregminster McDohl's Mansion, interiors
05 - 03: Gregminster Castle, interiors
05 - 04: Banner Village
05 - 05: Banner Pass
05 - 06: Banner Pass

06 - 00: Tinto City
06 - 01: Tinto Mine (world map entrance)
06 - 02: Crom
06 - 03: Drakemouth Pass
06 - 04: Drakemouth Pass North
06 - 05: Drakemouth Village
06 - 06: Tigermouth Village
06 - 07: Tinto Shop, interiors
06 - 08: Tinto Church, interiors
06 - 09: Tinto Mine (bridge between areas)
06 - 0A: Tinto Mine Depths
06 - 0B: Cabin (Bad Ending)
06 - 0C: Tinto, interiors (unused?)
06 - 0D: Tinto City (no exits, etc.)
06 - 0E: Tinto Mines (back way)
06 - 0F: Drakemouth Pass
06 - 10: Tinto City
06 - 11: Tinto Interiors

07 - 00: Two River
07 - 01: Lakewest
07 - 02: Kobold Village
07 - 03: Two River Sewers
07 - 04: Two River Winger Section
07 - 05: Two River Kobold Section
07 - 06: Two River Kobold Section (deserted)
07 - 07: Two River (battle)
07 - 08: Kobold Village (Hix & Tengaar sequence)
07 - 09: Unicorn Forest
07 - 0A: Two River, interiors (Inn)
07 - 0B: Two River

08 - 00: Rockaxe Town
08 - 01: Rockaxe Town North
08 - 02: Rockaxe Town Castle, exterior
08 - 03: Rockaxe Town Castle, entrance
08 - 04: Rockaxe Town Castle, interior (chambers, throne)
08 - 05: Rockaxe Town Castle, interior (dungeon)
08 - 06: Rockaxe Town Castle Parapet
08 - 07: Rockaxe Town Castle, interior (training area)
08 - 08: Rockaxe Town Castle, interior (balcony)
08 - 09: Rockaxe Town Castle, interior (balcony)
08 - 0A: Muse-Matilda Border
08 - 0B: Highway Village
08 - 0C: Rakutei Mountain
08 - 0D: Matilda Liberation
08 - 0E: Rakutei Mountain Summit

09 - 00: Muse City
09 - 01: L'Renouille
09 - 02: L'Renouille Castle, interior
09 - 03: L'Renouille Castle, exterior
09 - 04: L'Renouille Castle, interior
09 - 05: Concept Art Passageway
09 - 06: L'Renouille Castle, interior (final save)
09 - 07: L'Renouille Castle, interior (Beast Rune hall)
09 - 08: Jillia's Bedchamber
09 - 09: L'Renouille Cathedral
09 - 0A: L'Renouille Castle, interior
09 - 0B: Luca's Tent (day)
09 - 0C: Luca's Tent (night)
09 - 0D: Forest (Shu and Leon meeting)
09 - 0E: Burning Forest
09 - 0F: Castle Hall
09 - 10: Sajah
09 - 11: Unknown Dungeon
09 - 12: L'Renouille Castle, exterior
09 - 13: Unknown Dungeon 2
09 - 14: Unknown Dungeon 3
09 - 15: Unknown Dungeon 4
09 - 16: Unknown Dungeon 5
09 - 17: Unknown Dungeon 6

0A - 00: Headquarters
...Most of the remainder aren't setup for teleporting to. I'll post anything interesting, if there is anything.
User avatar
BrucePrintscreen
Posts: 651
Joined: Sun Dec 15, 2013 2:58 am

Re: Trial Road

Post by BrucePrintscreen »

Please give that man the Special Suikoden Award of the Year!

I believe the scenery in the first picture is used at some point between two major battles for a dialogue between the leaders of your army. I'll check that for you.
highwind44029
Posts: 1490
Joined: Wed Sep 29, 2004 4:40 am

Re: Trial Road

Post by highwind44029 »

The first photo is for when you walk towards Muse with Miklotov in tow and you see the Beast Rune "eat" the citizens from Jowston Hill, I believe.
User avatar
sticky-runes
Posts: 1939
Joined: Wed Nov 14, 2012 2:29 pm

Re: Trial Road

Post by sticky-runes »

I agree with highwind, that field looks like the area where you approach Muse with Miklotov and witness the beast rune thing.
Antimatzist
Posts: 2770
Joined: Sat Apr 19, 2008 9:48 am
Location: Germany, yeah baby
Contact:

Re: Trial Road

Post by Antimatzist »

Yes it is:
https://www.youtube.com/watch?v=iLhY7M_KwS4#t=17

That test dungeon is awesome.
User avatar
Rooks
Posts: 429
Joined: Mon Jul 05, 2010 2:03 am

Re: Trial Road

Post by Rooks »

Very well done. I see Radat on the list, but did we ever figure the exact code for Radat's treasure room on the upper floor of the item shop?

In any event, I do have two quetions:

1. How powerful is your system, Pyriel? it may be possible to get further and crash less on a more powerful/different PC. Also, changing basic emulator settings may help. What plug-in and version are you using?

2. Are the retail PSX discs entirely binary? I know we can rip info off of them, but can we rip code? if so, we may be able to reconstruct the dungeon and get it working.

EDIT: When I say "we" I mean: Not me. I only learned C basic in college, so I doubt I could do anything but ruin this code if we ever get our hands on it.
User avatar
Pyriel
Webmaster
Posts: 1227
Joined: Wed Aug 18, 2004 1:20 pm

Re: Trial Road

Post by Pyriel »

  1. My system has plenty of horsepower for a PSX emulator. The issue isn't instability in the emulator. The issue is that code in that 9x11 module is somehow attempting to execute illegal operations. My first thought is that one of the external functions it relies on was relocated after that module was last touched, but I haven't looked into it.
  2. I can't really answer that except as "yes and no". All digital data is binary at the lowest level. Calling it anything else is another level of abstraction. There is text data, but only the leftover debug messages are in an encoding that's widely recognized. The rest is in a custom encoding. The executable code on the disc is also binary, but if you know what data is executable, then it can be analyzed according to the rules of the processor, linkers, and compilers available for the system.
The dungeon already works pretty well. The one crash I saw may or may not be resolvable. It depends on what the underlying issue is.
ne__ya
Posts: 26
Joined: Wed Dec 07, 2016 8:47 am

Re: Test Dungeon

Post by ne__ya »

Hi! Can't say how extremely excited I am to find this thread!

While working on my own little project to make a script database for S2, I came by an unused game script in Japanese. When I checked the English version of S2, I found that it was left out from translation, so the data is there, too, only in Japanese. On the Japanese side of the internet, I saw a mention that this script may be related Sajah and an undergroung dungeon of L'Renouille, and long story short, I somehow found this thread.

I tried the cheat code provided above and walked through the dungeon a few times myself, and came to an exciting hypothesis: this unknown dungeon, is no test dungeon.

First off, I suspect you enter it from Sajah. Take a save state from Sajah village and open it in vram, you notice there is a hidden cave behind the large rock in the little garden where a young girl is situated. It is my guess that what ever is behind it will take you to the lowest floor of the unknown dungeon which has to be a Sindar thing. (Killey has visited Sajah after all!)
Once you follow the dungeon all the way up, you'll probably meet the Rune of Circulating Path, or whatever the translation might have been. If you choose to follow a new path (see the script below), I am fairly certain that you'll be returned to the Sindar Ruins event at the White Deer Inn where Riou was temporarily on his own to pick up the healing herb for Hilda, to start everything over from there, but you get to keep your character strength.

It all so perfectly clicks into place. The Sindar Ruins that seemed a tad of too elaborate for the little meaning it held in the game play, it would in fact have held a very important role if S2's developers chose to keep this dungeon in the game: Riou would have been given a second chance to take back what he treasures most.

I'd love to go further and rip graphics for the Rune and such, but the only thing I could find was a C++ data decompressor for S2 graphics (at RHDN), which I managed to somehow run with what meager programming experience I have, only to realize I have no tools nor skills to check the output (duh!). Unfortunately, the link provided by Pyriel from his first post in "Bug Fixes" thread, that was holding a zip file with information about the decompressor, is no longer working.
If someone has a better tool, the data would probably be in 100_ARJ folder HIMURA.SDD (Sajah?), J_2 and J_3.VAB (Unknown Dungeon?), or maybe the 030_ARC folder C_1,4,5.VAB (Sindar Ruins?) or maybe FCEV_C.SDD (???), SD_C05.VAB(???).

Last but not least, please find a quick translation of the unused game script below, and I think that's all the contribution I can make so far.
Cheers!! :D

included in VJ17.BIN, VJ24.BIN
------------------------------------------
"One in search of a new path - I shall test your will."
------------------------------------------
"I am the Rune of Circulating Paths. Do you wish for a new path?"
------------------------------------------
"Yes"
------------------------------------------
"No"
------------------------------------------
"New path?"
------------------------------------------
"While your strength remains, the new path shall guide you to a new beginning.
Though be warned that there is no return path. Do you still wish for a new path?"
------------------------------------------
"Yes!"
------------------------------------------
"Wait a minute"
------------------------------------------
"What new path?"
------------------------------------------
"You will lose your current path, lose all allies and friends that joined you,
and you will even lose the outcome. Do you still choose to follow the new path?"
------------------------------------------
"Yes"
------------------------------------------
"Rather not"
------------------------------------------
"What new path?"
------------------------------------------
"Close your eyes. I shall open the new path for you to see..."
------------------------------------------
"Accepted. Time does not flow for me, I shall wait."
------------------------------------------
"The world has a million forms, not identical, but not alien.
The path you have followed can once again be followed in another world.
While your strength remains, the path will be a new beginning.
Too many seek that path. Do you seek it also?"
------------------------------------------
"Accepted. Time does not flow for me, I shall wait."
------------------------------------------
"The world has a million shades, not identical, but not alien.
The path you have followed can once again be followed in another world.
While your strength remains, the path will be a new beginning.
Too many seek that path. Do you seek it also?"
------------------------------------------
"Accepted. That is a wise path. I shall take you outside."
------------------------------------------
"Thank you"
------------------------------------------
"No thanks"
------------------------------------------
"Then farewell, wise young one. Follow your path to the end."
------------------------------------------
"You do not wish to use my powers? Accepted. The path is there for you to take."
------------------------------------------
"The world has a million shades, not identical, but not alien.
The path you have followed can once again be followed in another world.
While your strength remains, the path will be a new beginning.
Too many seek that path. Do you seek it also?"
------------------------------------------
"Young one that seeks for a path. Do you choose to follow a new path?"
------------------------------------------
"Then... Young one... Leave your last record of this world..."
------------------------------------------
"I shall open the new path for you..."
------------------------------------------
"Thank you"
------------------------------------------
"I, er, maybe not"
------------------------------------------
"Do you fear, young one? But that may be just the wise choice..."
------------------------------------------
Omnigamer
Posts: 324
Joined: Wed Feb 13, 2013 11:48 am

Re: Trial Road

Post by Omnigamer »

Interesting. Just going from the text, I can think that the "new path" corresponds to which of the Sword or Shield rune you get, and maybe some differences in the story as a result. Alternatively, it could be another instance of something referencing cut content. Either way, I think it must be intended as some Epilogue content. It's a shame we don't get to see what it was intended for, but definitely a good thing to have it documented. Can you please add this information to the tcrf.net page for Suikoden II?
User avatar
Pyriel
Webmaster
Posts: 1227
Joined: Wed Aug 18, 2004 1:20 pm

Re: Trial Road

Post by Pyriel »

Yeah, I think I mentioned on the video page somewhere that it seemed more like an end-game challenge dungeon than a testing dungeon once I'd played with it a bit. And if you step on the teleporter near where I arrive in the video, it does say "Sajah" in the format of a town name before it crashes. Someday, I'd like to try to get it working as much as possible. I just haven't had time.

Here's the compression and decompression routines. It's not an automatic tool, and because of the way Konami packed assets into the modules, you have to know exactly where to look within them to get the data. It's not hard to distinguish what's compressed graphics, but it is hard to tell what graphics are what, because the links aren't obvious. It's down to individual scripts in some cases and the game engine in others. Kind of to be expected in this era, but still frustating.

The other issue, which can be more frustrating, is that the CLUT (palette) is stored separately from the pixel data, usually uncompressed. There can be several tables floating around, and I've not yet found an indicator that tells you which one should be used. In images I've ripped, I wind up either manually inserting color tables, or using all the color tables and manually picking the one that looks right. There has to be something that tells the game what to do, somewhere, I just haven't picked up on it.

The compression, should you have cause to use it, is not identical to what Konami used. It still produces valid output, the size just differs a bit in most cases I tested. I think I just walked the wrong direction in the sliding window when looking for matches. I never got too excited about it because it hasn't been an issue for me yet.

Code: Select all

struct Location {
	unsigned short pos;
	unsigned short len;
} T_MATCHPOSITION;

struct CompUnit {
	unsigned char datasize;
	unsigned char mask;
	unsigned short data[8];
} T_COMPUNIT;

//deviating a little bit here.  Just for convenience, have it return the uncompressed size.
//Konami hard-coded sizes, and didn't store them with the compressed data in most cases.
unsigned int decompress (unsigned int size, unsigned char *pCompressed, unsigned char *pUncompressed) {
	unsigned char window[0x400];
	unsigned char *pCompEnd = pCompressed + size;
	unsigned char *pSave = pUncompressed;
	unsigned int offset = 0x3DE;

	memset(window, 0, offset);			//was a loop in the game.

	while(pCompressed < pCompEnd) {
		unsigned int proc = *pCompressed | 0xFF00;
		pCompressed++;

		do {
		  if(!(proc & 1)) {				//first byte of each segment is a set of flags.  1 if compressed, 0 if not
			    // not compressed, just emit the next byte in compressed buffer
				*pUncompressed = *pCompressed;
				window[offset] = *pCompressed;
				offset++;
				pUncompressed++;
				pCompressed++;
			  if(pCompressed >= pCompEnd) {
				  return pUncompressed - pSave - 1;
			  }
			  if(offset >= 0x400) offset = 0;
		  } else {									//compressed.  next byte's upper two determine how.
			  char length = *pCompressed;
			  unsigned int distance;
			  int count;
			  pCompressed++;
			  if((unsigned char)length < 0x80) {	//this byte and the next are a length-distance pair
				  distance = *pCompressed | ((length & 3) << 8);
				  pCompressed++;
				  length = (length >> 2) + 2;
				  count = 0;
				  if(length >= 0) {
					  do {
						  unsigned char *match_window = window + ((distance + count) & 0x3FF);
						  *pUncompressed = *match_window;
						  window[offset] = *match_window;
						  offset = (offset + 1) & 0x3FF;
						  pUncompressed++;
						  count++;
					  } while(length >= count);
				  }
			  } else if ((unsigned char)length < 0xC0) {	//this byte alone stores length + offset
				  unsigned int tmpOff = length & 0xF;
				  length = ((length & 0x30) >> 4) + 1;
				  if(length >= 0) {
					  count = 0;
					  do {
						  unsigned char* tmpframe = window + ((offset - tmpOff) & 0x3FF);
						  *pUncompressed = *tmpframe;
						  window[offset] = *tmpframe;
						  offset = (offset + 1) & 0x3FF;
						  pUncompressed++;
						  count++;
					  } while(length >= count);
				  }
			  } else {										//not actually compressed.  run of 8 or more uncompressed bytes
				  length = (length & 0x3F) + 7;
				  if(length >= 0) {
					  count = 0;
					  do {
						*pUncompressed = *pCompressed;
						window[offset] = *pCompressed;
						pCompressed++;
						pUncompressed++;
						offset = (offset + 1) & 0x3FF;
						count++;
					  } while(length >= count);
				  }
			  }
		  }
		  proc >>= 1;
		} while(proc & 0x100);
	}

	return (pUncompressed - pSave) - 1;
}

unsigned int compress(unsigned int size, unsigned char *pUncompressed, unsigned char *pCompressed) {
	unsigned char window[WINDOW_SIZE], *pEnd = pUncompressed + size;
	unsigned char *pStart = pUncompressed, *pFlag = pCompressed;
	unsigned int offSearch = 0x3BC, offWrite = 0x3DE, lasthit, units, unit_bytes, comp_size = 1; //uncpos;
	Location matchpos;

	memset(window, 0, 0x3DE);
	units = unit_bytes = *pFlag = 0;
	comp_size = 1;

	while(pUncompressed < pEnd) {
		register int i, j, k;
		matchpos.len = 1;
		matchpos.pos = 0;
		for(i = 0; i < 0x400; i++) {
			j = (offSearch + i) & 0x3FF;
			k = 0;
			do {
				//if(j >= offWrite && j <= ((offWrite + 0x41) & 0x3FF))
					//break;
				if( pUncompressed[k] != window[j] )
					break;
				if((++j) >= WINDOW_SIZE) j = 0;
				k++;
			} while (k < MAX_MATCH_SIZE && (pUncompressed + k) < pEnd);

			if(k > matchpos.len) {
				matchpos.len = k;
				matchpos.pos = (offSearch + i) & 0x3FF;

				if( k > MAX_MATCH_SIZE || (pUncompressed + k) >= pEnd)
					break;
			}
		}

		if(matchpos.len < THRESHOLD) {
			if(matchpos.len > 1 && (offWrite - matchpos.pos) < 0xF && (offWrite - matchpos.pos) > 0) {
				*pFlag |= 1 << units;
				pCompressed[comp_size] = 0x80 | ((matchpos.len - 2) << 4) | (offWrite - matchpos.pos);
			} else {
				pCompressed[comp_size] = *pUncompressed;
				matchpos.len = 1;
			}
			comp_size++;
			unit_bytes++;
			units++;
		} else {
			if(matchpos.len <= 5 && (offWrite - matchpos.pos) < 0xF && (offWrite - matchpos.pos) > 0) {
				*pFlag |= 1 << units;
				pCompressed[comp_size] = 0x80 | ((matchpos.len - 2) << 4) | (offWrite - matchpos.pos);
				comp_size++;
				unit_bytes++;
			} else {
				*pFlag |= 1 << units;
				pCompressed[comp_size]		= ((matchpos.len - 3) << 2) | (matchpos.pos >> 8);
				pCompressed[comp_size + 1]	= matchpos.pos & 0xFF;
				comp_size  += 2;
				unit_bytes += 2;
			}
			units++;
			lasthit = matchpos.pos;
			offSearch = offWrite;
		}

		if(units == 8) {
			pFlag = &pCompressed[comp_size];
			*pFlag = 0;
			comp_size++;
			units = unit_bytes = 0;
		}

		for(i = 0; i < matchpos.len; i++) {
			j = (offWrite + i) & 0x3FF;
			window[j] = pUncompressed[i];
		}

		offWrite = (offWrite + matchpos.len) & 0x3FF;
		pUncompressed += matchpos.len;
	}

	return comp_size;
}
Edit: The script sort of reads to me as though they intended a final challenge prior to something like a new game+ or an alternate adventure as in the original Legend of Zelda.

Might as well upload this too: http://herrvillain.net/suikoden/gs2/gs2textdump_na.zip

This is the script dump I made about a year ago. This was actually done with an automated tool, so other than poking around some of the files to make sure it's mostly right, I don't really know what's in there. Looking at VJ17 and VJ24, that Japanese text is there. Although, it's worth noting that I probably do still have that one character's minuscule and normal cases swapped in any Japanese strings. Can't remember if I reran the dump after I fixed that.
ne__ya
Posts: 26
Joined: Wed Dec 07, 2016 8:47 am

Re: Trial Road

Post by ne__ya »

>Omnigamer,

I hadn't thought about the possibility that the "path" might be hinting at the different paths Riou and Jowy took to get their Runes. It definitely would have been interesting to see the runes swapped, or even their places swapped!

Documenting it on tcrf.net is a good idea. I'll just have to recheck the translation, and also check what kind of material is allowed on that page. Anyway, thanks!


>Pyriel,

Oh wow! The decompressor! Thank you very very much!!
Now I can go play and dig with it :wink:
I see how working without a CLUT can be pain, especially if you are looking at unknown graphics data with nothing to compare it to. It would be so much more convenient to find a way getting into these special places using cheat codes, but the in-and-outs aren't easy to find at all.

Great to see your script dump, too. It certainly looks much more sophisticated than what I am doing. Is that automated tool a general tool available online?
What I am particulary interested in doing is determine the speaker, but seeing it hasn't been done, I already have a feeling that it might be well beyond my programming level.

As you say, in the Japanese text of VJ17 "つ" and "っ" are swapped, and there are a few other minor things like wrong Kanji, but otherwise that's exactly the unused script.
If you ever manage to work around the crash, it would be awesome to see the unused event in action!
Post Reply