Author Topic: [AXE LIB] YAAM - Yet Another Axe Mapper  (Read 10972 times)

0 Members and 1 Guest are viewing this topic.

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
[AXE LIB] YAAM - Yet Another Axe Mapper
« on: February 24, 2012, 01:16:34 am »
I've been planning this project for a long time, and with the recent release of Axe 1.1.2, I can finally begin to make it a reality!

YAAM

YAAM? How is a vegetable going to help me develop Axe projects?
   YAAM is no vegetable! It stands for Yet Another Axe Mapper, my friend! It is an Axe library designed to make smoothscrolling tilemapping in Axe both fast and easy by providing all the necessary routines for you in an easy to use manner! Instead of having to write your own tilemapping engine to your custom specifications, select the options you want from the built-in variety of options in YAAM and your tilemapper is done! (This will be more true in later versions as I add more features)

But drawing a whole unaligned tilemap every frame is slow! I don't want my game to be slow!
   Au contraire, YAAM makes scrolling tilemaps very quick by shifting the previous frame's tilemap and redrawing only the tiles shifted in, which is quite fast. If the tilemap doesn't shift between frames, you don't need to redraw it at all!

That sounds cool! What other cool features does it have?
   Here, let me draw you up a quick list:
  • Very fast tilemap shifting
  • Handles all drawing and shifting through a few easy to use routines
  • Works with any tile size up to 8x8
  • Works with any map width and height

But I want this feature! And fix this bug!
   For any feature requests and bug reports, just post them in this thread. However, I am already planning many features for the future, so your feature request may actually already be on my to-do list:
Spoiler For To-Do List:
  • Allow many variables, like pointers and map size, to be defined as constants instead
  • Allow tile sizes larger than 8x8
  • Add support for grayscale
  • Implement optimized multi-pixel shifting
  • Add support for inflated coordinates (256 = 1 tile, instead of 1 = 1 pixel)
  • Add support for archived tiles and tilemaps
  • Add support for nibble or bit tilemaps
  • Implement packed tile reading (e.g. 4x4 = 2 bytes, grayscale 5x5 = 7 bytes)
  • Optimize all the code!

Awesome! Where do I get it? How do I use it?
   Easy there, one question at a time! The latest version of YAAM (v0.2) can be found attached to this post. It requires Axe 1.1.2. Download the zip file, send YAAM.8xp to your calculator, include it anywhere in your program, and you're good to go!

Full usage details can be found in the included readme. No they can't, because I haven't written one yet. However, I have included a sample program using YAAM that should detail the basics of using it. You can also learn more about YAAM's options and variables by looking at the options section in the library itself, which has small comments to generally explain what everything is. To set constants like tile width and height to your own values, redefine these values before including YAAM. To set everything else like tilemap size and pointers, store values to the variables listed after including YAAM.


More features will be coming soon!
« Last Edit: February 24, 2012, 01:41:45 am by Runer112 »

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: [AXE LIB] YAAM - Yet Another Axe Mapper
« Reply #1 on: February 24, 2012, 03:46:07 am »
Looks nice, so you plan to implement grayscale?
Also nice pokemap ;D
I'm not a nerd but I pretend:

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: [AXE LIB] YAAM - Yet Another Axe Mapper
« Reply #2 on: February 24, 2012, 04:50:18 am »
Looks nice! Keep it going! :)

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
Re: [AXE LIB] YAAM - Yet Another Axe Mapper
« Reply #3 on: February 24, 2012, 07:19:24 am »
That's look awesome, I like those optimization ! :D

Just a question, what are apperr1 and apperr2 usually ?
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [AXE LIB] YAAM - Yet Another Axe Mapper
« Reply #4 on: February 24, 2012, 12:00:58 pm »
Looks nice, so you plan to implement grayscale?
Also nice pokemap ;D

Grayscale is right at the top of my to-do list. :)

Looks nice! Keep it going! :)

Will do!

That's look awesome, I like those optimization ! :D

Just a question, what are apperr1 and apperr2 usually ?

appErr1 and appErr2 form a 26-byte section of RAM that you can use as scrap RAM in your programs, because very few things will write to them. As the name suggests, really the only thing that writes to this area are errors, but if an error message occurs, you don't need to worry about your program's data being destroyed because your program will have already quit. 26 bytes was about the perfect size for the amount of data I needed to store, so I chose this as the default RAM area to be used.

But, just like everything else in this project, I've planned to make everything customizable. If you want to change the RAM area used for some reason, you can by defining °MR to be something else before including YAAM.

Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
Re: [AXE LIB] YAAM - Yet Another Axe Mapper
« Reply #5 on: February 24, 2012, 12:28:29 pm »
Yeap, I noticed it, your code is beautiful, that's a kind of art. :D
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

Offline turiqwalrus

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 840
  • Rating: +51/-2
  • Wheeeeeee~!
    • View Profile
Re: [AXE LIB] YAAM - Yet Another Axe Mapper
« Reply #6 on: February 24, 2012, 12:35:10 pm »
Yeap, I noticed it, your code is beautiful, that's a kind of art. :D
beautiful and illegible :P
I guess that runer just knows every free ram area...

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: [AXE LIB] YAAM - Yet Another Axe Mapper
« Reply #7 on: February 24, 2012, 01:48:31 pm »
Idea: Add Animated tilemaps (like water in your map)

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [AXE LIB] YAAM - Yet Another Axe Mapper
« Reply #8 on: February 24, 2012, 01:52:40 pm »
I'm not sure if I'll add animated tile support. The idea behind my drawing method, and what makes it fast, is only drawing tiles as they are shifted in. Having to redraw only a few animated tiles per frame might work. But if a large portion of the visible area was composed of animated tiles, my method would actually start to become slower than just redrawing the entire tilemap every frame.
« Last Edit: February 24, 2012, 01:54:46 pm by Runer112 »

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: [AXE LIB] YAAM - Yet Another Axe Mapper
« Reply #9 on: February 24, 2012, 01:53:00 pm »
Unfortunately that's one of the downsides of this methods - since it shifts in tiles, it can't redraw the others.

Edit: ninja'd :(
« Last Edit: February 24, 2012, 01:53:53 pm by leafy »
In-progress: Graviter (...)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: [AXE LIB] YAAM - Yet Another Axe Mapper
« Reply #10 on: February 24, 2012, 01:54:46 pm »
Idea: Add Animated tilemaps (like water in your map)

The whole concept of Runers tilemapper is that it doesn't have to redraw the entire screen every frame, and doesn't even do anything if the screen isn't moving.  If you had animated tiles, you might as well just use a regular tilemapper and redraw the entire screen each frame. 

EDIT" Double Ninja'd D:

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: [AXE LIB] YAAM - Yet Another Axe Mapper
« Reply #11 on: February 24, 2012, 01:56:54 pm »
Lol, anyways animated tiles arent really needed so bad if you have grayscale.
EDIT:
Also, is there some routine to get a certain x,y tile from the map? Havent tried it out yet
« Last Edit: February 24, 2012, 02:01:39 pm by aeTIos »
I'm not a nerd but I pretend:

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: [AXE LIB] YAAM - Yet Another Axe Mapper
« Reply #12 on: February 24, 2012, 02:19:39 pm »
This is nice runer112. Hopefully this should make things much easier for people.

Does your tilemapper supports shifting more than one pixel in one frame? I mean like in Super Sonic Ball, for example, where you could scroll by 4 pixels at once and it even supported variable scrolling rates, as required by the game physics.
« Last Edit: February 24, 2012, 02:20:27 pm by DJ_O »

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [AXE LIB] YAAM - Yet Another Axe Mapper
« Reply #13 on: February 24, 2012, 02:25:08 pm »
This is nice runer112. Hopefully this should make things much easier for people.

Does your tilemapper supports shifting more than one pixel in one frame? I mean like in Super Sonic Ball, for example, where you could scroll by 4 pixels at once.

Not yet. But it will. :) However, it's worth noting that, although vertical shifting by Y pixels will be just about as fast as shifting by 1 pixel, horizontal shifting by X pixels will not. I estimate that it will only be somewhere from 5-25% faster than calling the 1-pixel shift in a loop.

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: [AXE LIB] YAAM - Yet Another Axe Mapper
« Reply #14 on: February 24, 2012, 02:32:53 pm »
Yeah that's what I thought.

Also does your tilemapper regulate speed for vertical movement when it's aligned horizontally? In some games I noticed that it runs much faster when the map is aligned than when it's not. I know it's due to aligned sprites taking less time to draw, but it kinda looks weird in some games.