Data driven level creation

Hi all,

I work as a producer in a AAA company. A few days ago I had an idea : what if we could use very simple tools that everybody in the industry knows like Photoshop, Illustrator or Premiere to create entire levels that we can test and iterate in an ULTRA fast manner using some kind of “translation rules”.

The goal is to give to the creative core (art director, game director, narrative director etc.) a way to iterate using top view maps. Those top view maps would be created using these simple tools and would then be translated into a fully playable 3d level in UE4 through a series of scripts outside UE4 and blueprint inside it. I really don’t care about art at this point as the goal is to test the flow of a map and not make it beautiful.

I came up with the following design for this pipeline :

  • First we need a terrain (an elevation). Photoshop would be used to create it with a simple grayscale texture. If we need verticality (e.g. a house with multiple levels) then we could use multiple layers.
  • Then we need a way to place object in the map. Illustrator, Microsoft Visio or any kind of vertor based graphic tool would be used to that extent. So anything like props, NPCs, vfx emmitters or any other kind of “placable” objects in Visio and would also have their counterpart in-engine. The idea here would be that everything than can be placed in Visio would have their actual 3d object equivalent in the engine.
  • Finally we need a way to create timelines for stuff like dialogs, cutscenes, etc. Premiere would be used as a sequencer for that. Same idea that Illustrator except shapes and form would exists only as specific timings.

Now for the actual implementation of this design :

  • for the terrain I have already a pretty cool protoype working using Procedural meshes. Basically I have a python script that reads the Photoshop grayscale layer(s), samples pixel on a grid and generate a csv file that is then read by a Data Table which in turn feeds vertices, triangels and UVs to a Procedural Mesh generation node. Works like a charm and it’s pretty ■■■■ cool. I have a standard gray material assigned ot it and it works great ofr the purpose of this pipeline.
  • for the instances generation I think I’ll implement the same kind of logic : I would have a script that reads the Illustrator or Visio file, generates a list of objects with their position. This information would then again be exported to a csv and fed to a blueprint that would spawn all of these object on the map using this method (https://answers.unrealengine.com/questions/442629/spawn-blueprint-by-stringpath.html). The only exception is that I would put the script on a forloop rather than hard coding values for String and Transform.

I’m a now struggling with two things for which I would love to have your input :

ISSUE 1 : INSTANCES THAT HAVE TRIGGERS

I must be able to trigger stuff in the map. For example you walk in a certain location and it triggers a vfx emmiter a bit further away in the map (e.g. something has exploded down there and you now must investigate it).

Using this example I would for example have a blueprint that would have two public variables : the location of the trigger and the type of vfx to spawn. If i do use this method (https://answers.unrealengine.com/questions/442629/spawn-blueprint-by-stringpath.html) I suppose I would have to add a bit more logic after the Spawn Actor node so I can set these two variables to their correct values. But the problem is I have a dozen if not more type of bluprint and all of them could have different properties.

I think the solution is, as ugly as it maybe, to hard code a Switch on String with all the type of blueprint that are supported to do a Cast as “type of blueprint” so that I can clearly access the public variable of blueprints which would then be set using the csv data. The problem is : I expect the number of blueprint to grow VERY VERY fast and the Swtich will become abslustly gigantic.

Is there a better solution ?

ISSUE 2 : TIMELINES

For this one I have absolutly no idea how to make this happen. My goal is to (just like the terrain and the list of instances) create some kind of data out of the premiere file that UE4 could read and translate into a time based events. You would hit a trigger and a given series of event would play like camera translation over time, vfx emitter, setting pose on 3d character, etc. I have seen no blueprint node that would allow me to add a track to a timeline. Evertyhing I’ve seen this far requires to “hard code” tracks in timeline nodes or in a sequencer.

For this one I really need your help because it could be a deal breaker.

The only solution I could think of is to pre-create a whole bunch of timelines (likes hundreds of them) with increments of, say, 0.5 seconds for their duration that would all have the same bunch of tracks (like interpolating a float from 0 to 1, setting True at first frame and setting False at last frame, etc., etc.). I would then use my csv data to know which timeline to use based on a duration parameter and which track of that timeline to use based on a property paramater. But man… I really don’t want to do this.

Is there a way I can “simply” set the duration of a timelinme, its tracks and keyframes using blueprint nodes ? Or using any other kind of data driven approach ?

Thank you very much for your time reading time. I’m really looking forward to see your asnwers.

Guillaume

By Timelines are you referring to these unwieldy things?

I recall having a similar problem over how uncontrollable the internals of timelines were and ended up creating my own custom nodes that might be useful here. For example, a simple timeline that linearly interpolates a float from 0 to 1 could be implemented as:

While a timeline that sets a bool True at first frame and False at last frame could be:

These both run off the FlowChargeUp node which I guess could be called a Latent State Node. I’m not sure if this is what you’re looking for, but let me know and I can describe them in a bit more detail

Hi ElderTwin !

That’s actually pretty neat !! I would love to know more about how these node are built because that’s exactly what I would need I think.
I could input whatever TimelineDuration comes from my data and trigger event at specific moment.

How does these two node interact with each other ? Are they referecing an external object ? Can I have mutliple of these timelines run at the same time if they are on different object (like one timeline per object for example) ?

Guillaume

The OnFlowStart node and the FlowChargeUp nodes are part of a custom macro library that utilize Unreal’s latent action manager (the same mechanism behind the Delay and Retriggerable Delay nodes). These nodes are entirely independent and you can have as many as you want on one or several blueprints. For example:

I’ve talked about these nodes in detail in a previous thread which is a bit out of date:

https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/118142-custom-flow-control-macro-library-request-for-feedback

The main tough part is creating the CustomRDelay node which is pretty much an exact copy of the Retriggerable Delay node except that it will always delay an execution pulse for at least 1 frame. Unreal did a restructuring of their C++ coding a few versions back so you may require different C++ files depending on what version you’re using. If you’re running 4.13 or below, you can use the C++ files in the above link but let me know if you’re running above that and I can try to dig up my current files. Once you have the CustomRDelay node working properly, just recreate the macros in the above link and you’re good to go.

I should mention that there are some significant bugs with these Latent State Nodes on any version before Unreal V4.19.2. If you’re running on earlier versions, then you might encounter inconsistent behavior when copying and pasting them.