Image courtesy of AFRY

Visualizing Sweden’s first high-speed railway with real-time technology

Image courtesy of AFRY
Ken Pimentel
Few engineering companies can claim a lineage as impressive as Scandanavian firm AFRY. With roots reaching all the way back to 1895, this award-winning company has been part of four major technological revolutions: steam power, electricity, nuclear power, and digitalization. 

From humble beginnings performing safety inspections on steam generators, the business has grown into an international multidisciplinary engineering consultancy employing more than 16,000 people across 50 countries, from Brazil to Vietnam. It consists of several subsidiaries including Infrastructure, the division that handles everything from planning roads to designing public transport systems. 

So when it came to choosing a consultancy to lay the groundwork for Sweden’s first ever high-speed railway, it’s no surprise that this firm was top of the list. Alongside community development consultancy Tyréns, AFRY is working on the engineering plans for the initial phase of the East Link railway line between Södertälje and Trosa. 

As part of the design visualization requirement, the firm has created two real-time applications in Unreal Engine; one to help engineers review designs, and another to present the project to the public. 
 

Leveraging the power of BIM, CAD, and GIS data in one environment 

The East Link will connect a number of towns in the surrounding countryside to Stockholm, bringing nearby Nyköping into the capital city’s labor and housing market, and making it possible to commute into the city from towns all along the new route.
Image courtesy of AFRY
It’s a development the scale of which has not been seen in this area since the beginning of the 1900s. Trains will run at a top speed of 250 km per hour (155 miles per hour), and carry passengers from Stockholm to the end of the line at Linköping in one hour. AFRY is heavily involved in developing the railway plans, including undertaking environmental impact assessments, creating system documents, and mapping out design programs. 

Adapting the design to the local environment in this part of Sweden is crucial to the project’s success. With the line running through densely populated areas, across rural land, and skirting archaeological sites, a huge amount of data must be analyzed to address a wide range of complex geological challenges.

The team imports these data sets into the design review version of its application to visualize and understand them. “This application has a lot of technical detail, preserved BIM information, and layers from our CAD software,” explains Ludvig Lovén, BIM / VR Developer at AFRY. “It also contains GIS data for archaeology, environment, land use, and more. It’s got profile data and a linear referencing system along the track alignment for navigation and orientation.”
Image courtesy of AFRY
To handle all of this information in real time, the team relies on the power of Unreal Engine. “Datasets are getting bigger and bigger, and their fidelity is getting higher and higher,” explains Lovén. “There's really no limit to the data density you can get in—and it’s just going to keep increasing. That was one of the reasons we chose Unreal in the first place.”
 

Pixel Streaming for team-wide access to the latest designs 

With updates being made continuously, it’s important that all engineers have easy access to the latest iteration of designs. Lovén’s team package up the internal application and deliver it to the 200-person design team every week through Pixel Streaming, embedding it on the project’s Sharepoint page. 

Pixel Streaming enables you to run an Unreal Engine application on a server in the cloud, and stream its rendered frames and audio to browsers on desktops and mobile devices. It gives AFRY team members access to the latest design data without having to download any files or install any software. This in turn helps improve their ROI by freeing up hours of time for key employees. “We have a peak usage of about 1000 hours per month for this service, which significantly reduces the load on our BIM coordinators in packaging the models for different uses, holding review meetings, and so on,” says Lovén.
Image courtesy of AFRY
The external-use version of AFRY’s visualization application presents the full model of the railway, stretching 160 km from end-to-end, including foliage, animated cars, trains, and even wildlife. It will be used to communicate to the public, municipalities, and other external stakeholders how the proposed railway will affect them and their local area. “The idea is that this will avoid miscommunication and speed up the planning process,” says Lovén.
 

From FME to Datasmith 

AFRY chose Unreal Engine as the real-time technology on which to build its applications for a number of reasons. “We felt it was the best game engine for large-scale open worlds,” says Lovén. “Unreal excels at displaying tons of foliage on screen, and the World Composition system helps with streaming large datasets. Another big factor was the Blueprint system, which helps team members who are not experienced C++ programmers contribute to the project.”
Image courtesy of AFRY
Blueprint visual scripting is a flexible, powerful system that enables those who don’t come from a development background to use the full range of concepts and tools generally only available to programmers. The team uses Blueprints for all game logic on the project, only reverting to C++ code for a utility plugin mostly used for file system management.

AFRY originally had to rely on custom-built tools to import all the data the team needed into Unreal Engine, which includes heightmaps generated from point clouds, and GIS data for biotopes, existing roads and railways, lakes and rivers, and more. “We started development well before Datasmith was a thing, so we had to create our own import pipeline at first,” recalls Lovén. “We did this by importing the design models in FBX format, along with a data table containing BIM data mapped to the FBX files. Now we’ve replaced the FBX import for design models with Datasmith. The big advantage of this is having the BIM data directly available on the objects, instead of having to do a data table lookup. That allows us to easily manage, view, and filter the objects in the editor, plus the object hierarchy is preserved from the design software.”

The team imports design files from Autodesk software including Revit and AutoCAD Civil 3D, as well as Bentley MicroStation-based design applications like OpenRail Designer, Promis.e, and others. They convert the files from these different applications into the Datasmith file format using Safe Software’s data conversion platform FME. With most of the data preparation automated by FME, switching from an FBX import pipeline to Datasmith was simple and straightforward. 
 

Real-time terrain deforming 

Other features the team relies on heavily include the Landscape system for building the environment and the World Composition system for level streaming. The presentation application has approximately 300 different streaming levels that are swapped in and out as needed in real time.
Image courtesy of AFRY
Upon experimenting with Unreal Engine, the team started to realize it could adapt the technology to its needs in ways that saved huge amounts of time. A case in point is the solution it developed for terrain deforming in real time. “At the start of the project, we reprocessed and reimported the terrain every time the design changed,” says Lovén. “This could take hours. It became so much easier once we had the epiphany that we could do the terrain deformation in real time on the GPU, meaning we could switch between different design options and have the terrain instantly adapt.” Lovén goes on to elaborate that their real-time terrain deforming saves the team at least four hours of tedious work per update, every week.

AFRY have also started developing tools in Unreal Engine for use in other areas. “The project has a requirement to deliver CAD-based coordination models, so we still need to update and review those,” explains Lovén. “These can contain data we don’t import to UE4. We’ve developed a simple camera view plugin that synchronizes the view in the CAD software to UE4 as you move around the world. This helps us a ton during review meetings, as the CAD software navigation can be very clunky.”
 

The team also did some tinkering to find a novel way of leveraging the power of Sequencer for their needs. Unreal Engine's multi-track editor, Sequencer is used for creating and previewing cinematic sequences in real time. The team was working alongside a communications agency with limited knowledge of real-time workflows that needed a way to create videos from the interactive environment AFRY had created. In response, AFRY developed a custom video-editing tool that enabled the agency to create basic sequences at runtime from the packaged-up project they’d been sent. The director at the communications agency could export key frames for different clips, which the team would import into Sequencer to polish up. This provided a great way for the two stakeholders to work collaboratively.
 

New real-time possibilities  

With the success it’s had using real-time technology on the East Link development, AFRY has now started using Unreal Engine for a number of new projects. Some of these are internal, such as their experimental multi-user VR road design tool, which enables four users to design roads collaboratively over a network in VR. Running both on Oculus Rift and HTC Vive, this is intended to be an early stage sketch tool for evaluating different options in road design.
Image courtesy of AFRY
Image courtesy of AFRY
Other exciting projects include one currently being undertaken for the European Spallation Source (ESS), a multi-disciplinary research facility based on what will be the world's most powerful pulsed neutron source. Here AFRY is helping engineers better understand the heavy and complicated crane operations required for maneuvering casks around the facility, modeling a traverse crane that can be controlled by gamepad and used to visualize and plan the process for loading the equipment in and out in VR. 
Image courtesy of AFRY

    Get Unreal Engine today!

    Get the world’s most open and advanced creation tool. 
    With every feature and full source code access included, Unreal Engine comes fully loaded out of the box.