This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Your Projects subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Project Ideas/Start New Projects => Your Projects
Author Message
asdf


Advanced Newbie


Joined: 17 Aug 2008
Posts: 73

Posted: 21 Sep 2008 10:49:32 am    Post subject:

Also, for testing out your tilemap i would recommend setting up a map like this one which i used to test a 16x16 tilemap:

Code:
mapData:
.db 11,11

.db 1,1,1,1,1,1,1,1,1,1,1
.db 1,0,0,0,0,0,0,0,0,0,1
.db 1,0,2,0,0,0,0,0,0,0,1
.db 1,0,0,0,0,0,0,0,0,0,1
.db 1,0,0,0,0,0,0,0,0,0,1
.db 1,0,0,0,2,0,0,0,0,0,1
.db 1,0,0,0,0,0,0,0,0,0,1
.db 1,0,0,0,0,0,2,0,0,0,1
.db 1,0,0,0,0,0,0,0,0,0,1
.db 1,0,0,0,0,0,0,0,0,0,1
.db 1,1,1,1,1,1,1,1,1,1,1

Then draw some simple tiles (don't worry about drawing the tiles you will use in the final game right now) and set tiles 1 and 2 to be non-passable tiles to test your collision detection. Later, you can use tile 2 to test your routine to handle interactive tiles, maybe displaying some text if the user runs into it or presses 2nd while facing it. If your tiles are 8x8, you may want to make the map a little larger so that you have more space to test the scrolling.
Back to top
TylerMcL


Member


Joined: 28 May 2008
Posts: 148

Posted: 30 Sep 2008 10:15:50 pm    Post subject:

So I had to do a short paper for Creative Writing and I figured I'd just make it about my game so I could get some inspiration for coding :D

I just threw this together in about 45 minutes so it's probably got flaws all over it, but whatever. At least you get the idea of where I'll be going with the game :)

Enjoy!

EDIT #4:
This is supposed to be the final copy, but I had to ramble on about some more nonsense because it wasn't long enough. I don't know if I'm going to include the stuff past, about half-way through the story. I haven't decided, let me know what you all think! :D


Code:
      I spent the beginning of my life in the Shinra building. I spent my childhood days wondering what the outside world was like, as I atrophied my hours behind glass walls. The eyes were always staring, always observing with such precision. How I loathed their leering eyes. I could not wait for the days of invariable elevating, leaping, and dodging to end. They assumed as this wore me down; as if it made a difference to me. They had no idea what I was capable of.

      As I advanced to the age of six, I recognized that my living quarters were not surveyed after the time I was pronounced to be asleep. I utilized this to my advantage, for Shinra’s lead scientist, Hollander, did not take into account the intensity of Mako infusion during my creation. He did not believe in the power of the Lifestream. I knew of its existence for the spirits of the Lifestream spoke to me in my sleep.

      What they had neglected was my ability to use the concentrated power of materia. These substances are the very being of the Lifestream that have erupted to the earth’s surface, and crystallized to be what they are. The Shinra authorities had still not discovered a purpose for this abundance of a resource. What I had done was extract a sample from the lab while Hollander was preoccupied with the recent test results. I had exercised my ability to manipulate these orbs and project them in the form of magic. The ability to perform the unheard of; was their primary goal. Their fault of error was that people who know nothing can understand nothing.

      The Lifestream told me of Shinra’s ill intentions  and of what was to become of me. I was to be Shinra’s prime military unit. The first unit of SOLDIER, 1st class.
   
      Sadly, I had no idea of what the outside world exerted on its people, for I had never seen it – at least until now. I heeded the advice given to me through the power of the Lifestream and the Jenova cells instilled within me. I grew tired of my pastime and grew chafed of my daily procedures. To work for someone else was to lose all purpose; it is to become a mere tool. So the night of the New Year, as most employees had the night off for the holiday, I enacted my escape. I knew for the earth’s survival, I must not let them advance in their SOLDIER project.
   
      While the blade I had used in training had only been constructed of steel, it would clearly suffice. I had equipped myself with this and had requested the night in the simulated training facility. I had bound the acquired materia to myself and presumed preoccupied for the hours before the new year. As the hour hand hit 12, I initiated my actions that would forever change the planets destiny.
   
      I felt the heat crawling through my veins; racing to the palm of my hand. I stood there, as the intensity of the sphere increased. I had decided it was time. The wall before me collapsed, as I step through the burning remains. I entered into a room that I did not know existed. The few people still working, fled with great despair. I knew I must also make haste in order to successfully escape. While I knew what Shinra was capable of, I did not wish for needless deaths.
   
      It was at this moment that I spotted my exits; a fleet of stairs, and an elevator. For the times I’ve used an elevator, I knew that it could be remotely controlled, and could lock down at the users desire. I took the obvious choice, the fleet of stairs that I had just seen a hoard of people rush down. I sighed and simply leapt over the arrangement of cubicles that populated the room. Still equipped with the training blade, I proceeded to open the door to find no sign of movement nor life. I did not hesitate for there was no time to spare; I had been anticipating Shinra’s automated security bots to engage with me at any moment.
   
      Counting the fleets of stairs, I had made It down 47 stories before finally reaching the ground floor. I have made it all this way, without seeing another sign of existence. I had gotten my hopes up; I should’ve known that this was not going to be an easy escape. I approach the door leading out of the stairway, already knowing what lies ahead of me. I have already come too far to simply turn around; to give up such an opportunity.
   
      I ready my blade and did not hesitate on charging through the door. I leap out of the stairway into the main lobby to find myself to be standing by myself. At first, there did not appear to be a single soul in sight. I look to my right, only to see an elevator full of terrified looking people peering out at me to observe my next action. It would be of no benefit to me to harm them in any way. I quietly say goodbye to the recognizable faces that I have been surrounded by, and mentored by my entire life. My teachers, my trainers, my friends; so I thought they were.
   
      I glance to my left to see the exit, and the hoard that I had been anticipating the entire time. Shinra’s security bots. This is where the true fun starts. I could already see the sector 7 slums in the background. Nothing in this world was going to stop me now. I wield my blade, and bring forth the familiar burning sensation. I think to myself that “this is just the beginning”, as I dash through the front gate. I hear bullets ring out before I even get a chance to reach the door. It’s gonna take more than that to stop me.


EDIT:

I am soooooo happy that I posted this online last night, because I forgot my flash drive at home and the final copy is due today :)

EDIT #2:

Oh yeah, and this is only my rough draft. I still have to fix it tonight and expand on it, so I should hopefully have another section of it later tonight :)

EDIT #3:

Yeah, I've been really sick for these past few days. which is why I'm working on the final draft, after the day that it is due :P

EDIT #5:

I posted the final draft, just for kicks and giggles Smile Let me know what you guys think! Very Happy


Last edited by Guest on 01 Oct 2008 10:38:14 pm; edited 1 time in total
Back to top
asdf


Advanced Newbie


Joined: 17 Aug 2008
Posts: 73

Posted: 01 Oct 2008 08:59:56 pm    Post subject:

This is really great! Very engrossing and seems like a great build up leading into an RPG Smile
Back to top
Art_of_camelot


Member


Joined: 05 Jan 2008
Posts: 152

Posted: 01 Oct 2008 11:53:42 pm    Post subject:

Hey, not bad! Looks like a solid begining.
Back to top
Liazon
title goes here


Bandwidth Hog


Joined: 01 Nov 2005
Posts: 2007

Posted: 05 Oct 2008 10:37:35 pm    Post subject:

That is really good. Maybe vary the tone a bit.
Back to top
TylerMcL


Member


Joined: 28 May 2008
Posts: 148

Posted: 21 Oct 2008 09:29:49 am    Post subject:

So... I'm sure that everyone's figured this project has become a complete failure, and has not had any work done to it. WRONG!! Very Happy

I've been really busy with work and school, and on my free time, working with the Nspire hacking community :P

So, I have the story developed -- but I still need help with the tile-mapper :(

I have the sprites and tiles almost completely finished, but now I just need to stop designing, and take time and effort into getting the engine working correctly. I have the title screen working, I just now need to work on getting the load/save features working :P

I've been helped alot with the tile-mapper already, I just now need to make a library that looks up all the saparate tiles, depending on what ID number was given.

I hope to have another screenie up by the end of this weekend Smile
Back to top
asdf


Advanced Newbie


Joined: 17 Aug 2008
Posts: 73

Posted: 22 Oct 2008 05:27:09 am    Post subject:

What type of tilemapper are you going for? Smooth-scrolling tilemappers add an extra degree of pain-in-the-ass, and it is not always as simple as writing an aligned mapper first then converting it so it scrolls smoothly, as you will probably find that your finished tilemapper is too slow to be of any use. That's not to say that writing an aligned mapper isn't worth it, it's a relatively simple exercise that will get you used to using and manipulating tilemaps, and as an added bonus you'll be able to see how your maps turned out/look on the calculator.

For smoothscrolling, there are a lot of different ideas and routines floating around: with/without a buffer, rotating the entire screen, rotating the individual tiles, shifting in pixels, fastcopy mixed into the sprite routine, etc. You may spend a lot of time coming up with ideas, implementing them halfway, finding that it won't work or is too complicated, and starting over, or you may find something that works for you right away. Keep in mind that some tilemaps are easier to implement other things, such as animated tiles and multipixel scrolling.

A (very brief) general overview of tilemaps:
A basic tilemap:

Code:
mapData:
.db 11,11

.db 1,1,1,1,1,1,1,1,1,1,1
.db 1,0,0,0,0,0,0,0,0,0,1
.db 1,0,2,0,0,0,0,0,0,0,1
.db 1,0,0,0,0,0,0,0,0,0,1
.db 1,0,0,0,0,0,0,0,0,0,1
.db 1,0,0,0,2,0,0,0,0,0,1
.db 1,0,0,0,0,0,0,0,0,0,1
.db 1,0,0,0,0,0,2,0,0,0,1
.db 1,0,0,0,0,0,0,0,0,0,1
.db 1,0,0,0,0,0,0,0,0,0,1
.db 1,1,1,1,1,1,1,1,1,1,1

tileData:
;tile 0
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000

;tile 1
.db %01010101,%01010101
.db %01010101,%01010101
.db %01010101,%01010101
.db %01010101,%01010101
.db %01010101,%01010101
.db %01010101,%01010101
.db %01010101,%01010101
.db %01010101,%01010101
.db %01010101,%01010101
.db %01010101,%01010101
.db %01010101,%01010101
.db %01010101,%01010101
.db %01010101,%01010101
.db %01010101,%01010101
.db %01010101,%01010101
.db %01010101,%01010101

;tile 2
.db $FF,$FF
.db $FF,$FF
.db $FF,$FF
.db $FF,$FF
.db $FF,$FF
.db $FF,$FF
.db $FF,$FF
.db $FF,$FF
.db $FF,$FF
.db $FF,$FF
.db $FF,$FF
.db $FF,$FF
.db $FF,$FF
.db $FF,$FF
.db $FF,$FF
.db $FF,$FF

Reading from a tilemap, you have the start of the map data supplied to a register combo (hl, ix, de, bc, or maybe one of the shadow registers) where you find the offset (mapStart + mapWidth*y + x). You can save a bit of time using SMC (self-modifying code) in setting up the map offset and all of that, but the speed you would gain is pretty much negligible here. What you will find is that certain parts of your routine are repeated MANY MANY times (ie, over 700 bytes on the LCD must be updated. Your routine to update the screen will be run through that many times! 8x8 tiles have 8x12=96 tiles on screen, and 96 repetitions). If you aren't satisfied with the speed, look at the routines which are looped through many times and try to optimize them further. Cutting 4 cycles off a piece of your routine that is run 764 times will give you something to smile about :)

To actually pull the tile ID and get the tile's address:

Code:
;hl points to first onscreen tile
ld e,(hl)
ld d,0
ld hl,tileData
ex de,hl;de=tileData hl=tileID
add hl,hl;x2
add hl,hl;x4
add hl,hl;x8
add hl,hl;x16
add hl,hl;x32
add hl,de;hl=tileData + tileID*32

To read the first byte of data in the sprite (also note that the example i am using uses 16x16 sprites) load the value of (hl) somewhere to manipulate it. There's really no saying what to do from here, as it all depends on how you structure your tilemapper.

Things to think about with smoothscrolling mappers:
-in a tilemap with 8x8 tiles, when the tilemap is aligned there will be 8 rows and 12 columns of the tilemap data displayed on the screen. If the tilemap is unaligned for x values, there will be 13 columns of data displayed, and the first and last columns will be clipped. Same idea for unaligned y values.
-figuring out how you want to handle unaligned x values will require a lot of thinking! If the x offset is 3 (3 bytes offscreen to the left) every sprite has to be shifted left three pixels. As the LCD is arranged so that 1 byte holds 8 pixels, every sprite will straddle two bytes. Yikes!
-a simple solution to drawing a map with an unaligned y offset is to simply start drawing the sprite at the yth row of the sprite. To clip a sprite with 3 pixels off the top edge, draw rows 4 through (# rows in sprite - 3).

i had some other things in my head, but it is late now (the sun is about to come up and i haven't yet slept) and i can't remember them. I had planned for this to be more thorough, but i guess just ask questions if you have them. I am glad you're still thinking about this project Smile But i'm off to bed!
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page Previous  1, 2, 3, 4, 5, 6
» View previous topic :: View next topic  
Page 6 of 6 » All times are UTC - 5 Hours

 

Advertisement