Author Topic: Help on collision for tilemaps  (Read 14235 times)

0 Members and 2 Guests are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Help on collision for tilemaps
« Reply #15 on: June 08, 2010, 01:53:55 pm »
I am sure the flicker can be reduced. Sometimes the grayscale just updates too fast and needs to be updated less often. It's because of the crappy LCD driver

EDIT: Nevermind. The reason why the RPG demo is so slow compared to stuff like Half Life 2D or Portal X is because he redraws the entire tilemap every frame
« Last Edit: June 08, 2010, 01:58:10 pm by DJ Omnimaga »

SirCmpwn

  • Guest
Re: Help on collision for tilemaps
« Reply #16 on: June 08, 2010, 03:03:40 pm »
HL2D redraws every frame...
Also, I have a one-nibble per tile method that includes scrolling, I can post more about it later, probably in its own tutorial.
It doesn't do smooth scroll, but I'm sure I can figure it out.
« Last Edit: June 08, 2010, 03:04:43 pm by Mr_Coding_Knight »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Help on collision for tilemaps
« Reply #17 on: June 08, 2010, 03:07:28 pm »
really? Strange. I wonder why the Axe RPG demo framerate is so low then x.x

Did I miss a Pause command somewhere or sometthing or does 4 lv grayscale really slow things down this much??

SirCmpwn

  • Guest
Re: Help on collision for tilemaps
« Reply #18 on: June 08, 2010, 03:09:08 pm »
4lv grayscale hasn't been too slow for me.  I haven't placed it in a production quality game yet, but I haven't noticed a signifigant slow down.  Someone should try disabling interrupts during a 4lv gs program and seeing what happens, that will give me a better idea of what's going on behind the scenes.  (I don't have a calc this week)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Help on collision for tilemaps
« Reply #19 on: June 08, 2010, 03:15:17 pm »
I just tried running the RPG with no grayscale and it seemed about twice faster. My guess is that HL2 probably used some cool optimizations to make it run this fast

SirCmpwn

  • Guest
Re: Help on collision for tilemaps
« Reply #20 on: June 08, 2010, 03:16:37 pm »
HL2 isn't in gray

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Help on collision for tilemaps
« Reply #21 on: June 08, 2010, 03:20:02 pm »
I know. I was talking about the RPG map engine Quigibo included with Axe. It's considerably slower than HL2. That's what I was saying.

SirCmpwn

  • Guest
Re: Help on collision for tilemaps
« Reply #22 on: June 08, 2010, 03:21:17 pm »
Oh, I see.  I'll try and throw together an engine later today.  I have an emulator to test it on, so I can try and post something later.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Help on collision for tilemaps
« Reply #23 on: June 08, 2010, 03:35:19 pm »
cool

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Help on collision for tilemaps
« Reply #24 on: June 08, 2010, 04:29:03 pm »
When you draw sprites in grayscale, you are drawing twice as many sprites as monochrome since you need to draw to both the front and back buffer layers, and 4 times as many if you need to mask any of those sprites!  Also, the flickeryness is my fault, I've already written a better looking routine with the help of calc84maniac.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Help on collision for tilemaps
« Reply #25 on: June 08, 2010, 04:32:51 pm »
aaah that explains the slow down x.x

When testing I forgot to remove the additional sprites display commands x.x

EDIT: THis is how fast it displays with no grayscale sprite storing
« Last Edit: June 08, 2010, 04:39:19 pm by DJ Omnimaga »

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Help on collision for tilemaps
« Reply #26 on: June 08, 2010, 06:36:10 pm »
Also, you can run the grayscale like this if you want to have 15MHz as much as possible:
Code: [Select]
:Normal
:Dispgraph^r^r
:Full
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Magic Banana

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 371
  • Rating: +77/-1
  • It's not an apple, it's a ... magic banana.
    • View Profile
Re: Help on collision for tilemaps
« Reply #27 on: June 08, 2010, 08:56:29 pm »
Huh, I guess I just really didn't go in depth when I tested it. I basically just removed the 1 or 2 commands that draws the grayscale, but what you guys are saying makes sense. I was pretty tired when I tried it out so I guess I wasn't thinking too much about it.

Also, you can run the grayscale like this if you want to have 15MHz as much as possible:
Code: [Select]
:Normal
:Dispgraph^r^r
:Full

Oh, never thought about it like that. I was just thinking that if you used grayscale you couldn't use full, but it looks like it's only for those commands. I'll be sure to keep that in mind when I jump into grayscale.
I do sprites and stuff, so yeah.

Quote from: yunhua98
i'M NOT SURE WHAT A SWORD SKILL IS BUT HERE'S THE SWORD ANIMATION FROM THE TWO SPRITES ON PG 13

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Help on collision for tilemaps
« Reply #28 on: June 08, 2010, 09:21:09 pm »
I think that can slow things down a bit if all your loop does is refreshing grayscale, though. In that case it's best to put the normal command before the loop and the full one after

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Help on collision for tilemaps
« Reply #29 on: June 08, 2010, 11:59:03 pm »
The normal and Full commands are negligible.  I think they're 10-20 clock cycles whereas the grayscale drawing is in the order of tens of thousands of clock cycles.  Also, all the drawing commands, both monochrome full speed, monochrome normal, 3-level grayscale, and 4-level grayscale take very close to the same amount of clock cycles since the LCD requires the same delay no matter what you're drawing.  The ones that are currently slower are fixed in the next version.  The only real slowdowns are going to be from drawing the sprites.
« Last Edit: June 09, 2010, 12:01:11 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!