don't click here

The SX Engine

Discussion in 'Engineering & Reverse Engineering' started by Uhyve, Dec 2, 2010.

Thread Status:
Not open for further replies.
  1. Uhyve

    Uhyve

    Master Procrastinator Member
    46
    0
    6
    Huddersfield, England
    SX Engine
    I had kind of hijacked the DEF leak topic, so I decided to create my own since the engine is coming along quite nicely now.

    Basically, with this project, I plan to recreate the executable missing from the DEF/PCX leak package. First, I am creating a level viewer, so I can work on loading the levels from the DEF and PCX files, which is getting closer to being done. After that, I'm going to create a small game on top, which in comparison, will probably be quite simple. As I said, I've gotten quite far, I can now load all of the game assets (which was surprisingly difficult due to the archaic PCX format) and recreate the level structure from the PCX layout files.

    I'll keep adding videos, screenshots and download links as I make progress, but I don't think I will be bothering uploading a compiled executable for every revision, so they might get a little bit behind.

    Video:


    Lowest video is the newest, which shows frame based animation. My naming got alittle messed up when I went over to google code.

    Old Videos:
    http://www.youtube.com/watch?v=txYZMsP2Wks& (shows level exporting)

    Download:
    http://code.google.com/p/sx-engine/downloads/list (Last Updated: 29 Jan 2011)

    Progress Screenshots:
    http://cid-9cd27aa5d866d5fc.office.live.co...gine%20Progress

    Source (keep track of individual revisions):
    SX Engine @ Google Code

    Planned features - Short Term (will make a release once this stuff is done):
    Allow animated textures.
    Allow sloped blocks.
    General code cleanup.

    PS: Anyone wanna do an icon for my google code page? I'm not much of a graphics guy. It'll need to be pretty simple since it needs to be recognizable at 153 x 55.

    PPS: I don't know if people would be interested in this, but I made a level editor with a friend before (for a custom game engine we were making), I was thinking that I might ask him if he'd be interested in making an editor using my code as a base, so we could essentially make a "Game Maker" style engine for 3D platforming games. I've not really thought through it yet, but I was just wondering if anyone thinks that there would be interest in a side project like that.
     
  2. Andrew75

    Andrew75

    Technical Artist Member
    2,030
    107
    43
    Project AXSX(Sonic Xtreme) + Misc Projects
    Hey looking very good!
    I think its really neat that we have the invisible block locations visible now!

    You're probably aware of this, seems some of your front facing block textures are incorrect,
    Maybe u can use my Jade gully as a bit of a reference
    ( yeah I know that a few block scales are off and some slopes are missing, in this outdated render.)
    [​IMG]
    [​IMG]
     
  3. Uhyve

    Uhyve

    Master Procrastinator Member
    46
    0
    6
    Huddersfield, England
    SX Engine
    Huh, that's weird, I hadn't even bothered checking the textures, I kinda just assumed it was right because most stuff was in the right place. Not sure what the deal is there... I have noticed some other texture weirdness aswell though, so it might be related.
     
  4. SaviourDCX

    SaviourDCX

    Oldbie
    227
    4
    18
    Cool, be sure to check out other fan creations of Sonic X-treme for comparison.
     
  5. Tanks

    Tanks

    Member
    1,048
    108
    43
    Why? It's based on the actual game files...
     
  6. Uhyve

    Uhyve

    Master Procrastinator Member
    46
    0
    6
    Huddersfield, England
    SX Engine
    Well, I have been looking at the SANiK viewer quite a bit, it's been pretty useful figuring out how certain stuff works, I've got the feeling I'll be using it quite a bit when looking at scales. Though I've still not figured out what the deal is with those incorrect walls... it's seemingly completely random.

    Progress!
    <a href="http://cid-9cd27aa5d866d5fc.office.live.com/self.aspx/.Public/SX%20Engine%20Progress/13%20-%20Getting%20there%20-%20All%20textures%20being%20assigned%20^5possibly%20slightly%20incorrectly^6.png" target="_blank">[​IMG]</a>

    You can't tell, but the code just got a whole lot cleaner and I've just passed the boring part. I just need to get transparencies, slopes, animations and billboards working, then I think I'm good. Now that I've got the textures loading properly, I just realised how difficult level exporting is gonna be, I do have some ideas for it though, it just needs a bit of a rewrite.
     
  7. Andrew75

    Andrew75

    Technical Artist Member
    2,030
    107
    43
    Project AXSX(Sonic Xtreme) + Misc Projects
    What sorts issues are you bumping into for exportation?
     
  8. Uhyve

    Uhyve

    Master Procrastinator Member
    46
    0
    6
    Huddersfield, England
    SX Engine
    Mainly my laziness. I was just concatenating all of the meshes into a single mesh (which is super easy), then using D3DXSaveXToFile (or something like that) to write that internal mesh to disk. That way of doing things seems to take issue with material changes in general, never mind ones that include textures that are created at run time... which will also need writing to disk. Plus internally, all of the level parts are still actually cubes (I'm just not drawing the unneeded sides), so I'm gonna need to save only certain submeshes (which is how I'm storing the different sides). I still think I can do it, it's just gonna be alittle challenging.
     
  9. Uhyve

    Uhyve

    Master Procrastinator Member
    46
    0
    6
    Huddersfield, England
    SX Engine
    Just a small update today.

    Transparencies: Check
    Mirrored textures: Check
    Double sided faces: Check (though don't see any in this picture...)

    <a href="http://cid-9cd27aa5d866d5fc.office.live.com/self.aspx/.Public/SX%20Engine%20Progress/14%20-%20Render%20order%20changed^J%20transparencies%20much%20better%20now.jpg" target="_blank">[​IMG]</a>

    Had some issues with transparencies allowing you to see through levels from certain angles, but that's fixed. Currently working on block scaling, think I might be getting close. Then I'll add slopes, which should be easy, though again, boring. Then, other than level exporting (which I now realise, is probably best left until I've got the levels working), I think I'll be pretty much done with the viewer part of the project.

    PS Just wondering what the posting etiquette is on this site. If it's about a week since I last posted (and mine was the last post), do I edit my post or make a new one? Don't wanna annoy the admins before I hit 20 posts...
     
  10. Ritz

    Ritz

    Subhedgehog Member
    4,083
    107
    43
    You're a coding machine. Keep it up, it's looking great.
     
  11. Vinchenz

    Vinchenz

    Yo! Hustle! Hustle! Member
    Looks like you got unlimited now. :P

    Nice job, BTW. Its weird that nobody else has done this yet.
     
  12. Uhyve

    Uhyve

    Master Procrastinator Member
    46
    0
    6
    Huddersfield, England
    SX Engine
    Heh, thanks guys. Yeah, the only reason I didn't start this sooner was because I assumed someone else would already be doing something similar.

    Thinking I might open source it soon, I keep getting stuck on things for days, always to find a simple fix, need to get a few more pairs of eyes on this thing.
     
  13. Vinchenz

    Vinchenz

    Yo! Hustle! Hustle! Member
    What graphics API are you coding this in? If its DirectX10 I could probably help. :P
     
  14. Uhyve

    Uhyve

    Master Procrastinator Member
    46
    0
    6
    Huddersfield, England
    SX Engine
    I'm actually just using DirectX9 at the moment, at first I was hoping to keep most of graphical stuff as disconnected from the main code as possible, so I could make an OpenGL version later on for the Mac/linux folk, that didn't happen.
     
  15. kazade

    kazade

    Member
    64
    0
    0
    A 2D Physics Engine
    If you open source it, it'll happen* ;)

    Luke.

    * I'll do it if I can find the time
     
  16. Uhyve

    Uhyve

    Master Procrastinator Member
    46
    0
    6
    Huddersfield, England
    SX Engine
    Added a new video to main post.
     
  17. Andrew75

    Andrew75

    Technical Artist Member
    2,030
    107
    43
    Project AXSX(Sonic Xtreme) + Misc Projects
    wow looking really good !
    Wondering how you came about the block scales, by eying it or you bust the def wide open ?
     
  18. Vinchenz

    Vinchenz

    Yo! Hustle! Hustle! Member
    That is very damn cool. DirectX9, huh? I guess I'll still check it out.

    With Andrew working on his project and you working on yours, Sonic Xtreme is getting closer at being playable every day year. :v:
     
  19. Uhyve

    Uhyve

    Master Procrastinator Member
    46
    0
    6
    Huddersfield, England
    SX Engine
    Yeah, I mainly just kept messing with values from the DEF files, trying to use them in a way that makes them work the same as the old viewer. Still not sure if the scales are completely right though, the floating creatures at the end of Jade Gully are kind of weirdly shaped...

    BIG Edit: Okay, I now think I've figured out scales. There was some slightly weird stuff going on in those DEF files, maybe someone other than me will find this interesting.

    Basically, for some reason, scales in the DEF files have a sign (+/-), which scales don't normally have (scales are usually multipliers, so unless you wanna turn something inside out, you don't do it). In this case, they seem to have started with a default scale (say 1.0) and added on the scale from the DEF, so if the scale is -0.5, you would have a scale of 0.5 (halving the size of the cube). On top of that, they weren't using floats (which means no decimal places), so they were using stuff like 128 to mean 1, which is actually pretty standard but I had no idea what 1 was so I kinda had to guess that. Once I figured all that out, I took at a look at the impossibly huge scales (for example, a y scaling value of 8388608, for those Beebot thingys). Turns out, there may have been some obfuscation going on, because I've never heard of anyone doing this for any reason, I had been assuming that the huge scales just meant high/low null, meaning the program defaults to max and minimum scale size. That wasn't it, it's actually kind of hard to explain what was going on, I'll copy and paste some code (read the comments):

    Code (Text):
    1. // Set a max scale value
    2. int maxScale = 128;
    3.  
    4. // Loading in yScale value from DEF file
    5. usedCubes[currentCube].yScale = (float)atoi(num.c_str());
    6.  
    7. // If the imported value is above the maxScale, it's probably one of those impossible scales
    8. if(abs(usedCubes[currentCube].yScale) > maxScale)
    9. {
    10. &nbsp;&nbsp;&nbsp;&nbsp;int tempPower = 1;
    11.  
    12. &nbsp;&nbsp;&nbsp;&nbsp;while (tempPower <= abs((int)usedCubes[currentCube].yScale))
    13. &nbsp;&nbsp;&nbsp;&nbsp;{
    14. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Find the highest power of two that'll fit into the imported scale (well, 1 multiply over)
    15. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tempPower = tempPower * 2;
    16. &nbsp;&nbsp;&nbsp;&nbsp;}
    17.  
    18. &nbsp;&nbsp;&nbsp;&nbsp;// Until we're within the scale range, keep subtracting the smallest power of two that'll fit.
    19. &nbsp;&nbsp;&nbsp;&nbsp;while(abs(usedCubes[currentCube].yScale) > maxScale)
    20. &nbsp;&nbsp;&nbsp;&nbsp;{
    21. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Divide first since we went over last time.
    22. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tempPower = tempPower / 2;
    23.  
    24. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (usedCubes[currentCube].yScale > 0) //Depending on whether we're dealing with a +/- scale...
    25. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;usedCubes[currentCube].yScale -= tempPower;
    26. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else
    27. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;usedCubes[currentCube].yScale += tempPower;
    28. &nbsp;&nbsp;&nbsp;&nbsp;}
    29. }
    I'm actually certain at this point, that this is the correct way to find the scale. The only thing I can't figure out, is the reason for it. Apologies to those who don't find this interesting at all :) .

    Edit: Heh, I probably should've checked for new posts before making such a large edit...
     
  20. Andrew75

    Andrew75

    Technical Artist Member
    2,030
    107
    43
    Project AXSX(Sonic Xtreme) + Misc Projects
    In Sanik's viewer the standard blocks appear squashed height wise. right?
    I remember SaniK saying that the standard blocks were scaled at 1 x 1 x 1.54 ( 1.54 being depth)
    than the fish eye formula and FOV would take care of the rest.( squashed look)

    Would love to take some time and research deeper into how the def files define scales for blocks.
    however there is no time to do this.
    Man......I'd Pee myself If someone did the research into DEF files and documented whats going on in there.

    The way I've been going about scales is by carefully looking at screen shots, videos and DEF viewer, and aligning the cubes heights to pixels.
    than comparing it to an identical model and texture in the modeling program I use to scale a secondary block up to the point in the reference.
    everything seems to be done by .25 .50 .75. and some other scales so far.
     
Thread Status:
Not open for further replies.