Directdraw game beings to lag
Directdraw game beings to lag
Directdraw game beings to lag
Directdraw game beings to lag
Directdraw game beings to lag
Directdraw game beings to lag Directdraw game beings to lag Directdraw game beings to lag Directdraw game beings to lag Directdraw game beings to lag Directdraw game beings to lag Directdraw game beings to lag Directdraw game beings to lag
Directdraw game beings to lag Directdraw game beings to lag
Directdraw game beings to lag
Go Back  Xtreme Visual Basic Talk > > > > Directdraw game beings to lag


Reply
 
Thread Tools Display Modes
  #1  
Old 01-15-2005, 01:50 PM
make_games make_games is offline
Newcomer
 
Join Date: Jan 2005
Posts: 13
Default Directdraw game beings to lag


I have a directdraw isometric tile game that I'm making. It's VERY fast and very cool, you can select buildings and see the info on them etc, but after a while, it beings to lag and go slower.. You can tell if you scroll around a bunch (arrow keys), and click stuff, it will start to lag. Can anybody help me?

Code is attached

Edit by Iceplug: 2 EXEs were removed from the attachment
Attached Files
File Type: zip MooseTown.zip (271.3 KB, 68 views)

Last edited by Iceplug; 01-16-2005 at 07:40 AM.
Reply With Quote
  #2  
Old 01-15-2005, 02:08 PM
Faith's Avatar
Faith Faith is offline
Contributor
 
Join Date: Sep 2003
Location: Finland
Posts: 690
Default

Hi!
Dude, remove the executables, so you save the Moderators the trouble...
I'd give it a guess, this has something to do with RAM space getting low, just a guess...
__________________
I love deadlines. I like the whooshing sound they make as they fly by. - Douglas Adams

Last edited by Faith; 01-15-2005 at 02:22 PM.
Reply With Quote
  #3  
Old 01-15-2005, 02:45 PM
make_games make_games is offline
Newcomer
 
Join Date: Jan 2005
Posts: 13
Default

Well, I thought of that, but I can't see anything that would keep taking up more and more ram? Does DirectX keep taking up more ram every time you drawfast or draw? Is there something I should do to like.. Clear the directx buffer or something every game loop.. THanks
Reply With Quote
  #4  
Old 01-17-2005, 04:42 PM
sgt_pinky's Avatar
sgt_pinky sgt_pinky is offline
Contributor
 
Join Date: Feb 2004
Location: Melbourne, Australia
Posts: 633
Default

In your render routine, try adding the line GC.Collect().

This manually calls the Garbage Collection (ie, clear out Virtual Memory).

This has solved alot of my memory problems with DirectX. It's not really a solution, but at least it works. The solution is to look for memory leaks. I have done this in my own code, and I swear there aren't any (I Dispose() and '= Nothing' every variable/class) and I still have problems, and have to use this method.
Reply With Quote
  #5  
Old 01-17-2005, 11:39 PM
Faith's Avatar
Faith Faith is offline
Contributor
 
Join Date: Sep 2003
Location: Finland
Posts: 690
Default

You perhaps shouldn't do the collection ALL the time, and should only probably collect the first generation of memory GC.Collect(0) only. (there's three generations, and objects get promoted in generations in relation to the time they're alive)
Quote:
In your render routine, try adding the line GC.Collect().
Evil, very evil
__________________
I love deadlines. I like the whooshing sound they make as they fly by. - Douglas Adams
Reply With Quote
  #6  
Old 01-18-2005, 02:43 PM
sgt_pinky's Avatar
sgt_pinky sgt_pinky is offline
Contributor
 
Join Date: Feb 2004
Location: Melbourne, Australia
Posts: 633
Default

Quote:
Originally Posted by Faith
Evil, very evil
Haha, yeah. I had a rush of blood. The last thing you want is to try and GC.Collect() 60 odd times a second, hehe. Your game will be a lot laggier probably.

In my case, my game was running for about 30 min, then virtual space started to get over 1GB and it started to lag. I solved the problem by calling garbage collection every 10 min. It annoys me that I can't solve the problem properly though.

Interestingly, I have had similar problems using COM stuff in .NET as well.
Reply With Quote
  #7  
Old 01-18-2005, 03:54 PM
Faith's Avatar
Faith Faith is offline
Contributor
 
Join Date: Sep 2003
Location: Finland
Posts: 690
Default

Quote:
In my case, my game was running for about 30 min
The program very likely has all the variables that have been alive for 30 minutes in generation 2 of the memory... It's not like there's anything you can move from generation two...
If you do the collection once per 10 min, then you can of course check all the generations...
__________________
I love deadlines. I like the whooshing sound they make as they fly by. - Douglas Adams
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
Directdraw game beings to lag
Directdraw game beings to lag
Directdraw game beings to lag Directdraw game beings to lag
Directdraw game beings to lag
Directdraw game beings to lag
Directdraw game beings to lag Directdraw game beings to lag Directdraw game beings to lag Directdraw game beings to lag Directdraw game beings to lag Directdraw game beings to lag Directdraw game beings to lag
Directdraw game beings to lag
Directdraw game beings to lag
 
Directdraw game beings to lag
Directdraw game beings to lag
 
-->