Grid Engine
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Grid Engine
Man. That's so slow. Why is it so slow? It's a smaller grid then what my own game creates. It takes a few seconds to load the array. (Mine loads in less than a quarter second.) How big is this grid? It looks small. Much smaller than what I create but takes longer? And it's taking too long for each frame. I'm getting 15FPS. What exactly is it doing each frame? The code is so confusing and spread out it's impossible to figure out.
Re: Grid Engine
I thought that was just me, I guess not. It is pretty slow.Jasoco wrote:Man. That's so slow. Why is it so slow? It's a smaller grid then what my own game creates. It takes a few seconds to load the array. (Mine loads in less than a quarter second.) How big is this grid? It looks small. Much smaller than what I create but takes longer? And it's taking too long for each frame. I'm getting 15FPS. What exactly is it doing each frame? The code is so confusing and spread out it's impossible to figure out.
@rynesaur
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Grid Engine
Okay. I get about 30FPS with nothing processor intense running on my computer. Still a bit slow. Is stuff being calculated every frame? Would be more efficient to precalculate it beforehand and recalculate only when something changes. This is how MineCraft works with lighting and why you can't have moving light sources yet. It calculates light first then only recalculates small areas when they change. Or in pieces when the sun comes up or goes down.
Re: Grid Engine
The grid size is set in the love.load in main.lua. You can also change the pixel size.
The grid is not a set of specific pixels, but a set of drawing instructions. The SetPixel function does not actually set a pixel, but add a drawing instruction. The initial load time is from rendering lights, which is pretty slow. It runs at a good speed on my comp, which is pretty bad so if you have a computer from pre-2005 it might go slowly.
The grid is not a set of specific pixels, but a set of drawing instructions. The SetPixel function does not actually set a pixel, but add a drawing instruction. The initial load time is from rendering lights, which is pretty slow. It runs at a good speed on my comp, which is pretty bad so if you have a computer from pre-2005 it might go slowly.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Grid Engine
There are better ways to do it. At least from what I saw in your code. In time you will learn, grasshopper.
Re: Grid Engine
New version of the Grid Engine has:
-The start of an inventory system
-Doors (lighting doesn't work well with this, even re-rendering a single light is slow.)
-2 Sensors:
--Switches
--Touch Sensors (stand on it to activate)
-Loading a level clears the ents table
-working file loading (sorry about that)
I decided to upload the latest version before I start on a GUI system, if there isn't a preexisting one.
Yes, I know there are better ways of doing many things in here. It's not like I've been pouring my heart into this for weeks, I started around noon monday.
-The start of an inventory system
-Doors (lighting doesn't work well with this, even re-rendering a single light is slow.)
-2 Sensors:
--Switches
--Touch Sensors (stand on it to activate)
-Loading a level clears the ents table
-working file loading (sorry about that)
I decided to upload the latest version before I start on a GUI system, if there isn't a preexisting one.
Yes, I know there are better ways of doing many things in here. It's not like I've been pouring my heart into this for weeks, I started around noon monday.
Re: Grid Engine
My system is new, i3 530, 2GB DDR3, and a 9800GTX OC +, I didn't bother checking frame rate but moving the player lagged significantly. Trying your new version now!ZenX2 wrote:The grid size is set in the love.load in main.lua. You can also change the pixel size.
The grid is not a set of specific pixels, but a set of drawing instructions. The SetPixel function does not actually set a pixel, but add a drawing instruction. The initial load time is from rendering lights, which is pretty slow. It runs at a good speed on my comp, which is pretty bad so if you have a computer from pre-2005 it might go slowly.
@rynesaur
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Grid Engine
Still going slow. You're not calculating light every frame, are you?
Re: Grid Engine
No. I tried it once, with horrific results.
I'm not sure what people are expecting, but Tick is called every .2 seconds, so you move 5 pixels a second.
I'm not sure what people are expecting, but Tick is called every .2 seconds, so you move 5 pixels a second.
Who is online
Users browsing this forum: No registered users and 2 guests