Help with development...

Discussions and help for the Bard's Tale Construction Set
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Help with development...

Post by Darendor »

Need a bit of a large favour here.

I need a listing of every single solitary possible door/secret door/wall combinations possible.

For instance:

Code: Select all

COMBINATION --------------------------  BINARY ----- HEX ---- DECIMAL

Wall south, secret door east ---------- 00010011 --- 13 ----- 19

Can someone help me?
User avatar
Horpner
Posts: 224
Joined: Thu Jan 08, 2009 11:53 pm
Location: New England
Contact:

Post by Horpner »

There are 255 of them, plus one for the vacant tile. That's a ton of work!

How many do you have done already?
Death and drek? WTF?
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Horpner wrote:There are 255 of them, plus one for the vacant tile. That's a ton of work!

How many do you have done already?
List the dungeon reader from lines 400 to 600 and you'll see.
Every 8 POKEs is one tile.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Are you on this or shall I be?
User avatar
Horpner
Posts: 224
Joined: Thu Jan 08, 2009 11:53 pm
Location: New England
Contact:

Post by Horpner »

I'm on it.
Death and drek? WTF?
User avatar
Horpner
Posts: 224
Joined: Thu Jan 08, 2009 11:53 pm
Location: New England
Contact:

Post by Horpner »

We have 256 characters to work with, but we want to leave at least some for displaying text, right? So we cannot display all 256 possible configurations of walls/doors/secret/doors if we try to cram all that information into one byte.

Moreover, if we've used up most of the characters just for walls and doors, how are we going to show specials and other features?

I think we should consider a different scheme for displaying dungeons on screen, though I haven't thought that much about what we should do. Something like my ascii maps would work, and we could program characters that draw walls very nicely. Doing it like I'm thinking of, we could get away with just 32 bytes of character graphics to display all kinds of wall configurations, including all the one-way combinations. If we want the 'corners' too look nice, we'll need an additional 16 bytes for those.

A scheme like this will mean we cannot display an entire dungeon level all at once, though. Consider one square:

Code: Select all

+-+
| |
+-+
This leaves one square open to display dungeon features. So a full map display would be 2*22+1 (45) characters wide, and 2*22+1 (45) characters high. Since we only have 40x25, we'd have to display a quadrant at a time, or something.

What do you think?
Death and drek? WTF?
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

I was thinking that for editing dungeons there'd be different modules:

- A physical layout editor (such as what I'm working on)
- A specials arrangement, where traps, darkness, and so on...

So 256 different characters you say, does that include the lower case set?
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

'Kay, here's what I'll do: I'll draft a proposal document outlining what I envision this project to be and you can tell me what you agree/disagree with and why.

Watch this space.
dulsi
Posts: 242
Joined: Thu Mar 22, 2007 7:15 pm

Post by dulsi »

I believe all the BTCS versions use the same format. You should be able to use the information in by Bt Builder to learn the format. Here is the map format. Let me know if you don't understand anything.

[map]
name: char[25]
unknown: byte
type: short {dungeon 1, dungeon 2, city, wilderness}
level: short {0 to 20}
monster level: short {0 to 20}
monster chance: short {0 to 100}
file name: char[9]
unknown: byte
square: mapsquare[22][22]
specials: special[]

[mapsquare]
wallinfo: walldata
unknown: byte
special: short

[walldata]
upperwall: bits[2] {blank, wall, door, secret door}
rightwall: bits[2]
lowerwall: bits[2]
leftwall: bits[2]

[special]
name: char[25]
operation: condition[] (20 conditions or until condition type 0xFF9D)

[condition]
type: short
text: char[26] (text, monster name)
number: short (item, local flag, direction, monster, class, global flag,
number, race)
then: command
else: command

[command]
type: short
text: char[26] (text)
number: short[3]
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Your entire post once you start posting code I don't understand. Care to break it down for me?
dulsi
Posts: 242
Joined: Thu Mar 22, 2007 7:15 pm

Post by dulsi »

All numbers in the map are little endian. So the file will have hex values like 0200 for 2.

The map file starts with 25 characters for the map name (name: char[25]). The next byte's purpose is unknown (unknown: byte). The next two bytes are a number which specifies the dungeon type (type: short {dungeon 1, dungeon 2, city, wilderness}). So a value of 0 is dungeon 1, 1 is dungeon 2, 2 is city, and 3 is wilderness. The next two bytes is a number which specifies the level of the map (level: short {0 to 20}). The next two bytes is a number which specifies the monster level (monster level: short {0 to 20}). The next two bytes is a number which specifies the chance of encountering a monster (monster chance: short {0 to 100}). The next nine bytes is the filename (file name: char[9]). The next bytes purpose is unknown. After this comes the map information. Each map square is 4 bytes. There are 22 x 22 squares (don't remember at the moment how they are ordered).

The first byte of the map square is a bit field indicating walls (wallinfo: walldata). Two bits store each wall position. A 0 is blank, 1 is a wall, 2 is a door, and 3 is a secret door. I'm not sure from looking at what I posted what wall comes first. But it is something like:

binary value of byte: 01110010
upperwall: 01 (wall)
rightwall: 11 (secret door)
lowerwall: 00 (blank)
leftwall: 10 (door)

The next byte of wall information is unknown (unknown: byte). The next two bytes is a number indicating the special on that square (special: short).

I don't have time to explain the specials right now but that should give you a lot to digest.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

When you have the time, take a look over here: http://bardstale.brotherhood.de/talefil ... .php?t=788

Horpner found the byte code order for the physical layout. Note that we're playing around with the Commodore 64 version here and not any others; is this the version you used to build your program?
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Alright, this is the type of "Bard's Tale Construction Set" I've envisioned for the C64.




You insert disk #1. You type: LOAD"*",8,1 ...

The booter file loads up. It loads the font and screen colours, sets the lower case setting, whatever, then displays a welcome message, such as:

Welcome to the Bard's Tale Builder Kit!

Select:

(F1) Edit Wilderness
(F3) Edit Cities
(F5) Edit Dungeons
(F7) Quit


The above three options explained:

EDIT WILDERNESS
The program shell then loads up "WILDERNESS.PRG", and then you are prompted for the Character disk, which of course has the Wilderness layout. The program loads up the Wilderness layout and gives you the following options:

(CURSOR): Select tile to edit (much like my current prototype dungeon reader)...
(SPACEBAR): Edit the current tile. Cycles between nothing, a tree, a building, or a city block.
(F1): Put an entrance to a city (as a marker). The relevent city number would be the same as referenced by the APAR spell...
(F3): Place an editable special on the current tile.
(F5): Save and exit back to the main editor shell program.


EDIT CITY
This program would load all the city names from the Character disk and you would select which one to edit. It would then be loaded into memory and:

(CURSOR): Select tile to edit ...
(SPACEBAR): Edit the current tile. Cycles between nothing, Adventurer's Guild, Roscoe's, The Bank, Garth's, Review Board, Tavern (note: Tavern name to be given), Iron Gates, or Casino...
(F1) Edit city name and position (e.g. "Tangramayne, city #1 according to APAR)
(F3) Save (city name) and return to main editor shell program.
(F5) Put in a user-defined special here (e.g. the entry to the starter dungeon scans the party roster for "The Princess" and if it doesn't find her, then it displays a word in the caption box, loads a picture, displays text, and asks for input...if "The Princess" is present it awards experience to all members, removes her from the ranks, prints revelent text and deletes itself from location).
Dungeon entrances and whatnot would also be written this way. Note that dungeon entrances could be made to reference the name of a dungeon disk (a la "DUNGEON A", "DUNGEON B") to allow players to make as many dungeons as they liked...
(F7) Save and exit back to the main editor shell program


EDIT DUNGEON

Dungeon levels would be loaded from disk (like the city editor) and displayed on screen. The level #, the name displayed in the caption box, the direction (up or down), the city name and co-ordinates of the linking special for the entry stairs (suppose the Dark Domain's entry stairs lead back up to 8 north and 16 east in Tangramayne), or the location of the previous linking stairs, the dungeon wall types, and finally which dungeon levels are shielded.
Consider the stairs up to level 2 of Harkyn's from level 1. They are located at 18N, 0E. You might have to tell these stairs to send the player to 18N, 0E on level 2 of Harkyn's (hmmm, are stairs just a specialized "Yes"/"No" teleporter?)...

Options:
(CURSOR) Highlight a given tile...
(SPACE) Change highlighted tile. 256 combinations to cycle through...
(F1) Edit specials on this tile. Darkness, traps, spinners, antimagic, silence, "Odd!", hitpoint leech (how many per move?), magicpoint leech (how many per move?), portal up and/or down, stairs up and/or down, and finally user-configurable specials...
(F3) Change dungeon name/direction/level #...
(F5) Save and exit to main shell



Well that's kind of my vision. Please do comment in detail, as I'd like to get this perfected before I stare at any more code.

Thanks.
Chaney
Posts: 100
Joined: Tue Jun 27, 2006 7:56 pm
Location: California

Post by Chaney »

Is this to edit current dungeons, or will you be able to use it create dungeons? I mean, would you need to use btcs to create a dungeon, and then this program to modify it easier? The control functions seem pretty intuitive, so it sounds user friendly to me.
When in doubt, kick your neighbors dog!
dulsi
Posts: 242
Joined: Thu Mar 22, 2007 7:15 pm

Post by dulsi »

Darendor wrote:Horpner found the byte code order for the physical layout. Note that we're playing around with the Commodore 64 version here and not any others; is this the version you used to build your program?
I've been using the PC version of BTCS. From what I understand all BTCS versions use the same format so that games can be interchanged regardless of the system that developed them.
Post Reply