PDA

View Full Version : Possible Easier Way To Do Layers



Solaris_Omega
03-15-2005, 08:31 PM
I am not sure how your doing layers now, but why not do them like this if this isn't the way you are already. Make a struct based off of the same struct you place your tiles on before saving the map. Something like this LayerArray(6) to create six layers, then make each position storable within each slot in that array, then draw the different slots of the array on top of each other to create the layering effect. Basically, each slot will hold all the possible position of each map, and depending on which slots is shown where, depends on the slot it is stored in. Does that make any sense, am I a moron, whats up here?

Dark Nation
03-16-2005, 08:37 AM
I had originally thought of doing that, but doing so would greatly increase the size of a quest (not the mention the memory requirements for ZC). Granted, layers could be set up dynamically, but then you'd lose the ability to use a single screen as a layer for several other screens.

Solaris_Omega
03-16-2005, 09:55 AM
That is true, I keep forgetting the ZC is one quest to play, no added files. Which is good actually, I am actually just itching to help out with the project somehow. I wish I could do more

Dark Nation
03-16-2005, 10:09 AM
Are you any good at programming? I have a side project that I need done but don't have time to do myself.

Solaris_Omega
03-16-2005, 10:21 AM
I am quite good at programming finally. I took a long time to learn, but I am willing to help you out any way possible. I am a developer at the forums on this site www.baronsoft.com where a free visual basic online rpg engine is hosted, but I can do C++ w/Allegro or DX very well. What do you have in mind?

Dark Nation
03-16-2005, 11:57 AM
ZC currently plays several types of music formats (.MOD, .IT, .XM, .S3M, .SPC, .MP3, and .OGG). I am wanting to add other formats to it. Specifically, .NSF (8-bit NES music) files. Another nice format to have would be .GBS (GameBoy music) files.

To this end, I've created a stand-alone music player that uses the same audio core that ZC does to allow third parties to work on this, should they wish to do so.

Ideally, the additions would be separate, Allegro-compatible libraries, like the 4 already in use (DUMB, AlSPC, AllegroMP3, and AllegroOGG), that would snap into the main library (music.cpp), which is called by the player (play.cpp). Also, as .NSF (and .GBS) files may contain multiple songs, the music_start() function will need to modified (as you see fit) to allow a desired track to be specified.

Included in the attached zip file are the source code for the player and the main music library. The 5 supporting libraries will have to be downloaded separately from the links below, then compiled and installed in order to get the main project to compile.

Finally, this must be a cross-platform library. No assembly, C only. Also, it must be endian-independant.

One possible starting point would be to use code from FakeNES 0.3.1 (http://sourceforge.net/project/showfiles.php?group_id=39844).

Another possibility is NoSeFart 2.3 (http://sourceforge.net/project/showfiles.php?group_id=66254&package_id=64140), (a cross-platform NSF player).

For GBS files, you could start with the Meridian GBS WinAmp Plugin 0.1b (http://meridian.overclocked.org/files/in_gbs_src.zip).

Preferably, the library you create would be a modification to one of the above suggested libraries (or another open source library available on the Internet) so that it can be updated easily when they are, but this is not a requirement.

Here are the links to the 5 main supporting libraries (if a library is listed twice, download the one for your platform):

Allegro is the main audio (and graphics, etc., but we are only dealing with audio right now) library that the other libraries use.
The two following files are the ones used by Zelda Classic currently:
Allegro for Windows/DOS (http://prdownloads.sourceforge.net/alleg/all4116.zip?download)
Allegro for Linux/Mac OS X (http://prdownloads.sourceforge.net/alleg/allegro-4.1.16.tar.gz?download)

The two following files are, at the time this post was made, the most current versions of the above two files:
Allegro for Windows/DOS (http://prdownloads.sourceforge.net/alleg/all4118.zip?download)
Allegro for Linux/Mac OS X (http://prdownloads.sourceforge.net/alleg/allegro-4.1.18.tar.gz?download)


DUMB is the library that ZC uses for playing .MOD, .IT, .XM, and .S3M files.
DUMB for DOS/Windows (http://prdownloads.sourceforge.net/dumb/dumb-0.9.2-fixed.zip?download)
DUMB for Linux/Mac OS X (http://prdownloads.sourceforge.net/dumb/dumb-0.9.2-fixed.tar.gz?download)


AllegroMP3 handles the .MP3 files:
AllegroMP3 (cross-platform) (http://www.hero6.com/filereviver/almp3.zip)


AllegroOGG deals with the .OGG files (another highly-compressed wave file, like .MP3)
AllegroOGG (cross-platform) (http://www.hero6.com/filereviver/alogg.zip)


AlSPC plays .SPC files
AlSPC (cross-platform) (http://www.armageddongames.net/darknation/alspc_src.zip)


Actually, this project is open to anyone who wishes to contribute. Anyone who submits a library that gets used will be given credit in Zelda Classic. Any and all music formats are welcome, though NSF (especially) and GBS are my main concern at the moment.


Here is the music player that needs to be modified: music.zip (www.armageddongames.net/darknation/music.zip)


I wonder if I should create a new topic about this?

Solaris_Omega
03-16-2005, 12:04 PM
Alright, I think I can handle this

Dark Nation
03-16-2005, 12:19 PM
I forgot to include the link for the actual music player that I need modified. I just added the link to my previous post. Look for music.zip.

Solaris_Omega
03-16-2005, 02:40 PM
I was going to say, lol..I looked in there and was wondering if your forogt it or if I missed something in your post. I have some other great ideas for ZC, can you PM me a way that I can contact you so we can talk about them?

Dark Nation
03-16-2005, 02:43 PM
You can PM the ideas to me.

Ganonator
03-16-2005, 04:17 PM
for my project, one dynamically creates layers for the current screen, and they can also be different sizes - smaller or larger - for a paralax effect. The only problem I've run into is when to draw all of the layers for the quest designer. lets say the base layer is 20x20. If layer 1 is 15x20, i say not to draw, but if it's 20x20, i do.

If ZC had the ability to walk on different layers (such as my project) maybe it would work out better, but I see no reason to change it now.

[offtopic]
I think it was ingenious to allow the player to walk between layers 2/3 for base and 4/5 for high. With big O(k) overhead, the player can change layers with the same effects as LttP. No warping needed.

Solaris_Omega
03-16-2005, 04:49 PM
Alright, thats a pretty cool idea Ganonator, I will get some ideas to you DN. Maybe if you were to step on a trigger right before the layer you want to walk on or around, and it switches it until you reach the other side of the area, in which it swiches back. So that when you coming from one side of the bridge it makes you look like your walking on in by switching the layers, and when going below it, the layer just appears above it

Dark Nation
03-16-2005, 04:59 PM
I had thought about layer flags. Basically, when Link steps on one of these, he gets moved above that layer. So, a layer 3 flag would make Link start getting drawn above layer 3.

An example of how this would be used: Have 2 layers, one is a bridge of sorts. There is set of stairs the connects the 2 layers. The stairs are drawn on layer 0. At the bottom of the stairs, put a layer 0 flag (the layer number for the main room, below the bridge). At the top of the stairs, put a layer 1 flag (the same layer number as the bridge). Whenever Link exits the stairs, he hits the flag for the layer he should be moved to (1 for the top of the stairs, 0 for the bottom).

And I'm wanting to do a parrallax scrolling feature at some point. I even have the structs set up for it; just haven't gotten around to doing the code.