Jump to content
IGNORED

Questions with Adventure.


EarthQuake

Recommended Posts

Hi all, I'm back after an extensive absence and ready to continue work on my Adventure hack, Odyssey. The main reason I quit work on it is because I lost everything I had and it was really detrimental to me. It was so close to completion. I've been hanging around the last couple days and managed to pick back up from Nukey's latest optimized 8k source. Got my dragon, start room/end room tables set up, and I'm currently adding a 4th difficulty level (which I'm bound to have problems with :P).

 

Anyways, my questions are (and I'm sure Nukey will have the answer to this :lol:):

 

1) How would I go about doubling the width of each screen's bitmap, effectively eliminating the need for mirroring the left side? No matter how this is done, you would no longer need to tell a room to be "mirrored" or "reversed". Or alternatively, could there be a way to specify a bitmap to the right side, so only select screens would take advantage of this doubled width? It would save on bytes that way. :|

 

2) Also, if I were to take the dot object, and add it to the dragon matrices so the dragons feared it, would there be any problems with doing so? I thought I tried this in the past and it did not work...

 

I would have waited until my screens are ready so I could have something to show, but I wanted to know how (or if) the double screen width was possible...

 

Thanks.

Edited by EarthQuake
Link to comment
Share on other sites

1) VERY difficult. You would need to rewrite the game kernal totally. With the 2600, anthing that is currently in the screen registers will be repeated. Due to the length of time that it takes Adventure to grab it's screen and sprite data, the pattern held in ram is repeated every other scanline. In order to implement asymmetrical playfields, these routines would have to be rewritten in order to happen MUCH faster (so that there's enough time to change the playfield pattern mid-scanline). With mirrored/repeated data, there's no need to do anything but wait...the 2600 will do that automatically. Trying to go that route with a hack, it would be easier to start with a game engine that already features asymmetrical playfields and hack it into an Adventure-type clone.

 

2) Nothing to it at all. The game uses the ram locations that hold the object room numbers to do comparisons..."if the object's current room equals the dragon's current room, then do this". The only thing that determines if it should be feared or guarded is whether it appears in the dragon's matrix before or after the dragon's ram location. $A1 is the ram location that holds the dot's room number, so all you need to do is add 2 bytes to each matrix...the dot's ram location, and then the dragon's ram location.

 

 

"Feared dot" hack...

;Red Dragon Object Matrix
RedDragMatrix:
      .byte $A1,$A4                 ;Dot, Red Dragon
      .byte $B6,$A4                 ;Sword, Red Dragon
      .byte $A4,$8A                 ;Red Dragon, Ball
      .byte $A4,$B9                 ;Red Dragon, Chalise
      .byte $A4,$C2                 ;Red Dragon, White Key
      .byte $00

;Yellow Dragon's Object Matrix
YelDragMatrix:
      .byte $A1,$A9                 ;Dot, Yellow Dragon
      .byte $B6,$A9                 ;Sword, Yellow Dragon
      .byte $BF,$A9                 ;Yellow Key, Yellow Dragon
      .byte $A9,$8A                 ;Yellow Dragon, Ball
      .byte $A9,$B9                 ;Yellow Dragon, Chalise
      .byte $00

;Green Dragon's Object Matrix
GreenDragonMatrix:
      .byte $A1,$AE                 ;Dot, Green Dragon
      .byte $B6,$AE                 ;Sword, Green Dragon
      .byte $AE,$8A                 ;Green Dragon, Ball
      .byte $AE,$B9                 ;Green Dragon Chalise
      .byte $AE,$BC                 ;Green Dragon, Bridge
      .byte $AE,$B3                 ;Green Dragon, Magnet
      .byte $AE,$C5                 ;Green Dragon, Black Key
      .byte $00

Link to comment
Share on other sites

Not much...got a slacker job moving office furnature, so I'm only online 16 hours a day rather than 24 ;)

 

BTW, adding game selections is covered someplace in the Adventure8k thread. Not too difficult, you just need to adjust the maximum value allowed (both when performing the selection, and when randomizing objects) and branch off to a custom routine that deals with higher selections. Some tables would need to be expanded to take the additional level(s) into account as well (like the RoomDiffs table).

http://www.atariage.com/forums/index.php?showtopic=50191

 

 

Edit: post #89 in that thread

Edited by Nukey Shay
Link to comment
Share on other sites

Okay back to the dragon matrices :)

 

;Red Dragon Object Matrix
RedDragMatrix:
     .byte $B6,$A4            ;Sword, Red Dragon <- here
     .byte $A4,$8A            ;Red Dragon, Ball
     .byte $A4,$B9            ;Red Dragon, Chalise
     .byte $A4,$C2            ;Red Dragon, White Key
     .byte $00

;Yellow Dragon's Object Matrix
YelDragMatrix:
     .byte $B6,$A9            ;Sword, Yellow Dragon <- here
     .byte $BF,$A9            ;Yellow Key, Yellow Dragon
     .byte $A9,$8A            ;Yellow Dragon, Ball
     .byte $A9,$B9            ;Yellow Dragon, Chalise
     .byte $00

;Green Dragon's Object Matrix
GreenDragonMatrix:
     .byte $B6,$AE            ;Sword, Green Dragon <- here
     .byte $AE,$8A            ;Green Dragon, Ball
     .byte $AE,$B9            ;Green Dragon Chalise
     .byte $AE,$BC            ;Green Dragon, Bridge
     .byte $AE,$B3            ;Green Dragon, Magnet
     .byte $AE,$C5            ;Green Dragon, Black Key
     .byte $00

 

One thing I'm left wondering, is why the sword is feared in each of these tables. I would have liked to make the 4th dragon avoid the sword, but it seems it's already in the table (taking them out seem to do nothing). Does this have something to do with the difficulty switches? If so, how would I go about permanently turning this on for one dragon?

Edited by EarthQuake
Link to comment
Share on other sites

The sword IS a feared object. When you play the game with the A (expert) difficulty setting, the dragons run away from it...making dragons harder to kill. When this switch is on the B (easy) setting, a special routine is used to mess up the table it's reading when checking for the sword ;)

 

;Dragon Normal (State 1)
      LDA    SWCHB              ;Read console switches.                                                   ;4
      AND    #$80               ;Check for P1 difficulty.                                                 ;2
      BEQ    MoveDragon_2       ;If Amateur Branch.                                                       ;2

      LDA    #$00               ;Set Hard - Ignore Nothing                                                ;2
      JMP    MoveDragon_3                                                                                  ;3

MoveDragon_2:
      LDA    #$B6               ;Set Easy - Ignore Sword.                                                 ;2

MoveDragon_3:
      STA    $D6                ;Store Difficulty                                                         ;3

 

 

 

This short routine made me realise that the edit I gave you is incorrect. The sword should always be the first object comparison in each of the matrix tables for this routine to work :P So move the two added bytes below the sword's line in each of them.

Link to comment
Share on other sites

BTW if you want 1 dragon to always ignore this routine (and therefore, always fear the sword), you could hack in a few instructions just before SWCHB is loaded in that routine. Just check if it's one of the dragon object numbers (#$30, #$38, or #$40)...and skip ahead if it is. This example exempts the red dragon:

 

 

;Dragon Normal (State 1)

;4 added lines
      lda    $A0                ;load Object were dealing with.                                           ;3
      sec                                                                                                  ;2
      sbc    #$30               ;Check for Red dragon                                                     ;2
      beq    MoveDragon_3       ;If so, Branch.                     ;2

Link to comment
Share on other sites

After adding my dragon, I offset each number in the comment (for my own use) to see what number I would have to use in place of #$30 (red dragon).

 

;Object numbers:
;these are used to calculate the offsets of the object table
SurroundNumber =  SurroundData - Objects;($00)
YGateNumber    =  YGateData - Objects;($08)
WGateNumber    =  WGateData - Objects;($10)
BGateNumber    =  BGateData - Objects;($18)
AuthorNumber   =  AuthorData - Objects;($20)
NumberNumber   =  NumberData - Objects;($28)
RDragonNumber  =  RDragonData - Objects;($30)
YDragonNumber  =  YDragonData - Objects;($38)
GDragonNumber  =  GDragonData - Objects;($40)
BDragonNumber  =  BDragonData - Objects;($48) <- added
SwordNumber    =  SwordData - Objects;($50)
BridgeNumber   =  BridgeData - Objects;($58)
YKeyNumber     =  YKeyData - Objects ;($60)
WKeyNumber     =  WKeyData - Objects ;($68)
BKeyNumber     =  BKeyData - Objects ;($70)
BatNumber      =  BatData - Objects  ;($78)
DotNumber      =  DotData - Objects  ;($80)
ChaliseNumber  =  ChaliseData - Objects;($88)
MagnetNumber   =  MagnetData - Objects;($90)
NullNumber     =  NullData - Objects ;($98)

 

So $48 is my number for the Black Dragon, yet when I tried the following:

 

;Dragon Normal (State 1)
      LDA    $A0             ;load Object we're dealing with.           ;3 <-added
      SEC                                                                ;2 <-added
      SBC    #$48  ;Check for Black dragon                              ;2 <-added
      BEQ    MoveDragon_3    ;If so, Branch.                            ;2 <-added
      BIT    SWCHB           ;Read console switches.                    ;4
      BPL    MoveDragon_2    ;If Amateur Branch.                        ;2

 

..nothing happens. All dragons still come near if you have the sword.

To make sure I didn't do anything wrong, I tried your original code with fresh source on the red dragon and still nothing happened...

Edited by EarthQuake
Link to comment
Share on other sites

The edits I was mentioning were regarding the original game...to get a sense of how it originally functioned (the BIT instruction below the added lines should have tipped you off that this is not the original code). In the newer version, I had reorganized the ram tables to provide an easier way to add new objects. So when you load $A0...it's not the correct ram location that X was just saved at ;)

 

You should use the line...

    LDA    ObjectNumber  ;load Object we're dealing with.          ;3

 

...instead. "ObjectNumber" is the correct variable where X was just saved at a few lines above this point.

 

The rest of your code looks good :thumbsup:

Edited by Nukey Shay
Link to comment
Share on other sites

Thank you, as always Nukey, works like a charm.

I'm not sure where I'd be without you.

 

Btw, this is amazing in terms of gameplay. I wanted a 4th dragon and I wanted it to be hard, and this certainly does the trick :lol:. The tactic that seems to kill him best is hiding the sword offscreen, waiting for the dragon to bite, and then bringing it back out right before he takes off.

Link to comment
Share on other sites

Thank you, as always Nukey, works like a charm.

I'm not sure where I'd be without you.

 

Btw, this is amazing in terms of gameplay. I wanted a 4th dragon and I wanted it to be hard, and this certainly does the trick :lol:. The tactic that seems to  kill him best is hiding the sword offscreen, waiting for the dragon to bite, and then bringing it back out right before he takes off.

850823[/snapback]

 

 

Oops...I also forgot to mention that the ram locations used to hold the dot, dragons, etc. were also renamed to be variables instead (like DotR, RDragonR, etc.)...so you should use the names of those variables in the matrix edits. i.e.:

 

;Red Dragon Object Matrix
RedDragMatrix:
      .byte SwordR,RDragonR       ;Sword, Red Dragon
      .byte DotR,RDragonR         ;Dot, Red Dragon
      .byte RDragonR,PlayerRoom   ;Red Dragon, Ball
      .byte RDragonR,ChaliseR     ;Red Dragon, Chalise
      .byte RDragonR,WKeyR        ;Red Dragon, White Key
      .byte $00                   ;matrix end

 

...and so on.

Link to comment
Share on other sites

No worries, I had already replaced the numbers with the variables in each table shortly after my 3rd post (#5). I also found a few occurances of the old numbers within the code itself that caused some items to not function properly (like the bridge and magnet) after I added the dragon. It's all fixed now :)

 

UPDATE:

After I followed your guide on adding the extra skill level, I found that when there was a lot of activity on a screen, especially with multiple dragons (i had 4 of them guarding the chalice at one point ;)), I found that I got some screen rumbles that only seemed to occur on level 4 (I might be wrong in assuming it only happened here). I was almost devastated, and then I saw your updated DoVSYNC routine and I used it in hopes of the rumbles going away. I think it worked, seeing as i had every item and all 4 dragons on the screen at once :lol:, but I can't be too sure.

 

Anyways, I still have to make changes to accomodate the new win/start rooms on level 4. If it's as simple as I think it is, then I should be almost finished with the gameplay related part of Odyssey.

Edited by EarthQuake
Link to comment
Share on other sites

Am I correct in assuming, that to have a seperate winning room for level 4, all I have to do is add another byte to the WinRooms table?

 

http://www.atariage.com/forums/index.php?s...ndpost&p=704937

 

WinRooms:
     .byte $12,$1A,$1B,$12;the winning screens (inside yellow, white, black, yellow castle)

 

Like so? I have it set up this way, but every so often when I select the 4th level, I win. Also, after walking into the yellow castle on level 4, I do not win. Why can't anything be straightforward? :?

Link to comment
Share on other sites

Impossible to tell from just a description. Working in an additional level involves more than just adding a WinRoom table...and some of the optimizations that I added won't work right when routines are altered. Can you PM the assembly to me?

Link to comment
Share on other sites

Just promise me you won't nag me about my organization. ;)

I haven't even started organizing tables and graphics yet, so a lot of space is wasted atm.

 

Basically, I have just been combining several of your tutorials/optimizations, including the one in the link above.

Just remember, you're not obligated to help at all. If worse comes to worst, then I'll just revert the changes I made to the difficulty levels. No huge loss.

 

To clarify:

When I followed your tutorial for adding a 4th difficulty level, it did not take into account that I also followed your tutorial for seperating start and win rooms for each difficulty level. So basically, the changes I made for start and win rooms only take into account 3 difficulty levels, not 4. Common sense told me that I only needed to add another byte to the end of that table to tell it what room to start/win on in difficulty 4.

odyssey7.txt

Edited by EarthQuake
Link to comment
Share on other sites

There are 2 problems that I noticed...

WinRooms:
    .byte $12,$1A,$1B,$13;the winning screens (inside the yellow, white, and black castles)

 

The winning screen is not inside the yellow castle in your assembly. That would be screen $12...but you used $13 for the 4th's winning screen (screen $13 is one of the Black Castle's maze screens). Running the program, I won the game consistantly bringing the Chalise there...and since the chalise is allowed to be randomly placed on that screen, you might win immediately without even playing ;)

You'd have to make sure that any screen you choose does not interfere with the boundry data in this table:

;Room Bounds Data.
;Ex. the chalise at location &B9 can only
;     exist in rooms 13-1A for level 3.
Loc_1:
      .byte ChaliseR              ;
Loc_2:
      .byte $13                   ;Chalise
Loc_3:
      .byte $1A                   ;
      .byte RDragonR,$01,$1D      ;Red Dragon
      .byte YDragonR,$01,$1D      ;Yellow Dragon
      .byte GDragonR,$01,$1D      ;Green Dragon
      .byte BDragonR,$01,$1D      ;Black Dragon
      .byte SwordR,$01,$1D        ;Sword
      .byte BridgeR,$01,$1D       ;Bridge
      .byte YKeyR,$01,$1D         ;Yellow Key
      .byte WKeyR,$01,$16         ;White Key
      .byte BKeyR,$01,$12         ;Black Key
      .byte BatR,$01,$1D          ;Bat
      .byte MagnetR,$01,$1D       ;Magnet

 

For each object, a data line is used that has 3 bytes: the ram location for the object's location, the lowest screen it's allowed to appear, and the highest (including all the screens that fall between). The chalise currently has $13 as a low boundry...the same as your win screen. So adjust your win screen value, and you should be good to go.

 

 

Another thing that -might- cause a problem is the use of LSR's instead of CMP in the SetupRoomObjects_2 routine. I'll admit that I didn't experiment enough with this idea to make sure that it worked 100%...so there might be something that isn't getting done from using that. But it looks OK.

Link to comment
Share on other sites

Shit...

You're telling me all that was because of a typo? :_(

Damn, I feel worthless now, wasting your time like that...

 

Anyways, I did have on other strange thing occuring. After I was eaten by a dragon, and I hit the reset function, I momentarily started on the yellow castle screen and then found myself back into the belly of the dragon.

 

I'm going to fix the start room tables and see if that fixes things. This problem only seems to occur on difficulty 4. Again, I'm not 100% sure on that.

 

EDIT: Hell, I don't think I added the seperate start rooms for this version of my source yet...

 

Okay, it's late and my brain is functioning less. Forgive me. ;)

Edited by EarthQuake
Link to comment
Share on other sites

Hm...I can't get it to happen now. Maybe that typo caused the glitch as well? :? I had it happen in the blue maze before.

 

BTW a dead black dragon isn't being revived when you press reset. To fix that, just add another line to the CheckGameStart routine (save a zero to BDragonR+4 along with the other dragons).

Link to comment
Share on other sites

Okay, it's got nothing to do with the seperate start rooms as I've not added that yet, but it's the black dragon itself.

If the black dragon has eaten you, then the reset bug occurs. The other dragons are fine.

850952[/snapback]

 

 

That explains it...I guess. Since the black dragon's state wasn't being altered, the game considered you to still be eaten ;)

No probs once STA BDragonR+4 is added to the reset routine.

Link to comment
Share on other sites

       STA    RDragonR+4        ;Set the red dragon's state to OK.           ;3
      STA    YDragonR+4        ;Set the yellow dragon's state to OK.        ;3
      STA    GDragonR+4        ;Set the green dragon's state to OK.         ;3

 

Here, I suppose. Thanks!

You might want to check your old tutorial as this code change might not have been mentioned (if that's of any importance to you).

Edited by EarthQuake
Link to comment
Share on other sites

       STA    RDragonR+4        ;Set the red dragon's state to OK.          ;3
      STA    YDragonR+4        ;Set the yellow dragon's state to OK.        ;3
      STA    GDragonR+4        ;Set the green dragon's state to OK.        ;3

 

Here, I suppose. Thanks!

You might want to check your old tutorial as this code change might not have been mentioned (if that's of any importance to you).

850956[/snapback]

 

 

Actually, it's kind of a worthwhile bug to know about. You could create a game where one of the opponents = certian death unless you get him first. No way to finish the game once he gets ya...just have to start over. :evil:

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...