Click here to Skip to main content
16,005,222 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: open file directory Pin
captainmogo18-Mar-09 9:04
captainmogo18-Mar-09 9:04 
GeneralRe: open file directory [modified] Pin
Alan N18-Mar-09 9:27
Alan N18-Mar-09 9:27 
GeneralRe: open file directory Pin
captainmogo19-Mar-09 3:28
captainmogo19-Mar-09 3:28 
Questioncalling a menu form from another menu Pin
Member 462416918-Mar-09 7:04
Member 462416918-Mar-09 7:04 
AnswerRe: calling a menu form from another menu Pin
iamalik18-Mar-09 7:38
professionaliamalik18-Mar-09 7:38 
GeneralRe: calling a menu form from another menu Pin
0x3c018-Mar-09 8:21
0x3c018-Mar-09 8:21 
Questionhow to improve my 2D collision detection system? [modified] Pin
O.G.I.18-Mar-09 4:08
O.G.I.18-Mar-09 4:08 
AnswerRe: how to improve my 2D collision detection system? Pin
Dave Kreskowiak18-Mar-09 6:04
mveDave Kreskowiak18-Mar-09 6:04 
Member 3734843 wrote:
I think that this code is pretty simple, why it takes so much power to run?


Well, since String's under the .NET CLR are immutable (cannot change them), every time you make a change to a string you're creating a new 81 MEGABYTE string! WTF | :WTF: Each old string is dropped, by not before the new one is created. Multiply that by the number of times you're making a change to the string and you've quite possibly created the worst collision detection algorithm ever.


Member 3734843 wrote:
Is this slow calculation have
anything to do with the programming language - Visual Basic 2008 - .NET Framework 3.5?


Nope. I can assure you, the performance problem is entirely in the design of your algorithm.


Member 3734843 wrote:
Is there anyway to
improve the collision detect performance of this system or this project is doomed?


Until you completely rewrite the detection algo to use the processor more efficiently, you're project is doomed.

Using an array of integers should improve performance dramatically. Completely scraping the array and comparing the bounds of object to object would be far better since you don't have to compare against 81000000 pixels every time you more something by 1 pixel.

It comes down to representing your objects more effificently and in a manner that lends itself to better collision detection. Really, pickup a book or two on game programming. I really can't explain how to do something better in a forum post.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008




GeneralRe: how to improve my 2D collision detection system? Pin
O.G.I.18-Mar-09 9:18
O.G.I.18-Mar-09 9:18 
GeneralRe: how to improve my 2D collision detection system? Pin
Dave Kreskowiak18-Mar-09 10:26
mveDave Kreskowiak18-Mar-09 10:26 
AnswerRe: how to improve my 2D collision detection system? Pin
riced18-Mar-09 7:32
riced18-Mar-09 7:32 
AnswerRe: how to improve my 2D collision detection system? Pin
Luc Pattyn18-Mar-09 8:39
sitebuilderLuc Pattyn18-Mar-09 8:39 
QuestionIs there a way to bypass the form_load event of vb.net windows application? Pin
rains197918-Mar-09 1:42
rains197918-Mar-09 1:42 
AnswerRe: Is there a way to bypass the form_load event of vb.net windows application? Pin
Eddy Vluggen18-Mar-09 1:58
professionalEddy Vluggen18-Mar-09 1:58 
GeneralRe: Is there a way to bypass the form_load event of vb.net windows application? Pin
rains197918-Mar-09 2:49
rains197918-Mar-09 2:49 
GeneralRe: Is there a way to bypass the form_load event of vb.net windows application? Pin
Eddy Vluggen18-Mar-09 2:57
professionalEddy Vluggen18-Mar-09 2:57 
GeneralRe: Is there a way to bypass the form_load event of vb.net windows application? Pin
rains197918-Mar-09 3:08
rains197918-Mar-09 3:08 
GeneralRe: Is there a way to bypass the form_load event of vb.net windows application? Pin
Eddy Vluggen18-Mar-09 3:19
professionalEddy Vluggen18-Mar-09 3:19 
AnswerRe: Is there a way to bypass the form_load event of vb.net windows application? Pin
Alan N18-Mar-09 4:52
Alan N18-Mar-09 4:52 
AnswerRe: Is there a way to bypass the form_load event of vb.net windows application? Pin
Dave Kreskowiak18-Mar-09 5:52
mveDave Kreskowiak18-Mar-09 5:52 
GeneralRe: Is there a way to bypass the form_load event of vb.net windows application? Pin
rains197918-Mar-09 23:42
rains197918-Mar-09 23:42 
GeneralRe: Is there a way to bypass the form_load event of vb.net windows application? Pin
Dave Kreskowiak19-Mar-09 2:15
mveDave Kreskowiak19-Mar-09 2:15 
Questioncombine and run two projects with diffrent menus forms Pin
Member 462416918-Mar-09 0:22
Member 462416918-Mar-09 0:22 
AnswerRe: combine and run two projects with diffrent menus forms Pin
Christian Graus18-Mar-09 0:25
protectorChristian Graus18-Mar-09 0:25 
GeneralRe: combine and run two projects with diffrent menus forms Pin
Member 462416918-Mar-09 1:05
Member 462416918-Mar-09 1:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.