Jump to content
IGNORED

The Legend of Beryl Reichardt


Opry99er

Recommended Posts

Tonight I brought a printout of my code listing with me to work. Didnt bring my documented Notepad++ text on purpose.

 

I forced myself to re-comment on every section of code from memory to re-orient myself with the game.

 

20150313_185922_zpsybakhhgd.jpg

 

Most of it I remembered pretty well, some of it took some mind tinkering, but I commented on all 10 pages, subroutines, GOSUBs, GOTOs and all.

 

Got a plan... More later

  • Like 5
Link to comment
Share on other sites

Over the past year, I have been doing all kinds of crazy things, most of which is of little to no interest to most of you, I'm sure. One thing I never STOPPED doing, however, is thinking about my game. Through the cross-country moves and the new baby, a growing son with an enthusiasm for the outdoors and the 7 day work weeks, Beryl has always been on my mind. I've spent the better part of today reacquainting myself with my code and am confident in my ability to pick up right where I left off, with ONE little wrinkle...

 

Coming back to this project a little older and perhaps slightly wiser, I understand what many of you had been telling me about the definite necessity for a pathway toward the goal... a set of steps that can be achieved in order to facilitate the completion of my project. I have had a year and a couple months off from the game and can see it with a slightly more focused eye. So, here we go... The LoBR Game Plan.

 

 

 

****************************************************

 

Legend of Beryl Reichardt Game Plan--part 1 (Paving a way forward)

 

 

I. Foundation

 

1) Resequence (RES) all code (100,100) to create space for new chunks of code. This will require a fairly substantial reorganization of my code in Notepad++

 

2) Move ENTIRE "menu" section (created in TIdBiT) into an XB subprogram for ease of editing and uniformity in structure

 

3) Download newest Magellan release and load in my old "Forestia" map .mag file for editing, ensuring that it works

 

 

II. Prepare for Adventure!!

 

1) Re-order all character sets in Magellan to put all allowable (navigable) tiles into adjacent character sets (will make flag checking for "navigable/non-navigable" tiles faster and easier

 

2) Change (current) lines 3500-3800 AND line 6400 to accept the new CHAR values based on new Magellan output

 

3) Finish Magellan "Forestia" map (to completion.... COMPLETELY FINISHED) **If old .mag file does not work, re-build world from relative scratch

 

 

III. Itemize and Arm!!!

 

1) Flesh out and implement real and usable Weapons, Armor, Spells, and Status code in the menu block

a) Create "Armor" arming code to take Armor from inventory and equip Beryl

b) Create "Weapon" arming code to take Weapon from inventory and equip Beryl

c) Create "Peace-Time" spell code (Heal, Life, etc... any spell not exclusively used in battle) Variables and strings for spell costs and names

and or types will be required.

 

2) Complete development and code in the Low-level equipment variables/names/types to be used in the first world, "Forestia"

 

3) Re-design code for the unique items to appear AFTER the assembly screen draw (not part of the map data) to allow them to disappear once taken. **Possibly put all unique items in "chests". This would negate the need for actually removing the graphic from the screen and would cut down on character definitions. Once the item is removed from the chest, set the STATUS to "empty" upon re-examination of chest.

 

 

*************************************************

 

 

 

 

Well, that's all I've got for now. And I won't be adding anything to this if I can avoid it. Once these steps are completed in THIS order, I'll contemplate other things like disk access for monsters, battle engine implementation, etc. Before, I had all of these things STARTED, but the tasks overwhelmed me because there was no game-plan. I'd work and tinker on one thing and then switch to another.

 

If I follow Part 1 (Paving a way forward) in direct sequence and to completion, it will then be on to Part 2.

  • Like 4
Link to comment
Share on other sites

Did the resequence today.

 

Since almost every line or two in my code is commented in Notepad++, the copy paste is going to be a beast. Many of the comments are "Adjust this variable when Magellan output is updated with new character sets" and "Consider replacing this section with a SUB". Things like that.

 

I'll be working on the Notepad update tomorrow night if I get off work at a decent hour.

 

I imagine I'll be "under the hood" on this thing for a month or two before any obvious changes to gameplay are implemented. Once the gameplay changes (proper navigation) I'll post up a new demo.

  • Like 1
Link to comment
Share on other sites

Did the resequence today.

 

Since almost every line or two in my code is commented in Notepad++, the copy paste is going to be a beast. Many of the comments are "Adjust this variable when Magellan output is updated with new character sets" and "Consider replacing this section with a SUB". Things like that.

 

I'll be working on the Notepad update tomorrow night if I get off work at a decent hour.

 

I imagine I'll be "under the hood" on this thing for a month or two before any obvious changes to gameplay are implemented. Once the gameplay changes (proper navigation) I'll post up a new demo.

Are you saying that it's just really big or that you have to cut a few lines at a time.

If it's the latter, can't you just put an apostrophes in front of the comments so they are treated as REMs without a line number?

Link to comment
Share on other sites

It's both James. I have a few lines in between comments, and it is very large.

 

When i resequence and SAVE, I open TI99Dir, copy the listing to a text file, and then go through, copying and pasting a little at a time into my commented Notepad file.

 

Mainly the issue is putting the code with the updated line numbers back into the Notepad code document. Ive done it a few times with this project, but not since adding menu functionality. That doubled my code size right there and, subsequently, doubled my comments and increased the complexity of the document.

 

At Walid: thanks man... Good to be back!

Link to comment
Share on other sites

Owen, it may be better to just re-transcribe your code into the TidBit format. That way, you will be able to add, delete, copy and paste code sections without having to worry about line numbers or comments. This will likely produce far more efficient and compact code and will save you a lot of frustration in the long run with such a complex project.

Link to comment
Share on other sites

The nice thing about line numbers is, they are unique. It should not be hard to search and replace any destination lines numbers of GOTO, GOSUB, THEN, and ELSE with labels. Once you have the destination line numbers replaced with labels, all the other line numbers can go away. I think you might want to consider the effort now before you grow the program larger.

 

TidBit can also consume existing XB code "as is", line numbers and all. XB in, XB out. Then you could start to replace lines numbers with labels as you go. Aside from not having to deal with line numbers, to me the other big advantage of TidBit is being able to use indentation which helps you keep structure to you code. Also, being able to use lots of comments that all get stripped out of the final output.

 

In:

 

// Clear the screen
10 CALL CLEAR

// Say Hi to Owen ten times.
FOR i=1 TO 10
    PRINT "HI OWEN!"
NEXT i
Out:

10 CALL CLEAR
20 FOR i=1 TO 10
30 PRINT "HI OWEN!"
40 NEXT i
Link to comment
Share on other sites

Thanks Matthew.. Yes, I was able to use it with great success on the menu portion of my code. Once I get everything that currently exists into the doc with new line numbers (basically just clean up my mess) I just might go full TIdBiT for the rest of it. First I have a mess to clean up. :)

 

BTW, I am now starting to think that the tool I was using to feed Magellan output into data usable with your scroll routine has gotten broken somehow. Thats my theory on why I cannot update my map and have it function properly.

 

I'll describe in more detail with pictures and some text when I get to that point. Your routine works fine, Magellan is a slick widget with very few (if any) bugs these days... Only thing I can think is that somehow I broke the tool.

Link to comment
Share on other sites

Thanks Matthew.. Yes, I was able to use it with great success on the menu portion of my code. Once I get everything that currently exists into the doc with new line numbers (basically just clean up my mess) I just might go full TIdBiT for the rest of it. First I have a mess to clean up. :)

 

BTW, I am now starting to think that the tool I was using to feed Magellan output into data usable with your scroll routine has gotten broken somehow. Thats my theory on why I cannot update my map and have it function properly.

 

I'll describe in more detail with pictures and some text when I get to that point. Your routine works fine, Magellan is a slick widget with very few (if any) bugs these days... Only thing I can think is that somehow I broke the tool.

 

Do you have the latest build of Magellan? Check the Magellan thread, post #386.

 

...lee

Link to comment
Share on other sites

I do not just yet... It is on my list of things to do.

 

Matthew, quick question... I am on my phone or I would test myself.

 

If i have sequentially numbered lines (i.e. 100 and 101) and i need to slam a chunk of code between them, does TIdBiT automatically resequence the numbered lines to facilitate the new chunk?

 

Just curious. :)

Link to comment
Share on other sites

Well, TIdBiT freakin works briliantly on my phone.. How about that?!

 

I used the following to test.

 

Start at 100

Increment by 10

 

 

100 CALL CLEAR

FOR I=1 TO 10

NEXT I

110 CALL SCREEN(9)

 

 

Out:

 

100 CALL CLEAR

110 CALL SCREEN(9)

120 NEXT I

 

So, it will not resequence current line numbers. Ill finish my post-RES Notepad++ integration and then I will have 100 potential lines in between the current ones to write code into.

 

I am scared stiff to try and convert my entire game into this format... :) Maybe I am just not confident in my abilities.

Edited by Opry99er
Link to comment
Share on other sites

But you know what? Maybe I ought to try it... Would make development so much more flexible... And it still technically falls into the Foundation category of my plan... Cleaning house might just have become a full-on Spring cleaning....

Edited by Opry99er
Link to comment
Share on other sites

Owen--you never need to doubt your ability. Even if the skill is not there yet, just trying will get you a lot closer to that skill level--and the best part is that it is an iterative process, so each attempt lobs you that much closer to the goal. When you are there (and I've seen what you've written before, so I think you are there already), you'll produce that which astounds and amazes the large mass of us without the skills to program a great game in the first place. Go for it, my friend. Go for it! :) :) :)

  • Like 1
Link to comment
Share on other sites

Jim, you're too kind my friend. :) Thanks for the confidence booster. I have been the beneficiary of some brilliant help and advice from some really talented guys. My own coding skill is hack-level at best... But I believe in determination and a willingness to fail a hundred times for the possibility of one success.

 

Matthew here has been so kind over the years in helping me progress my projects, as has tursi, Marc Hull, and others. Without these guys, I doubt I'd be anywhere. If matthew thinks this is the way to go, Im inclined to trust his judgment.

Link to comment
Share on other sites

So went to pull up my Notepad++ source on my desktop and couldn't find it. It is apparently still on my laptop (which has a dead battery and a virus...havent used it in months)

 

Guess Ill plug it in and try to fire it up, transfer the files from a USB thumbdrive. I thought i had transferred all my TI stuff over a year ago, but I must have missed a folder or something.

Link to comment
Share on other sites

Well, TIdBiT freakin works briliantly on my phone.. How about that?!

The interface to TidBit is just a textbox that submits to my web-server where the program actually runs. This means that unlike most websites these days, TidBit does not rely on a heavy Javascript or advanced browser to work. It should run on pretty much any basic web browser.

 

So, it will not resequence current line numbers. Ill finish my post-RES Notepad++ integration and then I will have 100 potential lines in between the current ones to write code into.

When TidBit sees a line that starts with a line number, it retains that number. It always assumes that you wanted that line number at that line of code and will not over-write it. However, it is also keeping an internal line number counter to produce the output. If your forced line number is less than the internal count then TidBit has to throw away the lines less than any forced line number it finds. Your code needs to have room between lines before you start working in TidBit, if you are going to have line numbers at all. If you have lines spaced by 10, then set TidBit to 5 or 1 so you can add non-line-number lines between existing numbered lines. But you are better off migrating away from line numbering all together.

 

I am scared stiff to try and convert my entire game into this format... :) Maybe I am just not confident in my abilities.

Start with a copy of your existing code so you can always reference it. This is mostly just search and replace, so I know you can do it. Your game is large enough that you need to get away from dealing with line numbers and get some formatting and structure to your code. You will not believe how much difference just being able to indent your code will make!

Edited by matthew180
Link to comment
Share on other sites

TIdBiT looks really interesting and is actually close to something I have been looking for, but there are some additional features I would want before I'd use it.

Such as?

 

There is a TidBit thread here in the development sub-forum. I don't want to hi-jack Owen's thread, but here is an example that demonstrates most of the features:

 

In:

 

 

 

//
// Hunter-Killer Maze Algorithm
// TI-99/4A Extended BASIC Version
//

// Initialize
CALL CLEAR :: OPTION BASE 0 :: RANDOMIZE
CALL CHAR(96,"0000000000000000")
CALL CHAR(97,"0101010101010101")
CALL CHAR(98,"00000000000000FF")
CALL CHAR(99,"01010101010101FF")
CALL CHAR(100,"017D4545457D01FF")
CALL COLOR(9,2,11)

// Initialize the maze screen offset and starting "hunt" mode coordinate.
OX=10 :: OY=6 :: HX=1 :: HY=1

// Dimmension the MAZE array and initialize the border.
SX=12 :: SY=12 :: ..
DIM MAZE(13,13)

FOR I=0 TO SX+1 :: ..
    MAZE(I,0)=-1 :: ..
    MAZE(I,SY+1)=-1 :: ..
NEXT I

FOR I=1 TO SY :: ..
    MAZE(0,I)=-1 :: ..
    MAZE(SX+1,I)=-1 :: ..
NEXT I

// Dimmension and initialize the direction-to-offset lookup table.  What
// this does is saves us from having to use IF statements to find out
// what to add to X and Y for a given direction D.
DIM P(4,2)
    P(1,1)=0 :: ..
    P(1,2)=-1 :: ..
    P(2,1)=1 :: ..
    P(2,2)=0
    P(3,1)=0 :: ..
    P(3,2)=1 :: ..
    P(4,1)=-1 :: ..
    P(4,2)=0

DIM DBIT(4) :: ..
    DBIT(1)=1 :: ..
    DBIT(2)=2 :: ..
    DBIT(3)=4 :: ..
    DBIT(4)=8

DIM DINV(4) :: ..
    DINV(1)=4 :: ..
    DINV(2)=8 :: ..
    DINV(3)=1 :: ..
    DINV(4)=2

// Draw the initial maze, all walls up.
FOR I=OY TO OY+SY-1
    CALL HCHAR(I,OX,99,SX)
NEXT I

// Pick a random starting point and enter Kill mode.
KillMode:

    X=INT(RND*SX)+1 :: ..
    Y=INT(RND*SY)+1 :: ..
    IF MAZE(X,Y)<>0 THEN ..
        KillMode

    DISPLAY AT(1,1):"KILL"

    // Pick a random direction D (1-4) and remember it (D1) so we know when we
    // have tried all 4 directions for this cell.  RND is a very expensive
    // instruction, as is the multiplication.
    PickRandomDirection:

        D=INT(RND*3)+1 :: ..
        D1=D

        CheckNewCell:
            // Generate a new cell location (NX,NY) and see if it is okay to move there.
            NX=X+P(D,1) :: ..
            NY=Y+P(D,2)

            IF MAZE(NX,NY)<>0 THEN InvalidDirection

            // Drop the wall in the current cell for the direction in which we are
            // leaving the cell.  Then display the proper wall character for this cell.
            MAZE(X,Y)=MAZE(X,Y) OR DBIT(D)
            C=99

            IF (MAZE(X,Y) AND 2)=2 THEN ..
                C=98

            IF (MAZE(X,Y) AND 4)=4 THEN ..
                IF C=98 THEN ..
                    C=96 ..
                ELSE ..
                    C=97

            CALL HCHAR(OY+Y-1,OX+X-1,C)

            // Set X and Y to the new cell and drop the wall for the direction in which
            // we just entered the cell.
            X=NX :: ..
            Y=NY :: ..
            MAZE(X,Y)=DINV(D)

    GOTO PickRandomDirection

    InvalidDirection:

        D=D+1 :: ..
        IF D>4 THEN ..
            D=1

    IF D<>D1 THEN ..
        CheckNewCell

// Begin "hunt" mode.  Displays the proper character for the current cell
// and marks the cell as "complete".
HuntMode:

    C=99
    IF (MAZE(X,Y) AND 2)=2 THEN ..
        C=98

    IF (MAZE(X,Y) AND 4)=4 THEN ..
        IF C=98 THEN ..
            C=96 ..
        ELSE ..
            C=97

    CALL HCHAR(OY+Y-1,OX+X-1,C)
    MAZE(X,Y)=MAZE(X,Y) OR 16

    // Set up the hunt loops.  Hunting is a sequential scan over the maze,
    // looking for a cell that has been visited but is not yet complete.
    // Once the whole maze has been scanned in hunt mode and all cells are
    // found to be "complete", the maze is done.

    RESET=0

    FOR J=HY TO SY :: ..
        DISPLAY AT(1,1):"HUNT: ";J

        FOR I=HX TO SX

            // Looking for a visited cell to being Kill mode again.  All cells that
            // are either 0 or >=16 are unvisited or complete, and are skipped.

            // If an unvisited cell (0) is found, the next time we enter hunting mode,
            // we must begin at the beginning (indicated by the RESET variable.)
            // However, if there are no unvisited cells up to the next cell to
            // continue with, we can pick up hunting were we left off.

            IF MAZE(I,J)=0 THEN ..
                RESET=1 :: ..
                GOTO Next_I

            IF MAZE(I,J)>=16 THEN ..
                Next_I

            // A valid cell was found, so set that as the current cell.  The direciton
            // is set instead of chosen again at random since 1. this cell already had
            // a random direction chosen for it once before, and 2. chosing a random
            // number is expensive and we want to avoid it if possible.  This is why
            // we jump back to the line just following the random direction generation.

            X=I :: Y=J

            IF RESET=0 THEN ..
                HX=I :: ..
                HY=J ..
            ELSE ..
                HX=1 :: ..
                HY=1

            DISPLAY AT(1,1):"KILL"
            D=4 :: ..
            D1=4

            // Hmm, jumping out of a FOR - NEXT loop is not really good
            // programming practice.
            GOTO CheckNewCell

        // Hunting loop iterators.  If we picked up hunting where we had left off
        // on a previous hunting loop, the hunting column (HX) must be reset back
        // to 1, otherwise hunting would miss chunks of the maze if we hunt past
        // the current line during this hunting iteration.
        Next_I:
        NEXT I

        HX=1

    NEXT J

DISPLAY AT(1,1):"DONE"
KeyWait: CALL KEY(0,K,S) :: IF S=0 THEN KeyWait

END

 

 

Out:

 

 

100 CALL CLEAR :: OPTION BASE 0 :: RANDOMIZE
110 CALL CHAR(96,"0000000000000000")
120 CALL CHAR(97,"0101010101010101")
130 CALL CHAR(98,"00000000000000FF")
140 CALL CHAR(99,"01010101010101FF")
150 CALL CHAR(100,"017D4545457D01FF")
160 CALL COLOR(9,2,11)
170 OX=10 :: OY=6 :: HX=1 :: HY=1
180 SX=12 :: SY=12 :: DIM MAZE(13,13)
190 FOR I=0 TO SX+1 :: MAZE(I,0)=-1 :: MAZE(I,SY+1)=-1 :: NEXT I
200 FOR I=1 TO SY :: MAZE(0,I)=-1 :: MAZE(SX+1,I)=-1 :: NEXT I
210 DIM P(4,2)
220 P(1,1)=0 :: P(1,2)=-1 :: P(2,1)=1 :: P(2,2)=0
230 P(3,1)=0 :: P(3,2)=1 :: P(4,1)=-1 :: P(4,2)=0
240 DIM DBIT(4) :: DBIT(1)=1 :: DBIT(2)=2 :: DBIT(3)=4 :: DBIT(4)=8
250 DIM DINV(4) :: DINV(1)=4 :: DINV(2)=8 :: DINV(3)=1 :: DINV(4)=2
260 FOR I=OY TO OY+SY-1
270 CALL HCHAR(I,OX,99,SX)
280 NEXT I
290 X=INT(RND*SX)+1 :: Y=INT(RND*SY)+1 :: IF MAZE(X,Y)<>0 THEN 290
300 DISPLAY AT(1,1):"KILL"
310 D=INT(RND*3)+1 :: D1=D
320 NX=X+P(D,1) :: NY=Y+P(D,2)
330 IF MAZE(NX,NY)<>0 THEN 410
340 MAZE(X,Y)=MAZE(X,Y) OR DBIT(D)
350 C=99
360 IF (MAZE(X,Y) AND 2)=2 THEN C=98
370 IF (MAZE(X,Y) AND 4)=4 THEN IF C=98 THEN C=96 ELSE C=97
380 CALL HCHAR(OY+Y-1,OX+X-1,C)
390 X=NX :: Y=NY :: MAZE(X,Y)=DINV(D)
400 GOTO 310
410 D=D+1 :: IF D>4 THEN D=1
420 IF D<>D1 THEN 320
430 C=99
440 IF (MAZE(X,Y) AND 2)=2 THEN C=98
450 IF (MAZE(X,Y) AND 4)=4 THEN IF C=98 THEN C=96 ELSE C=97
460 CALL HCHAR(OY+Y-1,OX+X-1,C)
470 MAZE(X,Y)=MAZE(X,Y) OR 16
480 RESET=0
490 FOR J=HY TO SY :: DISPLAY AT(1,1):"HUNT: ";J
500 FOR I=HX TO SX
510 IF MAZE(I,J)=0 THEN RESET=1 :: GOTO 580
520 IF MAZE(I,J)>=16 THEN 580
530 X=I :: Y=J
540 IF RESET=0 THEN HX=I :: HY=J ELSE HX=1 :: HY=1
550 DISPLAY AT(1,1):"KILL"
560 D=4 :: D1=4
570 GOTO 320
580 NEXT I
590 HX=1
600 NEXT J
610 DISPLAY AT(1,1):"DONE"
620 CALL KEY(0,K,S) :: IF S=0 THEN 620
630 END

 

Edited by matthew180
Link to comment
Share on other sites

Hey, my thread is your thread, Matthew. :)

 

 

And thanks for the replies. I'll take a long hard look at my code when I transfer it over to my desktop tonight. Start trying to format the existing stuff into TIdBiT-style source... See how far I get.

 

It really would make for a nice development environment,rather than line numbers.

Link to comment
Share on other sites

Well, I got half my files pulled over this morning. I missed a ton of stuff jammed into 2-3 folders. Bunch of old roguelike hack-job code I abandoned, music listings, Magellan maps... Got most of it pulled over, but then the laptop kinda crashed (which it does wuite a bit).

 

Got the good stuff though. Thats what matters. :)

 

Ill try starting in safe mode when I get home and see if the thumb drive works in Safe.

Link to comment
Share on other sites

You know you write XB programs with almost all SUBs instead and use them like names instead of Program names.

 

P.S. I tested the XB version on Extended Basic vs RXB 2015 and started XB first then RXB 2015 and RXB 2015 got done first.

Edited by RXB
Link to comment
Share on other sites

Yea, I made a short video of Beryl Reichardt running in RXB. It load faster at startup, I remember that much. Might be on my YouTube channel... Cant remember if I posted it there or not.

 

RXB is awesome sauce, for sure.

RXB 2015 is done so getting ready to release in next few days.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...