<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pioneerspacesim.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gliese852</id>
	<title>PioneerWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pioneerspacesim.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gliese852"/>
	<link rel="alternate" type="text/html" href="https://wiki.pioneerspacesim.net/wiki/Special:Contributions/Gliese852"/>
	<updated>2026-09-12T09:36:22Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.pioneerspacesim.net/index.php?title=Development_Tools&amp;diff=4311</id>
		<title>Development Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.pioneerspacesim.net/index.php?title=Development_Tools&amp;diff=4311"/>
		<updated>2022-01-06T17:47:17Z</updated>

		<summary type="html">&lt;p&gt;Gliese852: /* Editor integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here we aim to document little known features that developers add to help themselves in the development process, wheather that be debugging, profiling, or what else&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Debug ==&lt;br /&gt;
&lt;br /&gt;
Build debug &lt;br /&gt;
&lt;br /&gt;
    ./bootstrap -DCMAKE_BUILD_TYPE=Debug&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To record video from gameplay (e.g. to document unexpected behavior):&lt;br /&gt;
&lt;br /&gt;
    To record video directly from Pioneer you will need to add the line&lt;br /&gt;
    RecordVideo=1 somewhere within your config.ini file. Then once ingame&lt;br /&gt;
    you can press Ctrl+ScrLk to start or stop recording.&lt;br /&gt;
&lt;br /&gt;
=== Debug from in-game ===&lt;br /&gt;
&lt;br /&gt;
Ctrl+I = debug window&lt;br /&gt;
&lt;br /&gt;
Ctrl+F10 open planet viewer, to view selected nav target&lt;br /&gt;
&lt;br /&gt;
Ctrl+F11 reload shaders while running game&lt;br /&gt;
&lt;br /&gt;
Ctrl+Del reload pigui element, allows for live coding. Limited support: Only reloads the active view and then only if the active view has manually enabled it (add `debugReload = function() package.reimport() end` to the view's definition next to the draw and refresh functions)&lt;br /&gt;
&lt;br /&gt;
=== Debug savegame files ===&lt;br /&gt;
&lt;br /&gt;
 ./build/savegamedump savefiles/&amp;lt;mysavename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and look in your savefile folder (e.g. ~/.pioneer/savefiles on linux) at &amp;lt;mysavename&amp;gt;.json file, put JSON e.g. into http://jsonviewer.stack.hu/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Misc. ===&lt;br /&gt;
&lt;br /&gt;
Pioneer can dump galaxy information, to make sure the galaxy hasn't changed, or to gather statistics, described here:&lt;br /&gt;
https://github.com/pioneerspacesim/pioneer/pull/2811&lt;br /&gt;
&lt;br /&gt;
The quit confirmation box can be supressed by putting ConfirmQuit=0 in the pioneer configuration file&lt;br /&gt;
&lt;br /&gt;
== Profiling ==&lt;br /&gt;
&lt;br /&gt;
For Profiling, one needs some tools installed?&lt;br /&gt;
&lt;br /&gt;
Now new profiling functions merged:&lt;br /&gt;
[https://github.com/pioneerspacesim/pioneer/pull/5168 Add zone-based profiling support #5168]&lt;br /&gt;
&lt;br /&gt;
=== Build with profiling support ===&lt;br /&gt;
&lt;br /&gt;
ToDo edit this to improve and make sense and be correct&lt;br /&gt;
&lt;br /&gt;
Profiling: to build with the profiler enabled, simply run ./bootstrap&lt;br /&gt;
-DPROFILER_ENABLED=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo and compile as normal.&lt;br /&gt;
The latter flag is not strictly needed, but building with a BUILD_TYPE&lt;br /&gt;
&lt;br /&gt;
To-do: extract wisdome from this conversation, https://github.com/pioneerspacesim/pioneer/pull/4764 and document here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;fluffyfreak&amp;gt; Gliese852, if you're on Windows then I use&lt;br /&gt;
                  https://github.com/VerySleepy/verysleepy a lot of the time&lt;br /&gt;
                  [17:37:07]&lt;br /&gt;
    &amp;lt;Gliese852&amp;gt; fluffyfreak: thanks, I meant the built-in profiler, it seems that&lt;br /&gt;
                if you do nothing, it creates a report on the launch of the&lt;br /&gt;
                program, and the launch of a new game [17:54:21]&lt;br /&gt;
    &amp;lt;fluffyfreak&amp;gt; If you're running the profile build then you can press Ctrl+p to&lt;br /&gt;
                  take a profile at any time [17:58:50]&lt;br /&gt;
    &amp;lt;fluffyfreak&amp;gt; hmm, been a while since I used it. There's two modes [17:59:37]&lt;br /&gt;
    &amp;lt;fluffyfreak&amp;gt; Ctrl+shift+p = is capture one frame, otherwise Ctrl+p toggles&lt;br /&gt;
                  capturing whenever the framerate is &amp;quot;slow&amp;quot; [18:00:12]&lt;br /&gt;
    &lt;br /&gt;
=== Using profiler ===&lt;br /&gt;
&lt;br /&gt;
to do&lt;br /&gt;
&lt;br /&gt;
=== clang format check ===&lt;br /&gt;
&lt;br /&gt;
    Yes, for your use you'd likely want to invoke `FORMAT_BASE=master ./autoformat` or `FORMAT_BASE=HEAD~1 ./autoformat`&lt;br /&gt;
    - there's little difference between the `autoformat` script and the `scripts/clang-format.sh` script other than the &lt;br /&gt;
    latter prompts you to automatically apply the issues in your files.&lt;br /&gt;
&lt;br /&gt;
== Editor integration ==&lt;br /&gt;
&lt;br /&gt;
There is support for sending Lua code from IDE into running pioneer session via TCP:&lt;br /&gt;
https://github.com/pioneerspacesim/pioneer/pull/3768&lt;br /&gt;
https://github.com/pioneerspacesim/pioneer/pull/4799&lt;br /&gt;
&lt;br /&gt;
=== Easy start (Linux) ===&lt;br /&gt;
&lt;br /&gt;
1. Reconfigure with remote lua console support and rebuild:&lt;br /&gt;
 ./bootstrap -DREMOTE_LUA_REPL=ON&lt;br /&gt;
 make -C build -j4&lt;br /&gt;
&lt;br /&gt;
2. Now after starting a new, or loading a saved game, you can connect to the program via telnet on port '''12345''':&lt;br /&gt;
&lt;br /&gt;
 $ telnet localhost 12345&lt;br /&gt;
 Trying 127.0.0.1...&lt;br /&gt;
 Connected to localhost.&lt;br /&gt;
 Escape character is '^]'.&lt;br /&gt;
 ** Welcome to the Pioneer Remote Debugging Console!&lt;br /&gt;
 &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can run any lua commands.&lt;br /&gt;
&lt;br /&gt;
=== Example of use with VIM for hot reloading of the module ===&lt;br /&gt;
&lt;br /&gt;
I added the following code to '''~/.vimrc:'''&lt;br /&gt;
 nmap ;mm :w&amp;lt;CR&amp;gt;:call PioneerReloadModuleFnc(expand(&amp;quot;%&amp;quot;))&amp;lt;CR&amp;gt;&amp;lt;CR&amp;gt;&lt;br /&gt;
 function! PioneerReloadModuleFnc(filename)&lt;br /&gt;
 	let s:data = strcharpart(a:filename, 0, 4)&lt;br /&gt;
 	let s:lua = strcharpart(a:filename, strlen(a:filename) - 3, 4)&lt;br /&gt;
 	if s:data == &amp;quot;data&amp;quot; &amp;amp;&amp;amp; s:lua == &amp;quot;lua&amp;quot;&lt;br /&gt;
 		let s:crop = strcharpart(a:filename, 5, strlen(a:filename) - 9)&lt;br /&gt;
 		let s:convert = substitute(s:crop, &amp;quot;/&amp;quot;, &amp;quot;.&amp;quot;, &amp;quot;g&amp;quot;)&lt;br /&gt;
 		let s:command = &amp;quot;package.reimport(\&amp;quot;&amp;quot; . s:convert . &amp;quot;\&amp;quot;)&amp;quot;&lt;br /&gt;
 		:execute &amp;quot;!echo '&amp;quot;. s:command . &amp;quot;' | telnet localhost 12345&amp;quot;&lt;br /&gt;
 	else&lt;br /&gt;
 		:echom &amp;quot;ERROR: file should be \&amp;quot;*.lua\&amp;quot; and in \&amp;quot;data\&amp;quot; subfolder&amp;quot;&lt;br /&gt;
 	endif&lt;br /&gt;
 endfunction&lt;br /&gt;
&lt;br /&gt;
Now when pressing the combination ''';mm''' in normal mode, the file is saved, then telnet is launched and the command is sent:&lt;br /&gt;
 package.reimport(&amp;lt;your module name&amp;gt;)&lt;br /&gt;
where the module name is taken from the name of the file being edited. This leads to a reload of this module without restarting the game.&lt;br /&gt;
&lt;br /&gt;
A short video of how it might look: https://youtu.be/f5s_tuAv6fc&lt;/div&gt;</summary>
		<author><name>Gliese852</name></author>
		
	</entry>
</feed>