Presenting Switched RPG! Switched is a RPG based on the RPG that I wrote in Prizm-Basic. It currently features nothing more than 8-bit tilemaps, some masked sprite support, and a menu/dialog system but it promises to become something incredible (I hope). This version will be much better than the Prizm-Basic version because:
1) It is written in C, not Prizm-Basic.
2) Graphics are incredibly better (and more understandable).
3) I actually have enough memory to make a real storyline.

Screenshot time!


All of those exclamation marks are due the Manager software not liking some of my code, I guess.

You can download the demo here.
Sounds like a great idea! I hope you'll show us some screenshots as soon as you have them, and of course let us know any and all C questions you may need assistance with.
First question:
Lets say that I had a tileset that looked something like this:

I want to use the CopySpriteNBit routine to draw tiles (for the compression). However, I don't think that routine will allow me to draw any individual tile as it is now. How would I go about modifying that routine so I could draw any one tile to the screen?
m1ac4 wrote:
First question:
Lets say that I had a tileset that looked something like this:

I want to use the CopySpriteNBit routine to draw tiles (for the compression). However, I don't think that routine will allow me to draw any individual tile as it is now. How would I go about modifying that routine so I could draw any one tile to the screen?


Something simple like this should do the trick:


Code:
void CopySpriteFromSheet(color_t*sheet, int x, int y, int width, int height, int offset_x, int offset_y, int sheet_w) {
   color_t* VRAM = (color_t*)0xA8000000;
   for(int j=y; i<y+height; j++) {
      for(int i=x; i < x+width; i++) {
         *(j*LCD_WIDTH_PX+i+VRAM) = *((j-y+offset_y)*sheet_w+(i-x+offset_x)+sheet);
      }
   }
}


sheet would be a pointer to the tilesheet data, x/y are the drawing coordinates for where to draw the sprite to VRAM, width/height are the width/height of the tile, offset_x/offset_y are where the tile is located on the sprite sheet, and sheet_w is the width in pixels of the actual spritesheet itself.

EDIT: and I can't help myself but comment that your tiles aesthetically don't quite fit together well; some are blurry, and some like the ones with the bricks are more pixelly. I suggest you stick with one way or the other (preferrably the pixelly one, especially because the blurry ones will looks a bit more odd once the color palette drops from 8-8-8 to 5-6-5 for the Prizm)
Thanks for the routine. However, I need to use an 8-bit tilesheet due to future size constraints. What I am looking for is a routine similar to yours that uses a 8-bit tilesheet. The problem is that I do not have the skills necessary to write such a routine.

Also, thanks for your observations on the inconsistencies of my tilesheet. I never noticed that before.
I got 256-color tilemaps working after a few hours of debugging and system crashes. I now turn to making a simple demo that will let people see what all of my tilesets look like on the screen itself.
I understand pointers a lot better now. Smile
I present to you the Tilemap Demo!
To use: just download, send to your calc, and run. The demo is in the "Graphics Testing" menu. Sorry about the main menu icons.

The demo is very simple. All you do is cycle through the maps with the arrow keys. There are 10 maps in total, two from each "region".
This is an excellent opportunity for all of you to provide feedback on my graphical designs. Ashbad already gave me some good feedback and the more I get, the better. I can already spot some areas that need improvement but I am only one person.

You can download the demo here. I am going to take a break from coding for a few hours. Then, I shall start implementing characters.
I like it. What dimension are each tile?
24x24. Each map is then 16 tiles wide and 9 tiles high.
I got masked sprite drawing working for whole tilemaps now. This means that I can draw NPCs and other interesting things that require being masked now. Interestingly enough, I can draw any combination of maps and masked tiles together (this means that I could put desert villagers in a lava fortress for example).

I am going to make some "screenshots" of my maps to put in the first post now.
m1ac4 wrote:
I got masked sprite drawing working for whole tilemaps now. This means that I can draw NPCs and other interesting things that require being masked now. Interestingly enough, I can draw any combination of maps and masked tiles together (this means that I could put desert villagers in a lava fortress for example).

I am going to make some "screenshots" of my maps to put in the first post now.
You'd better! Very Happy I can't wait to see them. If your tilemapper code can be easily pulled out without a ton of dependencies, I would love it if you shared it in the Useful Prizm Routines and/or in the relevant section of WikiPrizm.

Edit: Derp, the screenshots are already there. They look great!
This looks pretty nice. Glad this was revived Very Happy
More progress!
I have added the main character and some NPCs (with some placeholder sprites for now). The main character can move around the map in a smooth fashion and will not move through buildings, rocks, and such. The player can also interact with NPCs and read signs.

I am actually starting to get closer to making a real game here. All I need to do to have a fully functional game now is:
1) Make a indoors "region"
2) Make shops
3) Make the battle system
4) Implement game saving
5) A whole lot of sprite making, including NPCs, battle imagery, and animated sprites for when the player moves
6) Make a system to keep track of every single event in an organized fashion

Is there anyone out there that would be interested in helping me make sprites? I have a lot of them to make and I would appreciate any help I could get. I'll provide details if anyone is interested.
I'm sure there are quite a few of us who would be happy to help with sprites. You can either continue asking in this topic, or make a separate Graphics topic requesting spriters. I know that I for one would be happy to contribute a handful of sprites.
I'll make a list and anything relevant in a graphics topic. Where would the best place to put such a topic be?

In other news, the player can now move between maps now. I am probably going to start working on save files after I get the graphics topic started.
m1ac4 wrote:
I'll make a list and anything relevant in a graphics topic. Where would the best place to put such a topic be?


http://cemetech.net/forum/viewforum.php?f=39
I want to start working with save files and save data but I am having trouble understanding how to do it because all of the information is scattered in several places. I want to be able to read information from a file to a struct and write it back. I'm still working on the structure of the save file so I don't know what size it will be yet. Would a struct be the best method of getting all of my data into one place and how should I go about reading and writing save data to a file?
I think you'd better wait for libfxcg standard file I/O functions are implemented, after that, you'll be able to use fopen() and friends as you would do in any other C program.
Ok. I have plenty of maps left to design and another tilesheet too so I can certainly keep myself occupied until then.
Since you are now getting in to files and such, i will now warn you about endianness. If you forget about it, you can be in a world a pain.
  
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
Page 1 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement