Saturday, June 14, 2014

Learning by Replicating another's work

This video is amazing:



I was looking for melding multiple textures on a single mesh in UE4 when I stumbled this 15 minute walk through on building a scene.

I've decided this guy has the mojo I need to build better games. If he can do it in 4 hours, so can I with a lot of research and some practice.

I am going to pick this video apart, replicate it step by step here and provide notes on how it is done. I fully expect it to take me weeks to do this, especially since I don't always have a lot of free time.

To make sure I didn't miss anything I downloaded the video via jdownloader2 and brought it into premiere. I am then walking through it frame by frame. It is tedious but I want to replicate his workflow and learn a few tricks along the way.

------------------------------------------------------------------------
6/14/2014 - Saturday
------------------------------------------------------------------------
Getting Started
1. download and open the cave example
2. create a new level
3. set up for Oculus Rift:

This does not add any special movement beyond flying but that is fine.

move snap: 5
rotation snap: 2.812
scale snap: .25

Adding a few meshs and setting up the camera

Add:
Environment:Meshes:Rocks:SM_Cave_Rock_Large_01a
Environment:Meshes:Bricks:SM_Cave_Brick_01a (scale:5:5:5)
Environment:Meshes:Rocks:SM_Cave_Rock_Large_01a (scale:1:0.25:1)

Switch to unlit mode

Add:
Environment:Meshes:WoodStruts:SM_Cave_WoodStruts_01a (scale 2:2,2)

Add a camera actor and lock viewport to it. (pos -315:-15:220)
> position it so that scene we are building is in view
> unlock viewport and pin it so it stays up when not selected

copy the brick 5 more times
copy that section of 6 bricks to the right

13 seconds into the video, but I'm keeping up...



------------------------------------------------------------------------
6/15/2014 - Sunday
------------------------------------------------------------------------
Adding the cave statue and fleshing out area prior to export:

create a lot of copies of the brick so it is 5 high & 5 deep
> remove a few from the end

add SM_Cave_Statue_01 (s=1000:1000:1000)
> this scale was ridiculous to work with I did 20:20:20

move narrow sm_cave_rock_large_01a to left, rotate and position
> pos=105:-555:380

delete furthest column of blocks and floor

select furthest column on blocks and export

Landscape work in blender
I've never used proportional selection before. That was quite a learning experience.

How I did it:
1. create a plane and subdivide it by 32 in each direction. 
2. then scale it 2x in the x axis.
3. select the 6 center rows and pull them down using proportional selection. You can adjust the amount of the selection with the scroll wheel
4. I then followed along in the video making a series of adjustments to match his. 

The proportional selection tool isn't as nice as the one in 3d studio max so I had to be a bit creative with what I selected and the radius of the proportional selection.

The top is his work in 3d studio max and the bottom is my work in blender





Setting up landscape in UE4

Before exporting the landscape UV map it onto a texture and set the shading to smooth.
Export it as fbx at 100x (opposite of import of meshes which was .01). This will get it in perfect scale with our scene.

This next part is where some of the dark arts of UE steps in:
We want a material we can vertex paint onto. He spends a few minutes experimenting with materials and going back to the cave several times to figure out which material and paint color work. He tried red, blue and green with a variety of materials until he found the right combination.

He finally settled on M_Cave_Ground_Mud_Inst.

For the paint:
 paint color = blue
 > advanced: alpha = 0
 uncheck all channels except alpha
 radius = 256
 strength = .2
 falloff = 1

Drag this texture onto the landscape. The landscape is initally snowy. Paint over the entire surface and it becomes muddy. Amazing (to me at least) this looks really good.

Here is a snapshot of the final product and all the paint settings:


I will need to do more research into the material. I opened up the parent and there was a lot there. 

------------------------------------------------------------------------
6/16/2014 - Monday
------------------------------------------------------------------------
Adjusting land creek depth and adjusting bricks

Painting onto this:
 paint color = red
 > advanced: alpha = 1
 check all channels except alpha
 radius = 128
 strength = .2
 falloff = 1

paint down the middle with this. It is a water texture
> this mostly undoes the blue painting from above

He goes back to 3d studio max and reduces the depth of the water channel
> reimport narrow stream version

switch back to blue and paint portions of end sides to switch it to rocks

select beam and rescale it: 3.5:3:3
> rotate it slighting clockwise in the YZ plane and position end behind rocks on right

select half of the bricks on the right and swap them out for an alternate
> he used magnifying glass on mesh to quickly find it in the content browser

he did a similar operation on the left:




rotate and swap out individual bricks

STOPPED at 1:39:28

-------------------------------

Reposition more bricks on the left and right side.
> A few copies were made too

Add Rocks/SM_Cave_Rock_Slate_01a
> scale 1.5 and put on left side of river towards the end
> I think this is a marker for how far he wants the scene to extend to

remove center column on right and slide end bricks and wood beam to fill gap

return to blender and remove the 6 end rows shortening the length of the creek
> pull down the sloped section further
> redo UV mapping to fit texture

return to blender and pull slanted area back up




STOPPED at 1:58:18

------------------------------------------------------------------------
6/18/2014 - Wednesday
------------------------------------------------------------------------

Rock walls and ceiling

raise rock, scale it to 3 and change material
> he paint red, blue and green (RGB no alpha) onto the surface (which isn't visible on his first material selection)
> he then spins through the rock materials looking for one where the surface texture varies by color
> NOTE: you can see the color on the vertexes when you roll over the material!




He settled on M_Cave_Rock_Large_Moss_Inst & painted the lower portion of it so moss showed through
> with this material, it doesn't matter what the color is
> drag it out of the way on the left

add Castle/SM_Cave_Castle_Tower_01
> scale to 2
> drag far into the distance on x axis

make a copy of the left rock wall
> slide away along the x axis
> scale to 50, .25 (unchanged), 50
> push far away on left along y axis
> rescale to 300, .25, 300 (damn!)
> pos = 1835,-111655,380

@ 2:08:25

I'm going to take a moment at fix the statue so it is scaled correctly
> scale = 1000
> pos = 293280,-20290,
> damn that is big

OK, back to rock mojo

Make a copy of the rock wall and move it to the right side of the scene
> pos = 1835,99910,380

Just so you grok the size of the wall I zoomed out a bit for you:




Make a copy of the rock wall on the right pulling towards the scene
> this will become the lower bounds/floor
> rot = -90,0,-90
> pos = 1835,19415,-80360
> sca = 500,.25.500

readjust scale of walls
> 500,.25,500

create a copy of the floor rock and move it above the scene
> sca = 100,.25,100
> pos = -5775,19415,12720

To position he working view above the ceiling he changed the camera speed (upper right corner of editor) to 8
> that was a huge help!

find light source in scene outliner
> rot = 28.868,-46,129.45

(5)move the ceiling rock toward statue, rescale & rotate it
> sca = 300,.25.,300
> pos = 154880,19415,114320
> rot = 90,0,-16

(6)create copy of the rock ceiling
> sca = 300,.25.,300
> pos = 233375,-107175,114320

(7)create another copy of last ceiling piece
> pos = 290875,157326,114320

reduce of the scale of the first ceiling rock (5) along x axis
> sca = 200,.25,300

make a copy and slide towards statue
> pos = 354360,19415,114320


@ 2:21:12

Part 2 here: http://oculusdrifter.blogspot.com/2014/06/learning-by-replicating-part-ii.html

Tuesday, June 10, 2014

Fixing UE4 Defaults for Oculus Rift Support

There are a lot of oddities to configuration that needed adjusted. My hope is that this helps others starting to use UE4 for Oculus Rift development:

DOOR PROP SCALE
The scale of default door and frame are wrong. The door is 200cm tall. That is 6.56 feet. Doors in my house are 6.8 feet. This means you need it to be 208cm. That is a scaling factor of 1.04. That doesn't mean I'm going to use their door frame but if you are using that to gauge if scale is correct in the game, 3 inches is a big deal. I felt like my head was scraping the top of the door.

PLAYER HEIGHT
I'm 5 foot 8. The default height for a player is much taller. To adjust this go to the MyCharacter blueprint, click default and search for height. you want to set "capsule half height" to 1/2 your height in centimeters. My height is 172cm/2 = 86.

POST PROCESSING VOLUME
The next set of adjustments require a post processing volume. You can find it in "All Classes" if you don't have one. Drag it into your scene. search for unbound detail and check that so it applies to everything.

MOTION BLUR
There is a blur as you approach objects. This is an anti-alias method of temporal and it is super annoying. search the post processing volume for AA Method. Set that to none.

LENS FLARE
Lens flare has to go. Search for Lens and set the Intensity and BokehSize to 0.

AUTO BRIGHTNESS
Scenes in the rift get unusually bright. That is auto exposure. Search for exp. I don't know exactly the best settings but I am using min brightness = .5, max brightness = 1, auto exposure = 0.

IPD
The other thing that bothered me was the IPD feels different. Up to now I hadn't adjusted it on the DK1. UDK3 felt perfect. I had to adjust it for UE4 to make it not give me a headache.

INITIAL IMPRESSIONS
My initial impression with UE4 versus UDK3 is that it doesn't feel as nice in the Rift. UDK3 felt like Half Life 2 which was very 'crisp'. UE4 feels more 'fuzzy' like Unity. UE4 certainly comes packed with more flexibility but it feels like a step back for Rift support.

That is a start I will update this blog entry as I discover other things to make UE4 development easier for the Oculus Rift.

Monday, June 9, 2014

Hourences & UE4 Tutorials

I watched a lot of UE4 tutorial videos this weekend. I don't want to start work on my Tuscany UE4 port until I've absorbed all the information I can about UE4.


There is some weird new stuff with materials using masks. I don't understand it yet but the videos discussing the Infiltrator talked about it:
https://www.youtube.com/watch?v=-VANuJCM29E
https://www.youtube.com/watch?v=RURQSR788Dg
https://www.youtube.com/watch?v=Q_-LrvzhBhM


I was particularly impressed with Hourences videos. The environment materials, mesh construction workflow and kismet were insanely cool. Materials that always have grass on top regardless of rotation. Materials that adjust color based on water level. Elements that change appearance based on temperature and humidity. I was humbled. It made all my work with the Stacks look like child's play (which it was).



You can download his stripped down Solas project here:
http://www.hourences.com/

Here is the game website:
http://www.solusthegame.com/

Here are his videos:
https://www.youtube.com/watch?v=rxM6QVwrzBg
https://www.youtube.com/watch?v=eKB_jMcW2hg
https://www.youtube.com/watch?v=IXpyFxf66ac

I never have a ton of time to dedicate to this but I am going to dissect that project and take notes.

Sunday, June 8, 2014

Portals in UE4

It appears portals have not been included in UE4. Several attempts have been made to replicate the look.

This never fully worked in UDK3 for the Oculus Rift (the right eye didn't render). I would love to add portals into my maps but it looks it is going to be a while before that materializes.

I'm sure they are avoiding it because it is a performance nightmare.

Web pages on the topic:
https://answers.unrealengine.com/questions/49911/recreating-udks-utportals.html

https://forums.unrealengine.com/showthread.php?7662-Recreating-UTPortal-from-UDK-in-UE4-%28the-portal-effect-from-Portal-in-UE4%29&p=64070#post64070

Demo of a hacked portal:
https://www.youtube.com/watch?v=hzzAVsHZ1jo

Here is the UE4 roadmap (no portals there):
https://trello.com/b/gHooNW9I/ue4-roadmap

Friday, June 6, 2014

Starting Over: Tuscony for UE4

I decided to make the plunge into UE4 and discovered that most of my previous work is lost (maps and kismet)

I need a project that will help me learn everything about UE4. I'm going to recreate and improve the Tuscony demo in UE4.



https://d39nlaid7cu5vo.cloudfront.net/shareuploads/apps/1374203063522b3r94wjyvi/screens/1374192331894673y4iy66r_1381343369674.jpg

I will include the run/jump ability from the Stacks, a setting screen to change movement mode from view/fixed and a new teleport mode. There will be a larger area to visit and possible more homes. We'll see how it goes

A few shots for inspiration:

http://privateitalytoursltd.files.wordpress.com/2012/11/tuscany-hills-view.jpg

http://blog.luxuryretreats.com/wp-content/uploads/2012/08/Tuscany-Hills.jpg

This is Vernazza:
http://www.thetuscanmagazine.com/articles/wp-content/uploads/2011/10/Tuscan-Coastline.jpg

Here is a poor man's pano from the tower:

Wednesday, June 4, 2014

Mathmos Astro Lamp for the US


I wanted a nice lava lamp for my desk (just like the one in the photo above). Little did I know the rabbit hole this would send me down.

The Exclusivity Restriction
The Lava Lamps in the US are made by a company called Lava Lite. They bought the exclusive rights to lava lamps in the US from the UK inventor Mathmos.

The quality between the 2 is very different. Many people have described the Lava Lite as a junky inferior product with a lower wattage light bulb. The Mathmos looks much more sleek. I watched their "making of" video and was impressed with the level of detail that goes into making a lamp.

So I thought, hey, I want one of the Mathmos Lava Lamps (called Astro Lamps). That's where stuff got weird. You can not buy a Mathmos from them due to the Lava Lite exclusivity. Furthermore I could find NO website that sold them with shipping to the US. Then I went to ebay. I couldn't find a good Mathmos there either.

I got a chuckle out of this forum thread:
http://oozinggoo.ning.com/forum/topics/mathmos-in-the-usa

"If one were to get a Mathmos lava lamp into the US via a secret submarine or coke mule (seriously the Mathmos rep made it sound like the feds would beat down my door if I even thought of shipping one over)"

Obsession
At this point this tipped over from a curiosity to a "I'm getting one of these bastards".

I remember back a few years ago when I wanted a Japanese papercraft model only available in Japan. After a lot of research I found a mail proxy that I shipped it to and they shipped it to me.

UK Mailer Proxy
I found a UK mailer proxy for getting the Mathmos: ukaddress.com



Signup is 5 pounds and handling fee for the package is an additional 5 pounds.

With ukaddress.com you get a legitimate UK address. They assign you a suite number that maps to your account. When they get the package they then send it to you via international shipping.

My UK address is very strange. I sent them a verification email to make sure I understood exactly what the address1, address2 and city were. They responded in a few hours

I then called my credit card company and told them that I was buying a product from the UK. They stayed on the phone with me as I placed the order to ensure everything went well.

Order Placed
I feel like I just threw a ton of money into the wind. I hope this goes well. {crosses fingers}


After you place an order you add to your incoming orders at ukaddress. If this works as planned I have to give ukaddress credit for a very easy and transparent process.

Power
The last piece of the puzzle was power. I could have modded the lamp but I went the easier route and bought a 110V -> 220V up convertor and UK powerstrip:



Shipping From Mathmos to ukaddress
I got a shipping confirmation this morning. woot! It is on its way to ukaddress.

Potential Snag
It appears there is a liquid restriction on international shipping from the UK. You can not ship any liquid over a litre. That is .26 gallons. Rumor has it that ukaddress will not ship any liquids. We shall see. I'm not digging the thought of returning a product remotely. I adjusted the description of my item to say it is a lamp from a lighting vendor. Nice and generic. It will say Mathmos on the outside of the box but they do produce non-liquid items...

All this trouble over a damn lava lamp. Seriously! Where is that secret submarine when you need it?

UKAddress has received the package
This email was waiting for me this morning:
subject:Your UKAddress Order 4732 has been approved

I was then asked to go to their site to ship the package.

The cost of shipping
Wow shipping and handling is expensive. This is the cheapest option:
UPS - UPS Express Saver (3-4 Days) - £35.50 + Processing Costs: £ 5.00 = $68

Well I'm all in at this point. Let's do this! 
After I made the payment it kicked me back to their main page with no indication that the payment was successful. After a couple of minutes I received a "shipment confirmed" email.

Looked like I'm good to go. It cost almost double the price to get it but I think it is on its way. Now it just needs to make it through customs. 

It has shipped!
I just got an email with a tracking number. The package is in route. 

Arriving today
The package will arrive today. Ironically, faster than the converter so I can't use it until that arrives :(


It is good to go
It arrived safe and sound and ironically with the other 2 packages.












So there you go. I can't believe it went this smoothly. It looks great on the desk. It's been warming up for 1/2 hour so far. I can't want to see this in action.

Porting from UDK3 to UE4


Porting from UDK3 to UE4

I am going to detail everything I will go through porting from UDK3 to UE4.

I have many textures, complex materials, complex kismet & matinee orchestrations and a master level with over a dozen child levels. If there is a problem I am probably going to encounter it. I imagine this will take weeks to sort through.

Installation Directory:
 c:\UDK\UE4
I wanted to keep things consistent

Backup:

Before I press "Fix Now" and UE4 start mucking with stuff I'm backing everything up:
maps, packages, custom code and configuration files. Clicking "Fix Now" didn't seem to do anything. I had to close down the install and reopen the executable "Unreal Engine". This presented me with an install button on the left.

Yea... This is totally going to suck:
https://forums.unrealengine.com/showthread.php?6975-Looking-for-advice-on-porting-my-game-from-UDK-to-UE4
The game has to be rebuilt.

Here is my discussion thread on the UE forums:
https://forums.unrealengine.com/showthread.php?8205-Porting-from-UDK3-to-UE4

I was pointed to these pages:
https://wiki.unrealengine.com/UE3_to_UE4_Transition_Guide
https://forums.unrealengine.com/showthread.php?297-Curious-if-I-can-open-a-UDK-project-in-UNREAL-4&highlight=Porting

Install underway
This may take a while

First Impression
My first impression with UE4 are: wow! I wish this was available a year ago. I feel like I am starting over again. I know how to build 3d objects, what uv and light mapping is, how to build materials and orchestrate animations but this has a lot different (and better approach). Keeping the blueprint and c++ examples in sync was a brilliant idea.

There are a ton of videos here I need to start watching:
https://www.youtube.com/user/UnrealDevelopmentKit/playlists

Playing all the demos
These things give me a headache. Three things cause this:
1. They have changed the inter oculur distance. The old default was perfect. This feels wrong
2. There is a blur as you approach object causing them to lose their 3d look until you stop
3. The framerate on all of the demos was bad

I have a really high-end machine. I think UE4 may cause me to have to reduce the size of maps significantly.