PDA

View Full Version : Editing Question


Brakazog
06-10-2007, 08:49 PM
Hi y'all,

First of all, congratulations on the game! It's fun, addictive, and it's got a great 'look & feel' to it.

My question is this: I'd really like to be able to build my own boards with specific patterns (like the double helix challenge or the merry go round in the forum), but I haven't found a way to do it, either in the program or the documentation. Did I just miss something, or is there not a simple way to do it yet? (and if there's no simple way, can you tell me how you did it anyway? I've got some interesting ideas that I'd really like to try...)

Thanks!

Josh Jensen
06-11-2007, 09:30 PM
We'd like to publish the editor portion of the game, too, but it all takes time. We're working on getting our Mac OS X build finished right now. At that point, we'll see what time is available to get the editor into a public form. It shouldn't take long, and it is something we'd really like to do for everyone.

(If you're REALLY ambitious, you can edit levels in a text file, but it is very hard to do.)

Thanks for your patience.

Josh

Brakazog
06-11-2007, 10:19 PM
COOL! I have friends who would LOVE to see a Mac version - I'll let them know it's coming...

In the meantime, I've just pulled up a .board file in a text editor and it looks like it might not be too bad (unless I need to worry about checksums and anti-cheating measures). I'll just think of it as another kind of logic puzzle.

Thanks for the reply, and good luck with it all!

Brakazog
06-12-2007, 07:59 AM
Success! After about 4 hours and a fair amount of beer, I've got a prototype level that I'm about to post. I just wanted to drop a note here saying that the developers rock - there's a lot of really complicated stuff you handle, especially when building random boards (I found this out when I tried to make a weird problematic arrangement, and the program corrected it for me - it's like there's an AI in there that knew I was trying to mess with it).

Anyway, building a custom level is kind of a pain, so unless I get a particularly inspired idea, I'll probably just wait for the editor.

For anyone interested, here's the method I found (this requires some tech skills):

1. In Pathstorm, build a board with the dimensions you want. Make sure you put enough objects in the level - sometimes blank rows can be omitted in the file, and I didn't research when that happens or how to add rows in that case (though it's probably something simple). Also, make sure the build parameters match what you're going to put in your level, just in case. For example, in my prototype I built a 15x7 board with 4-directional bouncers. Start playing it, but don't finish it; then Add to Favorites. Go to Favorites, pick it, and Start New Level. Confirm that you want to lose your progress so far. Now any random saved-along-with-the-level data will be cleaned out, and you won't have an inappropriate time saved with it.

2. Find the .board file and copy it to a work area, then rename your copy so it has a .zip suffix.

3. Inside the .zip file you'll find a .board file with the same name. Extract it. Open the .board file in your favorite hex editor.

4. About 1/3 of the way through the file, you'll see something that looks like a level layout. It's the level layout.

5. Each row has the following format (in hex):
04 (I'm assuming that's the length of the integer to follow)
xx 00 00 00 (xx is the length of the string to follow, in hex, including the 00 at the end -- yes, this does vary even with fixed width rows - see below)
(row data followed by 00 - details below)

6. Replace the row data with yours, adjust the row data lengths as appropriate. Save, update the .zip, rename .zip back to .board.

7. Back up your original .board file (in the game's directory), then copy your new (zipped) .board file in. Play it most of the way through, but don't finish it (otherwise it'll save the file with you as the lowest time, and that really wouldn't be fair).

8. Choose "Email" and copy the file it creates. Now test it again and complete the level. Make sure you didn't do something stupid that fried your profile (unlikely, but there's a bunch of stuff in the file that I haven't decoded, so best to be careful). Share the copy you made from the "Email" option that doesn't have your time in it. Bask in the glory of the accolades that are sure to come in!

Row Data (text form) - concatenate to build your row:
. = Empty
* = Wall
v0 = Top Entry
>0 = Left Entry
<0 = Right Entry
^0 = Bottom Entry
//0 = Bouncer /
\\0 = Bouncer \
--0 = Bouncer -
||0 = Bouncer |
//1 = Switcher (bouncer) with / as correct direction
\\1 = Switcher (bouncer) with \ correct
/\8 = Scrambler (bouncer) starts as \ but / is correct
\\8 = Scrambler (bouncer) starts as \ and \ correct
(other combos are xy8, where x is correct and y is the starting state)
++0 = Splitter +
]]0 = Shifter CW
[[0 = Shifter CCW
}}0 = Twirler CW
{{0 = Twirler CCW
Switchers and Scramblers for shifters and twirlers follow the same pattern as for bouncers.

So, to write a level that looks kinda like this:
**v**v*
>.\...*
>.....*
*.....<
>.\...*
*.....<
***^^**

you'd actually code it as this:
**v0**v0*
>0.\\0...*
>0.....*
*.....<0
>0.\\0...*
*.....<0
***^0^0**

and so your hex (broken into rows) would look like this:
04 0A000000 2A2A76302A2A76302A00
04 0B000000 3E302E5C5C302E2E2E2A00
04 09000000 3E302E2E2E2E2E2A00
04 09000000 2A2E2E2E2E2E3C3000
04 0B000000 3E302E5C5C302E2E2E2A00
04 09000000 2A2E2E2E2E2E3C3000
04 0A000000 2A2A2A5E305E302A2A00


See? Kind of a pain. Nevertheless, if y'all want to go to the effort of building something, I promise I'll play it :D .

Cheers!

Josh Jensen
06-12-2007, 09:23 AM
I was going to post you some information on what to do with this, but I didn't have time earlier. This likely could have saved you a lot of time.

This method is a lot easier, but be warned. Pathstorm has a lot of error checking for bad levels, but bad stuff could still slip through. There are lots of interactions. When we post our editor, it guards against most of this.


Download and extract http://luaplus.org/LuaPlus51_Build1100_Win32Binaries.zip. For the bullet points below, I extracted it to c:\LuaPlus\.
Download the ExtractLevel.zip attachment. Extract it to c:\LuaPlus\bin\.
To access a given Shared Favorite, navigate to c:\Documents and Settings\All Users\Cavebug Games\Pathstorm\Favorites\. Note that "Cavebug Games" may be "Big Fish Games" or "Oberon Media".
Run c:\LuaPlus\bin\ExtractLevel {d0897d38-1b87-ea45-b3cc-b51aefc7e803}.board. Replace the file name as appropriate. This also works for .pathstorm files.


You'll find a text file similar to the one below. You can more freely edit this file. It may also be copied directly into the Favorites\ directory, and it will be read.

As for which things work and don't work, I'll have to post another message.


Board =
{
MaxTime = 30,
MaxMisses = 1,
Name = L"A Double Helix",
PuzzleOptions =
{
BouncerCoverage = 0,
BouncersMaxWeight = 0,
BouncersMinWeight = 0,
WallsMaxWeight = 0,
WallsMinWeight = 0,
NormalMaxWeight = 1,
NormalMinWeight = 1,
ReverseMode = false,
Rotated = false,
ScramblersMaxWeight = 0,
ScramblersMinWeight = 0,
ScramblersWrongMaxPercentage = 0.5138121843338,
ScramblersWrongMinPercentage = 0.33149170875549,
ShiftersMaxWeight = 0,
ShiftersMinWeight = 0,
SplittersMaxWeight = 0,
SplittersMinWeight = 0,
SwitchersMaxWeight = 0,
SwitchersMinWeight = 0,
TwirlersMaxWeight = 0,
TwirlersMinWeight = 0,
UseFourDirectionalBouncers = false,
VariableSpeedBalls = false,
},
Rows =
{
"*v0v0v0v0v0*",
"*||0.++0.||0*",
"*||0.++0.||0*",
"*||0.++0.||0*",
"*||0.++0.||0*",
"*||0.++0.||0*",
"*||0.++0.||0*",
"*||0.++0.||0*",
"*||0.++0.||0*",
"*||0.++0.||0*",
"*||0.++0.||0*",
"*||0.++0.||0*",
"*||0.++0.||0*",
"*||0.++0.||0*",
"*******",
},
UUID = "{d0897d38-1b87-ea45-b3cc-b51aefc7e803}",
Version = 3,
Width = 7,
}

Josh Jensen
06-12-2007, 09:38 AM
Each entry on a row starts with one of the following symbols.


. = Empty tile
* = Wall. The outer edge must be surrounded by a wall.
^ = Entrance facing up. Followed by ball speed 0 - Normal, 1 - Fast, 2 - Slow.
v = Entrance facing down. Followed by ball speed 0 - Normal, 1 - Fast, 2 - Slow.
< = Entrance facing left. Followed by ball speed 0 - Normal, 1 - Fast, 2 - Slow.
> = Entrance facing right. Followed by ball speed 0 - Normal, 1 - Fast, 2 - Slow.


Other initial object type symbols are:


\ = Bouncer NW_SE
/ = Bouncer NE_SW
] = Shifter CW
[ = Shifter CCW
} = Twirler CW
{ = Twirler CCW
+ = Splitter
- = Bouncer W_E
| = Bouncer N_S


Following any of the object type symbols is a second symbol from the list above. It is usually the same as the first symbol, except in the case of a Scrambler.

The third symbol is a text encoded bitfield. It is made by taking the result of the bitfield and subtracting '0' from it.

int value = *row - '0';


tileInfo.origSwitcher = (value & 0x1) == 1;
tileInfo.switcher = (value & 0x2) == 2;
tileInfo.forceExposed = (value & 0x4) == 4;
tileInfo.scrambler = (value & 0x8) == 8;

Josh Jensen
06-12-2007, 10:32 AM
Most of the information in the PuzzleOptions portion of a .board file is only useful for Puzzle generated levels. The few options that affect Favorites are detailed below.


AlwaysDrawRollingBall - [false] True if the ball should always be drawn.
ReverseMode - [false] True to turn on Find the Exits mode.
Rotated - [false] True to rotate the level.
Theme - The theme to use (0 for random and no greater than 10) or a string theme name in the themes/ directory.

Brakazog
06-12-2007, 05:49 PM
Thanks Josh - this is great! And definitely easier than my way (although it was kinda nostalgic to break out the old hex editor - I haven't done much direct editing since the '80s). I'll definitely be giving this a try.