JOY OF PROGRAMMING - Software Engineering Simulator

JOY OF PROGRAMMING - Software Engineering Simulator

34 ratings
Using VS Code or other external IDEs
By maschere
This is a short guide for those that prefer to use VSCode (or other external IDEs like PyCharm) to write Python code for JOY OF PROGRAMMING.
2
3
2
   
Award
Favorite
Favorited
Unfavorite
Editing Code
This is a short guide for those that prefer to use VSCode (or other external IDEs like PyCharm) to write Python code for JOY OF PROGRAMMING. It’s recommended that you have a dual monitor setup for this.
  • Install VSCode along with the Python and mypy integration https://code.visualstudio.com/docs/python/python-tutorial
  • Open VSCode and open the folder “My Documents\JoyOfProgramming” as your workspce
  • Open the command palette (Ctrl + Shift + P) and chose “Python: Select Interpreter”
  • Click “Enter interpreter path…” and then “Find…”
  • Now browse to your Steam installation folder (usual “C:\Program Files (x86)\Steam\steamapps\common\”) and from there to “JOY OF PROGRAMMING\JoyOfProgramming\Content\000_MyContent\External\python-3.10.4-embed-amd64” and select “python.exe”
  • You are ready. Start the game on one screen and keep VS Code open another monitor.

In the game, start a level of your choosing and open the in-game code view. This should create a boilerplate file for the current level called “<LevelName>_0.py” under "My Documents\JoyOfProgramming". You can open this file in VSCode and start editing. Once you are satisfied and saved your code, go back to the game and either click “Run Code” directly or type anything in the code window to have it reload the file you just changed. It's best not change code from within the game if you are using this workflow.
Running Code
With the setup from above, it would also be possible to run and debug your code directly from within VSCode while the game is running. Additionally you could also select another local python interpreter and install the pyjop package there. This however circumvents some security features within the game and several gameplay features might not work correctly. As such, this is not recommended and not officially supported.
12 Comments
Grim Leaper Jan 28 @ 5:19am 
@maschere, any chance you could add an option *not* to lock the mouse to the JOP window? It would make switching between IDE and JOP a lot easier. Never mind, I found the Mouse Lock option eventually, above the keyboard control settings!

BTW I hacked together a basic requirements.txt by running:

> "D:/SteamLibrary/steamapps/common/JOY OF PROGRAMMING/JoyOfProgramming/Content/000_MyContent/External/python-3.10.4-embed-amd64/python.exe" -m pip freeze > requirements.txt

# Now edit pyjop line in requirements.txt to say:
# pyjop @ {LINK REMOVED}

> .venv\Scripts\pip.exe install -r .\requirements.txt
Grim Leaper Jan 28 @ 3:42am 
Hi @maschere, I'm trying to adapt these instructions to work with PyCharm and mypy-pycharm-plugin, but I'm running into a few problems. The mypy.exe in python-3.10.4-embed-amd64\Scripts seems to have some hard-coded file paths from your build machine. Also, the version of the mypy module is a bit old and doesn't seem to support options like "--output json". Would it be possible to update mypy?

Or, to approach this another way, would it be possible for you to publish a requirements.txt, setup.py, pyproject.toml or similar, to help users configure the right set of Python dependencies without using the embedded Python installation directly? Thanks.
Comic Sans Frontieres Jan 22 @ 1:07pm 
Thanks! I'll comment again if I get it working, didn't try the game and leaving my my vscode open.
maschere  [author] Jan 21 @ 12:04am 
I'm not sure if running vscode from a wsl partition will work, because you need to access files in the game's install directory and the documents folder.
Comic Sans Frontieres Jan 20 @ 7:29pm 
I installed my vscode on a ubuntu/wsl partition but I usually run windows, I think I'm doing something wrong, says mypy isn't installed on the path. (python select interpreter doesn't show).
maschere  [author] Jan 18 @ 10:50pm 
You can install it from Github: https://github.com/maschere/pyjop
SIGSTACKFAULT Jan 18 @ 8:01pm 
Where do I find the pyjop backage to install in a local python interpreter? it's not on PyPi.
adeilt Feb 10, 2024 @ 1:40pm 
You can get vscode to recognize the API by telling it where to look. I searched the settings for "python.envFile" to find where vscode was expecting to find the environment file (for me it was ".env") and added the following line:

PYTHONPATH="C:/Program Files (x86)/Steam/steamapps/common/JOY OF PROGRAMMING/JoyOfProgramming/Content/000_MyContent/External/python-3.10.4-embed-amd64/Lib/site-packages/"

I converted the backslashes to forward slashes to avoid escaping them and that seems to work.

(Also, didn't Steam used to have [code][/code] tags?)
Zaphod Feb 8, 2024 @ 3:17pm 
Wow. This I can't wait to try.
Zarrakis Feb 5, 2024 @ 12:51pm 
Works perfectly. Thanks boss!