GLBasic forum

Main forum => Beta Tests => Topic started by: MrTAToad on 2010-Apr-12

Title: Mappy
Post by: MrTAToad on 2010-Apr-12
This is my first beta for my Mappy routine.  Just really need to add in the collision detection code.

Quite a simple demo, just use the cursor keys to move around.

The graphics are processed from within the FMP file itself.

It uses a bit from Moru's routine (converted to C), and will use the collision detection routine when I get around to it!

[attachment deleted by admin]
Title: Re: Mappy
Post by: Moru on 2010-Apr-12
Nice work :-)

Can the included grafics handle an alpha channel?
Title: Re: Mappy
Post by: Marmor on 2010-Apr-12
welcome to Battle Squadron    :D

http://www.youtube.com/watch?v=6JDJOaTcpz4&feature=related
Title: Re: Mappy
Post by: MrTAToad on 2010-Apr-12
QuoteCan the included grafics handle an alpha channel?
What I do is write the RGB values to a screen (with a sprite), and set the transparency to 0, although I'll be changing that to use the transparency value in the file.
Title: Re: Mappy
Post by: Kuron on 2010-Apr-13
Very nice work!  Runs at 1 FPS, but that is very good for not having hardware GL support on this clunker  =D
Title: Re: Mappy
Post by: Moru on 2010-Apr-13
Ow, what sort of computer is that? 386? :-)
Title: Re: Mappy
Post by: Kuron on 2010-Apr-13
Close: Athlon 1.4GHz  :D  (1GB RAM, GeForce4 MX 4000 64MB, XP SP2.  The speed is because I am just using the drivers that came with XP SP2 (ie, no hardware GL support).  No biggie as it is an internet only machine.  I keep meaning to install the drivers, but I never get around to it.)
Title: Re: Mappy
Post by: Moru on 2010-Apr-13
Hmm, even the 200 MHz GP2X gets at least 30 FPS with 8 layers of tiles... Has to be the drivers.
Title: Re: Mappy
Post by: MrTAToad on 2010-Apr-13
There may be a few more efficiency savings I can add to make it up to 2FPS
Title: Re: Mappy
Post by: MrTAToad on 2010-Apr-13
This should produce a fair speed increase.  Also give the second one a go too :)

[attachment deleted by admin]
Title: Re: Mappy
Post by: Ian Price on 2010-Apr-13
That second demo is nice, but there is significant slowdown when scrolling diagonally, which is quite odd.
Title: Re: Mappy
Post by: MrTAToad on 2010-Apr-13
Cant say I noted that...  :S  Will have to have a look there...

See if this is any better...

I've reduced some error checking that wasn't really needed, but beyond that there isn't much else to improve speed...

[attachment deleted by admin]
Title: Re: Mappy
Post by: Kuron on 2010-Apr-14
Tested the latest on my two dev machines.  Very nice and extremely smooth.  :good:

This is also a good advertisement for Mappy (which I haven't touched in years).
Title: Re: Mappy
Post by: Kitty Hello on 2010-Apr-14
very strange. It's not all that smooth for me, here. It's smooth, but when I scroll to where there's less stuff, it scrolls faster.
Title: Re: Mappy
Post by: Ian Price on 2010-Apr-14
Quote from: Kitty Hello on 2010-Apr-14
It's smooth, but when I scroll to where there's less stuff, it scrolls faster.

Yep. This ^^^. Speed definitely reduces when there are more tiles on screen, especially around the animated features.
Title: Re: Mappy
Post by: MrTAToad on 2010-Apr-14
Give this a go - removed a bit more error checking

[attachment deleted by admin]
Title: Re: Mappy
Post by: Ian Price on 2010-Apr-14
Doesn't seem to be much of a difference really.
Title: Re: Mappy
Post by: Kuron on 2010-Apr-14
MrTAToad:  What method are you using to control your framerate?
Title: Re: Mappy
Post by: MrTAToad on 2010-Apr-14
There isn't - its just going as fast as possible.  LIMITFPS  is set to -1

Using VIEWPORT does hammer the program speed, especially with 4 sections :)

There is one more bit that can simplified - I'll try that later on...
Title: Re: Mappy
Post by: Wampus on 2010-Apr-16
I'm getting the same result as others; the more tiles displayed the slower it goes. On an old Pentium 4 3.2GHz the processor is getting fairly well hammered.

There must be some reason for that. How much is the routine doing other than displaying the map sprites?

[edit: Nevermind. I saw you posted the code elsewhere. Thanks.]
Title: Re: Mappy
Post by: MrTAToad on 2010-Apr-17
Aside from displaying the tiles, it just animates them.

Have a look at the source code and see if you can speed it up...