Page 2 of 6

Re: Grid Engine

Posted: Thu Nov 18, 2010 1:09 am
by Ryne
Pretty interesting, I could definitely see some uses for this. Good work! :)

Re: Grid Engine

Posted: Thu Nov 18, 2010 1:12 am
by Jasoco
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

Posted: Thu Nov 18, 2010 1:42 am
by Ryne
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.
I thought that was just me, I guess not. It is pretty slow.

Re: Grid Engine

Posted: Thu Nov 18, 2010 1:48 am
by Jasoco
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

Posted: Thu Nov 18, 2010 1:54 am
by ZenX2
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.

Re: Grid Engine

Posted: Thu Nov 18, 2010 2:54 am
by Jasoco
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

Posted: Thu Nov 18, 2010 2:59 am
by ZenX2
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.

Re: Grid Engine

Posted: Thu Nov 18, 2010 3:19 am
by Ryne
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.
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!

Re: Grid Engine

Posted: Thu Nov 18, 2010 3:35 am
by Jasoco
Still going slow. You're not calculating light every frame, are you?

Re: Grid Engine

Posted: Thu Nov 18, 2010 3:40 am
by ZenX2
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.