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 +
  • ◄ First
  • 8
  • 9
  • 10
  • 11
  • 12
  • Last ►
    Locked
    Locked Forum

WindowsZone Sonic for your desktop!

#136 User is offline ICEknight 

Posted 03 April 2010 - 08:20 AM

  • Posts: 10815
  • Joined: 11-January 03
  • Gender:Male
  • Location:Spain
  • Wiki edits:18
QUOTE (MainMemory @ Apr 2 2010, 10:56 PM)
Try redownloading it if you got it right after I uploaded that, there was a problem I fixed.

Just redownloaded and it's the same version I had. Here's the error window I got:



And the text:
QUOTE
Consulte el final de este mensaje para obtener más detalles sobre cómo invocar a la depuración
Just-In-Time (JIT) en lugar de a este cuadro de diálogo.

************** Texto de la excepción **************
System.IO.FileNotFoundException: No se puede cargar el archivo o ensamblado 'Microsoft.DirectX.DirectInput, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' ni una de sus dependencias. El sistema no puede hallar el archivo especificado.
Nombre de archivo: 'Microsoft.DirectX.DirectInput, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
en WindowsZone.Controller.UpdateControllerData()
en WindowsZone.Form1.Timer1_Tick(Object sender, EventArgs e) en C:\Users\Mike\Documents\Visual Studio 2008\Projects\WindowsZone\WindowsZone\Form1.vb:línea 35
en System.Windows.Forms.Timer.OnTick(EventArgs e)
en System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

AVS: El registro del enlace de ensamblado está desactivado.
Para habilitar el registro de errores del enlace de ensamblado, establezca el valor de Registro [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) como 1.
Nota: existe una disminución del rendimiento asociada registro de errores del enlace de ensamblado.
Para desactivar esta característica, elimine el valor de Registro [HKLM\Software\Microsoft\Fusion!EnableLog].



************** Ensamblados cargados **************
mscorlib
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.3603 (GDR.050727-3600)
Código base: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
WindowsZone
Versión del ensamblado: 1.0.0.0
Versión Win32: 1.0.0.0
Código base: file:///C:/Documents%20and%20Settings/Usuario01/Escritorio/WindowsZone_NEW/WindowsZone.exe
----------------------------------------
Microsoft.VisualBasic
Versión del ensamblado: 8.0.0.0
Versión Win32: 8.0.50727.3053 (netfxsp.050727-3000)
Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.3053 (netfxsp.050727-3000)
Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.3053 (netfxsp.050727-3000)
Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.3053 (netfxsp.050727-3000)
Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.3053 (netfxsp.050727-3000)
Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
Rat234
Versión del ensamblado: 1.0.0.0
Versión Win32: 1.0.0.0
Código base: file:///C:/Documents%20and%20Settings/Usuario01/Escritorio/WindowsZone_NEW/Rat234.DLL
----------------------------------------
System.Web
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.3082 (QFE.050727-3000)
Código base: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
ManagedWinapi
Versión del ensamblado: 0.3.0.0
Versión Win32: 0.3
Código base: file:///C:/Documents%20and%20Settings/Usuario01/Escritorio/WindowsZone_NEW/ManagedWinapi.DLL
----------------------------------------
System.Windows.Forms.resources
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.3053 (netfxsp.050727-3000)
Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_es_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
mscorlib.resources
Versión del ensamblado: 2.0.0.0
Versión Win32: 2.0.50727.3603 (GDR.050727-3600)
Código base: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------

************** Depuración JIT **************
Para habilitar la depuración Just In Time (JIT), el archivo de configuración de esta
aplicación o equipo (machine.config) debe tener el
valor jitDebugging establecido en la sección system.windows.forms.
La aplicación también se debe compilar con la depuración
habilitada

Por ejemplo:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

Cuando esté habilitada la depuración JIT, cualquier excepción no controlada
se enviará al depurador JIT registrado en el equipo
en lugar de controlarlo mediante el cuadro de diálogo.


Quite odd, since the previous version I had downloaded worked fine. =\
This post has been edited by ICEknight: 03 April 2010 - 08:20 AM

#137 User is offline MainMemory 

Posted 03 April 2010 - 11:55 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4146
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
QUOTE (Delta @ Apr 3 2010, 03:13 AM)
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.

I will consider this.
QUOTE (Delta @ Apr 3 2010, 03:13 AM)
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.

Probably a good idea.
QUOTE (Delta @ Apr 3 2010, 03:13 AM)
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.

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.
QUOTE (Delta @ Apr 3 2010, 03:13 AM)
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.

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.
This post has been edited by MainMemory: 03 April 2010 - 12:22 PM

#138 User is offline Dario FF 

Posted 03 April 2010 - 12:05 PM

  • Tech Support Hotline
  • Posts: 1056
  • Joined: 03-April 10
  • Gender:Male
  • Location:Mar del Plata, Argentina
  • Project:SonicGLvl
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?

#139 User is offline MainMemory 

Posted 03 April 2010 - 12:07 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4146
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
That is a bug... that seems to only affect people with XP SP3...

Hmm...

#140 User is offline Dario FF 

Posted 03 April 2010 - 12:12 PM

  • Tech Support Hotline
  • Posts: 1056
  • Joined: 03-April 10
  • Gender:Male
  • Location:Mar del Plata, Argentina
  • Project:SonicGLvl
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 smile.png.

#141 User is offline MainMemory 

Posted 03 April 2010 - 12:13 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4146
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
I tried preloading the sounds into Byte arrays, but somehow that messed up the jump sound.

#142 User is offline Vangar 

Posted 03 April 2010 - 12:14 PM

  • Posts: 3447
  • Joined: 08-January 04
  • Gender:Male
  • Location:Australia
  • Wiki edits:2
haha, this is awesome

#143 User is offline Alriightyman 

Posted 03 April 2010 - 12:26 PM

  • !!!!!!!!!!!!!!!!!
  • Posts: 351
  • Joined: 27-November 07
  • Gender:Male
  • Location:Largo, Fl
  • Project:0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
  • Wiki edits:5
I noticed if you downsize your desktop resolution, it speeds it up quite a bit. My resolution is at 1920x1080, but if I drop it to say, 1280x720, it runs much better.

#144 User is offline MainMemory 

Posted 03 April 2010 - 12:32 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4146
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
I bet it does, because it has to draw less then.

#145 User is offline Bluenuhvok 

Posted 03 April 2010 - 04:31 PM

  • Posts: 20
  • Joined: 31-March 10
WindowsZone was working fine up until a few minutes ago, when it starts jumping randomly when I try to control it. It still works on Random Input, but it gives me that same problem each time I try to control it. Can anybody PLEASE help me? I tried PMing MainMemory, he read it, but didn't reply to it. >_>

#146 User is offline DigitalDuck 

Posted 03 April 2010 - 05:24 PM

  • Arriving four years late.
  • Posts: 4658
  • Joined: 23-June 08
  • Gender:Male
  • Location:Lincs, UK
  • Project:TurBoa, S1RL
QUOTE (MainMemory @ Apr 3 2010, 05:55 PM)
QUOTE (Delta @ Apr 3 2010, 03:13 AM)
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.

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.


Could you not just add sprites for when Sonic's facing left? It'll use more storage, but save masses on CPU.

#147 User is offline MainMemory 

Posted 03 April 2010 - 05:30 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4146
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
QUOTE (DigitalDuck @ Apr 3 2010, 05:24 PM)
QUOTE (MainMemory @ Apr 3 2010, 05:55 PM)
QUOTE (Delta @ Apr 3 2010, 03:13 AM)
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.

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.


Could you not just add sprites for when Sonic's facing left? It'll use more storage, but save masses on CPU.

I guess I could make the left-facing sprites when it loads.

#148 User is offline MainMemory 

Posted 05 April 2010 - 04:11 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4146
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Now you can choose different direction modes for controllers, POV hat/D-pad (what it already had), Analog stick (X/Y axes), or buttons.

I implemented some of the changes that were suggested which may have a small effect on performance, but I'd say it uses 50% less CPU when I comment out the line "mygfx.DrawImage(level, 0, 0, screenbounds.Width, screenbounds.Height)". Another large part may be looping through all the windows.

I have put together a basic framework for object interactions, but I'm not using it yet, because this would mean that you would be unable to interact with the inside borders of windows. I'm also not sure if I'm doing it right. I'm not sure what I would need to do to make a spring work, or how they work in the original games. But if you look at the code with Reflector (or you could just ask for the source, but give me a good reason), you'll see that GameObject.CheckCollision and Player.Act have been filled out and behave almost exactly like the code in Form1.Timer1_Tick.
This post has been edited by MainMemory: 05 April 2010 - 04:53 PM

#149 User is offline SMTP 

Posted 05 April 2010 - 09:29 PM

  • Posts: 2146
  • Joined: 27-April 04
  • Gender:Male
  • Location:Ohio
  • Wiki edits:59
Never has worked for me, I'm getting the typical Failed to initialize C0000135 error...

#150 User is offline MainMemory 

Posted 05 April 2010 - 09:45 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4146
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
STMP: Do you have the .NET Framework installed? If you don't, you need it.

  • 19 Pages +
  • ◄ First
  • 8
  • 9
  • 10
  • 11
  • 12
  • Last ►
    Locked
    Locked Forum

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