don't click here

Basic Questions & Answers thread

Discussion in 'Engineering & Reverse Engineering' started by Tweaker, May 29, 2008.

  1. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    Sorry for the double post, but I have been pulling hairs out over this issue.
    I have coded an attack for Tails where he throws a ring to kill enemies. This works in that sense, but the object also interacts with any other object, and I am not sure how to correct this. Is there any way other than calling for touchresponse?
     
  2. E-122-Psi

    E-122-Psi

    Member
    2,471
    612
    93
    Does anyone here know how to code an object to home towards the player character? I basically want to make a projectile that is thrown and then pulls back towards the player.

    I've been trying to port the routines from other objects with similar behaviour such as Cheese or the lightning shield but NONE of them respond.

    Also does anyone know how to turn off the character flying the Tornado in Sonic 2? It looks like it loads a fake Tails in the cockpit with the object anyway.
     
    Last edited: May 14, 2020
  3. nineko

    nineko

    I am the Holy Cat Tech Member
    6,328
    491
    63
    italy
    In before "Rayman in Sonic 1".

    Sorry, I couldn't resist.
     
  4. E-122-Psi

    E-122-Psi

    Member
    2,471
    612
    93
    Oh it's something FAR more surprising. Believe me. :P
     
  5. Devon

    Devon

    A̸ ̴S̴ ̵C̵ ̷E̶ ̸N̸ ̴D̶ ̵E̶ ̸D̶ Tech Member
    1,300
    1,510
    93
    your mom
    @E-122-Psi With your first question, one thing you can do is utilize CalcAngle, and then CalcSine.

    Basically, first you set the X distance between the player and object into d1, and then the Y distance into d2. CalcAngle will calculate arctan(y/x) and retrieve the angle you need into d0. And with that, you can then just call CalcSine to grab the sine and cosine of that angle into d0 and d1 respectively, and use it for your homing needs.
     
    Last edited: May 14, 2020
  6. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,758
    341
    63
    SonLVL
    Yeah my homing attack code does exactly that, works great. I could share it with you if you need a reference.
     
  7. E-122-Psi

    E-122-Psi

    Member
    2,471
    612
    93
    Oh, yes please. An example would help. :D
     
  8. Karia

    Karia

    Member
    6
    0
    1
    Hello, I hope I'm posting in the right section ^^

    As the title say, I'm trying to export some models of the Zelda Zone dlc from Sonic Lost World Wii U.

    After some research, I found and used the pacpack-WiiU in this version of the soniclgvl: https://github.com/slashiee/libgens-sonicglvl/tree/WiiU
    I used this version, since the others didn't work, as they're for the pc version if I understood.

    I got Sonic's files as: .model, .shadow-model, .skl.hkx, .dds and .material.

    I looked into the dds files with the hex editor HxD, I found that they're apparently Gfx textures, as the begining start with: Gfx2.
    What can I do to open theses files?

    Using the modelfbx_2012, I converted the .model into fbx, but it doesn't have bones?

    How can I convert the models with their bones intact so that I can open them in Blender?

    Here's the sample files for LinkSonic: http://www.mediafire.com/file/maqvrnx5qtm9jtm/LinkSonic_Sample_files.rar/file

    I also found something strange, I can't convert the zdlc03_obj_fairy.model into .fbx while my attempts with others files were successful...

    When I try using the modelfbx_2012, I get this message on the command prompt : A string different than water for the 4th slot? Report this model! special1

    I can't even look at the file using SonicGLvl, I get the same message.

    I even tried the most recent version of sonicglvl, and I got the same results.

    Here's the .model files, along with samples of other .model files for comparison: http://www.mediafire.com/file/nr39g..._from_Zelda_Zone_of_Sonic_Lost_World.rar/file

    Also, just by curiosity, is there a way to convert .anm.hkx files?
     
  9. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    Would anybody be willing the explain how dynamic PLCs and DMATransfer work? I am looking to insert something into the VRAM location that's normally used for Sonic's spindash dust, but I cannot seem to figure it out.
     
  10. Devon

    Devon

    A̸ ̴S̴ ̵C̵ ̷E̶ ̸N̸ ̴D̶ ̵E̶ ̸D̶ Tech Member
    1,300
    1,510
    93
    your mom
    DPLCs pretty much define what tiles to load into VRAM from an uncompressed set of tiles for an object's sprite frame. Each DPLC entry contains a list of offsets and load sizes within the tileset.

    The VDP has a DMA (Direct Memory Access) controller that can handle loading VDP data from M68K memory by itself so that the M68K doesn't have to do it manually (alongside a couple other features). It is generally faster this way, since the DMA controller just does the copying and stuff, whereas the M68K would be doing that alongside parsing and running instructions.

    With that and DPLCs, it parses the data and submits it into QueueDMATransfer, which take a source address in M68K memory, a destination address in VRAM, and a size in words and turns them into DMA register data that is saved into RAM, and then processed during VBlank via ProcessDMAQueue, which sends the DMA register data loaded in RAM to the VDP.

    What is it that you're exactly trying to insert?
     
    Last edited: May 17, 2020
  11. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    Drop dash dust, specifically the pre-plus sprites that Mania used. I'd imagine the best way to get them in the game would to be by utilizing the same VRAM that the spindash dust would normally use, because in this case, I am not using it at all, so makes sense, right?
     
  12. Devon

    Devon

    A̸ ̴S̴ ̵C̵ ̷E̶ ̸N̸ ̴D̶ ̵E̶ ̸D̶ Tech Member
    1,300
    1,510
    93
    your mom
    You can just add the frames to the tileset, mappings, and DPLC data and make sure that the object displays the right sprite frame, no?
     
  13. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    Honestly, not sure. Loading the DPLC data for obj08 just displays a mess, or at least the past few times I tried to.
     
  14. Devon

    Devon

    A̸ ̴S̴ ̵C̵ ̷E̶ ̸N̸ ̴D̶ ̵E̶ ̸D̶ Tech Member
    1,300
    1,510
    93
    your mom
    What does the "mess" look like?
     
  15. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    [​IMG]
     
  16. Devon

    Devon

    A̸ ̴S̴ ̵C̵ ̷E̶ ̸N̸ ̴D̶ ̵E̶ ̸D̶ Tech Member
    1,300
    1,510
    93
    your mom
    It looks like art isn't how it should be. Did you change it before, or did it get corrupted in some way?
     
    Last edited: May 17, 2020
  17. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    I didn't change a thing with the files for that object. I will grab some clean files just in case and double check.

    Edit: Apparently, the disasembly for S2 I was using has the skid dust and spindash art split from the splash art. Unsure why. But yeah, using the files from the git version, they load fine.

    Edit 2:
    So, I am still having issues. I got the art/map issues sorted. See edit 3 for my current issue.

    The code looks like this:
    Code (Text):
    1.  
    2. Obj08_MdDropDashDust:
    3.     cmpi.b    #$C,air_left(a2)
    4.     bcs.w    Obj08_ResetDisplayMode
    5.     move.w    x_pos(a2),x_pos(a0)
    6.     move.w    y_pos(a2),y_pos(a0)
    7.     clr.b   x_vel(a0)
    8.     move.b    status(a2),status(a0)
    9.     andi.b    #1,status(a0)
    10.     tst.b    objoff_34(a0)
    11.     beq.s    +
    12.     subq.w    #4,y_pos(a0)
    13. +
    14.     tst.b    next_anim(a0)
    15.     bne.w    Obj08_Display
    16.     andi.w    #$7FFF,art_tile(a0)
    17.     tst.w    art_tile(a2)
    18.     bpl.w    Obj08_Display
    19.     ori.w    #$8000,art_tile(a0)
    20.     bra.w    Obj08_Display
    21.  
    Edit 3:
    with some fiddling, I got it to work... Kinda. It seems to just track onto Sonic, which obviously I do not want.
    [​IMG]
     
    Last edited: May 18, 2020
  18. RetroKoH

    RetroKoH

    Member
    1,670
    29
    28
    Project Sonic 8x16
    Reposted in the CORRECT thread because I forgot how to read... Mods, please trash my post in Screenshots thread...
    So, the bloody fox is pissing me off. On certain angles his sprites do wacky stuff. Not glitching, not garbled, just, odd frames, or displaying an empty frame (even weirder). This specifically happens on loop-de-loops, particularly when going right. For context, his walking is as it is in S2... 8 frames walking, 4 frames running, 2 dashing

    Tails_Animate PasteBin: https://pastebin.com/Nmh6aHcf
    As for my art files, Tails follows a global Animation system followed by all characters, so 0 is no longer Walk. 1=Walk, 2 = Run and 3 = Dash. Maps and DPLCS are moreorless the same as S2, but the frames of the tails by themselves are removed. They are a separate sprite.
     
    Last edited: May 18, 2020
  19. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    Ok, so you removed the standalone tails from the files. Did you update the animations themselves to account for this?
     
  20. RetroKoH

    RetroKoH

    Member
    1,670
    29
    28
    Project Sonic 8x16
    Yes. I did. The frames are accounted for and even equated. I equated them all in the same manner that Sonic 1 disasm has Sonic's frames equated.

    UPDATE: I'm getting somewhere... so, removing the code that applies the dash animation completely solves the bug entirely, at the expense of having a dashing animation.

    UPDATE 2: This still makes no sense. I have the dashing sprites 6 frames apart as well, so the code should still work. The problem is seemingly not with the animation code itself..

    Code (Text):
    1.     @nomodspeed:
    2.         move.b    d0,d3 ; d3 = 0,2,4,6
    3.         add.b    d3,d3 ; d3 = 0,4,8,$C
    4.         add.b    d3,d3 ; d3 = 0,8,$10,$18
    5.         lea    (TailAni_Walk).l,a1
    6.  
    7.         cmpi.w    #$600,d2        ; is Tails going pretty fast?
    8.         bcs.s    @speedselected        ; if not, branch
    9.         lea    (TailAni_Run).l,a1
    10.         move.b    d0,d1 ; d1 = 0,2,4,6
    11.         lsr.b    #1,d1 ; d1 = 0,1,2,3
    12.         add.b    d1,d0 ; d0 = 0,3,6,9
    13.         add.b    d0,d0 ; d0 = 0,6,$C,$12
    14.         move.b    d0,d3 ; d3 = 0,6,$C,$12
    15.  
    16. ; Removing this circumvents the bug...
    17. ;        cmpi.w    #$700,d2        ; is Tails going really fast?
    18. ;        bcs.s    @speedselected        ; if not, branch
    19. ;        lea    (TailAni_Dash).l,a1
    20.  
    21.     @speedselected:
    22.         neg.w    d2
    23.         addi.w    #$800,d2
    24.         bpl.s    @belowmax
    25.         moveq    #0,d2        ; max animation speed
     
    Last edited: May 18, 2020