Jump to content

Unity Zelda64 Game Engine


SoulofDeity
 Share

Recommended Posts

This is a project to recreate the Zelda64 game engine that I've been working on in Unity. You can check out the latest source with git to help contribute from here.

 

 

 

The top 3 things on the todo list at the moment:

  • Write camera control script
  • Write player control script
  • Import animations for player

 

 

Here are some previews of the project's progress thus far:

 

 

Menu animation test:

 

 

 

Menu icons and camera testing:

 

s4qjk3.png

 

 

Shader testing:

 

1zmctaa.png

 

igc2s9.png

 

r9o5rt.png

 

 

  • Like 19
Link to comment
Share on other sites

This looks nice. I'm interested in contributing to this. What tools were used to dump player and map models?

 

 

I just use my Z64 import script for blender, apply smoothing, then export them as FBX (6.1 ASCII) with tangents enabled. One they're in Unity, I change the storage mode for each texture from "Compressed" to "True Color", change the wrap mode of certain textures to "Clamp" and the aniso-level to 4, and change the shader of each Material to 1 of my Custom/N64 shaders; of which there are 7:

 

  • PrimShade - Uses lighting, shading (vertex colors), and a primitive color.
  • PrimShade2S - Same as PrimShade, but with culling disabled for 2-sided objects
  • PrimShadeAlpha - Same as PrimShade, but with alpha cutoff transparency. This is what should be used for a majority of transparent objects
  • PrimShadeAlpha2S - Same as PrimShadeAlpha, but with culling disabled for 2-sided objects
  • PrimShadeBlend - This is used to blend 2 textures together for grass effects in the game.
  • PrimShadeTrans - This is for translucent textures in the game, things like the smoke on death mountain where ztesting isn't really needed.
  • PrimShadeTrans2S - Same as PrimShadeTrans, but with culling disabled for 2-sided objects.

For each one, I set the primitive color to pure white.

 

Once all the materials and whatnot are imported, I start tweaking little things in unity. For example, because there is no stencil buffer capability in unity, all the trails in Hyrule field were moved up on the y axis by .0003. Also, some textures don't get exported properly by my script or are missing, so I use Rice's plugin to get the correct version and fix them.

 

For Kokiri Forest, I went into Edit->Render Settings, enabled linear fog, used the colors for one of the environment settings in the scene file, and set the clearcolor for the SkyboxCam to the ambient color. 

 

There's also a sort of naming convention thing going on. All QI_, EI_, SI_, MI_, are used as prefixes to the Quest/Equip/Select/Map item icons, which makes them easy to find. I won't go into too much detail on this though as you can most likely figure it out just by poking around in the assets.

Link to comment
Share on other sites

This is just a rough idea, but I was threw this together in GIMP thinking of a open world

 

23j31j5.png

 

 

There is a bit of theorizing I did behind this:

 

 

  • The only entrance that epona could possibly enter the lost woods from is the Goron City entrance because Kokiri Forest has a cliff and the Zora's River has an underwater dive.
  • The lost woods only has 4 exits aside from the Sacred Forest Meadow. The 2 south exits lead to Kokiri Forest (which is relatively south of the Lost Woods). The one east exit leads to Zora's River, which as you can see in the map above is relatively east of the Lost Woods. The final north exit leads to Goron City which is relatively north. So we can logically conclude that each exit (although covering a large distance in a short amount of time) is still facing the direction that it leads to. So, if we cross out the possibility of exits that lead in the same direction, here is the path that link would most likely take
xnvtiw.jpg
  • Considering that the exit faces left, it would only make sense that it connect to some place on the western side of Hyrule, most likely near Desert Colossus
  • Both maps in game are oriented correctly, so neither should be rotated
  • In Hyrule, the largest bodies of water are the Gerudo Valley river and Lake Hylia, both in the west, and in Termina the Great Bay sea is in the west. Both Zora's Domain and Death Mountain in the east actually sit on a really high elevation as well, so when you take the WW flood into consideration, it only makes sense that the water would come from the west.
  • Ikana Canyon sits side by side with the Desert Colossus. It would be a little bit much of a coincidence that the kingdom of the dead sits right next to the Spirit Temple that is associated with black magic and has an altar for human sacrifice in it. Also consider that you only ever see male (or otherwise androgynous) people in Ikana Canyon, whereas Gerudo Valley has only females; both cultures have somewhat similar clothing, both cultures are outcasts in their countries, and the temples in both places contain mirror shields.

 

 

All that said, I was wondering what you guys would think of an open world game?

  • Like 8
Link to comment
Share on other sites

Official site says this regarding Termina:

 

"When Hyrule was created by the three goddesses at the beginning of time, there were certain side effects of its creation which Din, Nayru and Farore did not anticipate. As the three holy women breathed life into the world and chased away Emptiness, their potent breath slipped through tiny cracks in the folds of space and created millions of alternate worlds in the process. One of these worlds became the land known as Termina. It is possible that we would know nothing of Termina's existence if Link had not been led there by the mischevious actions of Skull Kid. Termina is very similar to Hyrule, but at the same time extremely different."

 
I think I remember this coming from an game manual or official instruction guide?
 
However, who's to say an open world game with portals to Termina couldn't be done? I'd enjoy that for sure!
Link to comment
Share on other sites

 

Official site says this regarding Termina:

 

"When Hyrule was created by the three goddesses at the beginning of time, there were certain side effects of its creation which Din, Nayru and Farore did not anticipate. As the three holy women breathed life into the world and chased away Emptiness, their potent breath slipped through tiny cracks in the folds of space and created millions of alternate worlds in the process. One of these worlds became the land known as Termina. It is possible that we would know nothing of Termina's existence if Link had not been led there by the mischevious actions of Skull Kid. Termina is very similar to Hyrule, but at the same time extremely different."

 
I think I remember this coming from an game manual or official instruction guide?
 
However, who's to say an open world game with portals to Termina couldn't be done? I'd enjoy that for sure!

 

 

Thanks for the info, hadn't read about that before. Also, I took a look at the Twilight Princess map to see if I could make heads or tails of it in it's relationship to OoT's Hyrule and my mind just imploded...

 

 

maptwilightgc.png

 

Link to comment
Share on other sites

If you believe the Temple of Time in TP is the same one as in OoT, then TP Hyrule is north of OoT's.

 

Another thought, if you flip the world map upside and still go by the location of the temple of time, it actually resembles Hyrule in one large part of the map in it's shape:

 

 

 

90rklk.png

 

 

 

 

Then again, you still can't really make heads or tails of it:

 

 

 

15yhj5g.png

 

 

 

 

EDIT:

 

...but I tried to anyway...

 

73e2rc.gif

Link to comment
Share on other sites

New update to the repository:

  • Imported all quest, map, and select item icons with their english text

    tags

  • Converted GUI shader to CG
  • Added new amount font (for things like arrows and bombs; 2 additional characters ':' is the beta '1/2' text and ';' is the 'Navi' text.)
  • Moved camera and skybox from data folder to actors/scenery
  • Reset camera prefab
  • Merged Data/HUD with Data/Gameplay.
  • Like 1
Link to comment
Share on other sites

This is actually really interesting. I think an open world game featuring both termina and hyrule would add a lot to the game. It'd make it it's own thing rather than just "OoT in Unity" (which by itself is amazing, at least for modders).

One thing to keep in mind though is to not think too far ahead and get too ambitious. That is unfortunately end up being what kills off many projects. Start out small, and build upon it rather than coming up with a gigantic project all at once. :)

  • Like 1
Link to comment
Share on other sites

One thing to keep in mind though is to not think too far ahead and get too ambitious. That is unfortunately end up being what kills off many projects. Start out small, and build upon it rather than coming up with a gigantic project all at once. :)

Yeah, that's why I put the project on GitHub early on. So even if I myself get overwhelmed and have to step away from it for a while, it won't die. Plus things will progress much faster with multiple people working on it.

 

You should add mouse aiming for first person items, like the Hookshot and Bow. However, mouse controls for camera...dunno if it'd work too well.

Unity has a control configuration menu that pops up before the game starts. We just need to label the input buttons, and then you can do whatever.

Link to comment
Share on other sites

If you believe the Temple of Time in TP is the same one as in OoT, then TP Hyrule is north of OoT's.

if its the same temple of time its rotated 90 degrees, you walk north to get the master sword in tp, but you walk like, east i think in oot's ToT.

 

 

also hyrule field: faron looks like its the same shape as oots lake hylia from that map, exits in the same spots, would put kinda lower eldin as the old hyrule field, and the newer kakariko in oot's position? and kokiri forest taken over my the lost woods. and it would kind of put a snowy bit in the same spot as sods map.

 

but im not paying attention to topography, just the shape from above.

 

 

LegendOfZelda-OcarinaOfTime-Present-Lake

 

Link to comment
Share on other sites

if its the same temple of time its rotated 90 degrees, you walk north to get the master sword in tp, but you walk like, east i think in oot's ToT.

 

 

also hyrule field: faron looks like its the same shape as oots lake hylia from that map, exits in the same spots, would put kinda lower eldin as the old hyrule field, and the newer kakariko in oot's position? and kokiri forest taken over my the lost woods. and it would kind of put a snowy bit in

It actually looks a lot more like old tp when your rotate the entire map 90 degrees

 

 

 

xc5e6x.png

 

 

The fact that the temple of time is in the Lost Woods in TP could just be circumstantial, as the Lost Woods in OoT connect to both Death Mountain and Zora's River which are also supposed to be large distances away.  Additionally, something far more interesting happens if after doing this, you grab a hold of everything that doesn't line up with old Hyrule and rotate it 90 degrees clockwise:

 

29w2szs.png

 

---

 

EDIT:

 

Since people seem to be ok with the open world thing, I'm going ahead and working on the real thing. Just touched up the Hyrule Field map a bit; left=old, right=new

 

2qbdpx4.png 2usxtmq.png

 

EDIT2:

 

Took me a little bit to rip this one...

 

ifwn49.png

 

Call me a procrastinator or whatever, but I'm not really in the programming mood right now so I'm just gonna rip some models  :P

  • Like 2
Link to comment
Share on other sites

Showing off the camera script I wrote; new menu opening animation, and Jack's additions of sound and player control with obstacle climbing

 

 

Obviously, still a work in progress, but not bad for like, 2 days of work. I'm not sure what's going on with the video quality; maybe it's just on my end, but the beginning of the video looks like shit and the end looks good...

  • Like 6
Link to comment
Share on other sites

When I get home I'll try to finish up the positioning of all the items in the equipment and inventory (possibly even quest) subscreens and make commit. If you guys are find with it, I'd like to focus on the subscreens primarily, such as the cursor movement and that. (basically the content a of the panels you've already made SoD). I enjoy designing and coding interfaces a lot, which is why that's been the focus of my mod so far. :)

  • Like 1
Link to comment
Share on other sites

I put together a code to get the float height and width of the pause menu panels, so I can use that as a base to calculate the perfect position for objects (so I can provide pixels values from OoT and have it converted to the right float value).

According to the code, the height of LPlane is 6.000001f, and the width of LPlane, CPlane and RPlane combined is 9.133646f. That seems wrong? The textures should total 240x160, in other words it should be 9:6.

Are you sure that you set up the scaling properly? because it sure seems to be off, by very little.

I'm setting it up so that the items are stretched along with the equipment so that they go together perfectly, so this won't really be a problem for my code. Just bringing it to your attention.

 

Edit: Scratch that, I'm confused. The height and widths I receive from .renderer.bounds.size.x and .renderer.bounds.size.y does not seem to be what I excepted them to be.

 

Edit2: nvm. I am dumb. I forgot to do something quite important. :P

Edited by CloudMax
Link to comment
Share on other sites

I put together a code to get the float height and width of the pause menu panels, so I can use that as a base to calculate the perfect position for objects (so I can provide pixels values from OoT and have it converted to the right float value).

According to the code, the height of LPlane is 6.000001f, and the width of LPlane, CPlane and RPlane combined is 9.133646f. That seems wrong? The textures should total 240x160, in other words it should be 9:6.

 

Trying to place pixel-perfect panels with sprite renderers in 3D is pretty much impossible; I just aligned everything closely enough that there weren't any seams. 

 

Are you sure that you set up the scaling properly? because it sure seems to be off, by very little.

 

The whole GUI is scaled based on the idea that no matter the aspect ratio, the width will always be greater than the height. So, the y scale of the gui root is always 1 and the x scale is the aspect ratio of the camera viewing it. Because you never know what aspect ratio the user will choose, it's pointless to even try to get things pixel-perfect. This is why there is an object in the SC_Camera prefab called "Backdrop"; it's a screenshot of the game itself used to position things as to line up as closely as possible to how they appear in game.

Link to comment
Share on other sites

I see. that makes sense. still, it should be possible to convert pixels to scale by comparing the original pause menu size (240x160) with the scale ingame to get the difference. Then do the same with icons (which actually appeared to be 28x28 in oot when I checked). However, in the end it just felt like useless extra work, so I'll just scrap the idea of doing that. I don't work Fridays, so I'll spend most of the time when I get home today and tomorrow to make some actual progress.

Link to comment
Share on other sites

Dude! This is awesome! Try to add a distance fog, that would represent the original game.

 

I actually did that in the Kokiri Forest preview. For those importing scenes who are are looking for how to do it, just go to Edit->Render Settings...; check the box for fog and set the mode to linear. Then you can adjust the distance and color. You can also mess with the ambient color there and change the skybox material, though eventually I'm going to write a script to replace the static skybox with one that rotates.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

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