Sonic and Sega Retro Message Board: WindowsZone - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 19 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

WindowsZone Sonic for your desktop!

#1 User is offline MainMemory 

Posted 30 March 2010 - 11:30 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3212
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
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 <a href="http://x-hax.cultnet.net/MainMemory/WindowsZone/WindowsZone.7z" target="_blank">WindowsZone</a>, and here's the <a href="http://x-hax.cultnet.net/MainMemory/WindowsZone/SonicEdit.7z" target="_blank">Animation editor</a>.

You'll also need the <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=0cef8180-e94a-4f56-b157-5ab8109cb4f5" target="_blank">DirectX Runtimes</a> if you don't have them.

<!--coloro:red--><span style="color:red"><!--/coloro-->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.<!--colorc--></span><!--/colorc-->

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.
This post has been edited by MainMemory: 02 August 2011 - 12:02 AM

#2 User is offline Aquaslash 

Posted 30 March 2010 - 11:39 PM

  • Super Mega
  • Posts: 2793
  • Joined: 17-November 04
  • Gender:Male
  • Location:Hampton, VA
  • Project:The S Factor: Sonia and Silver
  • Wiki edits:1,144
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 User is offline MainMemory 

Posted 30 March 2010 - 11:45 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3212
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
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 User is offline FraGag 

Posted 31 March 2010 - 12:16 AM

  • Posts: 656
  • Joined: 09-January 08
  • Gender:Male
  • Location:Québec, Canada
  • Project:an assembler
  • Wiki edits:6
It crashes for me on startup. Visual Studio shows me this exception message:
QUOTE
Une erreur s'est produite lors de la création du formulaire. Pour plus d'informations, consultez Exception.InnerException. L'erreur est : La conversion de la chaîne ".875" en type 'Double' n'est pas valide.

Stack trace:
QUOTE
à WindowsZone.My.MyProject.MyForms.Create__Instance__[T](T Instance) dans 17d14f5c-a337-4978-8281-53493378c1071.vb:ligne 197
à WindowsZone.My.MyApplication.OnCreateMainForm() dans C:\Users\Mike\Documents\Visual Studio 2008\Projects\WindowsZone\WindowsZone\My Project\Application.Designer.vb:ligne 35
à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicat
ionModel()
à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String
[] commandLine)
à WindowsZone.My.MyApplication.Main(String[] Args) dans 17d14f5c-a337-4978-8281-53493378c1071.vb:ligne 81

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 User is offline Polygon Jim 

Posted 31 March 2010 - 12:20 AM

  • Posts: 3071
  • Joined: 29-March 08
  • Gender:Male
  • Location:across town from Hinchy
  • Project:All the bitches.
  • Wiki edits:582
It eats my CPU and ram like crazy, but it's an amazing idea.

#6 User is offline Digiku 

Posted 31 March 2010 - 12:33 AM

  • Posts: 50
  • Joined: 07-January 09
  • Wiki edits:1
I LOVE this! It's like a good, entertaining way to kill boredom smile.png

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 User is offline SonicVaan 

Posted 31 March 2010 - 06:35 AM

  • The probably one and only cybergoth in this community. '_'
  • Posts: 375
  • Joined: 16-May 08
  • Gender:Male
  • Location:Germany, Cologne
  • Project:Betatesting, Various hacking projects, programming synthesizers, music production
  • Wiki edits:52
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
This post has been edited by SonicVaan: 31 March 2010 - 06:35 AM

#8 User is offline MainMemory 

Posted 31 March 2010 - 07:49 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3212
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
QUOTE (FraGag @ Mar 31 2010, 12:16 AM)
It crashes for me on startup. Visual Studio shows me this exception message:
QUOTE
Une erreur s'est produite lors de la création du formulaire. Pour plus d'informations, consultez Exception.InnerException. L'erreur est : La conversion de la chaîne ".875" en type 'Double' n'est pas valide.

Stack trace:
words.gif
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).

I keep forgetting that argh.gif 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.

QUOTE (SonicVaan @ Mar 31 2010, 06:35 AM)
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

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.
This post has been edited by MainMemory: 31 March 2010 - 07:51 AM

#9 User is offline CarrierHack 

Posted 31 March 2010 - 09:15 AM

  • Posts: 153
  • Joined: 21-December 09
  • Gender:Male
  • Location:The Netherlands
  • Wiki edits:11
QUOTE (MainMemory @ Mar 31 2010, 02:49 PM)
QUOTE (SonicVaan @ Mar 31 2010, 06:35 AM)
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

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

It does exactly the same for me.
I'm using windows XP and I have .NET framework 3.5


#10 User is offline Darkon 

Posted 31 March 2010 - 09:15 AM

  • Posts: 44
  • Joined: 19-January 05
  • Gender:Male
  • Location: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 User is offline MainMemory 

Posted 31 March 2010 - 09:26 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3212
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
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 User is offline CarrierHack 

Posted 31 March 2010 - 09:35 AM

  • Posts: 153
  • Joined: 21-December 09
  • Gender:Male
  • Location:The Netherlands
  • Wiki edits:11
QUOTE (MainMemory @ Mar 31 2010, 04:26 PM)
CarrierHack: does it give you an error message like FraGag's or is that all it gives you?

CODE
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

That's all it gives me.

#13 User is offline MainMemory 

Posted 31 March 2010 - 09:39 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3212
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Then it's probably an error in one of the PInvoke calls or something :S
I really have no idea. sad.png

#14 User is offline Mad Echidna 

Posted 31 March 2010 - 10:29 AM

  • Gone
  • Posts: 5217
  • Joined: 13-January 03
  • Gender:Male
  • Wiki edits:4
QUOTE (MainMemory @ Mar 30 2010, 09:30 PM)
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

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.


Any chance you could make a video of it on your system?

#15 User is offline MainMemory 

Posted 31 March 2010 - 10:34 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3212
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
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.

  • 19 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users