Author Topic: OmniRPG - Coding  (Read 66068 times)

0 Members and 3 Guests are viewing this topic.

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 #75 on: December 09, 2012, 04:05:01 pm »
For the code you're right (I didn't optimize though), but there are little squares that are going from the shooter to the shooted.

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: OmniRPG - Coding
« Reply #76 on: December 09, 2012, 04:19:13 pm »
can you maybe scale it down a bit?

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

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: OmniRPG - Coding
« Reply #77 on: December 09, 2012, 04:37:20 pm »
matrefeytontias: i know that the direction is indicated; what i meant was that the animation is the only thing that can be displayed on the screen at once because it uses screen shift commands, so it wouldn't work for being overlayed on a battle scene.

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 #78 on: December 09, 2012, 07:46:48 pm »
Holy crap that engine looks amazing. With graphics like that I don't mind monochrome at all ;D

I don't see why we should include sound if we're worrying about people having a shell or not......:P

@Shmibs, so the laser attack would shake the screen too...I don't see a downside....
« Last Edit: December 09, 2012, 07:47:36 pm by willrandship »

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: OmniRPG - Coding
« Reply #79 on: December 09, 2012, 08:55:27 pm »
Will this project require animated tiles?
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


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 #80 on: December 09, 2012, 09:09:40 pm »
I was working on a separate engine to handle animated sprites :D Also, if I have it so that it smoothscrolls 8 pixels at a time, I can get rid of the difficult parts of the tilemap engine. (Basically, if you move left, it will scroll in 8 times, kind of like how Pokémon does it).

@tr1p1ea: For the animated tiles, I was thinking of having a format like this:
Code: [Select]
Tileset:
;     .db Evolvesto   ;This is the tile it turns into on the next frame
;     .db TileInfo    ;a bit here will indicate that the tile needs to be updated this frame. I am sure other info
;     .dw ;TilePointer  ;This points to the sprite data
will be needed.
Then, a copy of the current map (I called it MapShadow), will be scanned every time through the loop. Each byte will point to a tile in the tileset, the byte will be replaced by the byte it evolves into (I'm thinking in terms of cellular automata) and if a specific bit is set in the TileInfo field, the LCD will be updated using the data and TilePointer.

This will make it very easy to have tiles animated at different speeds, without keeping a timer for each tile. It will also allow for arbitrary speeds, like some tiles could move every frame and others could move every 3 or 5 frames. It will also mean that you can keep a low number of base tiles for the actual map data (like 16, for nibble packing), but still use 256 tiles in all (or more).

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 #81 on: December 10, 2012, 02:25:49 am »
That actually sounds pretty cool. So, if you're walking in one direction it would stay continuous, but you would have to wait for it to finish scrolling to turn around?

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 #82 on: December 10, 2012, 07:22:51 am »
Precisely, and if we went that route, coding would be much easier, with a lot less error checking. I found out my first final doesn't start until tomorrow, so I will try to get to writing up a better engine :3

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: OmniRPG - Coding
« Reply #83 on: December 10, 2012, 08:06:33 am »
+ collision detection is way easier and smaller... :D

So I think the movement will be like this? ok lol :p

And then all walkable tiles before non-walkable this and collision detection is based on if the number-of-map-tile your standing on, is smaller then the number-of-first-non-walkable tile...?

And i sugest tiles as following: sand, dirt, stone, grass, and some other .. all to walk on, and some fences as non walk-able and some other...
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 #84 on: December 10, 2012, 08:18:52 am »
+ collision detection is way easier and smaller... :D

So I think the movement will be like this? ok lol :p

And then all walkable tiles before non-walkable this and collision detection is based on if the number-of-map-tile your standing on, is smaller then the number-of-first-non-walkable tile...?

And i sugest tiles as following: sand, dirt, stone, grass, and some other .. all to walk on, and some fences as non walk-able and some other...
Yes, this is definitely the next important thing that will need to be figured out after the map engine is made. In my experience, it is always easiest to have walkable tiles as the first tiles in the set.

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: OmniRPG - Coding
« Reply #85 on: December 10, 2012, 08:21:55 am »
well yeah that's what i mean :p so if you for example have 5walkable tiles, they are, 0,1,2,3,4  so you say if {tile-to-move-to} < 5
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 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 #86 on: December 10, 2012, 08:37:20 am »
I coded a very simple (and a bit optimised) smooth-scrolling engine (after all, I'm at school, thanks to Wabbitemu :P ). It's only 963 bytes, so I thank that we should compare our techniques.



Here's the code :

Code: [Select]
:.AXESMTH
:[3C4281818181423C→Pic1TILE
:[3C7EFFFFFFFF7E3C
:[0000000000000000
:
:Buff(384)→GDB1MAP           // this does take a lot of the 963b of the prgm
:0→H→V→S-1
:For(384)
:+1→r1
:rand^3→{r1+GDB1MAP
:r1
:End
:
:While 1
:‾1
:For(10)
:+1→r2
:‾1
:For(14)
:Pt-On(+1→r1-1*8-(H and 7),r2-1*8-(V and 7),{VAsm(CB2DCB2DCB2D)+r2*8*3+r1+(HAsm(CB2DCB2DCB2D))+GDB1MAP}*8+Pic1TILE
:r1
:End
:r2
:End
:
:DispGraphClrDraw
:getKey(1)-getKey(4)*2+VAsm(E5)≥≥0?Asm(E1)→V,Asm(E1)                                  \  I move 2 pixels
:getKey(3)-getKey(2)*2+HAsm(E5)≥≥0?Asm(E1)→H,Asm(E1)                                  /    by 2 pixels
:EndIf getKey(15)

Fun fact : I used #ExprOff to optimise this program for size, and the size remained the same ;D
« Last Edit: December 10, 2012, 08:41:06 am by Matrefeytontias »

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 #87 on: December 10, 2012, 08:45:19 am »
Wow, that is awesome o.o

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: OmniRPG - Coding
« Reply #88 on: December 10, 2012, 08:52:44 am »
Yes it is :o ashame i don't get it xD
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 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 #89 on: December 10, 2012, 09:33:25 am »
I forgot to say : it runs at 6Mhz :)

I calculated on IRC that the real engine's code, I mean without datas and without the map filling code, is only 465 bytes :o
« Last Edit: December 10, 2012, 09:36:17 am by Matrefeytontias »