L3DT users' community
Large 3D terrain generator

ZeoGraph

Any and all chit-chat regarding L3DT.

ZeoGraph

Postby MiToVo » Tue Jul 12, 2016 5:50 pm

Hello,

So, I was looking a bit at the ZeoGraph, reading some of the info for it, etc.

I saw Aaron introduce it as "Hey, here's this cool plugin I've created", and I've seen people praising it, but I feel like I missed some important information somewhere, because I have no idea what its intended use is.

Is this an alternative way to create maps, using "nodes" rather than design map, heightmap, etc? Is it intended to be used in tandem with those methods? Is it something like World Machine where you can create environments from scratch via control nodes?

I've looked up more info on it, but it seems there's no actual explanation or overview of what its intended use or application is, or how a workflow might benefit from it, etc. Further, are there any visual examples of things people have done with it, to illustrate what it can do as opposed to the standard approach (design map, etc)?

Thanks for any info/insight y'all can provide!
MiToVo
Member
 
Posts: 15
Joined: Sun Feb 15, 2015 5:32 pm

Re: ZeoGraph

Postby Aaron » Fri Jul 15, 2016 1:08 pm

Hi MiToVo,

I apologise for the general lack of documentation or tutorials for ZeoGraph. I'll do my best to answer as fulsomely as I can:

Is this an alternative way to create maps, using "nodes" rather than design map, heightmap, etc? Is it intended to be used in tandem with those methods? Is it something like World Machine where you can create environments from scratch via control nodes?


Yes, yes, and somewhat.

You can certainly make make heightmaps without the design map using "nodes" (ZeoGraph term is "filters", as in filter graphs). ZeoGraph certainly doesn't have the same fantastic variety of filters/nodes as World Machine, but the concept is fundamentally pretty similar (I imagine; I haven't really kept up to date with WM).

You can also use ZeoGraph to modify heightmaps generated by the usual design/inflate method. There are at the time of writing some 41 filters for modifying or manipulating a heightfield:

hf_filters.png


...not to mention a further set of filters for performing operations on generic maps (including heightfields, but also colour maps, etc.), including resizing / rotating / transforming / loading / saving / etc:

filter_map.png


There are also a bunch of filters for performing simple arithmetic or logic operations, which you can think of as sort of a visual scripting language. This can be useful for modifying numeric outputs from one filter to feed into another filter (filters don't just pass maps around, they can pass numbers, text strings, arbitrary data structures, etc.) There's even a filter for popping up an edit window to change the values of one or more numeric/text parameters, so you can create a basic user interface for a calculation in ZeoGraph.

If you need more heavy-duty customisation, there is a 'ZeoScript' filter, which you can use to run custom script commands. This scripting filter can read inputs, write outputs, and generally do whatever it wants to do (scripts are quite free to mess with just about anything inside L3DT, and can even read and write arbitrary binary or text files). Scripts can be used to call other 3rd party plugins, which can themselves do just about anything Windows lets them do (run other programs, connect to the internet, etc.)

One example that demonstrates what you can do with ZeoGraph is the 'Operations->Heightfield->DesignInflate->DesignInflate64 step-by-step' menu item. This menu item calls the ZeoGraph plugin to load and run a rather large and complex 102-filter graph, which replicates the entire process of calculating a heightmap from a design map. This graphs allows you to step through each individual stage of the process of generating the heightfield from the design map. Here is most of it, spread across five or so pages:

filter1.png

filter2.png

filter3.png

filter4.png

filter5.png

[this is obviously an insane example; I don't recommend anyone tries making something like this at home]

For an extra degree of difficulty, this graph includes an awful lot of custom scripting filters to perform operations that are not currently supported by any of the prebuilt filters. For example, at various points of the graph, I call a script to store a backup point so that the user can press 'undo' in the menu to undo the last changes made to the heightfield by the graph calculation. The script in this filter looks like:

backup_filter.png


Some of the filters are implemented in plugins, but many filters are actually just fancy wrappers for scripts. For instance, the 'map.Resize' filter, which you use to change the size of a generic map, is defined in a '.zgraph' text file as a set of INPUTs (i.e. input pins), OUTPUTs (output pins), FILTERDATA (internal working variables used by the filter), and an ON_RENDER script:

Code: Select all
CLASSNAME:Map.Resize

INPUTS:3
hMapInput,hvar
nx,int,0
ny,int,0

OUTPUTS:1
hMapOutput,hvar

FILTERDATA:1
TempMap,map

ON_RENDER
if <iseq NULL hMapInput>
  echo "map.Resize error:\r\n - invalid map handle"
  return -1
endif

float minval maxval
if <not <calc.map.Resize hMapInput &FilterData.TempMap nx ny 0x0>>
  echo "map.Resize error:\r\n - cannot get resize map"
  return -1
endif

set hMapOutput &FilterData.TempMap
return 0
END


Thus, with a bit of scripting experience, you can write your own filters. The above script calls the 'calc.map.Resize' scripting function, which I think at the moment is implemented in the L3DT binary and is fairly well optimised (it's the same function you get when you use 'Layer->Resize' in the L3DT menu). My point, if I still have one, is that all this scripting adds a lot of power to customise, but doesn't necessarily slow things down.

Anyway, getting back to the sorts of things you can do with ZeoGraph: Recently a user requested a way to calculate the locations of valleys for use with land type and vegetation maps (thread here). I didn't have an algorithm that could do this already in L3DT, but my first port of call was to kludge one together using ZeoGraph:

valley_filter.png

[note there are several filters there just for saving intermediate map output, so I could visualise the calculation stages]

And whaddaya know, it worked:

Image

[of course, having prototyped the calculation in ZeoGraph, I now have to work out how to integrate the calculation with L3DT's climate generation system; this is unlikely to use ZeoGraph, as it needs some performance optimisations that can't easily be done in ZeoGraph.]

The moral here is that ZeoGraph is a pretty useful interface for experimenting with new ideas for calculations, and doesn't require the user to be able to write scripts or binary plugins (though of course you can use scripts and plugins too, if you want.)

Okay, I should stop now. Please feel free to ask any questions.

Cheerio,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3680
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Re: ZeoGraph

Postby rubner » Wed Nov 09, 2016 4:20 am

Very nice and effective range of information
rubner
Newbie
 
Posts: 1
Joined: Wed Nov 09, 2016 4:19 am


Return to General discussion

Who is online

Users browsing this forum: No registered users and 4 guests