don't click here

Sonic Engine Demo

Discussion in 'Fangaming Discussion' started by Rob Jinnai, Nov 30, 2008.

Thread Status:
Not open for further replies.
  1. Rob Jinnai

    Rob Jinnai

    Not really master of theory debunking anymore Tech Member
    215
    0
    0
    Custom Game Engine Prototypes
    This is truly a "to each his own" type of argument. I can work with assembler just the same as I could clean oil out of cement floors for a living. I've done both but prefer neither, if I have a choice. This provides a choice. I find assembler something I can handle, but it requires a lot more brain power and imagination, and it's all too easy to screw up the stack or modify the wrong register and get unpredictable results, which was one of the problems I constantly ran into. And on your next point...


    This is true. However, of all higher level languages I could use, I know of no greater controllable language than C. The memory you allocate is very specific based on types you use. I have so far recreated all of the major arrays used by the system and require exactly the same amount of memory they originally took, I ensured that with tests before committing. If you use GCC cross-compiling for 68K the RAM will be the same. Yes, there is always the trouble of the code not being as efficient. This is a fact of life with any higher level language. The best thing I can say is, observe the same healthy practices you use in assembler in C. Don't make unnecessary function calls (inlines are supported even in C with GCC), perform shifts / logical operations as appropriate, avoid straight up multiplication and division as much as possible. And, of course, turn on optimizations. I also do post-compile audits of code to see if they've become "ridiculous." However, GCC has time and again shown me some amazing generation that I personally would never have thought of doing if doing assembler by hand. Obviously that's not ALWAYS the case, so mind critical loops. It's a programming game. If I get further along and see that the performance will never be adequate (it will almost certainly be less, but I wouldn't write it off yet) then I'll see the futility of it.


    Good ol' endianness. :) Right now there are #if/#else preprocessor blocks that change endian-specific accesses, and I leave big endian as the "main" format so that Genesis is doing zero conversions yet the PC is doing a few minor load-time-only conversions. And technically my "resource packer" in use on the Genesis is also setup to later post-convert resources automatically for a little-endian based ROM system (I.e. GBA) since it ties into the loader code and thus will pre-convert resources as necessary.


    Yes, that will depend on that. My first goal is to make it work. But keep it abstracted enough that the graphics system can be pulled later and replaced with something better.


    Well, first of all, the "final" version of this, since it uses the same data in the same format as Sonic 2, can and likely will be distributed without data. I only did it this time for a quick "get up and go" demo. We didn't get into how my system works in detail. The "resource packer" program gathers up resources into a ".s" file and produces a header file that gets compiled with GNU as and externalizes labels. This is linked with compiled source. Thus there is no reliance on data actually being present in your code. So there's no reason I should have to distribute it either. (Just source and the freeware compiler.) And because I put the main code in a library and game specific code outside of it, making a whole new game is as easy as throwing away the other half.

    Believe me, I did consider that venue. However, I have no evidence to support this, but I have heard from two different people with completely different associations that say that Sega has "lost" their original source and they actually are interested in what goes on with these works, rather than against them. I don't know if that's true, but I can see the possibility in the situation. Obviously if I got a cease and desist notice I would quit. But yes, the future would be a source/binary distribution sans data, and someone will have to use the existing tools on their own ROM with the split and whatnot OR obviously use their own data and forgo some of that legality. I don't know what can be said other than there's probably no practical difference to distributing assembler and data versus distributing C and data. All of us being in this association are treading foreign waters and that's just the name of the game.

    As for your hope of professional work, I have no comment. Maybe it will happen, maybe it won't. I would say there's a far greater chance they're waiting for one of me so they can get it free than waiting to pay you. They are likely more interested in developing based on resources available to them, especially with some abysmal Sonic titles ruining the name and putting them in deep water. Sure I would love to do it for the same reasons you have, waiting for a paycheck for a hard earned porting job, but I'm not holding my breath. I'd rather do it and talk about having experience working with 68K assembler and making C ports of functions (non-specifically) than waiting for a contract that may never come. (Although seriously, if you're contracted tomorrow, I'd probably quit out of respect.)


    Okay, I "sales pitched" that a little bit. It is instruction by instruction, but my guess is I made a few misinterpretations, based on the problems I do have reading assembly. It's darn close with subtle errors. I've gone through it before casually and found conditionals that get reversed or forgetting to pay attention to byte access and thus not wrapping an addition value in C correctly (which likes to convert up to integers if you're not explicit.) It just means it's time to audit the source function-by-function and clean up errors. Which I will certainly do.
     
  2. Quexinos

    Quexinos

    Since 1997 Oldbie
    1,677
    10
    18
    I officially have no idea what's going on in this thread anymore.

    But on the legal thing, aren't Roms illegal as well and we distribute them? I really think if Sega had a problem, they'd have stopped us by now. I mean Nintendo has all ready done this but I haven't heard of Sega doing so.

    But I'll stop now because Tweaker thinks I'm making an ass of myself. =P
     
  3. roxahris

    roxahris

    Everyone's a hypocrite. Take my word for it. Member
    1,224
    0
    0
    Doing anything at all
    They don't tell us to stop distrubuting ROMs because there's no point. At all. It's a waste of time and money; who cares about fans copying games which aren't even being sold in their original form? They'll just buy the compilation anyway...
     
  4. Quexinos

    Quexinos

    Since 1997 Oldbie
    1,677
    10
    18
    I don't think anyone is saying that actually.
     
  5. roxahris

    roxahris

    Everyone's a hypocrite. Take my word for it. Member
    1,224
    0
    0
    Doing anything at all
    It's not what they're saying; they just don't care. Like I said, it's a proven waste of time and money shutting down a site like this that only distributes a few roms. If it were a big romsite then they would probably shut it down (or rather, the ESA). Have you even stopped and thought of what would happen if SEGA shut down Sonic Retro? To be serious, there are some reasons they would want to stop a few things (Sonic 2 HD, Project Sonic Retro...) but they probably don't want to waste their time, not to mention the backlash they would probably receive by doing so.
     
  6. Rob Jinnai

    Rob Jinnai

    Not really master of theory debunking anymore Tech Member
    215
    0
    0
    Custom Game Engine Prototypes
    For those playing along at home, here's a new Win32 executable and Genesis/Megadrive ROM entailing various cosmetic and gameplay fixes I made to Sonic. Can now run fast enough to break the screen update a bit. :P They were all "stupid" fixes that were actually simple logic errors...


    The ZIP is binaries only; you still need the data from the original download in the first post.
    http://www.el-hazardonline.net/downloads/S2EngineDemoUpd.zip


    Shouldn't be any other releases for a while, just wanted to get the majority of crappy physics/cosmetic bugs out of the way...
     
  7. SMTP

    SMTP

    Tech Member
    Simply perfect imo...
     
  8. Tweaker

    Tweaker

    Banned
    12,387
    2
    0
    I'm getting an error saying that I need alleg42.dll to run the program, but a Google search wields no download results for such a thing. Could you host a mirror of the dll, please?

    Amazingly constructive and helpful comment! :)
     
  9. Sappharad

    Sappharad

    Oldbie
    1,414
    70
    28
    You didn't read his post properly then.
    That file was included with the first release, as well as the data files needed to run the game.
     
  10. SMTP

    SMTP

    Tech Member
    You're welcome!


    but now playing it more I've noticed, his acceleration is a bit fast...
     
  11. Tweaker

    Tweaker

    Banned
    12,387
    2
    0
    ...

    I just downloaded the new pack; I had already deleted the old one. I wasn't aware this was a "patch" release... kind of annoying to figure out now, but whatever. Thanks.

    After checking out the new build, I can definitely say the physics are shaping out much better. Still some issues with what seems like jump height, but that may tie into the next problem I was going to mention:

    The vertical camera scrolling seems to be a bit out of whack. In the original games, the camera would always vertically center on Sonic unless he was near the level boundaries or going above a certain speed whilst vertically rolling. It seems that there's a bit of leniency in this engine where Sonic can vertically traverse vertical pixels away from the camera when jumping or moving normally, which sort of changes the overall feel of how he appears to move. I figure if you do some comparisons with the original game, you should be able to see what I mean.
     
  12. MUCH better.

    I like that the gravity doesn't suck me down to earth anymore.

    Also many of the hill bugs have been fixed. Great job!
     
  13. Sappharad

    Sappharad

    Oldbie
    1,414
    70
    28
    This is pretty good. The new version runs fine in WINE for me, aside from the sound hiccups that most people got in the last version too.

    Bug: If you rev up too much for a spindash, you won't move at all when you let go.
    Aside from that, the physics are fairly accurate now. I was even able to reproduce the steep slope bug in Casino Night that's in the original too.

    I hope you consider Open Sourcing this when you finish it, or porting it to other platforms.
     
  14. If it is perfect why would he even need constructive critiscism?
     
  15. Rob Jinnai

    Rob Jinnai

    Not really master of theory debunking anymore Tech Member
    215
    0
    0
    Custom Game Engine Prototypes
    Right now I'm just kludging the camera movement. I'll need to go back and do it proper. There was just a lot more pressing problems I wanted to deal with first. :)


    I'm basically planning on swapping out Allegro for SDL. I just wanted to get all my base functionality in place first.


    I can't seem to replicate this one. There are limiters in place that shouldn't let that happen and seem to be working from my end.


    Both are part of the plan, actually.
     
  16. SMTP

    SMTP

    Tech Member
    Only happened to me once, cant replicate it either..
     
  17. Mr. Shun

    Mr. Shun

    Member
    3
    0
    0
    Did anyone find this 'lil easter egg yet? If it is an easter egg, that is.
    [​IMG]

    Metropolis Zone music and all. In order to do this, you have to be playing the Genesis binary (haven't tried the Win version, although it probably works), die, then wait through the wraparound effect until Sonic stops at the bottom of the screen in his death animation. Press Start to restart the level, and you will remain in the 'death fall' for a while. Keep pressing start, until you're not dying anymore. You'll be standing in the Wood Zone-palette EHZ. This takes a while, so you should enable a "fast mode", if your emulator has one. I was a bit surprised to see this. Was it intentional?
     
  18. Nibble

    Nibble

    Oldbie
    Pressing Start in close succession switches the level by +1. If you keep doing it, you'll also get all the other S2 levels, including a corrupted Hidden Palace.
     
  19. Mr. Shun

    Mr. Shun

    Member
    3
    0
    0
    Hmm. That doesn't work for me, for some reason. It just resets the level.
     
  20. muteKi

    muteKi

    Fuck it Member
    7,851
    131
    43
    I thought it was pausing the game and pressing one of the jump buttons...
     
Thread Status:
Not open for further replies.