Author Topic: The Massacre  (Read 19400 times)

0 Members and 1 Guest are viewing this topic.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
The Massacre
« Reply #90 on: May 25, 2007, 04:39:00 pm »
As I stated it was commented for a n00b. Obviously I do not really comment like this alright ;)wink.gif . Secondly maybe you should do a trace of the routine and that will provide you with a good understanding, Thrid off the routine needs no debugging it works, Fourthly I need to talk to you about an effcient way to search for tiles and... so on, but I would rather talk to you in realtime because it is a little more than a little explanation. So you have any realtime contacts at the moment??
There are 10 types of people in this world-- those that can read binary, and those that can't.

Liazon

  • Guest
The Massacre
« Reply #91 on: May 26, 2007, 03:28:00 am »
QuoteBegin-Fallen Ghost+25 May, 2007, 20:58-->
QUOTE (Fallen Ghost @ 25 May, 2007, 20:58)
I've been on a bit of a break because of school recently, but I'll test it like it is now. (or I'll try).

Destructible tileset buffer means you need to ldir all your tileset from it's originial location or just a buffer equal in size?

Great, I'm a noob using tilemappers so I need a little course of how to use it. Then I'll debug.

1)what is the format for the tilemap? (not the tileset, I talk about the thing that represents each tile on the map) Is it 1 byte/tile? (I guess so, but just to be sure)

2)hell, what a brick to read. I love comments, but less would not be a big matter. I know it's better with complete sentences and all, but we aren't stupid neither. Oh and please, next time you show up code, do us a favour and separate your code of comments with at least 5-10 spaces (horizontally) so that semicolon isn't the next char after the instruction.

And it would be fun to differentiate routines of code continuations (like a big header of "now my code is multiplying, no more bit shifting, just additions" would be replaced by "[instruction].....;multiplications here")

But those are no debug logs, so I'll run up and check it out now.

[looking at code]
3)messing up tiles and finding rotations? what? kk, save tiles and change bit positions according to X.

4)from what i've seen, tilesbuf2 is the buffer where the byte+inverted mask is, so that you know where you can write and where you cannot for the other rotated+clipped tilesprites can be applied. But how come 2 tiles would overlap in any way?

IIRC, it's kinda been awhile sorry.

0.)
i'm pretty sure (tilesaddress) can be in ROM, but you need buffers of equal size in RAM somewhere.  I'm pretty sure iirc that the routine just reads the tiles from their source and saves the modifications in the buffers.

1.)
ya, 1 byte per entry, so 256 tiles max.  117 or less is the most efficient.  Anything above will seriously lose to a planeshifting tilemapper iirc.  Still, I can't imagine needing so many black and white tiles since you could always  change the tileset address that the routine reads from.

2.)
well, I do admit I wish that forum code boxes had syntax highlighting, but  


http://www.revsoft.org/phpBB2/viewtopic.php?t=644&start=0  

3+4.)
The concept behind this tilemapping technique is based on around the idea that an unaligned sprite will ALWAYS take up 2 bytes (if it's aligned for a moment, you can still say the second byte is %00000000).  If you look at ionputsprite, you notice that it too must split the sprite into it's two parts through rotations before it can write to the buffer.

Jim e just applied that to the tilemapper by pre-shifting EVERY TILE into it's two parts and saving one part in one buffer, and the other part in another buffer.  When it comes time to write, all you need to do is take the second part of the first tile and XOR/OR it with the first part of the tile next to it.  It's like putting unaligned sprites next to each right next to each other.  They both must share bits in the same bytes, the ones in the middle.

Hope that helps.

I'm pretty sure the only way to really use this in an app right now is to copy into reserved $9d95 space.

Fallen Ghost

  • Guest
The Massacre
« Reply #92 on: May 26, 2007, 04:06:00 am »
routine (or what I understand of it):

1)rotate all tiles from tileset into buf1 and buf2 (named after their according byte from sprite
2)fetch what tiles are used and what height/width of them is taken to fetch good bytes
3)bitwise OR with two tile parts into acc
4)out to LCD data port

I just copied the code in ZDS and everything looks way better with colours

Wasn't it supposed to be an app-friendly tilemapper using no SMC?

I'm very loaded up with school but just give me a time and I'll probably be there. Like tonight 6-10 GMT-5?

[Edit]there are 2^64 possibilties for a 8*8 tile so I guess you can have alot and alot of them

a tilemap of 16*16. isn't that a bit small for a complete map?  

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
The Massacre
« Reply #93 on: May 26, 2007, 04:50:00 pm »
16x16. That is not the max tiles the tilemap can be???

Don't you guys read my posts at all?? I think I remember clearly stating I am posting a commented out source so that other people can understand it faster and mod it.
There are 10 types of people in this world-- those that can read binary, and those that can't.

Fallen Ghost

  • Guest
The Massacre
« Reply #94 on: May 27, 2007, 01:52:00 am »
I know tilemaps are really bigger than that but you seemed to say it was the max size.

Liazon

  • Guest
The Massacre
« Reply #95 on: May 27, 2007, 03:08:00 am »
no i mean't since the map is an array of 1 byte entries, you can only have a tileset of 256 tiles in Jim's mapper.

the idea is that a 64x96 pixel screen can only show 8x12 8x8px tiles, which is 96 tiles on the screen.  Now most of the time, tiles get reused in order to create graphical structures like roads, trees, building, etc.  If they are going to reappear multiple times, there is no point in rotating the same tile every time it appears.  you might as well rotate them once and simply copy the prerotated data into where it goes.

This works the best when you have less tiles in your world (ie, Digitan's Robot Wars actually only uses 32 tiles max in each level)  When you have less tiles than 96, the chance that you reuse the tile is higher.  If you have to reuse tiles, then messuptiles is more efficient than ionputspriting in a loop, and probably more efficient than planeshifting.

I thought 96 was ideal, but for some reason Jim documents 117 or less as the most efficient, but that's probably using a direct comparison of t-state usage between all the other methods and Dwedit's original messuptiles mapper.

I know StarCalc will probably use a lot of tiles, so maybe messuptiles isn't ideal for what you need FallenGhost.  I don't know.  Like I said, this just one of the methods of tilemapping I've seen.

Fallen Ghost

  • Guest
The Massacre
« Reply #96 on: May 27, 2007, 12:01:00 pm »
Thanks alot for enlightening the subject.

Uh, as the maps are 128*128 (16*12 pixels), I don't plan to add mapping so much because it will take too much space.

I rush like hell to add vital functions such as attack move (come on, that's essential) without lag.

The thing that takes the most time for now is the map exploration, so maybe that'll be the thing that goes off... sadly (let's say 200 times putspriteclip (sigma's) is long to do)

but if I remove map exploration, maybe I might be able to add a tilemapper with the space saved. I'll probably use something like 32 tiles too.

Liazon

  • Guest
The Massacre
« Reply #97 on: May 27, 2007, 03:19:00 pm »
Well the reason why Digitan only uses 32 is because he uses tmap20 by CrashMan, which is an uber optimized version of Jim and Dwedit's messuptiles mapper.

It's so uber optimized that you can only use 32 tiles at most, you have to use buffers that start on an address like this: $XY00 where  X and Y are digits.  Most importantly, the buffer is vertically aligned.  That means adjacent bytes in memory represent vertically adjacent groups of 8 pixels on the screen.  In other words, very difficult to use, but extremely fast, which really gives digitan a lot of clocks to work on physics based stuff.

It sounds like you've got a plan though.  

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
The Massacre
« Reply #98 on: May 27, 2007, 05:28:00 pm »
Yeah that is the part I hate about Crashman's routine is that it is column major not row major.
There are 10 types of people in this world-- those that can read binary, and those that can't.

Fallen Ghost

  • Guest
The Massacre
« Reply #99 on: May 28, 2007, 02:35:00 pm »
I didn't know of th downfalls of it but sure knew it went very very fast for a small 32 tiles (in case just change the set between maps).

I have to use buffers that use strange addresses, ok, well, I guess that's not much of a problem, just do all your bcalls, then transfer some of TI's code in ram to other useless spaces (like some unused rampant asm spaces), then re-transfer them back before bcalling again.

And if I understand, X and Y are flipped up. Ok, fits alot better with LCD port. Why not? Now you just got to figure out some things like drawing characters and stuff over it before it draws, but it's now much more easy! Whatever I'll find it out when I'll use it.

Now back to subject Halifax, what did you need to iron out with me for the code? (can be via pm)  

Offline bfr

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 819
  • Rating: +4/-0
    • View Profile
    • bfr's website
The Massacre
« Reply #100 on: June 02, 2007, 08:52:00 am »
Does anybody have a link to Crashman's tile-mapping routine for the TI-83+/TI-84+?  I found http://62.65.69.4/archives/files/fileinfo/178/17880.html, but it is for the TI-82.  Would it work on the TI-83+/TI-84+ too?

Relating to the Massacre...wasn't it originally in BASIC+xLIB?  Will the BASIC+xLIB version ever be finished?

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
The Massacre
« Reply #101 on: June 02, 2007, 11:39:00 am »
Crashman's routine was made for TI-82 yes. It won't work on 83 or 84 because it needs a little modification(shouldn't be hard).

Yes it was originally BASIC+xLIB. Simply put...H*** no. There would be no point in finishing it since XBASIC can not match up to ASM when it comes to action games.

Anyways there are no updates for the Massacre because I have been busy with finals which SUCK. Some good news is that I tested out(I won't have to take it next year) Computer Concepts 2, and Advanced Programming Techniques since they were both about C++ programming. So I have to take this philosophical type of computer course next year about optimization and how to figure out optimizations on high-level by the low-level x86  assembly. After that in my junior year it is on to my college computer courses!!!!!! :)smile.gif
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline bfr

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 819
  • Rating: +4/-0
    • View Profile
    • bfr's website
The Massacre
« Reply #102 on: June 02, 2007, 12:58:00 pm »
Cool.  I'm kind of mad that my parents (mostly my mom) set up my schedule (they kind of forced me to choose certain courses) so that I wouldn't be able to take ANY programming courses in high school.  :(sad.gif  I hope I don't fall behind in computer programming....  I might be able to take an online course, though....

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
The Massacre
« Reply #103 on: June 02, 2007, 02:13:00 pm »
Hmmm that's not good. Have you told them that you can get full-paid scholarship for computer programming. That's what I told my parents and now they want me to go on with it. That's why they want me to get into those college courses. I have no problem with that ;)wink.gif lol.
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
The Massacre
« Reply #104 on: June 07, 2007, 03:10:00 pm »
After a quick hack of about 10 minutes I made support for animation in the tilemapper. It is variable animation which means you can have 1 frame for some tiles and 2-infinity frames for animated tiles. I show this in the screenshot by making a black and white tile for the one area and keeping the brick sprite for the other. So there is only one animated tile in this screenshot. I will later add support for multiple frame animations so you can have 2 frame, and 5 frame, and w/e all in one tilemap.

As I said this was a quick hack so I will optimize it and implement the stuff above before releasing the source code.(And embarassing myself with it lol).

Well for your non viewing pleasure :(sad.gif , because PTI grayscale screenshot taking sucks.

user posted image
There are 10 types of people in this world-- those that can read binary, and those that can't.