don't click here

WindowsZone

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

  1. FraGag

    FraGag

    Tech Member
    You're not trying hard enough. I assume there's a folder icon on your desktop. Can you right-click it and select an option to open the folder in another window? Otherwise just move the folder elsewhere (like Documents) or extract it again and run it from there.
     
  2. OK. FINALLY it works. I'll just go to replacing Sonic with Shadow. And, since I don't wanna screw up, I made another copy of WindowsZone so that I'll still have at least one that works.
     
  3. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    OK so, I fixed it so that it uses the application's directory as the current directory which would fix your problem when you run it like that, and I fixed random input mode.
     
  4. How long would it be until we see the rings, springs, etc. alongside Sonic?
     
  5. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    When I stop adding other features to it.
     
  6. Chaos Knux

    Chaos Knux

    Stable avatar temporary. Randomizer site down. Banned
  7. ICEknight

    ICEknight

    Researcher Researcher
    Oh no. Just tried the latest version and it doesn't work for me.... =(

    I'm using XP SP3, if it helps.
     
  8. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    Try redownloading it if you got it right after I uploaded that, there was a problem I fixed.
     
  9. I finished Shadow! :D

    It turned out better than I expected it to be. Although there are a few slight differences in the dimensions, it's barely noticeable and turned out just GREAT. ;D

    EDIT:

    Here's a picture. I made a few boundaries on the top of Firefox for Shadow to roam freely in random input, because he usually gets in my way of typing when roaming down there.

    [​IMG]
     
  10. Alriightyman

    Alriightyman

    I am back... from the dead! Tech Member
    357
    11
    18
    Somewhere in hot, death Florida
    0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
    Finally works for me! This is really cool! I like how I can throw Sonic around and how he can push the windows around too! Great Job!
    EDIT: I just realized he can also make the window bigger if he is on the inside of it and pushes it!
     
  11. Oh, hey, I just thought, what if there was some way to implant a Super Sonic mode? That'd be pretty kick'n.
     
  12. Come to think of it, I was gonna ask that question myself! >:U

    I think I'll make a Super Sonic version, too. It SHOULD be easy, after all. :P
     
  13. Nibble

    Nibble

    Oldbie
    Very neat concept! It seems quite inefficient though.

    Using Reflector, I decided to take a look at what your code is doing. I found a number of things that are likely to be causing the very high CPU and memory usage, and other problems.

    1. You're using a standard WinForms Timer control with low milliseconds. Problem is that the WinForms timer isn't really suited for things like 60fps animation; it's not that high-resolution. I think its minimum is anywhere from 10 to 15 millisecond intervals, and even then it's hardly guaranteed. A more appropriate choice could be the StopWatch class:

    System.Diagnostics.StopWatch is a class containing a very high-resolution timer, with an accuracy of less than a millisecond, I believe. Only thing is that it's not automatic—it works just as the name implies. It has Start() and Stop() methods and an ElapsedTime property that you can read from. I'm not sure how much knowledge you have, but if you can, you could run the main logic in a separate thread in its own loop, checking its stopwatch every 16.6666...ms or so.

    This isn't absolutely essential, though. It just makes frame timing more accurate.

    2. In each timer tick (every frame), you're creating a Graphics class for both the 'level' bitmap and for the Form itself. Not only that, but you're not calling Dispose() on them, causing memory to temporarily leak (at least until garbage collection). What would be a better solution is to create a Graphics instance once, at form initialization, and keep their references in your Form class. You shouldn't need to create/destroy it every frame.

    3. You also seem to be creating a Bitmap object every frame for the current Sonic sprite. This is probably fairly expensive. What you should do instead is similar to #2—create the bitmaps at initialization and hold on to those references. Or better yet (though not strictly required), put all of Sonic's sprites into one image, then draw from sub-rectangles of that image. This would be more efficient with memory, disk storage, and CPU.

    4. This isn't as readily fixable or easy to replace, but just using GDI in general is slow. I believe there are ways to use DirectX/Direct3D with a transparent background, but I don't really know much about that. But if possible, it would give you insanely better graphics performance.


    There might be more than that, but that's what I saw in a quick glance.
     
  14. Ultima

    Ultima

    Games Publisher Tech Member
    2,398
    1
    18
    London, England
    Publishing mobile games!
    Performance is very slow but this is a really cool idea.
     
  15. Conan Kudo

    Conan Kudo

    「真実はいつも一つ!」工藤新一 Member
    478
    1
    18
    Cairo with GTK# is one way to accelerate it. It can use OpenGL and fall back to GDI if necessary. And I know it works with Microsoft's .NET Framework. GTK# for Windows for .NET Framework can be downloaded here.
     
  16. ICEknight

    ICEknight

    Researcher Researcher
    Just redownloaded and it's the same version I had. Here's the error window I got:
    [​IMG]


    And the text:
    Quite odd, since the previous version I had downloaded worked fine. =\
     
  17. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    I will consider this.
    Probably a good idea.
    As far as I can tell, I need to do this in order to be able to flip the image when he's facing left, or he'll flip every frame.
    I would like to get away from GDI+, as it would also fix the 32-bit color issue some people are having.

    ICEknight: You need the DirectX runtime download at the top of page 5, or under the download on the first page.
     
  18. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    Nice Idea, this is really cool. But I don't seem to get smooth controls as other people here. I'm using Windows XP SP3.

    I mean, if I run Windows Zone, every other input for a program gets blocked. I don't know if this is the expected behaviour, but when I run this, I can't interact with anything else(not even the taskbar, and the system clock), unless I alt-tab out of it. If I alt-tab, I can still run and everything, but once I left click in something, WindowsZone takes the focus again and I have to alt-tab out again.

    Is this normal or a bug?
     
  19. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    That is a bug... that seems to only affect people with XP SP3...

    Hmm...
     
  20. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    I see. Another thing, I don't know if this has been mentioned before, but I noticed you load the sounds as soon as they're used right(and they seem to remain in cache luckily)? Wouldn't it be better to preload them when the program starts? Just another tip.

    BTW, nice detail with pushing the windows, it made me smile :).