ZDOOM connects to Arduino?

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
Post Reply
User avatar
Firewalker
Posts: 7
Joined: Fri Aug 31, 2018 3:37 pm

ZDOOM connects to Arduino?

Post by Firewalker »

Hi, I would like to start a small projekt.
Every time you get hit in ZDoom, the engine should sends a signal to an Arduino via USB (or Serial).
Lets say for example I want an LED to blink every time I get hit in game.

Any suggestions what would be the easiest approach?
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: ZDOOM connects to Arduino?

Post by Gutawer »

You'll first need to fork GZDoom to add code to it that can interact with the Arduino. From there, it's basically a matter of sending serial data down the USB port and then writing a listener program on the Arduino that will handle that data and react appropriately to it.
This seems like a pretty good tutorial for it, if you're on Windows. If you're not, it appears to depend on Microsoft functions, so you'll need to look into writing different code for opening up the serial port. After that, you'd just have to work out where GZDoom handles getting hit (I don't know this off by heart, but finding in the source code where it plays the pain sound is a good start), then send serial data at that point.
User avatar
Firewalker
Posts: 7
Joined: Fri Aug 31, 2018 3:37 pm

Re: ZDOOM connects to Arduino?

Post by Firewalker »

Thanks sounds like a good start!
I got Doom to compile already. Excellent wiki by the way :)
User avatar
Firewalker
Posts: 7
Joined: Fri Aug 31, 2018 3:37 pm

Re: ZDOOM connects to Arduino?

Post by Firewalker »

Can someone give me a hint where, in the source code, it plays the pain sound?
I tried to find a good place but the code base is quiet large and (aside from funny developer comments) I can't find a proper location :?
Is there a particular string I can search for? That would be really helpful :)

...I want to connect a shock-collar to doom and play with the shock-collar around my neck :mrgreen: ... I'm not going to play on nightmare though.
Attachments
shocking.jpg
shocking.jpg (5.86 KiB) Viewed 481 times
Last edited by Firewalker on Sun Sep 09, 2018 4:39 pm, edited 1 time in total.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: ZDOOM connects to Arduino?

Post by wildweasel »

I don't think you're going to want to tie it to the pain sound specifically. What you're more likely going to want is to find where the damage flash happens.
User avatar
ramon.dexter
Posts: 1520
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: ZDOOM connects to Arduino?

Post by ramon.dexter »

Firewalker wrote:
...I want to connect a shock-collar to doom and play with the shock-collar around my neck :mrgreen: ... I'm not going to play on nightmare though.
What?
User avatar
Rachael
Posts: 13531
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: ZDOOM connects to Arduino?

Post by Rachael »

Much as I know any code I write can be used for nefarious purposes, I would never knowingly code something that I do not see as having a direct benefit, if indeed I suspect it could be used nefariously.

And unfortunately, this is one such case. A shock collar is a torture device - plain and simple. I don't care if you're not using it on others, and to be honest I really don't want to know about it if you are, so please don't spill the beans if that is the case - but the fact that you are using one at all makes me feel quite suspicious about it.

If you think this is going to make you a better gamer, I can think of numerous ways to do that which do not involve self torture.

I cannot, and will not condone this, therefore I refuse to help you, and I advise anyone who is knowledgeable about what is being asked here to do the same.
User avatar
Firewalker
Posts: 7
Joined: Fri Aug 31, 2018 3:37 pm

Re: ZDOOM connects to Arduino?

Post by Firewalker »

Rachael wrote:Much as I know any code I write can be used for nefarious purposes, I would never knowingly code something that I do not see as having a direct benefit, if indeed I suspect it could be used nefariously.

And unfortunately, this is one such case. A shock collar is a torture device - plain and simple. I don't care if you're not using it on others, and to be honest I really don't want to know about it if you are, so please don't spill the beans if that is the case - but the fact that you are using one at all makes me feel quite suspicious about it.

If you think this is going to make you a better gamer, I can think of numerous ways to do that which do not involve self torture.

I cannot, and will not condone this, therefore I refuse to help you, and I advise anyone who is knowledgeable about what is being asked here to do the same.
Well of-course I understand you. I know this must sound very shocking to you.
I just want to do it, there is no particular reason. For the fun of it. I really don't think it will improve my gaming either :mrgreen: I ordered the collar for this particular reason only.
No one will be harmed (but me?). I already tested it on myself. The thing is quiet powerful, and luckily you can adjust the power. Now I know what all those poor animals have to take, cruel humans.
Nefarious device it is, but so is a spoon used in the wrong way :ugeek:

And if nobody wants to help with the programming, I guess I just have to read more code ;)
Post Reply

Return to “General”