Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. NyaNyaLily

    NyaNyaLily h Member

    Joined:
    Jun 3, 2017
    Messages:
    54
    Say, does anybody have any information about if it is possible to extend Sonic 1's max level length?
    I want to make my levels to have some nice speed sections, but it currently comes at the cost of the level being like 45 seconds long.
    I can't find any information online about this.
     
    Trickster likes this.
  2. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    You'll have to rewrite the code that handles the level layout. You can sacrifice height for width, you can expand the RAM area used for the layout, you can read the layout data uncompressed from ROM, or you can port S3K's layout system.
     
    Trickster and Inferno like this.
  3. DeltaWooloo

    DeltaWooloo The noob next door Member

    Joined:
    Aug 7, 2019
    Messages:
    373
    Assuming you're here MainMemory, is there a way to fix objects not loading in levels? It only seems to load after dying. I don't know if it is a SonLVL or disassembly bug.
     
    Last edited: Dec 26, 2019
    Trickster likes this.
  4. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    It's definitely not a SonLVL bug. I don't know what could be causing it though.
     
    Trickster likes this.
  5. Monitor

    Monitor Custom Title Member

    Joined:
    Jul 12, 2019
    Messages:
    15
    So I was using SonMapEd to put a sprite, but instead of getting the sprite, i get a black sprite, and the sprite and tiles just disappear.

    Can anyone here help me how to do this?

    [​IMG]
     

    Attached Files:

    Trickster likes this.
  6. Samey

    Samey Le Bored Hedgie Member

    Joined:
    May 3, 2017
    Messages:
    57
    well first, I suggest turning the first color in your palette line to magenta (or '255 0 255')
    it makes importing sprites alot easier.

    Though, I honestly don't know why it turned all black, can I see the sprite you tried importing?
     
    Trickster likes this.
  7. Monitor

    Monitor Custom Title Member

    Joined:
    Jul 12, 2019
    Messages:
    15
    The sprite I tried to put is this.

    [​IMG]

    Yes, it's a test sprite.
     

    Attached Files:

    • _inc.png
      _inc.png
      File size:
      771 bytes
      Views:
      881
    Trickster likes this.
  8. Samey

    Samey Le Bored Hedgie Member

    Joined:
    May 3, 2017
    Messages:
    57
    Ah I see.
    No idea why it turned all black, but I suggest turning the entire background of the sprite to magenta, to match with the palette.
    SonMapEd can't tell between the bright magenta and the dark magenta, and when it gets imported it'll turn into the red color.
    Once that's imported it should look alright.

    I also suggest using these settings for image importing, though these are just my preference.
    Capture.png
     
    Trickster likes this.
  9. Kilo

    Kilo Foxy Fren Exiled

    Joined:
    Oct 9, 2017
    Messages:
    391
    Location:
    A warm and lovely place~
    I'd recommend you use Flex 2 instead. It's more modern, and easier to use. For example, rather than having to export some art and then editing it in an external program, Flex 2 allows you to draw in the program. As well, mapping is a lot easier (At least in my opinion). The only issue I could imagine is the fact that importing is somewhat buggier.
     
    Trickster likes this.
  10. Devon

    Devon Down you're going... down you're going... Member

    Joined:
    Aug 26, 2013
    Messages:
    1,372
    Location:
    your mom
    Actually, you should use a different color. When you import an image over a sprite with that color as the background color, SonMapEd will not blank out the overwritten tiles, so you'll end up just overlaying your new sprite over the old one. I believe it's related to how SonMapEd uses that color to indicate that a tile in an image is unused. I personally use (0,255,0), but really, any color that stands out from the palette will do.
     
    Trickster likes this.
  11. Samey

    Samey Le Bored Hedgie Member

    Joined:
    May 3, 2017
    Messages:
    57
    Ah, I usually end up clearing the tiles first anyway ‍¯\_(ツ)_/¯
    @Kilo: I'm used to using Gimp for pretty much anything art related so ye :p
     
    Trickster likes this.
  12. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    If you only want to draw sprites and not think about mappings at all, SpriteSheetGen+SpritePlotter.NET from SonLVL is also an option.
     
    Trickster likes this.
  13. Tanman Tanner

    Tanman Tanner Well-Known Member Member

    Joined:
    Dec 23, 2016
    Messages:
    116
    Location:
    Buffalo, New York
    Sorry for answering your question so late.
    Can you reply with what sound driver you're using? If it's the Sonic 2 Clone Driver v2, I probably already know the answer for you.
     
    Trickster likes this.
  14. CreepyMystery

    CreepyMystery Reminiscence and Semblance Member

    Joined:
    Oct 20, 2017
    Messages:
    36
    Recently, I've been adding the Spin Dash and Skid dust to my Sonic 1 hack. Most of it works out fine, but when the dust art loads up:
    sdvfsdfvasdfv.PNG This happens.
    I assume it could have something to do with the Mega CD DMA bugs (I'm using HCKTROX's Sonic 1 for MegaCD disassembly), but I have added 2 to the dust destination and source.

    Dust_SkidDust:
    subq.b #1,$32(a0)
    bpl.s loc_1DEE0
    move.b #3,$32(a0)
    jsr SingleObjLoad
    bne.s loc_1DEE0
    move.b (a0),(a1) ; load obj08
    move.w 8(a2),8(a1)
    move.w $C(a2),$C(a1)
    addi.w #$10,$C(a1)
    move.b #0,$22(a1)
    move.b #3,$1C(a1)
    addq.b #2,$24(a1)
    move.l 4(a0),4(a1)
    move.b 1(a0),1(a1)
    move.b #1,$18(a1)
    move.b #4,$19(a1)
    move.w 2(a0),2(a1)
    andi.w #$7FFF,2(a1)
    tst.w 2(a2)
    bpl.s loc_1DEE0
    ori.w #$8000,2(a1)

    loc_1DEE0:
    bsr.s Dust_LoadArt
    rts
    ; ===========================================================================
    ; loc_1DEE4:
    Dust_LoadArt:
    moveq #0,d0
    move.b $1A(a0),d0 ; load frame number
    cmp.b $30(a0),d0 ; has frame changed?
    beq.s @nochange ; if not, branch

    move.b d0,$30(a0)
    lea (Obj05_DPLC).l,a2 ; load PLC script
    add.w d0,d0
    adda.w (a2,d0.w),a2
    moveq #0,d5
    move.b (a2)+,d5
    subq.w #1,d5
    bmi.s @nochange
    move.w #$F362,d4
    move.l #Art_Dust,d6

    @readentry:
    moveq #0,d1
    move.b (a2)+,d1
    lsl.w #8,d1
    move.b (a2)+,d1
    move.w d1,d3
    lsr.w #8,d3
    andi.w #$F0,d3
    addi.w #$10,d3
    andi.w #$FFF,d1
    lsl.l #5,d1
    add.l d6,d1
    move.w d4,d2
    add.w d3,d4
    add.w d3,d4
    jsr (QueueDMATransfer).l
    dbf d5,@readentry ; repeat for number of entries

    @nochange:
    rts
     
    Trickster likes this.
  15. Trickster

    Trickster Well-Known Member Member

    Joined:
    Aug 22, 2018
    Messages:
    110
    Location:
    Brazil Bad Future
    Could someone explain how the fuck does HTZ bg works? I've been trying to port the parallax scrolling of it to CPZ but the coulds stop moving above the line of the red rocks, and I dunno how the objects behind them works as well.
    upload_2020-1-17_22-41-36.png
     
  16. CreepyMystery

    CreepyMystery Reminiscence and Semblance Member

    Joined:
    Oct 20, 2017
    Messages:
    36
    The mountain effect is achieved by dynamically loading different tiles for the X position of the camera. This effect is used in many games, like Shinobi III, and S3K. I assume the clouds do the same thing as the mountains, but i'm not sure.

    Dynamic_HTZ:
    lea (Anim_Counters).w,a3
    moveq #0,d0
    move.w (Camera_X_pos).w,d1
    neg.w d1
    asr.w #3,d1
    move.w (Camera_X_pos).w,d0
    lsr.w #4,d0
    add.w d1,d0
    subi.w #$10,d0
    divu.w #$30,d0
    swap d0
    cmp.b 1(a3),d0
    beq.s BranchTo_loc_3FE5C
    move.b d0,1(a3)
    move.w d0,d2
    andi.w #7,d0
    add.w d0,d0
    add.w d0,d0
    add.w d0,d0
    move.w d0,d1
    add.w d0,d0
    add.w d1,d0
    andi.w #$38,d2
    lsr.w #2,d2
    add.w d2,d0
    lea word_3FD9C(pc,d0.w),a4
    moveq #5,d5
    move.w #tiles_to_bytes(ArtTile_ArtUnc_HTZMountains),d4
     
    Trickster and ProjectFM like this.
  17. Trickster

    Trickster Well-Known Member Member

    Joined:
    Aug 22, 2018
    Messages:
    110
    Location:
    Brazil Bad Future
    got it. I found the dynamic tiles/blocks ID and I transfered them to CPZ, as seen here.

    upload_2020-1-18_13-3-51.png upload_2020-1-18_13-5-37.png upload_2020-1-18_13-1-22.png

    BUT...

    upload_2020-1-18_13-7-46.png

    guess it has to have the art data of the dynamic mountains as well or something like that...
    And again, I have no idea how to import it. (' ;u; )
     
  18. CreepyMystery

    CreepyMystery Reminiscence and Semblance Member

    Joined:
    Oct 20, 2017
    Messages:
    36
    I forgot about the rest of the routine, sorry.

    Dynamic_HTZ:
    tst.w (Two_player_mode).w
    bne.w Dynamic_Normal
    lea (Anim_Counters).w,a3
    moveq #0,d0
    move.w (Camera_X_pos).w,d1
    neg.w d1
    asr.w #3,d1
    move.w (Camera_X_pos).w,d0
    lsr.w #4,d0
    add.w d1,d0
    subi.w #$10,d0
    divu.w #$30,d0
    swap d0
    cmp.b 1(a3),d0
    beq.s BranchTo_loc_3FE5C
    move.b d0,1(a3)
    move.w d0,d2
    andi.w #7,d0
    add.w d0,d0
    add.w d0,d0
    add.w d0,d0
    move.w d0,d1
    add.w d0,d0
    add.w d1,d0
    andi.w #$38,d2
    lsr.w #2,d2
    add.w d2,d0
    lea word_3FD9C(pc,d0.w),a4
    moveq #5,d5
    move.w #tiles_to_bytes(ArtTile_ArtUnc_HTZMountains),d4
    loc_3FD7C:
    moveq #-1,d1
    move.w (a4)+,d1
    andi.l #$FFFFFF,d1
    move.w d4,d2
    moveq #tiles_to_bytes(4)/2,d3 ; DMA transfer length (in words)
    jsr (QueueDMATransfer).l
    addi.w #$80,d4
    dbf d5,loc_3FD7C
    BranchTo_loc_3FE5C
    bra.w loc_3FE5C
    ; ===========================================================================
    ; HTZ mountain art main RAM addresses?
    word_3FD9C:
    dc.w $80, $180, $280, $580, $600, $700 ; 6
    dc.w $80, $180, $280, $580, $600, $700 ; 12
    dc.w $980, $A80, $B80, $C80, $D00, $D80 ; 18
    dc.w $980, $A80, $B80, $C80, $D00, $D80 ; 24
    dc.w $E80,$1180,$1200,$1280,$1300,$1380 ; 30
    dc.w $E80,$1180,$1200,$1280,$1300,$1380 ; 36
    dc.w $1400,$1480,$1500,$1580,$1600,$1900 ; 42
    dc.w $1400,$1480,$1500,$1580,$1600,$1900 ; 48
    dc.w $1D00,$1D80,$1E00,$1F80,$2400,$2580 ; 54
    dc.w $1D00,$1D80,$1E00,$1F80,$2400,$2580 ; 60
    dc.w $2600,$2680,$2780,$2B00,$2F00,$3280 ; 66
    dc.w $2600,$2680,$2780,$2B00,$2F00,$3280 ; 72
    dc.w $3600,$3680,$3780,$3C80,$3D00,$3F00 ; 78
    dc.w $3600,$3680,$3780,$3C80,$3D00,$3F00 ; 84
    dc.w $3F80,$4080,$4480,$4580,$4880,$4900 ; 90
    dc.w $3F80,$4080,$4480,$4580,$4880,$4900 ; 96
    ; ===========================================================================
    loc_3FE5C:
    lea (TempArray_LayerDef).w,a1
    move.w (Camera_X_pos).w,d2
    neg.w d2
    asr.w #3,d2
    move.l a2,-(sp)
    lea (ArtUnc_HTZClouds).l,a0
    lea (Chunk_Table+$7C00).l,a2
    moveq #$F,d1
    loc_3FE78:
    move.w (a1)+,d0
    neg.w d0
    add.w d2,d0
    andi.w #$1F,d0
    lsr.w #1,d0
    bcc.s loc_3FE8A
    addi.w #$200,d0
    loc_3FE8A:
    lea (a0,d0.w),a4
    lsr.w #1,d0
    bcs.s loc_3FEB4
    move.l (a4)+,(a2)+
    adda.w #$3C,a2
    move.l (a4)+,(a2)+
    adda.w #$3C,a2
    move.l (a4)+,(a2)+
    adda.w #$3C,a2
    move.l (a4)+,(a2)+
    suba.w #$C0,a2
    adda.w #$20,a0
    dbf d1,loc_3FE78
    bra.s loc_3FEEC
    ; ===========================================================================
    loc_3FEB4:
    rept 3
    rept 4
    move.b (a4)+,(a2)+
    endm
    adda.w #$3C,a2
    endm
    rept 4
    move.b (a4)+,(a2)+
    endm
    suba.w #$C0,a2
    adda.w #$20,a0
    dbf d1,loc_3FE78
    loc_3FEEC:
    move.l #(Chunk_Table+$7C00) & $FFFFFF,d1
    move.w #tiles_to_bytes(ArtTile_ArtUnc_HTZClouds),d2
    move.w #tiles_to_bytes(8)/2,d3 ; DMA transfer length (in words)
    jsr (QueueDMATransfer).l
    movea.l (sp)+,a2
    addq.w #2,a3
    bra.w loc_3FF30
     
    ProjectFM and Trickster like this.
  19. Trickster

    Trickster Well-Known Member Member

    Joined:
    Aug 22, 2018
    Messages:
    110
    Location:
    Brazil Bad Future
    Okay, here's what I'm doing:

    [​IMG]

    As you can see, instead of code-porting the BG code, I'm just telling the game to load a different table when loading the zone.
    But, even if I did this, it still doesn't load the necessary graphics.

    Just for tests, I did this.

    upload_2020-1-19_8-31-11.png

    And well, It just stopped loading the graphics of the clouds and cliffs.

    upload_2020-1-18_19-33-10.png
    And while this trick didn't load the needed graphics in CPZ, It messed up them in HTZ.

    Welp, this made me realize that doing this will not do the expected results. But, I don't know what else will. :/
     
    Last edited: Jan 19, 2020
  20. Trickster

    Trickster Well-Known Member Member

    Joined:
    Aug 22, 2018
    Messages:
    110
    Location:
    Brazil Bad Future
    upload_2020-1-19_13-35-54.png
    Erm, for some reason. after defeating eggman in EHZ, this happened. :T
    While it loaded the graphics of the clouds, it glitched out the graphics of the moutains.
    The art of the mountains and of the bee badnik is conflicting with themselves.

    So, I guess the problem is actually the game itself having a hard time loading too much stuff! :V
    I'm so glad it still tries to load the graphics, now the only issue i have to solve is to how to fix this glitch.

    (Also, I'm self aware that it's not cool to double post, but, right now I'm having problems editing them. For some reason, when I click to edit a post, an image is deleted and I have to "remake" it. I already done this *4 times.)