don't click here

Basic Questions & Answers thread

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

  1. Alriightyman

    Alriightyman

    I am back... from the dead! Tech Member
    357
    11
    18
    Somewhere in hot, death Florida
    0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
    First off, I would lock the vertical movement. S3K does that I believe. This way if someone jumps, the camera doesn't move up or down and boom there goes the dynamite.

    Sonic 3 glitches too btw, it's just hidden well.

    I was considering trying something like that myself, just I haven't gotten that far yet.
     
  2. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,587
    10
    18
    United Kingdom
    YouTuber
    Shit, you're right. The camera doesn't move vertically at all in S3K. Maybe that's how they do it then and just don't set the dirty_flag RAM. Because like said, it's fine when going horizontally only.

    I'll give this a go tonight for one of my levels, but still, if anyone has a solution to this, it'd be nice to know, because another one of my level refreshes whilst falling down a pit, and not setting dirty_flag doesn't work (because the camera is going vertically all the time and not horizontally at all). So dirty_flag needs to be set for this level but obviously I get that annoying flash.
     
  3. Alriightyman

    Alriightyman

    I am back... from the dead! Tech Member
    357
    11
    18
    Somewhere in hot, death Florida
    0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
    Actually, instead of a "dirty_flag", S3K has screen refresh functions to call upon.
    Refresh_PlaneFull is probably equivalent to setting the dirty_flag.

    Don't know what to tell you for the falling. Maybe some clever y_wrapping is in order?
     
  4. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    How do I work with the Nick Arcade prototype disassembly of Sonic 2? All it is is the ASM file; no builder or splitter, no data files, nothing. What am I missing?

    Edit: Also, the collision in my hack is broken atm. It works fine at first, but it breaks when trying to use the secondary index, likeso:

    [​IMG]

    I was following the guide here:
    http://info.sonicretro.org/SCHG_How-to:Extend_the_level_index_past_$10_in_Sonic_2

    except for using the Hg version of Sonic 2.

    Here is the collision code:

    Code (Text):
    1. LoadCollisionIndexes:
    2.     moveq   #0,d0
    3.     move.b  (Current_Zone).w,d0
    4.     add.w   #1,d0; =pointer index: 1.
    5.     add.w   d0,d0; =x2
    6.     add.w   d0,d0; =x4
    7.     add.w   d0,d0; =x8
    8.  
    9.     move.l  #Primary_Collision,(Collision_addr).w
    10.  
    11.     movea.l Off_ColP(pc,d0.w),a0
    12.     lea (Primary_Collision).w,a1
    13.     bsr.w   KosDec
    14.  
    15.     movea.l Off_ColS(pc,d0.w),a0
    16.     lea (Secondary_Collision).w,a1
    17.     bsr.w   KosDec
    18. ; End of function LoadCollisionIndexes
    19.  
    20. ; ===========================================================================
    21. ; ---------------------------------------------------------------------------
    22. ; Pointers to collision indexes
    23. ; ---------------------------------------------------------------------------
    24. Off_ColP:
    25.     dc.l    0
    26. Off_ColS:
    27.     dc.l    0
    28. CollisionData:
    29.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;00
    30.     dc.l    ColP_GHZ, ColS_GHZ  ;01
    31.     dc.l    ColP_WZ, ColS_WZ    ;02
    32.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;03
    33.     dc.l    ColP_MTZ, ColP_MTZ  ;04
    34.     dc.l    ColP_MTZ, ColP_MTZ  ;05
    35.     dc.l    ColP_WFZSCZ, ColS_WFZSCZ    ;06
    36.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;07
    37.     dc.l    ColP_HPZ, ColS_HPZ  ;08
    38.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;09
    39.     dc.l    ColP_OOZ, ColP_OOZ  ;0A
    40.     dc.l    ColP_MCZ, ColP_MCZ  ;0B
    41.     dc.l    ColP_CNZ, ColS_CNZ  ;0C
    42.     dc.l    ColP_CPZDEZ, ColS_CPZDEZ    ;0D
    43.     dc.l    ColP_CPZDEZ, ColS_CPZDEZ    ;0E
    44.     dc.l    ColP_ARZ, ColS_ARZ  ;0F
    45.     dc.l    ColP_WFZSCZ, ColS_WFZSCZ    ;10
    46.     dc.l    ColP_CNZLegacy, ColS_CNZLegacy  ;11
    47.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;12
    48.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;13
    49.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;14
    50.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;15
    51.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;16
    52.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;17
    53.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;18
    54.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;19
    55.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;1A
    56.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;1B
    57.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;1C
    58.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;1D
    59.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;1E
    60.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;1F
    61.     dc.l    ColP_EHZHTZ, ColS_EHZHTZ    ;20
    62.  
     
  5. BlackHole

    BlackHole

    You're going to need MORE than help. Member
    5,649
    772
    93
    England
    Complaining
    Not sure if this goes here, but it's a question about ripped models so meh.

    Has anyone ripped the planet model from Sonic Unleashed? Preferably a completely reassembled model. I'm working on a project and I'm a bit of a continuity nut, so I want the planet that appears rather then the map G.U.N. uses in Shadow the Hedgehog. If they have, might I have a link to a download?
     
  6. steveswede

    steveswede

    Member
    5,032
    1
    16
    Ask my hand
    Fighting against the Unitary State of Europe
    Right so I've heard a long while back that the Megadrive has a colour limit of 64, then I came across this.

    [youtube]http://www.youtube.com/watch?v=Z9rjwECf2wQ[/youtube]

    To my surprise, Toy Story managed to output 171 colours at the same time.

    So I started to look around the web and I read this

    http://forums.sega.com/showthread.php?427692-Mega-Drive-64-colour-limit-Plus-other-question%28s%29

    Does this mean that if the time was spent exploiting these tricks that we would say get a hack of Knuckles in Sonic the Hedgehog with the correct colour palette for everything and possibly even replace the dithering effects with real transparency?
     
  7. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,202
    432
    63
    Japan
    It's actually the horizontal interrupt that you need to exploit, but the genuin idea is just that.

    Given careful planning and well thought out software engineering, yes, you could swap the palettes during scanlines in knuckles' current position on screen, in order to give him his correct palette of colours, I believe ColinC10 did a similar thing with Sonic 1 and 2 which worked out quite well, the only flaw being; anything that uses the player's palette line while they are on the same horizontal lines, will of course begin to use the player's colours instead, but I don't think it was that noticable.

    As for transparency, you could in essense, create a form by outputting a pixel colour that is a mix between the colours of the FG and BG pixel, however, the calculations required to get the pixel drawn correctly at the correct place along with constant changing of the palette every scanline and plane/sprite positions every frame, may put a lot of pressure on the main processor, so it probably wouldn't do any good during a game, it's not impossible, but perhaps it's not worth it to throw your efforts into such an effect that will limit your gameplay.

    Other methods of changing colours that I'm aware of are for example, a bitmap displaying demo that Jorge and Oerg made, which disables the display mode of the VDP to increase its speed, and simply changing the backdrop colour constantly (during display), the backdrop colour is the one form of graphics that still display when the display mode is disabled. With this method, they managed to display an image with any of the 512 colours they wanted at any position on screen. But of course, such a thing isn't practical for solid games.

    It all boils down to what use you have the effect for, anything complexe like a solid game you will no doubt have problems with, simple coded display demos on the other hand have more than enough free processing cycles left to display some remarkable graphics.
     
  8. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    I removed Casino Night Zone act 2 from the "nosignpost" array in my hack, but the sign still isn't showing up... Any idea what's going on? If there something else I have to edit? My first guess is that it's related to 2P mode somehow, but I really don't know.
     
  9. Steelrush

    Steelrush

    Every good deed has its reward. Member
    19
    0
    1
    A humid place
    Blaze the Cat in Sonic 2
    Hello, I'm currently attempting to make a Sonic 2, as my profile stated. However, I ran across major roadblock in the form of not being able to gain the means of changing/adding music, adding or removing stages, as well as bosses.

    Now, I know that what I intend to do is possible, because Team Megamix pulled this off with Sonic 2 Megamix. They managed to add music from Sonic 1, along with Sonic 3 & Knuckles, and also did major editing on those tracks. In addition to this, they also ported a level from Sonic 1 as well (an incomplete version of Labyrinth Zone).

    Robotnik's Revenge also shows that putting bosses from other games into Sonic 2 can be done as well, so---

    I would appreciate it greatly if someone could help me get through this problem, as I haven't found any guides with the solution.

    By the way, I'm using the Xenowhirl 2007 disassembly. If there are any tools I'm missing, please tell me. Thank you for the assistance.
     
  10. RetroKoH

    RetroKoH

    Member
    1,662
    22
    18
    Project Sonic 8x16
    Well, at least it was in the Basic Q&A and not in its own topic. THIS will help you out, for starters. It will give you tutorials on stuff like bugfixes, and adding characters, bugfixes, etc.
    THIS page provides any and all basic information needed to get around a disassembly.

    I assume you have a disassembly, if not, click Mercurial at the top and grab one. SonLVL is the premier tool for editing levels. Editing the .inis to add a new level to work on is piss easy, and after that, follow the tutorials shown to add the files into the game.

    A good start is trying to port Hidden Palace Zone from the S2 beta to the Sonic 2 game. Extract all the needed tiles, and import them into your disassembly. If you can do THAT, you are ready to dive into some of your other aspirations. If not, you got some learning to do.
     
  11. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    If you're looking to import a level from another Sonic game, LevelConverter is a good start.
    As long as you're not, you know, trying to edit art with it...
     
  12. RetroKoH

    RetroKoH

    Member
    1,662
    22
    18
    Project Sonic 8x16
    Well, to be fair, the "third" act of SBZ is actually a 4th Labyrinth Zone. SBZ Act 3 is really Final Zone. So... having a third act in that regard would simply be having an act in a different zone.

    I'd imagine that having an actual Act 3 "properly coded" would take quite a bit more work than just adding an act into a new zone, and using that as an act 3... though I'm not 100% certain about this.
    I'd just take note of Metropolis Zone's "Act 3" and do it that way. That is... unless you wanted EVERY act to be a 3 act zone... then you'd probably need to do something else...
     
  13. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    What's wrong with editing art using SonLVL? I haven't used the tile editor much, but it seems to work acceptably.

    also, again:

    Using the hg disassembly of Sonic 2. Any idea why that didn't work? This is currently the biggest problem with my hack, and the only thing rendering the game's level order outside of level select unbeatable. (Aside from Casino Night act 3's layout stopping about 1/4th in, but meh).
     
  14. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    The block and chunk editors have been described by several people as tedious, and I think importing might be buggy, I don't remember.

    As for the signpost, see loc_19208. If the level is not Metropolis Zone Act 2, and you're in Act 2, it moves the signpost object to x position 0. Just copy the first two lines and change the zone to casino_night_zone_act_2.
     
  15. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    ThankyouThankyouThankyou! That's so helpful!

    One "shortcut" I've found with the chunk editor is that if you click any block property in a chunk, and select another black, the program remembers what property was selected last, so I can set one block's collision on plane 1 to "True", and then click another block and press "T", another block and press "T" again, and that works until I select a new property or change chunks. It makes the whole process a little more streeamlined, especially if I remember specific block numbers so I can just input the block ID's where needed. The ability to bluk select blocks would be a major boost in efficiency though.

    No worries, you're miles ahead of Soned2 for me, no doubt.

    On another note, I have one more porblem:

    In Hidden Palace Zone, I've gotten to a point were if I ad more rings, the RAM seems to "bleed" into other RAM and cause camera bugs and graphical glitches... Would replacing the rows of rings that are already there with multiple individual rings in a line be any help at restoring RAM space?
     
  16. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    It wouldn't, they use the same amount of RAM regardless. The only things to do are use less rings, or port S3K's ring manager. Although that guide was written for the 2007 disassembly...
     
  17. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    I'll give it a whack. I'm not much at ASM, but the 2007 disassembly and this one have a lot in common from my experience, and I'm fairly certain I can figure it out (I say this having not fully read this yet though, so it's subject to large amounts of derp.)

    EDIT: Yes, yes. I just did a play test on Emerald Hill and everything seems to be working. There were several errors along the way, but they were mostly just differences in routine/variable names.

    EDIT AGAIN: Um... Any advice on what could be causing this?
    [​IMG]
    EDIT AGAIN: I figured that out too, it was a dirty workaround I was trying to use to implement Sonic 1's collision data in certain levels... Does anyone have any idea how I could do this without causing a rather ugly data conflict...?
     
  18. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    As far as I'm aware, it should be as simple as copying the collision and angle array files from Sonic 1, and setting the game to reference them in specific levels instead of the normal collision data...
     
  19. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    I haven't been able to find where it loads that data from. there isn't any routine that picks that, it just calls it directly from the Binclude, so the only way I've been able to get it to call the Sonic 1 Colliosn is litterally finding every reference to ColArray and make an adaptation similar to this:

    Code (Text):
    1.     lea (ColArray).l,a2
    2.     cmpi.b #$01,(Current_Zone).w ;Is this level Green Hill Zone?
    3.     bne.s +
    4.     lea (ColArrayGHZ).l,a2
    5. +
    however, that, in addition to bincluding the collision of Sonic 1 in the same Location of Sonic 2's where what threw that garbage data onto Sonic's spindashing animation somehow. Any suggestions?
     
  20. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    That's a common problem. It's because the tiles in Sonic's spindashing animation are crossing a 128KB boundary in the ROM, which causes the code that loads his art into VRAM to 'wrap around' to the start of the 128K section. You can try moving data around near Sonic's art until the problem stops, or you could move GHZ's collision files to after Sonic and Tails' art.