too much lines of codes creates delay?
too much lines of codes creates delay?
too much lines of codes creates delay?
too much lines of codes creates delay?
too much lines of codes creates delay?
too much lines of codes creates delay? too much lines of codes creates delay? too much lines of codes creates delay? too much lines of codes creates delay? too much lines of codes creates delay? too much lines of codes creates delay? too much lines of codes creates delay? too much lines of codes creates delay?
too much lines of codes creates delay? too much lines of codes creates delay?
too much lines of codes creates delay?
Go Back  Xtreme Visual Basic Talk > > > too much lines of codes creates delay?


Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2011, 08:13 AM
masterpreenx masterpreenx is offline
Newcomer
 
Join Date: Sep 2010
Location: Davao City Philippines
Posts: 24
Default too much lines of codes creates delay?


I am creating a game using VB .net i called it neo tetris battle "just for game development practice, experience and learn something new". it somehow similar to facebook's tetris battle gameplay and I already made a progress on the games logic. Now here's the problem everything works pretty on my pc BUT when I try to deploy it on a lower specs pc it lags or creates delay on movements. The game is just simple and it only use simple graphics but why it lags?

I have also an idea why my game lags but I dont know if its accurate and I dont know any solutions yet. I guess the game lags because of too much lines of codes it consists of 5052 lines of code in just a single form.

Do anybody here can help me figure this out? Do I lack some game development methods?

"If I can figure out this problem, I believe I can create more powerful games using VB .net"
Reply With Quote
  #2  
Old 11-03-2011, 08:27 AM
AtmaWeapon's Avatar
AtmaWeapontoo much lines of codes creates delay? AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

VB .NET with Windows Forms as the graphics platforms is one of the worst choices you can make for a high-performance 2D game. The explanation is long, but the summary is Windows Forms is based on an architecture that hasn't changed much since Windows 95, when no one used alpha blending or animation because accelerated video cards didn't exist. It's possible to use OpenGL or DirectX from VB .NET but in my opinion it is suboptimal.

As to why it's performing slow, that can't be told without looking at the code. 5,000 lines of code in a single form is not a guarantee that you are doing anything wrong, but from an architectural standpoint it makes me cringe. While you insist on placing all of your toys in one box you will find it increasingly difficult to alter the program. Consider extracting as much as you can into other classes. It won't make the code faster, but it will make it easier to understand.

Really all you can do is use a class like System.Diagnostics.Stopwatch to time parts of your code and narrow down which ones are taking a long time. Then ask why that code takes a long time. Then fix it. My guess? You're probably doing all of your logic in some Paint event handler. You should do as little work there as possible; it's for painting. The slower that method runs the slower your program will run. Still, I can't comment on what I can't see.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #3  
Old 11-03-2011, 08:37 AM
DrPunk's Avatar
DrPunktoo much lines of codes creates delay? DrPunk is offline
Senior Contributor

* Expert *
 
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,403
Default

The last I heard they'd added VB support to XNA, so it might be worth looking at that -> http://blogs.msdn.com/b/vbteam/archi...-platform.aspx
__________________
There are no computers in heaven!
Reply With Quote
  #4  
Old 11-03-2011, 04:34 PM
masterpreenx masterpreenx is offline
Newcomer
 
Join Date: Sep 2010
Location: Davao City Philippines
Posts: 24
Default

I am also planning on using vb .net XNA and see what happens but I think the real problem is the part that how I code the game and also It takes too much time to debug if it contain too much lines of codes specially this game I made.

for better understanding and better suggestions for me I will place a download link for the game I made.

http://www.mediafire.com/?9k8dhiio4r45i5s

I cant post the codes here because its too long. =D
Reply With Quote
  #5  
Old 11-03-2011, 04:37 PM
PlausiblyDamp's Avatar
PlausiblyDamptoo much lines of codes creates delay? PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

There is nothing stopping you attaching the project here, just delete the bin and obj folders before zipping it up and there should be no problems.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #6  
Old 11-04-2011, 07:20 AM
masterpreenx masterpreenx is offline
Newcomer
 
Join Date: Sep 2010
Location: Davao City Philippines
Posts: 24
Default

I still cant attach the project here =(. It says "Invalid File" . I compressed it with winrar.
Reply With Quote
  #7  
Old 11-04-2011, 08:24 AM
PlausiblyDamp's Avatar
PlausiblyDamptoo much lines of codes creates delay? PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

Did you create a rar file or a zip file? If you create a zip file it should work.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #8  
Old 11-04-2011, 08:49 AM
passel's Avatar
passeltoo much lines of codes creates delay? passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,024
Default

Your file on the link is greater than 3MB.
If after compressing the files the zip file is still greater than 2MB, you are probably restricted from trying to upload it.
Break the png files directory into a separate zip and upload it separately.
If the png files file is still bigger than 2MB, break it into two files.
Alternatively, you could copy the project to a new folder, change all the png files to .jpg files, and globally search and replace .png with .jpg in your code. It may not look as nice, transparency wise, but the code should still work for someone examining it.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
  #9  
Old 11-04-2011, 06:10 PM
masterpreenx masterpreenx is offline
Newcomer
 
Join Date: Sep 2010
Location: Davao City Philippines
Posts: 24
Default

there you go . =D

Edit-passel: I had to remove your attachment. You perhaps missed PlausiblyDamp's notice "just delete the bin and obj directories".
Since any executable file (.exe, .dll, .ocx, etc...) is a simple source of malicious code, we don't allow them to be part of an attachment.
In your case, since your Images directory is under the bin/Debug directory you would have to manually delete all the file under bin/Debug and leave your Images directory and the upper level bin directory, rather than delete it.
But you also have dll files in that directory that are necessary for your code for socket comms. You can't attach them, and your code won't compile without them. So, I don't know if you want to go through the effort of commenting out the code necessary to remove the dependency on the dlls.
If not, you won't be able to post a compilable source here.

I'm sure you had to agree to the Posting Guidelines when you joined the forum.

Last edited by passel; 11-05-2011 at 06:00 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
too much lines of codes creates delay?
too much lines of codes creates delay?
too much lines of codes creates delay? too much lines of codes creates delay?
too much lines of codes creates delay?
too much lines of codes creates delay?
too much lines of codes creates delay? too much lines of codes creates delay? too much lines of codes creates delay? too much lines of codes creates delay? too much lines of codes creates delay? too much lines of codes creates delay? too much lines of codes creates delay?
too much lines of codes creates delay?
too much lines of codes creates delay?
 
too much lines of codes creates delay?
too much lines of codes creates delay?
 
-->