Funny demo and a lot of questions

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
Post Reply
User avatar
Kerby
Posts: 90
Joined: Wed Feb 06, 2013 6:02 pm

Funny demo and a lot of questions

Post by Kerby »

Hi!
I do not know in which section is better to place this issue, if I'm wrong, then move to the right place.

Oversee the development of a new video mode 13 and he is not ready, and the desire to create something I have a lot, I decided to work out in the video mode 3 with music and sprites. This project is not a complete game, but a small demo joke. To be honest, I wanted to do this project on 1 april , but as job usual things slow down and work all my projects ... In the process of creating, I had a lot of questions and difficulties. Many problems I decided to myself, but further work would clarify some of the guesses and questions:
- It can be in the game have multiple sets of tiles for various game screens and levels? But at the same time you can use only two sets (SetTileTable - for background and stationary objects, SetSpritesTileTable - for sprites) 256 + 256?
- If we want to use during the game text, font tiles must be stationed in a set of background tiles? It turns out 256 tiles for the graphics is even less?
- How can I repay a sprite? Only if in its place to bring empty (transparent)?
- Music from the original game comes from NSF File, but the sound is a little like the original games console NES. How to create a design patches?
- The speed of music playback on real hardware was much faster (although it is possible the computer on which to create projects has been slow and heavily loaded), the parameter F MidiConv had to put in 40. Is that normal?
- Play music begins with a long delay after the team startsong, maybe it can be fixed in Anvil Studio. But how to remove a pause at the beginning?
- How to write patches for the sounds (eg the sound of laughter dog in this demo)?

This is a small part of the questions that stops me for the following projects. I apologize if komuto these difficulties seem very simple or stupid ... But I have a great desire to make the ports of small but interesting toys with retro consoles in our uzebox.
Attachments
DuckHunt.zip
(35.36 KiB) Downloaded 377 times
User avatar
uze6666
Site Admin
Posts: 4821
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Funny demo and a lot of questions

Post by uze6666 »

Very good work so far, the music conversion is pretty good!
- It can be in the game have multiple sets of tiles for various game screens and levels? But at the same time you can use only two sets (SetTileTable - for background and stationary objects, SetSpritesTileTable - for sprites) 256 + 256?
The main background section which can have sprites over can use a single tileset (256 tiles) at a time. You can activate the overlay, which is a background section at the top of the screen that cannot have sprites but can have it's own tileset. Sprites can use any one of 4 tilesets at once.
- If we want to use during the game text, font tiles must be stationed in a set of background tiles? It turns out 256 tiles for the graphics is even less?
Exact. The tileset must contain both the font and the graphics, so that leaves your game with less graphic tiles.
- How can I repay a sprite? Only if in its place to bring empty (transparent)?
Can you rephrase, not sure what you mean here. :?:
- Music from the original game comes from NSF File, but the sound is a little like the original games console NES. How to create a design patches?
You mean how to design sound instrument/patches? Check the wiki for Lee's tutorials on the subject they are very good.
- The speed of music playback on real hardware was much faster (although it is possible the computer on which to create projects has been slow and heavily loaded), the parameter F MidiConv had to put in 40. Is that normal?
Yeah, midiconv is not so good some times to process the music at the right time (some bugs never fixed). So use the speed parameter, it's okay.
- Play music begins with a long delay after the team startsong, maybe it can be fixed in Anvil Studio. But how to remove a pause at the beginning?
It can be fixed in Anvil. Open it and you will see all notes shifted in time. Shift back everything at the beginning and it will be ok.
- How to write patches for the sounds (eg the sound of laughter dog in this demo)?
Aahhh, that's an art in itself and not an easy one. It's an iterative process. Check out Lee's tutorials: http://uzebox.org/wiki/index.php?title=Weber%27s_Rants(sound section) http://uzebox.org/wiki/index.php?title= ... emystified http://uzebox.org/wiki/index.php?title= ... n_Easy_Way That said, I would not be surprised if the dog barking is a sample. Edit: I verified, and yes it's a sample. So you can make a PCM patch.
This is a small part of the questions that stops me for the following projects. I apologize if komuto these difficulties seem very simple or stupid ... But I have a great desire to make the ports of small but interesting toys with retro consoles in our uzebox.
No stupid questions here, always glad to help a Uzebox fellow! :P
User avatar
Kerby
Posts: 90
Joined: Wed Feb 06, 2013 6:02 pm

Re: Funny demo and a lot of questions

Post by Kerby »

You can activate the overlay, which is a background section at the top of the screen that cannot have sprites but can have it's own tileset. Sprites can use any one of 4 tilesets at once.
It is interesting. How can I activate it, what size, and whether you can place it at the bottom of the screen?
Other sprites can be composed of different sets of tiles, belonging to different tilesets simultaneously on the same screen? Or at the same time all sprites belong to one of four tilesets?
Can you rephrase, not sure what you mean here.
For example, a few characters on the screen - sprites. What is the easiest to do if one character dies, how to remove only one sprite? And if you need to remove all the sprites at once?
User avatar
D3thAdd3r
Posts: 3293
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Funny demo and a lot of questions

Post by D3thAdd3r »

Kerby wrote:Other sprites can be composed of different sets of tiles, belonging to different tilesets simultaneously on the same screen? Or at the same time all sprites belong to one of four tilesets?
You could have sprites from any of 4 tile banks on the same screen at once. So you could have a couple sprites from tile bank 0, plus a couple from tile bank 1, and some from tile bank 2, as well as some from bank 3 all at once giving you a choice of 256x4=1024 possible choices for sprites[X].tileIndex. It was a bit confusing because it was never documented on the wiki. I filled in the function info here. The example in the API documentation should pretty well explain it how to set the banks up and assign them to certain sprites.
Kerby wrote:What is the easiest to do if one character dies, how to remove only one sprite? And if you need to remove all the sprites at once?
You can hide any sprite by:

Code: Select all

	sprites[X].x = SCREEN_TILES_H*TILE_WIDTH;//remove this sprite from the screen
So for most games I do, I hide EVERY sprite right away EACH frame. Then I setup the ones needed to draw the frame, and any that I don't need for that frame are already hidden. You could hide them all like this:

Code: Select all

void HideSprites(){//hide ALL sprites
	for(unsigned char i=0;i<MAX_SPRITES;i++)
		sprites[i].x = SCREEN_TILES_H*TILE_WIDTH;
}
or if you want to do it a different way(than clearing sprites each frame) you could make a function to just hide a certain number of sprites starting at a certain position if a player died or something:

Code: Select all

void HideSprites(unsigned char start, unsigned char num){
	for(unsigned char i=start;i<start+num;i++)
		sprites[i].x = SCREEN_TILES_H*TILE_WIDTH;
}
Kerby wrote:How can I activate it, what size, and whether you can place it at the bottom of the screen?
Activate it by putting this in your make file:

Code: Select all

KERNEL_FLAGS += -DOVERLAY_LINES=4
this would of course make the overlay 4 tiles high at the top of the screen. As far as I am aware, there is only the option to have the overlay at the top of the screen in mode 3(mode 2 does have screen sections but...). It sounds like Alec might find a way to do the overlay in more than just the top of the screen so we'll have to wait and see on that one. You can probably get by without it for that game.
Post Reply