Page 1 of 2

LuaTroid (is only a clone in terms of mechanics)

Posted: Wed Sep 29, 2010 7:21 pm
by MaskedRetreiver
LuaTroid is definitely still at the Technical Demo stage, but I thought I'd throw it up and see if anyone's got flags to throw or wisdom to impart given what's there so far:

http://github.com/MaskedRetriever/LuaTroid

Navigate with w, a, and d keys, tilde key to bring up the tile selector, mouse and drag to draw tiles, and 1 enters debug mode. All the graphics are CC'd so feel free to snag them if my lame blendArt somehow catches your fancy.

*edit: oh and obviously a lot of mechanics such as any kind of collision detection and a screen more than one screen wide are conspicuously absent...

Re: LuaTroid (is only a clone in terms of mechanics)

Posted: Wed Sep 29, 2010 9:56 pm
by Jasoco
The player moves extremely slow. Are you using Delta Time? (dt)

Re: LuaTroid (is only a clone in terms of mechanics)

Posted: Wed Sep 29, 2010 10:22 pm
by MaskedRetreiver
Um, yes? dt is probably on the list of things I Don't Know Any Better on. It seems alright on my system but I know I'm not optimizing a lot of things properly yet...

Re: LuaTroid (is only a clone in terms of mechanics)

Posted: Wed Sep 29, 2010 10:33 pm
by Robin
It seems the player moves .2 pixels per frame...

Re: LuaTroid (is only a clone in terms of mechanics)

Posted: Wed Sep 29, 2010 11:56 pm
by Jasoco
DT is easy. You just multiply the number of pixels per second * delta time. If you want your player to move 256 pixels in a second do 256 * dt. If you want to do a timer to count down to something else, you do number of seconds * delta time. It's that simple.

What kind of super machine do you have that you don't get any slowdown at all?

Re: LuaTroid (is only a clone in terms of mechanics)

Posted: Thu Sep 30, 2010 12:07 am
by MaskedRetreiver
I think there must be something else wrong as I don't have /that/ great a machine. (It is a quad-core modern machine but it's by no means a gaming rig.) Either I didn't fix the code so it's not regenerating the map every step or there's a version incompatibility I'm missing. I'll run more tests on that soon--

...it sure LOOKS like I have the right code for pasting the whole map to a single image... :ehem:

I am using dt as the controller for how fast the player moves, so that's not the problem...

Re: LuaTroid (is only a clone in terms of mechanics)

Posted: Thu Sep 30, 2010 6:06 am
by Robin
MaskedRetreiver wrote:I am using dt as the controller for how fast the player moves, so that's not the problem...
Not on GitHub you don't.

Re: LuaTroid (is only a clone in terms of mechanics)

Posted: Thu Sep 30, 2010 7:08 am
by MaskedRetreiver
Okay, first, wow thanks for digging that deep, and second yeah I totally misunderstood how that function works. Definitely on my list for another night's experiments. (Tonight I got to successfully identifying if the player is over a specific tile, paving the way to actually landing on platforms.)

Any other advice on graphics optimization? I've already worked out that I'm going to need to switch to Quads at some point for better render speed on the backdrop, and that I pretty much can never go back to drawing one tile at a time, but beyond that I'm kind of flailing around.

EDIT: Okay that was easier to fix than I thought. Updated version now available on GitHub.

Re: LuaTroid (is only a clone in terms of mechanics)

Posted: Thu Sep 30, 2010 1:05 pm
by TechnoCat
Heh, it doesn't take more than a minute to walk across the room anymore. :crazy:

Re: LuaTroid (is only a clone in terms of mechanics)

Posted: Thu Sep 30, 2010 2:41 pm
by bartbes
MaskedRetreiver wrote: Any other advice on graphics optimization? I've already worked out that I'm going to need to switch to Quads at some point for better render speed on the backdrop, and that I pretty much can never go back to drawing one tile at a time, but beyond that I'm kind of flailing around.
You might want to take a look at SpriteBatches, or Framebuffers (0.7.0).