Blog

Gameplay systems update

I am nearly finished with the first pass of prototype functionality. Here is a video of the current system in action:

 

This still needs a lot of polish and there are a few bugs. It’s possible for the bools to be in the wrong state if you swap parts in your hands while in the collision volume. Also, I can move more a few more things from the child to the parent blueprint so that the child blueprints are cleaner. The whole system feels a bit messy and I’m doing a lot of casting. There is probably a better way to handle the communication between parts but I’m not very comfortable with blueprint interfaces or event dispatchers yet.

The cliff notes of how this system works:

There is a master object that has a bunch of socket locations and a bool for each of socket to indicate if a part is installed. I don’t want to be stuck duplicating all of the functionality for each object so there is also a child class that inherits behavior from the parent. The parent class can’t store specifics about which bools its checking against because the child would be forced to inherit that information. To get around that issue there is an intermediary bool that in the parent class that operates locally and has no connection to the master object. Each child blueprint is responsible for  talking to the master object and checking which parts are installed. That information is then sent to the inherited local bool so that the main loop can allow or deny install/removal without a direct connection to a specific part.

Child blueprint that inherits the parent functionality.

 

 

Assembly and Disassembly update

I am almost finished with the basic systems for assembly and disassembly. Each car part is a child class with a new static mesh and target socket defined in the construction script. I also implemented the ability to pickup and drop sub objects in a blueprint. I am planning around a basic structure with 3 classes of objects:
*A master object that holds the socket locations for parts to attach to
*Part assemblies which snap to the master and can be removed either whole or after partial disassembly
*Individual parts that make up the assemblies

I am still using an overlap event to get a reference between the parts and master object. This hasn’t been 100% reliable and seems to fail when I swap the parts between hands inside the collision volume.  I think switching to a sphere trace will be more reliable but I haven’t had time to test that this week.

Here is a video showing the snap system and the ability to pick up/drop assemblies and their sub components:

I think I am less than a week from having the dependency checks functioning and all of the art working with this system.

 

 

Metal fab- Firepit

I spent my 4th of July finishing up a fire pit for my backyard. It’s 3/16 plate and 14 gauge 1″ tube. The firepit is 38″ square and almost exactly 150lb. I had planned to paint it but I really liked how it looked halfway through removing mill scale with muriatic acid. I sprayed it with VHT flameproof clear coat in order to preserve the look. Hopefully that holds up to firewood.

 

This was my first time working with plate. Automotive projects for a sub 2000lb car tend to be light weight. My normal tools were not up to the task. I don’t have a compressor, 220v, or a plasma cutter in my shop. I ended up cutting all the plate out with a jigsaw and a 5 pack of blades. My 135 amp import mig welder on maximum settings can’t do 3/16 plate and after a few inches of continuous weld at max power it trips my 20 amp breaker. The machine also seems to stop welding well after about 10 minutes, the arc is unstable, as if the settings have all been changed. I think its overheating or just not putting out the amperage it needs to.

 

Free 3d scans

I am sharing low resolution copies of my 3d scans so that the aftermarket community can use them to develop new parts. I will continue to update this library as I make more scans. The files are in obj format with two different triangle counts. Download them for free on gumroad here: https://gumroad.com/alecmoody#

Accuracy of these scans is generally limited by how accurately the model is scaled (photogrammetry doesn’t know anything about scale on its own). I include a machinists ruler in my scans so that I can generate scale information. My testing shows the scans are accurate to less than .1%. Larger parts maybe be more accurate since I use a measurement span that is similar to the overall part size. This image shows some of the early scale testing on small parts and I have improved my scanning since I did this testing:

3d printed air intake design

I designed in this a few years ago and published it under a creative commons license so that people could print their own.  Here is some information I wrote back in 2014:

Download here:

Design

The goal of this intake system is draw ambient air into the engine while getting close to ideal intake tract length. The duct routes through the negative space in front of the radiator and then through a factory hole in the radiator support bar. This fits miatas from 1994 to 1997 running stock engine managment or all years of first generation miatas running a MAP based ECU (the 1.6l air flow meter will not fit where the MAF goes).

The design started with a urethane expanding foam pour to capture the availible negative space, that was 3d scanned and I have made about a dozen design iterations over the course of 9 months. I was careful in the design to make smooth transitions between shapes and keep a very consistent cross sectional area at every point of the duct. Cyotani on miataturbo volunteered to CFD simulations on the part (pictured) and came up with a pressure drop of .2 PSI at 275cfm. The intake has an internal dimeter of 62mm and is approxiamtely 25″ long from the tip of the throttle body to the edge of the filter flange. There is a thread on miataturbo showing most of the build process Here.

The files are all availible under a creative commons license that allows people to share and adapt the design so long as they attribute appropriate credit and do not use it for commercial purposes.
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Download Version 1.0 7/18/2014

Getting It Printed

Print cost is hugely variable depending on who is doing the printing and in what material. Most commercial printing services won’t be affordable. All of my prints have been done in multiple sections and I bond them using ABS cement (MEK solvent with ABS filler material, commonly found in the plumbing section of HD). ABS plastic is the only material I have tested this with and is the only commonly available FDM filament that I would use. PLA plastic will almost definitely melt or deform.

I strongly reccomend getting an acetone vapor polish done on the part. My break tests have shown a big improvment in strength between parts that are and aren’t treated this way. The blue part pictured on the left hasn’t been acetone vapor polished. It is much easier to delaminate the layers and break the part.

Required Parts

This intake is designed around 2.75″ tubing- this size is the easiest to mate to the stock MAF and it is a good match for more reliable aftermarket throttle bodies. The intake’s internal cross section is 62mm which is larger than the stock throttle body and very close in size to skunk2 64mm throttle body.

Couplers:
I bought all my couplers from www.siliconeintakes.com. I have ordered a few ebay elbows, some of them have been off by as much as 10 degrees and made fitting difficult.

2.75″ 45 degree elbow
2.75″ to 2.5″ 90 degree reducing elbow (if using a 64mm throttle body)

Fitting for IACV hose (not needed for NB engine swap):
Silicone intakes port system
90 degree 1/2″ NPT to 3/4″ hose barb

Air filter:
I designed this around the K&N RC-9310. This filter is expensive but it is a very good fit for the space and I optimized the duct length to match the length of the filter flange. There are other air filters out there that will fit but the critical limiting factors are that it needs to have 2.75″ flange and be no more than 4.75″ in diameter. A 5″ diameter filter will not fit the availible space and you will have to force it through bumper opening or remove the undertray to install.
You also need a small filter for the crankcase breather

For cars running stock engine management this is all you need. For cars running MAP on an aftermarket computer you will also need a 5.5″ length of 2.75″ tubing and some provisions for placing an IAT sensor. I found an aluminum tube caused severe IAT sensor heat soak.

Making It Fit

1) Bend or remove hood prop for clearance. The hood prop still works when bent but the intake prevents you from being able to use it.

2) install 90 degree elbow on throttle body and mark location to cut hole for IACV fitting. Install port system and fitting.

3) Trim or remove plastic clip that runs through the bumper support just to the left of main hole. This clip holds a plastic bracket for the hood release cable. The hood release works just as well with the bracket floating.

4) Some years have horn wiring routed on top of the bumper support, if so reroute it under the support out of the way.

5) With plastic cooling shroud in place, run a razor blade along the factory hole to make clean trim.

6) Insert the duct, and mock up placement of elbows and maf.

7) For users running stock engine managment, extend the MAF wiring so that the connector will reach.

8) Disconnect the duct from the 45 degree elbow but leave it in place. Slip the filter over the duct by working it left to right. Do not press too hard on the ABS plastic- it is brittle and can crack. This can be done through the bumper opening with the car on the ground but it is much easier (especially the first time) with the car a few feet off of the ground and with the plastic undertray removed. I usually use a short ratchet with a socket matching the hose clamp.

9) Re-fit the 45 degree elbow. Before adding any clamps adjust rotation and position of pieces for best fit.

10) Lower the hood and gently press down for it to latch. If you feel abnormal resistance stop and make sure your hood latch isn’t out of adjustment.

11) Attach breather filter to crankcase, add hose clamps and tighten everything.

 

In 2016 I did a redesign that flows about 12% better but requires a very thin wall thickness. It can’t be easily printed but I will be making some carbon fiber versions off of the updated design and I will post about that process when I do.

Learning blueprint – snapping and unsnapping parts

I have worked on Unreal engine games for years but haven’t done any scripting, kismet, or blueprint. My only programming knowledge comes from making text adventure games in Q basic almost 20 years ago. Fortunately, I am comfortable with node based shaders and, having worked in games for a long time, I understanding some of the basics like variable types and how to lay out simple systems. I am currently working on the first iteration of a system to snap and unsnap parts from the car.

Again, not being a programmer there may be a better way to do this. I am open to feedback and expect to be iterating on these systems. That said, my plan looks like this:
There are two types of objects. A master object that holds parts, and the car part parent class objects that the users interact with. The Master Object (MO) is a blueprint with a skeletal mesh that has sockets placed where each car part needs attach. The MO doesn’t have any actual geometry (I think I need to skin a single triangle to it in order to bring it into Unreal) but populates itself with car part objects. I would also like to implement IK to allow the suspension to move correctly as the car is raised and lowered on the lift. The MO will be responsible for keeping track of which parts are on the car and what their condition is and will need to be something that can be saved and loaded. The car part Parent Class (I’ll call this PC) will have have a bunch of variables to define things like what static mesh is used and what the condition of the part is. Each part also needs to check a list for assembly and disassembly to see if dependent parts are installed. Basically, it needs to know if the part is free to be removed, or installed, and if what you are attempting to bolt it to is actually there.

I am working from Tom Looman’s VR template and using his pick up interface. So far I have implemented a simple system for parts to snap and unsnap (with no checks to prevent removal or installation). Most of the work is in the car part blueprint, the MO is just some sockets on a simple skeletal mesh and a collision box to detect when a part is nearby.

My car part blueprint looks like this:

Basically, when a part enters the collision volume I set a bool, “Is Overlapping,” I use that collision event to get a reference, and I cast to the master object to pull information from it. The blueprint checks the location of the socket and compares that vector to the world location of the part. If the difference between the two vectors is less than the variable Snap Distance, it attach the part to the master object at the socket. There is also a loop to get the blueprint to continuously perform that check while inside the collision volume and for debugging I am constant printing the distance between the socket and the car part (while the bool is overlapping is valid).

Here is a video of the system in action (framerate while capturing video is terrible).

 

 

 

 

 

Inexpensive Oculus tracking camera mounts

I designed these tracking camera mounts as an inexpensive solution for mounting Oculus tracking cameras. They’re available on shapeways without any markup–cost is just what shapeways charges to have them printed:

https://www.shapeways.com/product/69ME6338C/oculus-rift-cv1-tracking-mount-economy

You will need drywall anchors or wood screws to mount them.

Print your own. Model direct download link:

http://www.wrenchgame.com/econ_mount.zip

VR racing simulator build

I got into virtual reality with a DK2 for a better racing simulator interface. VR provides spacial awareness and which translates into an intuitive understanding of distance and speed and it also encourages the player to practice looking where the car should go. The DK2 didn’t quite have the resolution necessary to resolve the track at long distances and the CV1 solved that problem. When I got my CV1 I decided to build a high end racing simulator. My criteria were that it needed to fit into my office closet so that it’s out of sight when not in use, that the frame must be light and stiff enough to transmit forces from bass transducers and the steering wheel, and that it use a wheel and pedals that accurately mimic real life forces. Sadly, after a year of use I sold the whole setup to help fund development on this game.

I built the frame from 1″ mild steel 16 gauge square tube. The sheet metal is all 12 gauge. The frame is triangulated as much was was feasible while still allowing easy ingress and egress. The seat is an expired Sparco Fia. For steering I built a direct drive force feedback wheel using a 20nm Mige servo motor controlled by a Granite Devices Simucube. The pedals are from HE engineering and the shifter is from Fanatec. For tactile feedback I installed aura shakers at each corner.

This is by far the most realistic and immersive sim racing setup I have used. Sim racing on a flat monitor (even a 3 monitor setup) with a consumer type steering wheel always feels disconnected and like something is missing. Sense memory skills like heel toe downshifting felt totally foreign because my brain was not convinced that the plasticy controls were affecting an engine. The combination of VR and good hardware totally eliminated that disconnect. With the direct drive wheel I could feel the tires generating and losing grip. The transducers did a surprisingly good job of providing feedback about what the car was doing and what the road surface was like. The only major issue I ran into was constantly dragging a mouse and keyboard back and forth  from my desk, and then trying to operate them with a headset on. To solve this issue I designed a 3d printed button plate with an integrated joystick mapped to function as a mouse. I had some fun designing the button plate around the material properties of SLS printed nylon. The control board has a very secure snap-in mount, clip-in strain relief for the USB connection, and zip tie anchor points for wire management. If anyone is interested in replicating this plate you can see a parts list and have your own printed here:  https://www.shapeways.com/product/98KVR4HCZ/vr-button-plate-for-sim-racing-320mm-wheel
The joystick mouse and wheel buttons are able to perform all the menu and car functions without the distraction of removing a headset or reaching for a mouse and keyboard.

Print your own. Model direct download link:

http://www.wrenchgame.com/buttonplate_final.zip

 

Parts list for the wheel plate:

 

Momo mod78 320mm wheel.

Leo Bodnar BU0836A joystick controller:

http://www.leobodnar.com/shop/index.php?main_page=product_info&cPath=94&products_id=204

Derek Speare Designs 4 Way Thumb Joystick with Push button:

http://www.derekspearedesigns.com/diy-components-for-circuit-projects.html

NNK mb2011 push buttons:

http://www.leobodnar.com/shop/index.php?main_page=product_info&cPath=98_74&products_id=190

Coiled right angle type A to type B USB cable:

http://www.ebay.com/itm/262375386604?_trksid=p2055119.m1438.l2649&ssPageName=STRK%3AMEBIDX%3AIT

2mm Zip ties:

https://www.amazon.com/gp/product/B009IOG3LO/ref=oh_aui_detailpage_o06_s00?ie=UTF8&psc=1

#2-56 machine screws for mounting the mini joystick:

https://www.amazon.com/gp/product/B00917KOHC/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1

3x Cable with 2 pin connector plug attached:

http://www.leobodnar.com/shop/index.php?main_page=product_info&products_id=209

You will also need basic soldering supplies and some black and red wire (20-24 awg)

My art workflow – Why scanning?

When developers are building a car for a racing game they’re are primarily concerned with the body work and the interior. Some amount of effort goes into modeling the mechanicals of the car but those are only seen from suspension cams, when then the car flips, and they’re always shown in an assembled state. There are no bolt holes, no bolts, and the mechanicals are necessarily simplified and inaccurate. It would be a huge waste of production resources to build every component of the car as a standalone object and then make it all fit together.

Building a car that can be fully disassembled is an order of magnitude more complicated. A car is made up of thousands of parts that need to fit and move together. These parts all sit in a giant hierarchy where Part A attaches to Part B and then Part C attaches to Part B. If the dimensions of Part B are significantly incorrect, the bolt holes may not line up, or two parts may be attempting to occupy the same space. Take, for example, the front upright. The upright dimensions are critical for suspension geometry, there are bolt holes that sit on off axis planes, and the upright mounts to a stack of other parts with minimal clearance. Here is an image that calls out some of critical dimensions on this one part:

With a traditional modeling workflow I would need to take measurements and then block out the upright with a rough mesh. I would also need to do the same for all of the surrounding parts (and this chain of surrounding parts could take me through large portions of the car). In this case I would also need to accurately measure and block out:

The Hub
Brake Caliper Bracket
Lower Ball Joint
Tie Rod End
Brake Caliper
Brake Pads
Brake Rotor
Brake Dust Shield
Front Upper Control Arm
Front Lower Control Arm
Front Subframe

Theoretically once you reach the Front subframe you need to consider where the engine mounts, engine dimensions, where the PPF mounts…but you could probably get away doing the subframe as one of the last pieces of finished art and adjusting it to fit everything else.

I couldn’t start the process of building the actual models until everything in that list had an accurate block out mesh. This game began as a part time experiment on weekends and in the evenings after work. Building a block out of a relatively complete car is not time efficient and there are too many opportunities for one incorrect dimension or block out error to propagate down the chain of parts  and require rework. The need for rework might not be discovered until after several months worth of production art was completed and depending on where the error occurred, there could be a lot of art thrown away.

In 2015 I did some experimenting to find a workflow to efficiently build an entire car worth of parts and have it all fit together. I had some experience with photogrammetry (3d scanning from photographs) as part of the fabrication process for some 3d printed car parts. At that point, my photo equipment and software limited my results to relatively blobby but useful meshes. These could replace the need for doing block out models and I could work on each part individually while being assured that parts would fit together correctly.

My early scanning results. Left: Scan mesh Right: A clean polygon model built from scratch using the scan as a blockout.

This worked and I was able to confirm accuracy to a tolerance that was acceptable, but building clean polygon models for all of these parts from scratch was extremely time consuming. At this point I was unsure if this idea was feasible with a team of one person working part time.

During 2016 I did more experimenting with photogrammetry in the hopes that I could efficiently produce scans that were high-quality enough that they wouldn’t need much rework. I am at what I think is my final iteration of scanning workflow and it looks like this:

*Nikon D800E with Sigma 50mm 1.4 <- this combination provides plenty of resolution and dynamic range.
*I am lighting everything with studio flash units. Switching away from continuous lighting has sped up the photography process by a factor of about 10X and every photo is now tack sharp so there are no throw away images.
*I’m treating the surfaces with Cantesco D2000A developer spray
*I switched my software to Reality Capture.

I created a tutorial covering what is effectively the same workflow here:
http://www.alecmoody.com/rubble/

The models I get out of this scan workflow are extremely high quality but polished areas and machined pieces still need remodeling. I also don’t attempt to scan things like fasteners and instead use thread checkers and calipers to build accurate parts.

On the left, the raw scan. The casting details are fantastic but there are errors from where the object was zip tied and suspended when it was photographed, and the machined surfaces are noisy and lack detail. On the right I combined the scan mesh with a polygon model for a clean final object.

The other half of this game art workflow is taking these high res models (usually about 10 million triangles per part) and building low poly game art with materials. At some point I will do a follow up post covering that process.

More scan results:

 

Art post

In video game development the most important props are referred to as hero props. Hero props are built in more detail–the artist is allowed extra time and resources to create higher quality art. Individual car parts would never be considered hero props under normal circumstances. For this game, however, I am approaching every part, no matter how mundane, as a hero prop. I’m also building this art to a detail level that will hold up through several VR headset iterations. Currently, with full resolution textures, it is not possible to resolve all of the detail on an Oculus CV1. When we get meaningful increases in headset resolution, the game settings can be turned up and the game will continue to look good. Most of these images can be opened to view a larger resolution: