Threading Performance

  • Thread starter One Handed Man \( OHM - Terry Burns \)
  • Start date
O

One Handed Man \( OHM - Terry Burns \)

Hi Again,

I'm still playing with this space invader type game, and I have the alien
wave on the main UI thread which works wuive well, I have also got a
SpaceShip on its own thread which scims acrross the top of the screen, but
the performance of the SpaceShip is a little erratic, it does not so much
slide back and forth but moreover, staggers drunkenly sometimes fast ans
sometimes slow

Does anyone know the best way to improve this performance.


--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
--
 
K

Ken Tucker [MVP]

Hi,

Try setting it threadpriority higher. Maybe that will improve
performance.
http://msdn.microsoft.com/library/d...rfsystemthreadingthreadpriorityclasstopic.asp

Ken
-------------------
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
Hi Again,

I'm still playing with this space invader type game, and I have the alien
wave on the main UI thread which works wuive well, I have also got a
SpaceShip on its own thread which scims acrross the top of the screen, but
the performance of the SpaceShip is a little erratic, it does not so much
slide back and forth but moreover, staggers drunkenly sometimes fast ans
sometimes slow

Does anyone know the best way to improve this performance.


--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
--
 
O

One Handed Man \( OHM - Terry Burns \)

Yes, this makes a marginal difference, however, I am beginning to think that
VB.NET is not the best thing to use for games programming. It's probably my
methods, but I tried to move the form while the invaders were invading and
the whole thing simply hung !

Oh Well, back to the drawing board.

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
C

CJ Taylor

OHM. Dont reinvent the wheel... Check out DirectX 9.0 Managed... I have a
book on game programming with direct x... I think you'll find it a much
easier interface.

You use models (.x files) that you put skins/meshes on that get painted.
All the dirty work is taken care of for you and has an incredible
performance rate...
 
L

Larry Serflaten

CJ Taylor said:
OHM. Dont reinvent the wheel... Check out DirectX 9.0 Managed... I have a
book on game programming with direct x... I think you'll find it a much
easier interface.

You have got to be kidding! To do it right, don't you have to detect the
capabilities of the monitor, before even getting to anything related to graphics?
It just seems every example I've seen so far was either buggy, or was so long
as to not be practical for a simple game.

What is the 'shortest' demo you've seen to put a single (transparent) image
on a background picture, that will work everywhere a Windows Form can
be shown? Keep in mind, a line like: frmMain.Show will show a form
wherever Windows and .Net are installed. Compare that to what would be
needed to call up a DirectX screen that would work every where Windows,
and .Net are installed. How can you say that's an 'easier interface' ???

You use models (.x files) that you put skins/meshes on that get painted.
All the dirty work is taken care of for you and has an incredible
performance rate...

What sort of 'dirty' work is that? Keep in mind his animation needs are
not 3D....

To me, it still seems like a new technology (finicky) that is often more
trouble than its worth. I have yet to see a demo that makes it look 'simple'.

Of course I'd love to be shown the error of my ways, and maybe I'm looking
at old code (DX9) but it still looks like a complicated mess just to get up
and running, much less grasp the new concepts needed to 'render' anything.

LFS
 
L

Larry Serflaten

One Handed Man ( OHM - Terry Burns ) said:
Hi Again,

I'm still playing with this space invader type game, and I have the alien
wave on the main UI thread which works wuive well, I have also got a
SpaceShip on its own thread which scims acrross the top of the screen, but
the performance of the SpaceShip is a little erratic, it does not so much
slide back and forth but moreover, staggers drunkenly sometimes fast ans
sometimes slow

Does anyone know the best way to improve this performance.


Can I suggest you use a background thread to provide logistical calculations
(positions, hit tests, etc) and the UI thread to just do the drawing? However,
since you've stepped away from dozens of threads handling the invaders,
I would think the whole thing could be done on the UI thread alone. I mean
if a 1.7 MHz chip can do a fair job of running the game, certainly something
a thousand times faster should be able to handle it without problems... ;-)

LFS
 
O

One Handed Man \( OHM - Terry Burns \)

As a matter of fact, I think I was already thinking along those lines. Using
the UI thread for the drawing does look to be the most consistent way to do
it using .NET's libraries, but it leaves me feeling like I'm back in the old
days writing code for a Micro computer.


Hey ho !

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
O

One Handed Man \( OHM - Terry Burns \)

This is definately a learning curve for me as all my .NET stuff has had
little graphics animations in it, I will take a look at it though.

Thanks - OHM

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Threading 16
This Group, what more do we need ? 19
OT - Good Ideas ? 3
Why Does This Fail ( Threading ) 17
Enumerations And Random Numbers 38
How to tell if a document is new ? 5
My Turn - Threading 10
Details Vs Thumnails 7

Top