Custom Level Not Loading in BeamNG.tech started with Terminal

Hi everyone,

I’m working on a custom level for BeamNG.tech v0.34.2.0 to be used within the ROS2 BeamNG simulation environment. The goal is to create a track for testing autonomous driving algorithms and start the Map with the scenario starter from the ROS2 services (I modified the example_tech_ground) scenario:

 ros2 service call /beamng_bridge/start_scenario beamng_msgs/srv/StartScenario "{path_to_scenario_definition: '/home/davide/ros2_ws/src/beamng-ros2-integration/beamng_ros2/config/scenarios/example_tech_ground.json'}"

So far, everything works fine when running the simulation via the API, but I’m encountering issues when launching BeamNG.tech from the terminal.
When I start BeamNG.tech from the terminal using the following command:

C:\Users\Davide\Desktop\MECCANICA_DEI_ROBOT\BeamNG.tech.v0.34.2.0\Bin64\BeamNG.tech.x64.exe -console -nosteam -tcom-listen-ip 0.0.0.0 -lua "extensions.tech_techCore.openServer(25252)"

I get these errors in the console:

003.350|W|GELua.core_levels.|info.json missing: /levels/Circuito_Prova/info.json
003.352|E|GELua.core_levels.|No entry point for level found: /levels/Circuito_Prova. Ignoring level.
003.354|W|GELua.core_levels.|info.json missing: /levels/Circuito_Prova.info.title/info.json
003.355|E|GELua.core_levels.|No entry point for level found: /levels/Circuito_Prova.info.title. Ignoring level.

However, the info.json file is present in the correct location:

:open_file_folder: levels/Circuito_Prova/info.json

Here’s the content of my info.json file. I created the level based on the vanilla SmallGrid map:

{
    "title": "levels.Circuito_Prova.info.title",
    "description": "levels.Circuito_Prova.info.description",
    "previews": ["Circuito_Prova_preview.jpg"],
    "size": [-1,-1],
    "biome": "levels.Circuito_Prova.info.biome",
    "roads": "levels.Circuito_Prova.info.roads",
    "authors": "Davide",
    "defaultSpawnPointName":"spawn_default",
    "flowgraphs":[
        "controls.flow.json"
    ]
}

Things I’ve Checked So Far:

:white_check_mark: The level works fine when loaded normally in-game via API.
:white_check_mark: The info.json file is correctly placed inside levels/Circuito_Prova/.
:white_check_mark: The defaultSpawnPointName is set to "spawn_default", and a spawn point exists.
:white_check_mark: No issues with JSON formatting.
:white_check_mark: The game is being launched with -console mode and -lua to open the server.
:white_check_mark: I also tried using a MOD (GridMap v1), and I encountered the same issue: the level appears in the menu when using the API but does not when launching via the terminal.
:white_check_mark: No issues with vehicle mods—vehicles can be spawned and controlled without problems. This issue only affects levels.

Questions:

  1. Why does BeamNG.tech fail to recognize my info.json file when launched from the terminal?
  2. Is there any additional setup required for BeamNG.tech to detect custom levels in this mode?
  3. Could this be related to the way levels are indexed or scanned during startup?

I’d really appreciate any insights or suggestions! Thanks in advance for your help.

1 Like

Hi,
I’m sorry for the issue, I think you encountered the same issue as one of our users on GitHub. Can you please try the solution from here?

You will need to download the techCore.lua file from the .zip and place it into %BNG_HOME%/lua/ge/extensions/tech.

Let us know if it helped.

1 Like

Thank you for your response! I really appreciate your help.

Unfortunately, the suggested solution did not work. The issue only occurs when launching BeamNG.tech via the terminal, which is necessary for us to set the listening IP.

When starting the game with API, the level loads without any issues, but when launching it through the terminal using the command:

C:\Users\Davide\Desktop\MECCANICA_DEI_ROBOT\BeamNG.tech.v0.34.2.0\Bin64\BeamNG.tech.x64.exe -console -nosteam -tcom-listen-ip 0.0.0.0 -lua "extensions.tech_techCore.openServer(25252)"

The level is not recognized, and we get the info.json missing error.

Would you have any other suggestions on how to fix this?

UPDATE

Hi,

I made some progress: I was able to load a modded level with the terminal comand (I tested with Gridmap_v1 from BeamNG) and added my custom track using the in-game editor.
This allowed me to successfully integrate BeamNG with ROS2 by modifying the tech ground scenario, which I had done multiple times before without issues.

However, since adding the new level,as you can see from the image, the comand ros2 run crashes with the following error:

... things...
  File "/home/davide/ros2_ws/install/beamng_ros2/lib/python3.10/site-packages/beamng_ros2/publishers/road_network.py", line 93, in set_up_road_network_viz
    network_def[int(r_id)] = beamng.scenario.get_road_edges(r_id)
ValueError: invalid literal for int() with base 10: 'busRoad_4'
Exception in thread Thread-1 (spin):

...things...
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
[ros2run]: Process exited with failure 1

It seems related to a conversion issue in beamng.scenario.get_road_edges(r_id).

My questions are:

  1. Is the integration compatible with modded maps? Vehicles work fine, as seen in the attached screenshot.
  2. If modded maps work, does this mean levels modified using the in-game Editor are not supported?

Any insights on this would be greatly appreciated!

Best,
Davide

Hi,
you can also set the -tcom-listen-ip through BeamNGpy, look at the documentation of BeamNGpy.open: BeamNGpy Reference — BeamNGpy documentation

I would guess that your modded level is then located in %localappdata%/BeamNG.tech and BeamNG.tech will use the %localappdata%/BeamNG.drive userpath when started from the terminal. You can run BeamNG.tech with the -userpath argument to use the former path:
BeamNG.tech.x64.exe <other arguments> -userpath "C:/Users/<username>/AppData/Local/BeamNG.tech".

About the beamng.scenario.get_road_edges(r_id) issue you get, seems to be a bug in the ROS2 integration, I’ll fix that. In the meantime, you can skip the road visualization by setting "network_visualization": "off" inside your scenario configuration file.

The integration should be compatible with modded maps and levels modified using the World Editor should be supported (so thank you for reporting all the bugs!).

2 Likes

Found the bug, will be fixed next release. In the meantime, you can fix it for your scenario by either leaving the “Name” field for roads in the World Editor blank, or setting the name to numbers only.

3 Likes

We have solved the issue, and we sincerely thank you for all the support. We successfully set up the simulation environment. In the future, we need to develop a Python subscriber to read from the topics and control the vehicle.

We are also happy that our project is helping with the bug-fixing process :slight_smile:

2 Likes