Commutator by Sodoj

[raw]
made by Sodoj for Ludum Dare 53 (COMPO)

commutator.png

Please read below before downloading!

In Commutator, you take on the role of the hardworking postman, Wilson, as he embarks on a perilous journey to deliver important packages to their recipients. But there's a twist – all of the packages are scattered across the town! To make matters worse, the packages keep piling up and Wilson must strategically collect them to avoid crashing and losing everything! Will Wilson ever make his delivery?

But wait, why does it look like a typical snake game that is somehow played in Microsoft Paint? Well, it's simple, it's because it is! Yeah, Commutator is a fully playable snake game in a Microsoft Paint window that allows for player input, growing snake, keeping score and increasing speed! Just pretend it's a little postman running around and collecting packages in order to fit this game with this Ludum Dare theme :p

ezgif-2-6ce11e3688.gif

HOW TO PLAY

Well, this is where it gets a little tricky. Commutator is not really a game in a traditional sense, but rather a Python script that simulates the snake game using your mouse! It requires more effort to run than your average game and it can be a little bit scary, but I promise you there is nothing to worry about!

Choosing a method

There are two methods you can play this game. The only thing you really need for both of these methods is to have is a computer with English Windows 10. The game simulates Wilson's movement with your mouse input and the first couple of inputs the game makes is setting up the canvas for the game, which was preconfigured for Windows 10 version of Microsoft Paint. The game then assumes everything is set up correctly so it starts moving your mouse and clicking. I haven't tested the game on Windows 7 or Windows 11, but you can feel free to give it a go! If anything goes wrong, you can press the Escape button which will stop the game immediately.

Well now, off to the two methods:

Method 1: Running the Source Python script

In order to run this script, you'll need to have several libraries installed:

  • pyautogui (pip install pyautogui )
  • pygetwindow (pip install pygetwindow)
  • pywin32 (pip install pywin32)
  • keyboard (pip install keyboard)
  • for updated version - psutil (pip install psutil)

There are two source scripts, one called CommutatorSource.py, which creates a canvas which dimension's are 800x600 and another one called CommutatorSource_NonStandard.py, which creates a canvas with dimensions of 640x480 . Non standard screen sizes like screens with 768p should ruin the NonStandard version of the code. When you

Method 2: Downloading and running the .exe

This method may seem more straightforward, but here's the catch: antiviruses really don't like precompiled Python scripts and they flag them as potentially harmful so you'll have to go out of your way to wrestle with your antiviruses in order to play the game. I recommend this method only if you really don't want to bother with setting up Python. The standard and non standard version of executables are the same deal, pick whichever suits your screen.

UPDATE: The Updated version of source is now available, including the support for French and Spanish Display language, Automatic Canvas resize depending on the screen you have and an option to resize the dots representing the player and the pellets! before the game starts!

Playing the game

When you run the script, let go of your mouse! The script will take control of your mouse and keyboard to run mspaint using the run command and will set up the game board for you. If you move your mouse in a meantime, there's a chance the script will missclick something and the worst it can happen is that the game will start clicking on your files, folders and whatnot! Again, if anything goes wrong, pushing the Escape key on your keyboard will end the game and the script.

Once the screen is set up and you see snake moving, then you can control it. You can control snake with WASD buttons. Once you lose, the game will display your final score and MSPaint window will close. If you want to play again, just run the script/exe!

I hope this wall of text won't intimidate too many people. I am very happy with how this project has turned out and I had a lot of fun working on it.

Have fun!

Ratings

Overall 175th 3.633⭐ 62🧑‍⚖️
Fun 188th 3.433⭐ 62🧑‍⚖️
Innovation 2th 4.628⭐ 76🧑‍⚖️
Theme 381th 2.754⭐ 63🧑‍⚖️
Graphics 328th 2.982⭐ 58🧑‍⚖️
Humor 38th 3.925⭐ 62🧑‍⚖️
Mood 178th 3.389⭐ 20🧑‍⚖️
Given 93🗳️ 157🗨️

Feedback

Nathan Franck
01. May 2023 · 19:39 UTC
The concept is hilarious! Not going to touch it from my work computer, bad look to be running un-sandboxed code on an intranet device. 😀
DecadeDecaf
01. May 2023 · 19:58 UTC
VERY cool concept!! I appreciate how you included a drawing and some theatrics on the LD page; it was a lot more interesting to imagine a mail carrier collecting packages than a bunch of dots in MS Paint collecting more dots. Creative stuff!
![snake.png](///raw/d0f/12/z/591b8.png)
blobo
01. May 2023 · 20:01 UTC
What a brilliant concept! Making a game that runs in MS paint is wild, and I love everything about this.

I recorded myself playing if you want some extra feedback. I don't have too much to say, it's just snake, but the medium in which you have presented snake is hilarious and crazy. Great work!

https://www.youtube.com/watch?v=6PDXqcZaBWU
ScalphaMission
01. May 2023 · 20:29 UTC
This deserves all the stars for innovation. I truly would never have thought to do this. check out my live review at https://www.twitch.tv/scalphamission
k8n
01. May 2023 · 23:58 UTC
Cool concept, but I couldn't play it. MSPaint has started, but other than that nothing happened for me =(
Answer21
02. May 2023 · 11:25 UTC
Very, very interesting, unusual game with unusual mechanics and perfect graphics)
Alex Chertilin
02. May 2023 · 12:50 UTC
I like the title picture so much
Timbaleek
02. May 2023 · 12:51 UTC
Wow really innovative and amazing that you got it to work :)
RegisMeysso
02. May 2023 · 13:10 UTC
very innovative
velvetlobster
02. May 2023 · 13:27 UTC
this is a crazy crazy idea, the kind of thing I love the most about ludum dares, some people will go far beyond what one can imagine a game to be, thanks for making this
seurimas
02. May 2023 · 13:29 UTC
It doesn't seem to play well with Windows 11, sadly! The pencil icon is in a different location, is all:
![Pencil.png](///raw/8c1/z/5a9d4.png)
DrunkardWolf
02. May 2023 · 14:26 UTC
Love this, really a cool idea :) good work
a333
02. May 2023 · 14:29 UTC
5/5 graphics here, mate! Great job!
Vectrex28
02. May 2023 · 17:36 UTC
Oh wow. This sort of stuff has to be one of my favourite things about LD - there's always going to be one game where the person went above and beyond as to what platform to run the game on - and it looks like we got a winner for this jam. Top stuff!
JimmyMcGinger
02. May 2023 · 19:54 UTC
What a clever idea! Getting it running in MS Paint is impressive.
Patrick Abernathy
02. May 2023 · 20:38 UTC
It's really cool that you made this in Paint. It's a new way to play a game we have been playing for years.
cepeka
02. May 2023 · 20:40 UTC
This is getting ridiculous.

I love it.
SID37
02. May 2023 · 20:45 UTC
I was able to launch the game.. only in a virtual machine.. Definitely, the most fun jam game
TrampolineTales
03. May 2023 · 19:35 UTC
What a rad idea. Makes me want to make a borderless (or maybe even windowless?) game that's played entirely on the desktop.
JosephGallear
03. May 2023 · 19:51 UTC
Wasn't able to properly play this in Windows 11; the canvas size didn't get changed and there was nothing being drawn. However, I was still able to play somewhat just by looking at where the mouse cursor was, which is a crazy thing to say. Great idea and as a big fan of Paint I just wish I could play it properly!
blank_3D
03. May 2023 · 20:42 UTC
Awesome! Innovation and graphics are a solid 5/5
Austin Sierra
03. May 2023 · 20:54 UTC
Classic twist on a classic program!
Sarah
03. May 2023 · 22:52 UTC
This is a really interesting idea and it's super cool that you got it working. I literally have never imaged something like a game running in paint, but great job getting it done!
andrground
04. May 2023 · 07:51 UTC
incredibly unique idea, this should definitely be at the top in innovation category
LDJam user 245646
04. May 2023 · 16:31 UTC
This is actually insane
MAT4DOR
04. May 2023 · 18:44 UTC
Amazing concept :trophy:
Sheepolution
04. May 2023 · 20:21 UTC
Very clever!
JAsonsumm1
04. May 2023 · 21:37 UTC
Whaaat?! This is crazy!! I love it haha! ...wow! Innovation 5*, Graphics 5* :zap:
EmeraldAlkemist
04. May 2023 · 23:47 UTC
This game is great. While it doesn't fit the theme very well, I think it's very interesting that you've managed to make a game inside of MS Paint.
LDJam user 316658
05. May 2023 · 01:53 UTC
i LOVE this!!! i was honestly a bit intimidated to install after seeing the text BUT it was definitely worth it & i think anyone else on windows should give it a try, what a cool experience!
GreenwoodDrive
05. May 2023 · 03:42 UTC
Hahah wow talk about innovation :D Great job :)
Tyrannas
05. May 2023 · 22:14 UTC
Ran the python script and it's opening mspaint but then nothing is happening :/
🎤 Sodoj
05. May 2023 · 22:23 UTC
@k8n @tyrannas Well, that's not good. I tested the script on a slower PC and it had trouble running it the first time, but after a couple of times it eventually work, so you could maybe try that. Additionally, since I have no idea why that happens on your PC, I'd appreciate if you shared with me the terminal log. Either way, I am really thankful that you guys took some time out of your day to try out my game, it really means a lot!
Tyrannas
05. May 2023 · 22:33 UTC
Oh yeah sorry didnt even check the logs (main python dev here, and didnt think of that lol), here you are in case that helps:
``` mspaint_window = gw.getWindowsWithTitle('Untitled - paint')[0]
IndexError: list index out of range```
🎤 Sodoj
05. May 2023 · 22:41 UTC
@tyrannas Aha, I see. That line is looking for the window called 'Untitled - Paint' so it could focus it and maximize it. I guess that if your OS is in foreign language that window is not called 'Untitled - Paint', but rather something else. If that's the case, you can rename 'Untitled - Paint' to whatever it's called in your language and it will work.

This is a huge oversight on my part, it never occurred to me that people don't necessarily have Windows in English while I was developing the game, so thank you for pointing that out to me! I'll see how I can address it!
Tyrannas
05. May 2023 · 22:57 UTC
Okey i fixed the window button, but now I got another one:
```
Traceback (most recent call last):
File "C:\Users\Utilisateur\Downloads\Commutator_Source.py", line 68, in <module>
canvas_x, canvas_y, canvas_width, canvas_height, board_width, board_height = get_canvas_position()
File "C:\Users\Utilisateur\Downloads\Commutator_Source.py", line 48, in get_canvas_position
rect = win32gui.GetWindowRect(paint_win)
pywintypes.error: (1400, 'GetWindowRect', 'Handle de fenêtre non valide.')
```
🎤 Sodoj
05. May 2023 · 23:08 UTC
@tyrannas From the looks of it, the window name you replaced it doesn't match with the name of the window. You may have misspelled it or there's maybe a special character you missed. From the looks of it, you're French, so the name of your mspaint window should be 'Sans titre - Paint', and the line of code should be
`mspaint_window = gw.getWindowsWithTitle('Sans Titre - Paint')[0]`

If you are sure the name you put in the parenthesis and the name of your window match, then I'm not sure what would cause the issue. Either way, thank you so much for taking time to debug this with me!
Tyrannas
05. May 2023 · 23:12 UTC
The window was changing name, basically there at the beginning of the code it should be "Sans titre - Paint" and then later "805.png - Paint". Now it's running without error but I think the script isnt changing the window size properly so the mouse moves but it's not drawing anything haha
I'm gonna try to find
🎤 Sodoj
05. May 2023 · 23:17 UTC
@tyrannas That's very strange. Are you on Windows 11 by any chance? If so, there may be some issues since I calculated the window setup for Windows 10. If you are on Windows 10, then make sure you don't touch the mouse while the board is being drawn!
Tyrannas
05. May 2023 · 23:39 UTC
Nah windows 10 but I think it's clicking on an option it shouldnt probably cause menus are not ordered the same in french ^^ ! Is it supposed to open this window ? Cause after opening this, the script just moved the mouse (and it does nothing) and ends [Capture d’écran 2023-05-06 013842.png](///raw/3bf/z/5b6df.png) (edit: i think my image is not being uploaded)
🎤 Sodoj
05. May 2023 · 23:44 UTC
@tyrannas Oh shit, I had no idea, I'd love to see what that looks like. Could you add me on Discord or something to chat?
Tyrannas
06. May 2023 · 00:15 UTC
Sorry just saw your message, finally managed to get it working, menus were indeed at the wrong place, and then it also wasnt clicking at the right place (no idea) why ! Thanks to @100th-coin video I was able to see was the script was really supposed to be doing and find the right x, y to make it work lol. Also mapped french keys: https://pastebin.com/2EremC2X

Well now going to bed, way to late and spent way too much time on this lol, let's say it was a part of the game ! Anyway, your idea was crazy and I really wanted to try it, great idea even if the game is super simple, good job !
🎤 Sodoj
06. May 2023 · 00:22 UTC
@tyrannas I love you dude, thank you so much for being so invested in this project! You've been an immense help in helping me figure out where to go next with this project by finding this oversight. Also kudos for bothering to fix it, it means the world to me!
LDJam user 302410
06. May 2023 · 10:19 UTC
Lol WOW
Firespike33
07. May 2023 · 01:50 UTC
Hilariously cool concept. I was using the exe version on Windows 10 and it seemed like the eatable dots stopped appearing after a while.
DGSpitzer
07. May 2023 · 01:57 UTC
5/5 on Innovation! That's insane you can make such a game in 48 hours with this fantastic idea!
🎤 Sodoj
07. May 2023 · 10:30 UTC
@firespike33 It's very possible that pellets spawned right onto border lines, although I'm pretty sure that isn't supposed to happen. Thank you for reporting it, I'll investigate and see what's up with that. It would help a lot if you tell me which exe did you download, as well as your screen resolution!
LDJam user 233347
07. May 2023 · 12:04 UTC
Not sure if screen or PC issue - but Win10 with 4k at 150% gives odd results.

I did use the precompiled jam version though.

![Communicator-1.png](///raw/38f/83/z/5b883.png)

![Communicator-2.png](///raw/38f/83/z/5b884.png)
🎤 Sodoj
07. May 2023 · 12:16 UTC
@xparker The 150% zoom is causing the issue. Thank you for letting me know, if it's not a problem, could you try running the game at 100% zoom just so I could have some idea about how the program behaves at regular 4k screen? Sorry for the trouble!
LDJam user 233347
07. May 2023 · 16:48 UTC
@sodoj Sorry for the late reply. With 100% it works as intended - though barely visible for my eyes. :smile:

EDIT: 125% causes same issue as 150% (duh)

![Communicator-3.png](///raw/38f/83/z/5b8c7.png)
🎤 Sodoj
07. May 2023 · 17:28 UTC
@xparker That's good to know, thank you for going out of your way to test it out!
AVAVT
08. May 2023 · 03:33 UTC
Heyo, interesting concept!

I played the JAM exe version and the postjam script:

- I think you need to update the instructor the postjam script, there's also `psutil` needed to run the script e.g.

```
pip install pyautogui pygetwindow pywin32 keyboard psutil
```

- Would love to have a bigger pencil size, currently the dots look too small on my monitor and it kinda hurt my eye.

- I managed to "trick" the JAM version by opening another Paint windows and use a Brushes with max size, and JAM version used that window instead of the one it opened. Max brushes size looks better imo and I can play well. But post-jam script detects window quite stably so can no longer trick it :(

This script is very interesting, maybe it can even turn Paint into a movie/gif player haha
Firespike33
08. May 2023 · 06:15 UTC
@sodoj The standard one, and it's 1080p.
🎤 Sodoj
08. May 2023 · 10:47 UTC
@avavt Hello, thanks for the comment and the suggestions! You can actually increase the brush size by pressing 'ctrl' and '+' together. Sadly I couldn't implement that in code because it didn't work for whatever reason, but increasing the brush size manually works pretty well!
🎤 Sodoj
08. May 2023 · 11:47 UTC
@firespike33 I see, thank you for reporting! I still have to find the potential cause of the issue, if anyone else has this happen to them, please let me know!
Starlight Glimmer is best poney
08. May 2023 · 19:52 UTC
Looks so fun and gives me a few ideas; wish I had a Windows install to play with it. I'd be curious to see how pyautogui works under the hood and whether it uses `SendInput()` on Windows. If that's not why the cursor keeps flying around, I'd hook into it and try something else. Maybe one day
kanity
09. May 2023 · 13:21 UTC
Unfortunately I couldn't get it to run, downloaded python extension (the code opened in Visual Studio for me) and clicked run, but nothing happens and it gives this line in the terminal: ModuleNotFoundError: No module named 'pyautogui'. Tried to open Paint just in case, it didn't help ofc ^^'' The code looks very pretty though and I like that you added lines for different languages :)
🎤 Sodoj
09. May 2023 · 13:42 UTC
Hey @kanity , you need to install the python libraries, the ones I listed in the description (pip install ones). To install them, run a command prompt and type `pip install *name of the library*`. Hope that helps!
Skleembof
11. May 2023 · 16:26 UTC
I think what you've done here is prove to the world that the metaverse will take place entirely within Microsoft Paint, and I expect you to port Doom for LD 54
🎤 Sodoj
11. May 2023 · 20:52 UTC
@avavt and @xparker, check out this [blogpost](https://ldjam.com/events/ludum-dare/53/commutator/a-sizeable-update), it addresses some of the concerns you had with the game. Hopefully you'll find it more fun with this update!
OgelGames
13. May 2023 · 05:23 UTC
This is crazy! A game that runs in Paint?! Amazing work, top marks for innovation!
ardorugus
16. May 2023 · 03:35 UTC
High 5s for the idea itself. This is art-house, also. Cool approach to the theme (and the tech decision!). Re-invited to and re-invented Paint for me)).
Zefphyer
16. May 2023 · 22:32 UTC
I'm impressed by the idea and execution. I don't think I've seen a game in Paint before. Seems to run... mostly okay? The dots didn't show up on my computer but apparently I don't need them to play passable Snake. Otherwise ran fine. Definitely a creative medium.
🎤 Sodoj
17. May 2023 · 00:09 UTC
@zefphyer Hello, could you tell me what version of Windows are you on and also what version of the game did you download, as well as your screen size? Thanks in advance!
Zefphyer
17. May 2023 · 02:54 UTC
@sodoj I used the source Python, standard version. The computer that I used for it was 64-bit Windows 10 Enterprise 19044.1415, monitor 1920x1080 resolution and 14-inch laptop screen.
🎤 Sodoj
17. May 2023 · 10:35 UTC
@zefphyer I see, thank you. If it's not a hassle, I'd really appreciate if you tried the updated version and see if it was any better. Thank you for trying the game out either way, I really appreciate it!
Zefphyer
19. May 2023 · 00:13 UTC
@sodoj didn't fix the problem unfortunately! I'm guessing that it didn't have the pencil tool selected or something like that. Seemed like it had a lot of other QOL features though.

Also when I looked through the code it looked like you quit the game if the player has the wrong language- you might want to default to English instead.
🎤 Sodoj
19. May 2023 · 00:32 UTC
@zefphyer Thank you for trying once again and sorry for all the mentions!

I'd love to have the game default to English, but as I explained in this [blogpost](https://ldjam.com/events/ludum-dare/53/commutator/the-horrors-of-making-a-game-running-in-microsoft-paint-window), the layout in Paint is different in every language and even some of the hotkeys are different, that is the sole reason why I added support for French and Spanish and also the reason I can't afford to do what you suggested, who knows what script might end up clicking, potentially giving a scare to unsuspecting players!