Documentation‎ > ‎

Adding To NEDE

NEDE is open-source, allowing any member of the community to create new functionality in areas of importance to them. This section will help you to create new assets for use in NEDE. It will also help you understand how certain additions work in NEDE.

Exporting Your Assets

  • To share the assets you have created (for example, a scene or folder), select them in the Unity editor's "project" tab, right-click, and click "Export Package...". In the window that pops up, make sure "Include dependencies" is checked, then click "Export..." and make a descriptive filename. This should create a single file with extension ".unitypackage". This is the file you will upload to this site.
  • To get permission to upload the site, join the nede-neuro Google group. Then when you visit any page on the site, click "Sign In" at the very bottom (on the left). If your google account is successfully a member of the Google group, this should navigate you to the corresponding Google Sites page, where you can edit the page or upload files.
  • Upload your file to the appropriate subpage of Downloads, and be sure to add a description so others know what to expect or how to use it. In place of a readme file, we suggest adding a page to the Documentation portion of this site to explain how to use your file.

Adding New Stimuli

  • Each stimulus category has its own folder in the resources folder. To make a category of 2D stimuli, simply place the stimuli in a folder and drag that folder into the Resources folder in the Unity editor. This should convert and import your image files so that Unity can read them properly. Be sure to give your folder a descriptive name that would look good in a task prompt (a singular noun, e.g., "laptop", is preferred).
  • To make a category of 3D stimuli, create a folder of 3D models (See this page for a list of supported formats) and drag it into the FBX_Models folder in the Unity editor (you can create this folder if it does not exist, but this is folder is only to keep things organized and is not essential). This will import the models into Unity and convert them as necessary. Then create a folder for this category in the Resources folder (with a descriptive name as in the 2D case) and create one new prefab for each object (Right-click, click Create -> Prefab to create one, then click on that and duplicate, using cmd-D or ctrl-D, as many times as needed). For each object, drag the main model from the FBX_Models folder onto an empty prefab. Then give that prefab a descriptive name (if desired).
  • To add your new category to the experiment, simply run the Startup scene to see the runtime GUI, type your new category's folder name at the bottom of the "Category" window, and click "+ New Category". Be sure to save your change to a params (.ini) file so you don't have to repeat this every time you run the experiment.
  • Export and upload the stimulus folder (the one in the Resources folder) using the instructions above.

Adding a New Environment

  • We recommend making a new scene by copying and modifying an old one inside an existing NEDE project. This will keep consistent certain properties of the scene, including lighting, camera properties (clipping, culling mask, and field of view), layers and tags (these last two are critical for proper stimulus placement in NEDE). 
  • Gravity rules apply in NEDE, so each environment must have a solid floor (with a Mesh Collider attached). Sometimes planes are unreliable, and resized cubes can be used instead. Walls should also have mesh colliders.
  • Each environment must have placeholder objects (typically spheres) where stimuli should appear. These placeholder objects should be given a "Locations" tag and placed in the "Locations" layer. Each placeholder object should have a parent with the "Cubbies" tag. If this parent object is not shaped like the "DoubleCubbyPrefab" used in the original NEDE environments, then object boundary calculations may be thrown off. During an experiment, the PlaceAll.js script will find all the "Cubbies" parents and all their "Locations" children. One location in each cubby will be randomly selected to hold an object.
  • To allow the subject to be navigated automatically in your environment, you must create a route text file with the same name as your environment (but ending in .txt) and place it in the NedeConfig folder. This file will be read in and a randomly selected portion (of specified length) will be traversed using RobotWalk.jsEach line of the file should be in the format "X,Z,P", where (X,Z) is the waypoint and P is a binary value indicating whether an object will be viewed by reaching that waypoint. 
  • Save your scene, then export and upload it using the instructions above.

Adding Scripts

  • Be sure to comment your script thoroughly to help future users modify or improve it.
  • Include instructions on how your script should be attached (manually or in scripting) and used in existing experiments.
  • Create a new page in the Documentation/Scripts section of this site (add it to the appropriate subfolder or make a new one).

Editing the EyeLink Wrapper DLL

  • Download the EyeLink SDK and be sure you have access to MS Visual Studio.
  • Download the latest EyeLinkWrapper project from the downloads page and give it a new name.
  • Edit the .c and .h files as desired, and re-compile the project into a DLL.
  • Copy the new dll into the Plugins folder of your Unity project. 
  • Edit the eyelink.cs file to reference your new plugin instead of the old eyelink wrapper dll.
  • Upload your DLL and/or visual studio project to the Downloads/Plugins section of this site.