Laggy game
-
- Prole
- Posts: 9
- Joined: Thu Jul 04, 2013 5:52 pm
Laggy game
I am making a platformer and is very laggy. This issue did not happen until I installed Advanced tile loader, so if you know any fixes, please tell me.
-
- Prole
- Posts: 30
- Joined: Tue Feb 12, 2013 7:45 pm
Re: Laggy game
Can I have .love file?
-
- Prole
- Posts: 9
- Joined: Thu Jul 04, 2013 5:52 pm
-
- Prole
- Posts: 30
- Joined: Tue Feb 12, 2013 7:45 pm
Re: Laggy game
I need you to post a full .love file or I can't help you. I need to be able to run the game so I can figure out what's causing the problem. Here is where you can learn how to create one if you don't already know.XxFullMetalxX wrote:Here is the main file
http://www.love2d.org/wiki/Game_Distrib ... .love-file
Re: Laggy game
I've tried replicating your code(made a map, got the camera and AdvTiledLoader version you're using, etc), but it still wont run. From reading your code, though, I can't see a problem. That being said, you haven't provided much information. Leave comments too.
P.S. Don't almost 100% copy Goatures tutorial, Thanks!
P.S. Don't almost 100% copy Goatures tutorial, Thanks!
"In those quiet moments, you come into my mind" - Liam Reilly
-
- Prole
- Posts: 9
- Joined: Thu Jul 04, 2013 5:52 pm
Re: Laggy game
Here is the .love fileCan I have .love file?
- Attachments
-
- game.love
- sorry but it is unresponsive
- (45.78 KiB) Downloaded 222 times
Re: Laggy game
I know what is it: Your map is HUGE! You're rendering too much of the map at once. I had the same problem. You may not realise it, but your map is 800x600. Yes, that's the size of your window, but each of your tiles is 32x32. You don't need all that space. Make your map smaller.
If you want that insanely huge map, just limit the draw range. That being said, I think your map is just too big. Make a new map, and leave it at the default size. You should be alright. If your map was smaller, you'd just have to limit the draw range.
If someone wants to say how to limit the draw range to fix this problem, be my guest. I divided the bounds by about 100,000,000 and it still froze. I think this is because ATL is having trouble loading in a map of that scale. I'm sure there's a way to have maps this big, but it's just not what you'd want.
So yeah: Make your map smaller.
Also, if your having trouble like this, do some deduction. That basically means comment out bits of code that you think might be causing the problem. If you're using a Map, check it's size. Remember: ATL is not an official part of LÖVE, and is a 3rd-party extension.
If you want that insanely huge map, just limit the draw range. That being said, I think your map is just too big. Make a new map, and leave it at the default size. You should be alright. If your map was smaller, you'd just have to limit the draw range.
If someone wants to say how to limit the draw range to fix this problem, be my guest. I divided the bounds by about 100,000,000 and it still froze. I think this is because ATL is having trouble loading in a map of that scale. I'm sure there's a way to have maps this big, but it's just not what you'd want.
So yeah: Make your map smaller.
Also, if your having trouble like this, do some deduction. That basically means comment out bits of code that you think might be causing the problem. If you're using a Map, check it's size. Remember: ATL is not an official part of LÖVE, and is a 3rd-party extension.
"In those quiet moments, you come into my mind" - Liam Reilly
Re: Laggy game
No problem! Always happy to help!
"In those quiet moments, you come into my mind" - Liam Reilly
Re: Laggy game
I'm not sure exactly what's going on here since I haven't looked at the actual source code, but if your map really is that huge, ATL is probably not the right tool for the job. If you split your map up into several smaller files, and only load the ones that are close to the player this would probably not be an issue.
I've been playing around a bit with a top-down adventure game engine that I wanted to support more or less infinitely large maps. It worked really well when I kept 9 canvases that draw the areas around the player, and once a new part of the world comes into view when I walk to the right, I simply clear the content from the leftmost camvases and draw the rightmost areas on there. Creating and destroying canvases was surprisingly slow, which is what I tried before.
I've been playing around a bit with a top-down adventure game engine that I wanted to support more or less infinitely large maps. It worked really well when I kept 9 canvases that draw the areas around the player, and once a new part of the world comes into view when I walk to the right, I simply clear the content from the leftmost camvases and draw the rightmost areas on there. Creating and destroying canvases was surprisingly slow, which is what I tried before.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Who is online
Users browsing this forum: Google [Bot] and 3 guests