don't click here

All Programming Discussion

Discussion in 'Sonic 2 HD (Archive)' started by Athelstone, Apr 24, 2008.

  1. PsychoSk8r

    PsychoSk8r

    PsychedelAnt | Tone Turner Oldbie
    2,642
    57
    28
    Birmingham, UK
    30 Day Project: Revisited.A New Release!
    I know that it's not Double Speed for the speed up, but this is just an example.
    Would it be possible using a calculation of how many seconds into the MP3 the song is playing, and divide by two, and go to that spot in a pre-rendered faster MP3?
     
  2. SANiK

    SANiK

    Tech Member
    413
    0
    16
    Regarding the handling of Input:
    The buttons are not a problem, e.g. tap a button, button registers as "hit", etc.
    But - the directional pad needs some rethinking.

    First I want to state that from now on, there should be two entities:
    Game Play Code (a.k.a. Game)
    Console Engine Code (a.k.a. Engine) (handles the Hardware communication stuff)

    Instead of of treating the directional pad as buttons wtih just on/off,
    -----e.g., if Up is pressed, in the Engine the Up key is set to "true",
    the solution is to, treat them as a 2D vector
    -----e.g. user presses right on the keyboard
    -----The engine creates a vector set to (1, 0) //A vector pointing right
    -----The game then does:
    Code (Text):
    1. //Pseudo code:
    2. Vector inputDirection=input_getDirectionVector();
    3. if( (inputDirection.y > 0.8f) && (fabs(inputDirection.x) < 0.2f)) //Checks if the vector is close to pointing Up
    4. {
    5.    //Play Sonic Looking Up Animation
    6. }
    7. else
    8. {
    9.   //Move Sonic
    10. }
    Now - you might be saying to yourselfs, "Why use a vector...?"
    The idea is this:
    For peeps that use the keyboard, it won't matter because:
    Up Button returns the vector (0, 1)
    Down Button returns the vector (0, -1)
    Left Button returns the vector (-1, 0)
    Right Button returns the vector (1, 0)

    But, for the people who use joysticks, this will make sure that since joysticks can return an analog value,
    the game code will already have support for the Joystick's ability to move Sonic with 1 pixel precision

    e.g., the harder one pushes on the joystick - the greater Sonic's movement is

    But - for those wanting to program the game, this means that for the movement one needs to do stuff like:
    Sonic.newVelocity=Sonic.oldVelocity+Sonic.acceleration*inputDirectionVector;
    Sonic.newPosition=Sonic.oldPosition+Sonic.newVelocity;
     
  3. muteKi

    muteKi

    Fuck it Member
    7,852
    131
    43
    Music stuff I did was all MIDI. Why not use a software synth engine with a bunch of good soundfonts/samples?
     
  4. Well I think we both know that he means generic-style MIDI with default instruments. There wouldn't be anything wrong with using MIDI with custom instruments, except that, in exchange for potential ease of song creation and lower file sizes, you lose the possibility of equalization and other effects that can be made with synth programs and compiled into MP3, OGG, or what have you. Not to mention the fact that this is almost certainly harder to program in than to just take some open-source MP3/OGG/What-have-you library and implement that. Also, you'd have to have somebody create said custom instruments, which adds another layer of duty to the equation. I don't understand why you'd choose specifically to use MIDI when it's easier on everyone but the user (during the download phase only), and there's much more viable options readily available.
     
  5. Magitek

    Magitek

    Member
    83
    0
    0
    USA
    Only because having skippy music would be bad and detract from the polished feel we're working hard to achieve. Even with beautiful and stunning graphics, choppy music can ruin the feel.

    Has anyone looked into any existing libraries for using XM/MOD/MIDI etc. ?
     
  6. I've seen many MIDI implementations that leave a horrible gap when looping, but I'm fairly certain that some audio library out there for MP3/OGG/whatnot allows you to buffer the song ahead.
     
  7. Cooljerk

    Cooljerk

    Professional Electromancer Oldbie
    4,521
    211
    43
    I've been using the other forum to talk to people, but it seems news spreads faster here... I notice that jman won't be able to work on the project and drx is taking over for him. I'm still working on rewriting my engine so I'll send my stuff over to drx instead.
     
  8. drx

    drx

    mfw Researcher
    2,254
    350
    63
    :rolleyes:
    I'm afraid I have (bad) news: I won't be able to lead the programming portion of the project after all. I won't have the free time I said I would, and this, coupled with some other stuff leaves me no choice but to step down. I might still help with the ASM->C "convertion" somehow, but I won't be able to lead / concentrate on the project as much as it is needed.

    Sorry.
     
  9. SANiK

    SANiK

    Tech Member
    413
    0
    16
    HA HA HA
    Oh Wow
     
  10. Vincent

    Vincent

    Sonic 2HD - Project Leader & Chara Member
    1,253
    0
    16
    Sonic 2 HD
    Thanks for offering your help of conversion Drx, however it's not good news for us.

    If anyone (and more than one)wants to help us, step forward! ;)
     
  11. SANiK

    SANiK

    Tech Member
    413
    0
    16
    CoolJerk, how are you going to handle 3D?
    Are you still against hardware acceleration?

    If you want - I can dig up my old software 3D engine:
    [​IMG]

    For the special stages, I wouldn't use textures but gradients instead:
    [​IMG]
    [​IMG]
     
  12. I see a potential problem in the engine, and I don't think it's come up yet as far as I can tell.

    How are old pallet tricks going to be handled?

    With this new engine, we're dealing with a full range of colors and a very wide pallet. Now smaller things like Sonic going Super Sonic can obviously just be an animation with color changes. But are we going to animate entire stages that use pallet changes for the illusion of animation? Really what I'm saying is how do we plan to handle Casino Night Zone?
     
  13. SANiK

    SANiK

    Tech Member
    413
    0
    16
    <!--quoteo(post=195508:date=May 17 2008, 04:42 PM:name=Spex Bluefox)--><div class='quotetop'>QUOTE (Spex Bluefox @ May 17 2008, 04:42 PM) [​IMG]

    :)
     
  14. ICEknight

    ICEknight

    Researcher Researcher
    I asked about that, over here.
     
  15. That's what I thought the answer would be. Long as it's taken care of! =)
     
  16. SwissCM

    SwissCM

    Member
    This may sound a bit nutty.

    Do we have to use bitmaps everywhere? Could we instead use the actual source, vector images, instead? Pretty much all the source artwork is being made using vectors anyway, and it would make the resolution incredibly scalable (over 1080p).

    Perhaps 3D Acceleration could help with the rendering of the vectors by rendering them as groups of polygons. Beizer Curves may cause a problem but a setting that allows a change of the accuracy of the Beizer (higher being smoother and slower, lower being faster but jagged).

    Pallette changes could be made easier too, since the renderer has more control over every surface.
     
  17. Drex

    Drex

    Lazy perfectionist Member
    812
    79
    28
    I'm sorry to bring this up once again, but I still don't see how having a layer restricted to a 256 color palette would work with the images we are producing. There is an alpha layer to smooth the outside of the art but what about the inside where the colors are blending with each other . My images have almost every color picked from the original sprite (except about 5 in between shades) yet they all come out at over a thousand colors because of this. I've barely started on the Drilldozer yet it is already has 1168 colors.

    [​IMG]

    Even Vincent's work has an average of 1200 colors with the green background and his shrunken cleaned sonic is still tops of at 256.

    [​IMG]

    Forgive me if I somehow missed a section the topics clarifying how this will be done, but right now I don't see it working out (unless MAYBE it every sprite had it's own palette).
     
  18. SANiK

    SANiK

    Tech Member
    413
    0
    16
    Drex,
    1) Get to uploading the Bee vectors!
    2) It wouldn't be hard to extend the palettes to 4096 colors. The palettes are being emulated via software, so the only limit is speed.
    Currently, there's like 16bits per pixel.
    8 bits for the Alpha
    and then 8 bits for the palette index

    In case of 4096 colors, it wouldn't be hard to make the palette index be 12-bits and the alpha be 4bits

    I guess one way to pull things off is to use a palette-hybrid.
    The pixels that are animated base their colors off a palette
    The pixels that are not use a preset RGB
     
  19. Like SwissCM, I too was wondering why we can't use, say, an SVG rendering library to draw the graphics. That way we could achieve "true" HD by making it scalable across any resolution and still looking sharp and crisp.
     
  20. Chimpo

    Chimpo

    I Gotta Be Me Member
    8,666
    1,521
    93
    Los Angeles, 2029
    Don't Forget! Try Your Best!
    The 256 limit is bullshit.

    Limiting the amount of colors artist can use because of the idea that you can achieve the same quality that artist in the 90s achieved with their limitations is insane. Their limitations is cannot be compared to what these guys will be facing. You're dealing with large images with multiple shades of colors and anti-aliasing here. You're going to need more than just 256 damn colors.

    Oh hey, you were able to do it with a spike trap. That's great, except you only used grey. Want to try that with red, blue, yellow, white, gray, black, orange, aqua purple, shark black too?

    They were able to get away with their limitations because the sizes of these images were so small and didn't need any additional shades to blend one color with another. You just needed blue, darker blue, and shit, if you wanted to be wild and crazy, go with another darker shade of blue. Lets not forget that what you call limitations today, they would call a fucking god send. Drawing a character with just 3 colors are your disposal if you were working on an NES game was no easy task. Now suddenly you have 15 colors on your palette and you feel like you can draw the Mona Lisa on that mother fucker.