Author Topic: [C] F-Zero : trackSpire  (Read 56022 times)

0 Members and 1 Guest are viewing this topic.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: [C] F-Zero : trackSpire
« Reply #30 on: January 08, 2013, 12:34:59 pm »
Quote
I can't blit a bunch of aligned images, I need to transform and blit separately each pixel of them
And precisely, for generating each pixel of the large image (pixels which you will, indeed, later transform and draw separately), you could use tilemap definitions + tile images ;)

Yeah I know that, but now that I think of it, using tiles is slower than parsing a whole map, because in addition of the initial operations that applies to a large map you'll have to find, load and apply calculations to pixels of different tiles (things that you don't have to do with a single image). Of course it saves size, but make the program slower. I think I'm better with a single image per map (that doesn't mean I can't change my mind tho, if I optimize my program to go fast enough maybe I'll have both speed and lightness).
Can't you store maps as tilemaps, then, at the beginning of the game, draw the wjole map to a certain buffer and you'll only have to deal with one big image ?
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: [C] F-Zero : trackSpire
« Reply #31 on: January 08, 2013, 12:40:41 pm »
That's indeed exactly what I'm suggesting :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [C] F-Zero : trackSpire
« Reply #32 on: January 08, 2013, 12:53:25 pm »
Not that I can't do that, but I also want users to be able to create, load and play with their own maps, so hard-coding maps isn't a solution. But for the draw-to-a-buffer thing, I could do that but that takes even more space than a single image map (tilemap + tiles + buffer, instead of only map).

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: [C] F-Zero : trackSpire
« Reply #33 on: January 08, 2013, 01:01:12 pm »
Quote
I also want users to be able to create, load and play with their own maps, so hard-coding maps isn't a solution.
Hard-coded, but editable, maps in external files ?

Quote
But for the draw-to-a-buffer thing, I could do that but that takes even more space than a single image map (tilemap + tiles + buffer, instead of only map).
Yup, it temporarily raises the peak RAM consumption, so as to permanently reduce the storage consumption.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline lkj

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +58/-1
    • View Profile
Re: [C] F-Zero : trackSpire
« Reply #34 on: January 08, 2013, 01:41:44 pm »
Quote
Quote
But for the draw-to-a-buffer thing, I could do that but that takes even more space than a single image map (tilemap + tiles + buffer, instead of only map).
Yup, it temporarily raises the peak RAM consumption, so as to permanently reduce the storage consumption.
And the little bit more RAM consumption shouldn't be a big issue, having less storage space for files/other games is much worse.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: [C] F-Zero : trackSpire
« Reply #35 on: January 08, 2013, 07:02:20 pm »
Not that I can't do that, but I also want users to be able to create, load and play with their own maps, so hard-coding maps isn't a solution. But for the draw-to-a-buffer thing, I could do that but that takes even more space than a single image map (tilemap + tiles + buffer, instead of only map).
Are you concerned about file size or RAM usage? The buffer could be dynamically allocated if the former.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [C] F-Zero : trackSpire
« Reply #36 on: January 09, 2013, 03:16:51 am »
If you go for images and re-use F-Zero maps, was the color you talked about for collision detection the black surrounding roads? Because if it's the case, then you might want to change it from a different black tone than the one in the circle tiles along the road, so no collision detection weirdness such as getting stuck inside those balls occur.

Offline Alex

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +3/-0
    • View Profile
Re: [C] F-Zero : trackSpire
« Reply #37 on: January 09, 2013, 07:01:12 am »
Good job matref ;-)

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [C] F-Zero : trackSpire
« Reply #38 on: January 09, 2013, 12:20:14 pm »
In fact I'll go with tilemaps. The whole image can't even be entirely loaded, it's 800K in gif format but 42MB in raw format D:

So I'll recode the display engine. Updates coming soon ;)

Offline Augs

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 306
  • Rating: +30/-29
    • View Profile
Re: [C] F-Zero : trackSpire
« Reply #39 on: January 09, 2013, 03:05:19 pm »
Is tile mapping when you have an array and you draw textures according to the array?
« Last Edit: January 09, 2013, 03:05:26 pm by Augs »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [C] F-Zero : trackSpire
« Reply #40 on: January 09, 2013, 03:12:22 pm »
In fact I'll go with tilemaps. The whole image can't even be entirely loaded, it's 800K in gif format but 42MB in raw format D:

So I'll recode the display engine. Updates coming soon ;)
That sucks, but yeah if you can go with tilemaps hopefully this should make things easier memory-wise in the end (and possibly allow a non-CX version). The only other solution is to only load needed parts of the image at a time but that would be decompressing every frame, which might be slow.

Is tile mapping when you have an array and you draw textures according to the array?
Yep, you have numbers in an array and each number corresponds to a specific tile. Generally the good way to do it is to group all wall tiles together and the floor tiles together, with the event tiles in the middle.

Offline Augs

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 306
  • Rating: +30/-29
    • View Profile
Re: [C] F-Zero : trackSpire
« Reply #41 on: January 09, 2013, 04:39:10 pm »
Having tiles that are "hit tiles" would mean that every turn would have to be blocky. Unless tiles are very small.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [C] F-Zero : trackSpire
« Reply #42 on: January 09, 2013, 04:43:20 pm »
It depends. I doubt SNES collision detection was even this complex. If a tile is half floor and half wall (eg if the wall is left of the tile) it is probably treated as a floor tile on the SNES. Othwerwise they most likely use pixel-test detection, since road edges are black and black isn't used anywhere else in F-Zero maps.
« Last Edit: January 09, 2013, 04:50:06 pm by DJ_O »

Offline Augs

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 306
  • Rating: +30/-29
    • View Profile
Re: [C] F-Zero : trackSpire
« Reply #43 on: January 09, 2013, 04:59:41 pm »
If a half floor/half wall tile were treated like a floor tile then it would mean that half of the tile is treated incorrectly.

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: [C] F-Zero : trackSpire
« Reply #44 on: January 09, 2013, 05:01:32 pm »
If a half floor/half wall tile were treated like a floor tile then it would mean that half of the tile is treated incorrectly.
Wow, that is one clever remark..
The SNES was not a computing wonder, it is normal that things were as minimized as possible, it's that way, or none at all