Grid Engine

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Ryne
Party member
Posts: 444
Joined: Fri Jan 29, 2010 11:10 am

Re: Grid Engine

Post by Ryne »

Pretty interesting, I could definitely see some uses for this. Good work! :)
@rynesaur
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Grid Engine

Post 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.
User avatar
Ryne
Party member
Posts: 444
Joined: Fri Jan 29, 2010 11:10 am

Re: Grid Engine

Post 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.
@rynesaur
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Grid Engine

Post 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.
User avatar
ZenX2
Citizen
Posts: 89
Joined: Wed Nov 17, 2010 5:35 am

Re: Grid Engine

Post 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.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Grid Engine

Post by Jasoco »

There are better ways to do it. At least from what I saw in your code. In time you will learn, grasshopper.
User avatar
ZenX2
Citizen
Posts: 89
Joined: Wed Nov 17, 2010 5:35 am

Re: Grid Engine

Post 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.
User avatar
Ryne
Party member
Posts: 444
Joined: Fri Jan 29, 2010 11:10 am

Re: Grid Engine

Post 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!
@rynesaur
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Grid Engine

Post by Jasoco »

Still going slow. You're not calculating light every frame, are you?
User avatar
ZenX2
Citizen
Posts: 89
Joined: Wed Nov 17, 2010 5:35 am

Re: Grid Engine

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests