Jump to content

Unity Zelda64 Game Engine


SoulofDeity
 Share

Recommended Posts

This is -very- impressive SoD. It reminds me a bit of the Zelda Classic engine, which started out as replica of the Zelda 1 game but became a full blown editor/engine to create custom Zelda games/quests. I think this engine could follow suit, tearing down the huge barriers the N64 has had for those wishing to create a custom Zelda game of their own, as we all know the N64 is very limited in what it can do and handle.  Keep up the amazing work on this SoD, I shall be watching this project very closely. :)

  • Like 2
Link to comment
Share on other sites

So what's the plan with the open world? Are you planning to put in the temples/dungeons from OoT and Majora or just the overworlds?

 

As I've mentioned in the shoutbox, I really like this project :D Wish you the best of luck with it!

 

I was planning on adding all the game content from both games. Then anyone who wanted to make their own Zelda game could just remove what that didn't need and add their own stuff.

Link to comment
Share on other sites

And the great question : Will it be free?

Also, can I do something for helping the project?

I can code in c#.

 

Of course. Unity is free to use; unless you want to get a pro license, which is pretty much pointless. You can download the latest commit from the link in the first post on this topic.

 

 

This looks really cool and all, would it make making fan projects easier to do? probably a stupid question...

 

Obviously

Link to comment
Share on other sites

https://dl.dropboxusercontent.com/u/6440063/unityZelda/signs.png Began writing code for "signs". Initially I just wrote it to practice stuff like interacting with objects and adding input fields to components. It is still super simple though. I Press F when intersecting the sign objects collider to open the textbox. Press F again to close it. Can still move around and all that.

Want to expand on the script to make it into a global textbox script for showing all dialog, rather that just interacting with objects.

 

Edit: Added "interaction angle". You can set the angle from which you're able to interact with the object. 180f from any direction. 90f and you must stand in front of it, etc.

Edited by CloudMax
Link to comment
Share on other sites

I was importing the animations for Link and figured I'd go ahead and rip Link's model from MM as well. Busted out laughing when this happened:

 

 

 

2hqe3kk.png

 

 

 

Fixed the problem by creating an asset post-processing script for the editor. Below, you can see adult link from OoT and child link from MM using the same drinking animation.

 

 

 

71lr1i.png

 

 

 

 

A Link dance party! The most difficult one to import was deku link, because his body texture clamps in the y direction and repeats in the x; but unity only allows you to clamp or mirror textures in both directions at once. To get around it, I write a custom shader that takes 2 textures (which are the same image); one with the wrapmode set to clamp and the other set to repeat. When the coordinates of the Y axis are greater than 1 or less than 0, it uses the clamped texture; otherwise it reduces reduces the othermode coordinates by .0275 and uses the repeating texture. I'll end up applying this shader to hyrule field's walls later as well.

 

xepe0k.png

  • Like 5
Link to comment
Share on other sites

i think you should test how oot3D maps looks on this ! (i would test it myself but i don't know how unity game engine work)

 

The shaders that I wrote probably won't look right on OoT3D models, but testing it yourself isn't hard at all. You just drag and drop the model into the assets to import it, then drag and drop it from the assets into the scene hierarchy. Right now, I'm sifting through Link's animation files files trying to find the idling, walking, and running animations. Already went through 150 without any luck. Once I find them though, I'm gonna update the player control script; finish up the new HUD script, and commit the changes.

Link to comment
Share on other sites

The shaders that I wrote probably won't look right on OoT3D models, but testing it yourself isn't hard at all. You just drag and drop the model into the assets to import it, then drag and drop it from the assets into the scene hierarchy. Right now, I'm sifting through Link's animation files files trying to find the idling, walking, and running animations. Already went through 150 without any luck. Once I find them though, I'm gonna update the player control script; finish up the new HUD script, and commit the changes.

Have you check this out? I've fiddled around with it and it seems to be the ONLY pure accurate  list of Link's animations and its using their proper file name from the 3DS animation listing.

http://oot.cloudmodding.com/wiki/Link_Animations

Link to comment
Share on other sites

Have you check this out? I've fiddled around with it and it seems to be the ONLY pure accurate  list of Link's animations and its using their proper file name from the 3DS animation listing.

http://oot.cloudmodding.com/wiki/Link_Animations

 

Sadly, that list doesn't work with my importer. To be honest, the animation part of the script was done by a guy called RodLima before I could do it myself.

Link to comment
Share on other sites

As I've mentioned before, I've recently been doing a major overhaul on the directory structure of the project; and since I haven't done so before, I'm going to take a little time to explain it.

 

 

 

The Basic Directory Structure

 

Below is a simple diagram representing the basic directory structure and files:

/Assets
 +- /Resources
 |   '- /Game
 |       +- /Actors
 |       |   +- /Characters
 |       |   +- /Common
 |       |   +- /Creatures
 |       |   +- /Enemies
 |       |   +- /Interface
 |       |   +- /Scenery
 |       |   '- /Uncommon
 |       +- /Audio
 |       |   +- /BGM
 |       |   '- /SFX
 |       +- /Data
 |       |   '- /Static
 |       '- /Scenes
 '- GameEngine.cs
 

The Assets directory is the root directory for Unity Files. All of the data is placed in the Resources directory so that files can easily be loaded on the fly like:

AudioClip clip = Resources.Load<AudioClip>("OoT/Audio/SFX/Explosion");
 

Notice that when loading files like this, the "Assets/Resources/" part of the path is omitted. In order to make assets more manageable, they're organized into Game directories. For example, all of the Ocarina of Time assets will be placed under "/Assets/Resources/OoT" and all of the Majora's Mask assets will be placed under "/Assets/Resources/MM". Assets that are not derived from any game at all and are shared among all games are placed into the "/Assets/Resources/_All_" directory. The underscores in the file name are placed there to make it easy to find and kept at the very top of the game list.

 

 

 

The Actors Directory

 

The first sub-directory inside of each game directory is Actors. As the name suggests, it contains all of the actors in the game. These actors are organized into 7 groups:

Prefix  |  Actor Group  |  Description
--------+---------------+-----------------------------------------------------------------
CH      |  Characters   |  Character actors (Link, gorons, zoras, etc.)
CO      |  Common       |  Common actors (doors, chests, switches, etc.)
CR      |  Creatures    |  Creature actors (butterflies, fireflies, fairies, etc.)
EN      |  Enemies      |  Enemy actors
UI      |  Interface    |  Actors for the user-interface (hud, file menu, etc.)
SC      |  Scenery      |  Scenery actors (skybox, trees, grass, fire, etc.)
UN      |  Uncommon     |  Actors that are generally only used by other actors.
 

Inside of each of these group directories is an Actor directory, which as the format:

/{actorName}
 +- /Animations
 +- /Materials
 +- /Shaders
 +- /Strings
 +- /Textures
 +- <models>
 +- {groupPrefix}_{actorName}.cs
 '- {groupPrefix}_{actorName}.prefab
 

For example:

/Skybox
 +- /Materials
 |   +- Skybox.mat
 |   '- ClearDawn.mat
 +- /Shaders
 |   '- Skybox.shader
 +- /Textures
 |   +- ClearDawnF.tga
 |   '- ...
 +- SC_Skybox.fbx
 +- SC_Skybox.cs
 '- SC_Skybox.prefab
 

This structure not only makes it easy to navigate, but also simplifies the creation of game objects. Back in the first diagram, you probably noticed there is a file outside of the Resources directory called "GameEngine.cs". It's a static Monobehaviour class that simplifies managing the gameplay and assets. One example of it's use would be spawning an actor:

GameObject actor = GameEngine.SpawnActor("OoT:SC_Skybox");
 

This is where the Actor group suffixes come into play. The GameEngine class expands the above file name to the resource path: "OoT/Actors/Scenery/Skybox/SC_Skybox". While the class is currently unfinished, it will eventually have functions for things like scene/room transitioning and displaying raw gui objects; it will also contain variables that will control things like whether or not actors are allowed to move or if enemies are allowed to be aggressive. Think of it as the equivalent of the code.zasm file in roms.

 

 

 

The Audio Directory

 

The Audio directory is fairly simple. It contains 2 sub-directories:

  • BGM - Background Music
  • SFX  - Sound Effects
All of the background music files are 2D sounds while all of the sound effect files are 3D. You can set the background music with the function:

GameEngine.SetBGM("OoT:HyruleField");
 

Which will cause the currently playing music to fade out and the specified music to begin playing. The reason why the sound effects are placed into a different directory than the actors that might play them is that they can often serve several purposes. For example, a laughing poe sounds like Ganondorf's evil laugh if you lower the pitch.

 

 

 

The Data Directory

 

The Data directory is what is used hold miscellaneous assets. By default, it usually contains at least one directory called Static; which contains all the static assets for the game. Kind of like gameplay keep.

 

 

 

The Scenes Directory

 

The Scenes directory, as the name suggests, contains all the scenes for the game. Each scene has it's own directory with the structure:

/{sceneName}
 +- /Maps
 |   +- /Rooms
 |   |   +- /Materials
 |   |   +- /Textures
 |   |   +- Map##_Room##.fbx     <-- Model for Room # of Map #
 |   '- Map##.prefab             <-- Prefab for Map #
 +- /Stages
 |   +- /Collision
 |   |   '- Stage##.fbx          <-- Collision model for Stage #
 |   '- Stage##.prefab           <-- Prefab for Stage #
 +- {sceneName}.prefab           <-- Prefab for Scene
 '- {sceneName}.unity            <-- Unity scene file
 

For example:

 

/TestScene
 +- /Maps
 |   +- /Rooms
 |   |   +- /Materials
 |   |   |   '- Checkerboard.mat
 |   |   +- /Textures
 |   |   |   '- Checkerboard.png
 |   |   '- Map00_Room00.fbx
 |   '- Map00.prefab
 +- /Stages
 |   +- /Collision
 |   |   '- Stage00.fbx
 |   '- Stage00.prefab
 +- TestScene.prefab
 '- TestScene.unity
This new directory structure will be available in the next commit made to the master branch of the repository.
  • Like 1
Link to comment
Share on other sites

Been expanding on the new GameEngine api. Currently, there are 13 functions:

GetScenePath(name)  - Gets the path to the directory for a scene by it's name
GetScene(name)      - Gets the id of a scene by it's name
GetActorPath(name)  - Gets the path to the directory for an actor by it's name
GetActor(name)      - Gets the prefab GameObject for an actor by it's name
GetMusic(name)      - Gets music by it's name
GetSound(name)      - Gets a sound by it's name

GetAnimation(root, name)            - Gets a localized animation in root by it's name
GetAnimation(root, name, localized) - Gets an animation in root by it's name
GetMaterial(root, name)             - Gets a localized material in root by it's name
GetMaterial(root, name, localized)  - Gets a material in root by it's name
GetTexture(root, name)              - Gets a localized texture in root by it's name
GetTexture(root, name, localized)   - Gets a texture in root by it's name
GetString(root, name)               - Gets a localized string in root by it's name
GetString(root, name, localized)    - Gets a string in root by it's name

LoadScene(name)     - Load a scene by it's name
LoadScene(id)       - Load a scene by it's id
SpawnActor(name)    - Spawn an actor by it's name
SetBGM(name)        - Set the background music by it's name
SetBGM(clip)        - Set the background music to a clip

The name format is "Game:Name". For example, in order to load the scene for Hyrule Field, you'd just type:

GameEngine.LoadScene("OoT:HyruleField");

You may optionally omit the "Game:" part of the name, in which case it defaults to "_All_:".

 

Localization is extremely simple. Say for example, that the actor "CH_Darunia"  has a string called "LostWoodsDance". You'd load it like:

string text = GameEngine.GetString(GameEngine.GetActorPath("OoT:CH_Darunia"), "LostWoodsDance");

If the player's localization settings were set to German, it'd first check if a file called "LostWoodsDance-DE" exists. If so, it would return the text in that file, otherwise, it would default to the originally specified file name. This makes the job of translators super-easy.

Link to comment
Share on other sites

The Models were ripped using a script written by SoD, specifically made for this project from what I know.

I don't know how the sounds were ripped, I'm sure the others can fill you in on that.

 

Not really. I actually wrote the script like, sometime last year, shortly before I left the community for a few months. The sounds were most likely from noproblo.dayjo.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.