don't click here

WindowsZone

Discussion in 'Fangaming Discussion' started by MainMemory, Mar 31, 2010.

  1. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Something I've been working on for the past few days...

    You may know that for one of my hacks, I had an idea for a Windows Zone based on the Windows OS. Unfortunately I lack the level design skills to make that work.
    So instead, I went the other way, and implemented a decent imitation of the Sonic engine in VB.NET, and made it able to interact with all the windows you have open.

    So here's the current version of WindowsZone, and here's the Animation editor.

    You'll also need the DirectX Runtimes if you don't have them.

    Note: if your entire screen turns magenta, you'll need to switch your color mode to 24-bit or less. This is a bug with GDI+ and I don't think I can fix it.

    Features:
    Can collide with the inside and outside borders of open windows.
    Physics values based on the Sonic Physics Guide, multiplied by 4 in most cases.
    Sound Effects that somebody else ripped from S3K
    Animations from S3K ripped with SonMapEd, aligned and timed by me
    Can pick Sonic up with the mouse and move him
    Useless looking up animation
    Useless ducking animation
    Sonic can Roll, Jump and Spindash (Spacebar = jump)
    Uses braking animation if you have enough speed
    Menu available by right-clicking Sonic's icon in the system tray
    Can choose which boundaries are solid for windows
    Can choose what happens when he reaches the edge of the screen area: Wrap, Stop, Ignore
    Can go up off the top of the screen indefinitely
    Dies when he hits the bottom of the screen
    Uses pushing animation when pressing against a wall
    Adjustable framerate (defaults to 16ms ~ 60fps)
    Can show collision boundaries (red for windows, green for Sonic)
    Has customizable physics and animations, by editing or copying sonic.ini

    In-progress features:
    Objects other than Sonic (springs etc.) this will likely mean you won't be able to stand inside of windows anymore

    Feel free to suggest improvements or new features.
    I may take this and make a more normal fangame engine out of it, but I'd need to rework collision some to get slopes to work.
     
  2. Aquaslash

    Aquaslash

    <The Has-been Legend> Moderator
    This is genius, though it'd be nice if I could interact with other windows while doing it. I had them all minimized and this locked up controls, unless I hit the Windows button.
     
  3. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Assuming you're not getting a magenta screen, you should be able to click on windows as normal, and then click on Sonic to bring the focus back so you don't accidentally do something you didn't mean to with the arrow keys.
     
  4. FraGag

    FraGag

    Tech Member
    It crashes for me on startup. Visual Studio shows me this exception message:
    Stack trace:
    Basically, you're converting strings to doubles but it fails. In my locale (fr-CA), ".875" is not a valid floating-point number; ",875" would be. However, the solution would be to use Double.TryParse by passing CultureInfo.InvariantCulture to the provider parameter (the default is CultureInfo.CurrentCulture, which crashes on my system).
     
  5. Polygon Jim

    Polygon Jim

    Eternal Tech Member
    0
    3
    0
    across town from Hinchy
    All the bitches.
    It eats my CPU and ram like crazy, but it's an amazing idea.
     
  6. Digiku

    Digiku

    Oldbie
    51
    0
    0
    I LOVE this! It's like a good, entertaining way to kill boredom :)

    It'd be perfect for me if you could block keyboard input for other apps, so I don't have to deal with Explorer opening files or Notepad typing stuff on me. I'd do just fine with dragging windows willy-nilly to make Sonic platform on them.
     
  7. neonsynth

    neonsynth

    Previously 'SonicVaan' Member
    394
    9
    18
    Germany, Stammbach
    gaming and music production
    Cannot play it. I always have to send a report to Microsoft.

    EventType : clr20r3 P1 : windowszone.exe P2 : 1.0.0.0 P3 : 4bb2786a
    P4 : windowszone P5 : 1.0.0.0 P6 : 4bb2786a P7 : f P8 : c6
    P9 : system.invalidoperationexception
     
  8. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I keep forgetting that :argh: but right now I can't make a quick fix and reupload because I'm in the middle of rewriting it so it can have other objects. You could just replace the periods in sonic.ini with commas.

    Do you even have the .NET Framework installed? Because that's not an error message like .NET gives.

    Digiku: You can click on Sonic again to get around that.
     
  9. It does exactly the same for me.
    I'm using windows XP and I have .NET framework 3.5
     
  10. Darkon

    Darkon

    Member
    44
    0
    6
    UK
    Hah, this is great, there seems to be a little lag between the time he jumps/rolls etc and the sound playing for me however.
    Would it be possible to make so collision boxes of the active window overwrite/mask the ones behind?
    Currently he can walk on windows that are behind your active window which looks a little weird.
     
  11. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    CarrierHack: does it give you an error message like FraGag's or is that all it gives you?

    Darkon: I'm aware of the sound lag, it's probably because it reads the file from disk every time it plays it. As for the window masking, not sure. If I could get the windows' z order values I might be able to do it, but I'd also have to compare every window's rectangle to the rectangle of every window above it. This might introduce lag and increase CPU usage even more.

    On the other hand, if I can get the SetWindowsHookEx function to work for me, I might not have to rebuild the list of window pointers every frame, which will probably cut down on CPU usage a bit.
     
  12. Code (Text):
    1. EventType : clr20r3 P1 : windowszone.exe P2 : 1.0.0.0 P3 : 4bb2786a
    2. P4 : windowszone P5 : 1.0.0.0 P6 : 4bb2786a P7 : f P8 : c6
    3. P9 : system.invalidoperationexception
    That's all it gives me.
     
  13. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Then it's probably an error in one of the PInvoke calls or something :S
    I really have no idea. :(
     
  14. Mad Echidna

    Mad Echidna

    Gone Oldbie
    5,219
    0
    0
    Any chance you could make a video of it on your system?
     
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Okay, I made a minor update which fixes FraGag's issue. Now I'm going to be using the Managed Windows API instead of trying to figure out how to get all these Winapi functions to work. This build has a bunch of extra code that I either haven't started using yet or haven't removed, and there's really nothing "new" about this one, so you don't need to download it.

    Mad: I will yes.
     
  16. Lostgame

    Lostgame

    producer/turnablist. homebrew dev. cosplayer. Oldbie
    4,134
    58
    28
    Toronto, ON
    The O.I.C.
    Video or screenies please? D:
     
  17. Tanks

    Tanks

    Member
    1,048
    108
    43
    He'd have to have a damn good system to do that. The thing locked up one of my cores when I ran it.
     
  18. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I managed to get a laggy video with Fraps, I'm encoding it in H.264 and then I'll upload it to YouTube. I expect it'll take at least 45 minutes.
    Here's a really old screenshot:
    [​IMG]
    That window title does a nice job obscuring a secret channel's name ;)

    Edit: uploading...
     
  19. Chaos Knux

    Chaos Knux

    Stable avatar temporary. Randomizer site down. Banned
    Yeah this locks out my control too. If you click, the focus shifts back on Sonic, and that's NO GOOD. Also, could it be possible to make this thing detect horizontal lines?
     
  20. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    By "locks out control", do you mean that Sonic doesn't respond or that you can't do anything else while it's running?

    And what do you mean by horizontal lines?