3D Game Lag
#1
Posted 27 June 2012 - 02:19 PM
I am GMRescue and I have a very basic problem. My game lags alot. Probably because of the amount of instances that I use. In the debug mode, it still doesn't get any more clear than before about the amount of instances there are since it is changing all the time. Is there a way for me to turn this lag-ful game into a smooth game? I've got a small demo right here:
Link to the Demo
What I'm trying to do is making a full game of this, because it's working out pretty well, but it has so much lag thought. I hope there is a solution for this problem.
What will you see
You'll probably see when you walk, that the FPS slows down from 64 to 42 or so. I think it's because of the amount of grass and rain. I added fog for lower detail and all the objects that are too far away (about 256-512 pixels away) will not be seen.
I hope I gave you all enought information. I don't want anybody to make my game. I want to do it by myself, but I called in help because of a small problem.
Thanks in advance, GMRescue
#2
Posted 27 June 2012 - 09:35 PM
Switch hosts to Mediafire or Dropbox to avoid the log-in requirement. I'm not going to make a box account just to download this.
Also, don't just give a demo. Let us muck around in the source.
Sounds to me like you're not properly limiting the amount you push through GM's renderer (Also sounds like you're using fog naively). Depending on the game (Solve the problem listed above so we can see it), there are several solutions.You'll probably see when you walk, that the FPS slows down from 64 to 42 or so. I think it's because of the amount of grass and rain. I added fog for lower detail and all the objects that are too far away (about 256-512 pixels away) will not be seen.
If your ground is ALWAYS flat, you can draw patches of grass ONLY in the area near the player by drawing 1-9 models.
If your ground is hilly or you need a large view distance, consider using a quadtree to render more-detailed grass near the user. (Lowest-level node has high-detail grass, each parent node has lower detail grass over a larger region) When using this method, you may want to generate new patches dynamically to reduce the amount of video memory you use. You can modify this system to show more-detailed models only once they are generated.
Edited by Gamer3D, 27 June 2012 - 09:37 PM.
#3
Posted 27 June 2012 - 11:46 PM
if i did grass and rain, i would have a few models with lots of blades of grass and rain drops in them. only displaying the models nearby, not the whole map and try to hide it with fog. defiantly don't create an instance for each blade of grass and rain drop. group lots of primitives together in one model and maybe have a few instances displaying the models
#4
Posted 28 June 2012 - 08:15 AM
if distance_to_point(obj_player.x,obj_player.y) < 64 then visible = 1 else visible = 0
Then it would look a little strange. The larger the allowed distance to the player, the better it looks, but the slower it goes. Isn't there a DLL out so I can get unlimited data rendering. That would be great. I've tried alot of topics, but none of them had what I was looking for.
If there is anything unclear, please PM me or reply to this topic.
Thanks in advance, GMRescue
Edited by GMRescue, 28 June 2012 - 08:16 AM.
#5
Posted 28 June 2012 - 07:53 PM
Fog just changes the color. It doesn't stop them from rendering. Besides, I think the problem is your code, not the graphics card's fill-rate.I already disabled the rain, because it was really beyond GM's ability to render this amount of polygons. Because of the fog, blades that are too far away, are hidden from the map and the player won't see anything.
No such thing exists. Whenever something looks unlimited, it's because the programmer is using clever tricks to make limited data look more detailed than it is.Then it would look a little strange. The larger the allowed distance to the player, the better it looks, but the slower it goes. Isn't there a DLL out so I can get unlimited data rendering. That would be great. I've tried alot of topics, but none of them had what I was looking for.
That actually shows the root of the problem. STOP USING OBJECTS FOR GRASS BLADES. Instances each have their own cost, even if no code is in them; also keep in mind that each GM function call is expensive, so drawing patches of grass individually will be slow. Take one of our suggestions for grouping grass blades into objects.if distance_to_point(obj_player.x,obj_player.y) < 64 then visible = 1 else visible = 0
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











