Basic Questions and Answers Thread

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

  1. Irixion

    Irixion Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    670
    Location:
    Ontario, Canada
    Flags dude. The spikes use a solid object and have whichever side hurt Sonic. They check for the invincibility flag, otherwise, hurt Sonic. The same principal can be used to your needs.
     
  2. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    I was looking at s2's tails' art and noticed his tails are in his art. Knowing obj02 & Obj05 load tails &his tails, for my Richter in sonic 1 hack (opinions please), would it be easier to port the obj05 code to load Richter's whip, or as a separate object with its own code?
     
  3. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    Honestly, it would be about the same. Porting over Obj05 will only be slightly easier because you have the code that will ensure the object follows you. Of course, that's about it. You could just as easily write code that does whatever. I'd assume you'd make the whip similar to a projectile, but it doesn't leave the spot it is created in. Honestly, the Dust object would be more useful, but meh.
     
  4. LooneyDude

    LooneyDude Back after a long absence! Member

    Joined:
    Feb 1, 2014
    Messages:
    277
    Location:
    EVERYWHERE
    I've been trying to find someone knowledgeable of Sonic 1's background programming. I don't know how to make a background move automatically, like the clouds of GHZ in Rev 01. How do I do it?
     
  5. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    OK. That's what I was thinking since when I made Richter straight from a sprite sheet. I would have to just separate Richter from his whip in his mappings/dplc so that I will have proper animation. 

    There's a tutorial over at the retro for moving clouds... Or should I say porting rev01 background deform. I was successful with GHz & lz in the tutorial but all others crashed so I just set the other stages back to original.
     
  6. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    415
    Yuji Naka did really overcomplicated things with his scrolling engine in Sonic 1. The way the background deformations were programmed is bizarre, which is why I try to avoid using the original scrolling routines and coding techniques as much as possible. I have my own way of coding background deformations in my hacks, including SWA, which uses slightly altered scrolling engine from Sonic 1 REV 00.

    Once, someone asked me to quickly code a simple deformation routine for his hack, yet make it easy to work with and flexible for later altering and re-using. I figured, it would be easier for me to create my own deformation engine than trying to get with Sonic 1's typical way of deformation programming, making it self-explanatory. It didn't took too long, actually, just a bit more than an hour. It's deformation engine, not scrolling engine. Its only task is to calculate how background lines are deformed as you move around, so it only outputs the values into the Horizontal Scroll buffer.

    The engine is script-based, so creating your own deformations gets as simple as this:

    Deform_SBZ:
    lea @ParallaxScript,a1
    jmp ExecuteParallaxScript

    ; ---------------------------------------------------------------

    @ParallaxScript:

    _normal = $0000
    _moving = $0200
    _linear = $0400

    ; Mode Speed coef. Number of lines
    dc.w _normal, $00B8, 16 ; Stars (6 layers)
    dc.w _normal, $00A0, 16 ; ''
    dc.w _normal, $0088, 16 ; ''
    dc.w _normal, $0070, 16 ; ''
    dc.w _normal, $0058, 16 ; ''
    dc.w _normal, $0040, 16 ; ''
    dc.w _normal, $0020, 48 ; Horizon (2 layers)
    dc.w _linear|$06, $0020, 32 ; ''
    dc.w _moving|$04, $0030, 16 ; Clouds (4 layers)
    dc.w _moving|$04, $0038, 16 ; ''
    dc.w _moving|$03, $0040, 16 ; ''
    dc.w _moving|$03, $0048, 16 ; ''
    dc.w -1
    It support 3 scrolling modes for blocks of lines so far:

    _normal -- all lines in a block move as a whole when the background scrolls.

    _moving -- all lines in a block move as a whole when the background scrolls, yet they have their own momentum and keep on moving when you stands (good for moving clods, like GHZ Rev01 effects).

    _linear -- lines are getting linearly deformed when the background scrolls, i.e. each next line in a block deforms faster than the previous one by a constant (good for water surface deformation, like GHZ water).

    Funnily, this engine that processes scripts, runs faster than standard hard-coded deformations.

    The parallax engine is simple yet, so there are some limitations to it:

    -- The background loops itself every 2 chunks (512 pixels)

    -- Scrolling on Y-axis is not supported yet

    If you (or someone else) are interested in obtaining my engine, PM me. Installation is simple and it will co-exist well with standard deformation routines -- you may use it only for zones you want a custom deformation in.
     
    Last edited by a moderator: Jul 2, 2015
  7. Devon

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

    Joined:
    Aug 26, 2013
    Messages:
    1,372
    Location:
    your mom
    EDIT: Nevermind! I fixed it!
     
    Last edited by a moderator: Jul 5, 2015
  8. Painto

    Painto Arthurus Paintus Erinaceus Member

    Joined:
    Mar 24, 2014
    Messages:
    321
    Location:
    Lublin, Poland
    EDIT: Nevermind, I figured it out.
     
    Last edited by a moderator: Jul 10, 2015
  9. Deadalive

    Deadalive Newcomer Trialist

    Joined:
    Aug 3, 2014
    Messages:
    19
    Location:
    Green Hill Zone
    Hello everyone, as I am getting further along with my hack im getting at least to the point of having a version ready for August. I have figured quite a bit with just trial and error but I cant seem to figure out what the asm command is for having an object use another pallet line. For instance in my hack I need the following Shield art line 1 the same as rings, shield icon on monitor line 1, Title card: the number and the bottom block back to pallet 0 (Sonic's). Silver sonic to line 0. I am using Sonic 2 Xenowhirl. Thank you for your answers and replies.
     
    Last edited by a moderator: Jul 10, 2015
  10. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    In the most basic sense, the palette line is dictated by both mappings and Art_Tile (in Sonic 2 disassemblies). Art_Tile usually holds the initial palette line while mappings may have components targeting another palette line. However latter is quite uncommon if not unused. So usually it is enough to focus on the Art_Tile of an object instead. Art_Tile is simply a bitfield of the offset of a tile in VRAM used + palette line + high plane/low plane setting. If you look at $02 in this wiki page, you should see the specification, that bits 13 and 14 control palette line (or values $2000 and $4000). Now if you know simple binary you should be able to or these values into the line which dictates objects Art_Tile.

    Just to demonstrate this better, lets take an example from Obj13 (in Xenowhirl disassembly):

    move.w #$E315,art_tile(a0)
    So what is actually being told here? If we look back in the wiki, we see that if bit 15 is set, so therefore it is on high plane. We also see bits 13 and 14 are set, so it is on palette line 3. And the remaining number, $0315 dictates it is tile offset of.. well, $0315.

    Hopefully based on this information you can figure out how work this out on any object.
     
  11. Deadalive

    Deadalive Newcomer Trialist

    Joined:
    Aug 3, 2014
    Messages:
    19
    Location:
    Green Hill Zone
    Does anyone know how to edit the Title cards in the Sonic Boom dissassembly? Anything after the first stage produces garbled Title Screens. (Has to be mappings but Selbi's editor and  everything including changing letters used and dumping vram and editing the mappings in SonmapED have failed.) Thanks for your help.
     
  12. Unused Account

    Unused Account Well-Known Member Member

    Joined:
    May 10, 2013
    Messages:
    153
    Does anyone know how to make Sonic use different animations for rolling and jumping in Sonic 1?

    I sure don't. I've been experimenting for a while and all I've gotten is errors or broken piles of mess. I'm not very good at ASM if you didn't guess.
     
  13. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Do you want to change the appearance of the roll/jump sprites, or actually switch it to a different existing animation? Their are some tutorials out there for editing animations if you wish to alter the rolling animation. As for replacing it with an already existing one... That requires changing a lot of things, as that particular animation has a lot of things hardcoded over it, which creates issues if you swap it out for another one (for example, certain breakable objects will become indestructible unless you edit more code, which I haven't quite figured out yet).

    This is a good tutorial for changing animations, it helped me get into it: http://forums.sonicretro.org/index.php?showtopic=23914
     
  14. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    How can I make Sonic get hurt when running into a wall (or at least have him fall backwards like he does when he gets hurt) in Hivebrain's Sonic 1 disassembly?
     
  15. DanielHall

    DanielHall Well-Known Member Member

    Joined:
    Jan 18, 2010
    Messages:
    860
    Location:
    North Wales
    Like in the Sonic 2 NA proto? It has a label called 'Sonic_WallRecoil', port that. It should port directly, for the most part.
     
  16. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    Thanks! I was able to add the code that branched to Sonic_WallRecoil and have it jump to HurtSonic instead.
     
  17. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Haven't asked a question in forever, but...I'm kinda stumped on a very particular section of Sonic 2 information I need for the progression of work on Neon Casino:

    In SonLVL (and presumably SonED2 though I haven't used it in forever since switching to SonLVL), the point giver object thingy from Casino Night Zone is pretty much just called that, and there is no object for slot machines. This leads me to believe that they are the same object and are simply different subtypes. Questions:

    1. Am I correct in what I've gathered so far, and
    2. If yes, which subtype(s) activate slot machines?
     
  18. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    SonED2 has ObjD6 named as "Score Slot." That is the object itself that holds the player as it either givers points or waits till the Slot Machine itself does it's thing.

    As far as the Slot mechanism itself, it is semi-controlled by ObjD6, but the art with the slot prizes will appear irrelevant to the object being present or not. APM_CNZ is what tells the game what block numbers are to be used to show the Slot Prize pics. "SlotMachine" is what controls the slot prize pics to spin when the slots are in use. So no, technically, the slot mechanism isn't totally controlled by ObjD6. It will show up, but requires ObjD6 to do anything useful for it.
     
  19. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    I have succeeded in adding another character in my hack (Original Sonic 128 HiveBrain Disassembly) by creating a separate object. Unfortunately, I have one problem: When the second character is being used, having the in-air flag set (2,$22(a0) and 6,$22(a0)) causes it to go to position $00000000 of the level. I've looked through piece of code with btst #2,$22(a0) and btst #6,$22(a0) and have been unable to find the cause of the problem. Does anyone have an idea of what could be making this happen?

    -Copied from original topic due to it being unanswered
     
  20. Niko

    Niko All's well that ends well, right? Member

    Joined:
    Mar 1, 2014
    Messages:
    245
    Location:
    $C800
    I have two quick little questions:  
     - What variables I should set and how, when it comes to the big idea of making Sonic 2's options change the HUD from on to off?

     - How would I make in-game setting changing via pause "menu," that would be nice. Like, basic "push A while paused to make setting change"?
     
    Last edited by a moderator: Aug 6, 2015