Author Topic: OmniRPG - Coding  (Read 66734 times)

0 Members and 2 Guests are viewing this topic.

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: OmniRPG - Coding
« Reply #150 on: December 15, 2012, 03:18:03 pm »
Ah, ok. Makes sense. :)

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: OmniRPG - Coding
« Reply #151 on: December 15, 2012, 07:35:12 pm »
I was doing laundry again today, so I brought my calculator and wrote a routine for animated tilemaps (variable speed animating), that uses masked sprites. Since I didn't want to write out a custom LCD updating routine, I ended up using a bcall (EF6A48, whatever it is actually called). I also am using an OS getkey routine (EF4447) and both are slowing it down quite a bit XD Basically, when I get around to cleaning it up with better, faster routines, this will be quite a bit faster o.o As it is, on an actual calc it handles grayscale very nicely (I used an animation scheme of two properly dithered tiles). Here is a screeny, showing the masked nature of the tiles, as well as the variable speed of the animations :D

I figured I would share since this topic is what inspired it :) If I find the courage to convert this to a scrolling tilemap, (and if we go with using an app for some codes like this), I'll be sure to update y'all :)

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: OmniRPG - Coding
« Reply #152 on: December 15, 2012, 07:38:07 pm »
Wow, variable speeds. I was thinking about this earlier today. Very nice! :D If speed becomes an issue the variable animation speed can probably be dropped though.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: OmniRPG - Coding
« Reply #153 on: December 15, 2012, 07:58:28 pm »
That version in the screenie updates the LCD every single frame, even if nothing has changed. The grayscale tiles update every frame, the ones in the middle-ish of the map update every 5 frames and the ones on the outer edge update once every 16 frames. I'm pretty sure speed won't be an issue, and even if I add the variable speed to the Axe version, it will only add a thousand cycles or less (still keeping it >60FPS). I am still trying to figure out a more clever and efficient method for this, though. It will be particularly difficult to smooth scroll the map with masking and a player sprite on it x.x

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: OmniRPG - Coding
« Reply #154 on: December 15, 2012, 07:59:51 pm »
Wow that's really nice :D yeah i think there are some other things that are gonna slow it down... Such as all code , sprite... Movement... AI... Like everything that yet has to be implemented in the map routines
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: OmniRPG - Coding
« Reply #155 on: December 15, 2012, 08:03:45 pm »
Yeah, my hope is that we can come up with pretty efficient algorithms that will only slow things down a little. My guess is that at this rate, the most major slowdowns will cause the animation to slow to about 40FPS with a bunch of activity on the screen.

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: OmniRPG - Coding
« Reply #156 on: December 15, 2012, 08:10:04 pm »
Yeah but i think we will be able to handle it... I think movement and collision will cause the biggest slowdown, and scrolling as well, but i think you guys could handle that :p cause even with my unoptimised routines i can get a smooth fast scrool-move-collision (b/w no anim)
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: OmniRPG - Coding
« Reply #157 on: December 15, 2012, 09:12:30 pm »
That version in the screenie updates the LCD every single frame, even if nothing has changed. The grayscale tiles update every frame, the ones in the middle-ish of the map update every 5 frames and the ones on the outer edge update once every 16 frames. I'm pretty sure speed won't be an issue, and even if I add the variable speed to the Axe version, it will only add a thousand cycles or less (still keeping it >60FPS). I am still trying to figure out a more clever and efficient method for this, though. It will be particularly difficult to smooth scroll the map with masking and a player sprite on it x.x
I forgot that grayscale would be updating every frame regardless...  x.x wasn't thinking lol. Even if it slows down to 40, that's still fine. A lot of games slow down when a lot of things are being updated on screen.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: OmniRPG - Coding
« Reply #158 on: December 21, 2012, 07:29:17 pm »
Phoenix only runs at 30 FPS, and everybody oohs and ahhs about how smooth it is. :P

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: OmniRPG - Coding
« Reply #159 on: February 16, 2013, 02:25:32 pm »
I modified the source to the animated, masked tilemap routine and it is now 43 bytes larger. I am not sure how much faster this is, but WabbitEmu says it is about 150% faster. Basically, instead of using bcall(4744h), I used direct key testing which cost an extra two bytes but is much faster, and instead of using bcall(_GrBufCpy) (EF6A48), I used a custom LCD updating routine which I believe should be pretty fast and I can make it even faster since it is inline code.

Anyways, see below for what it currently looks like (I took about a 1 second screenshot, so it is on a loop). Now if I can get it to handle scrolling, that would be awesome, but I am pretty sure I will have a difficult time with that. I might be able to get a movable sprite on there, though. Also, the grayscale looks better on an actual calculator.

AMASK is for the most part hexadecimal with some labels (it is meant to be compiled with prgmASMCOMP) and prgmMASKEDTM is the assembly program.

EDIT: I rewrote the program to draw the tilemap while updating the LCD and doubled the speed to about 73 FPS according to WabbitEmu. It is also 27 bytes smaller :) At some point I should make actual tiles for this.

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: OmniRPG - Coding
« Reply #160 on: February 17, 2013, 08:20:57 am »
Awesome stuff Xeda. :D

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: OmniRPG - Coding
« Reply #161 on: February 17, 2013, 10:33:57 am »
I have some sprite movement started :) I don't have actual player sprites, so I just used an 8x8 sprite. I am working on making the data for some sample 16x16 sprites, but once I actually have the data in there, it won't be difficult to add in 16x16 player sprite movements.


EDIT: Also, I need to come up with a less distracting animation XD

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: OmniRPG - Coding
« Reply #162 on: February 17, 2013, 12:08:27 pm »
But that doesn't support scrolling? I don't think you'll have any trouble adding in scrolling, but it might take a big speed hit. I don't think you have to worry so much about speed for this project, though. I also don't understand why you're using masked sprites, especially for 8x8 sprites, having more than one layer isn't going to give you that much more detail unless you want things like bridges and even then i like having larger sprites (16x16) to fit more detail in.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: OmniRPG - Coding
« Reply #163 on: February 17, 2013, 03:08:39 pm »
Yeah, it doesn't support scrolling yet. For all of the things I am thinking about adding, it will probably have its speed cut in half. I think the easiest way to have the sprite display and the LCD updating interleaved will be to have 8x8 tiles, but we can use those to form 16x16 tiles. I am working toward creating a movement engine that features pixel based collision with bottom layer of sprites (the mask) and there will be a buffer holding damage zones for when enemies are on the screen, or anything that can cause damage. So for those, I will need two 768-byte buffers  (plotSScreen and saveSScreen) and then AppBackUpScreen can hold all sorts of special info about where monsters are, open menus, and all that good stuff. I am planning to insert a 14*64 byte buffer using bcall(_InsertMem) at the end of the program to work as a buffer for the screen instead of using plotSScreen and this should really help with scrolling.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: OmniRPG - Coding
« Reply #164 on: February 17, 2013, 03:31:34 pm »
Buff(14*64) in Axe should be enough for the buffer you said.