Spider Mastermind
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom General > Vanilla Doom's external control API
 
Author
All times are GMT. The time now is 21:32. Post New Thread    Post A Reply
fraggle
Super Moderator


Posts: 5999
Registered: 07-00


Thanks to some helpfully-provided information from Quasar, over the past few days I've been playing with Doom's external control API. This is a little-known command line parameter in Vanilla Doom (-control), which I think was added so that manufacturers of controllers (gamepads, joysticks, etc) could write special drivers to control the game.

What I have so far is here. It's essentially possible to inject any ticcmd into the game. These are the demo programs I've put together so far (copy+pasting from the text file):
code:
forward.exe - The most simple (and most boring) example. This program simply makes the player move forward constantly. To run: forward.exe doom2.exe -warp 1 replay.exe - This program replays a previously recorded demo. This is useful because it allows a demo to be partially recorded and then continued at a later date. To run: replay.exe -playdemo olddemo.lmp doom2.exe -warp 1 Or to continue recording: replay.exe -playdemo olddemo.lmp doom2.exe -warp 1 -record newdemo statdump.exe - This is a refactored version of my external statistics driver which I previously released as statdump.zip. Problems were reported with that program because it replaced the mouse interrupt, and as a result, worked under DOSbox but not under real DOS systems. Hopefully this should work better. This does not actually make use of the control API to inject any events, it just take advantage of the fact that it provides a regular interrupt. To run: statdump.exe doom2.exe -warp 1 Or for statistics for a demo: statdump.exe -o mydemo.txt doom2.exe -playdemo mydemo

Feedback is welcome. Any suggestions for other things this might be useful for?

Old Post 10-03-11 23:35 #
fraggle is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
DaniJ
Senior Member


Posts: 1740
Registered: 08-03



fraggle said:

Feedback is welcome. Any suggestions for other things this might be useful for?


Automated strafe running and other player movement scripting?

Holding down the fire button on slaughter maps while I go make a cuppa?

Old Post 10-03-11 23:52 #
DaniJ is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
chungy
Doomworld is so about bullshit excuses


Posts: 1457
Registered: 06-05


This is pretty cool, I wonder if replay.exe could be used to play back demos larger than Doom allows ...

Also, I might be missing something obvious, but what did you use to compile it? I seriously doubt this TCC has a DOS port, and I already have DJGPP in DOSEMU but gcc can't compile the code either (this probably isn't hard to fix, I'm thinking).

Old Post 10-03-11 23:57 #
chungy is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
fraggle
Super Moderator


Posts: 5999
Registered: 07-00



DaniJ said:

Automated strafe running and other player movement scripting?

Holding down the fire button on slaughter maps while I go make a cuppa?

I thought about things like these; unfortunately, the ticcmd structure doesn't capture the "run held" or "strafe held" actions, so because of the level it works at, it can't really inject them.


chungy said:
This is pretty cool, I wonder if replay.exe could be used to play back demos larger than Doom allows ...
Doom doesn't really have much problem playing back long demos, only recording them.


Also, I might be missing something obvious, but what did you use to compile it?
It's compiled with Borland Turbo C.

Old Post 10-03-11 23:59 #
fraggle is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Csonicgo
This post is probably useless


Posts: 3960
Registered: 03-04



chungy said:
This is pretty cool, I wonder if replay.exe could be used to play back demos larger than Doom allows ...

Also, I might be missing something obvious, but what did you use to compile it? I seriously doubt this TCC has a DOS port, and I already have DJGPP in DOSEMU but gcc can't compile the code either (this probably isn't hard to fix, I'm thinking).



He used tcc...

edit: wait no. so how will the batch file work?

edit2: nevermind, I got it to compile :)

Old Post 10-04-11 00:03 #
Csonicgo is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 7040
Registered: 07-07



fraggle said:
code:
replay.exe - This program replays a previously recorded demo. This is useful because it allows a demo to be partially recorded and then continued at a later date. To run: replay.exe -playdemo olddemo.lmp doom2.exe -warp 1 Or to continue recording: replay.exe -playdemo olddemo.lmp doom2.exe -warp 1 -record newdemo



Vanilla TAS! Run for cover everybody! :p

Old Post 10-04-11 00:49 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
kb1
Junior Member


Posts: 167
Registered: 11-06


Just wanted to say that this is massively cool! I'm slightly disappointed that I didn't know about it. Awesome work!

Old Post 10-04-11 17:08 #
kb1 is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
fraggle
Super Moderator


Posts: 5999
Registered: 07-00


Final version is here, and I've uploaded it to /idgames/incoming. I made some minor changes and enhancements: the most significant one being that replay.exe also supports Strife playback now.

Thanks for your comments, everyone!

Old Post 10-09-11 21:40 #
fraggle is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Maes
I like big butts!


Posts: 8661
Registered: 07-06


uhhhhhhhh

Doesn't the Heretic source code contain a lot of device-dependent defines which allowed using some exotic controllers like Cyberman to control the character? Those worked at the G_BuildTicCmd level, by directly "injecting" in the input.

Old Post 10-09-11 22:24 #
Maes is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
fraggle
Super Moderator


Posts: 5999
Registered: 07-00


Indeed, it seems that it does! The "-externdriver" command line parameter seems to do something similar to -control.

Looks slightly more elaborate than -control, though. It seems that with -externdriver you can do the strafe down/speed down thing that isn't possible with -control.

Looking at the code it seems like Raven put a lot more effort into it than Id did with -control, to the extent that I suspect they must have had something they used to test it. I wonder what they added it for?

Cyberman support is separate, by the way. It's built in to the program. The Cyberman API worked through an extended DOS mouse API, which is why you always get a "wrong mouse driver - no SWIFT support" message on startup. I had a crazy idea a while back to make a modified version of DOSbox which used a Wii remote to emulate a Cyberman, to see if I could use it to control Vanilla Doom (and other games, like Descent).

Old Post 10-09-11 22:31 #
fraggle is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 21:32. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom General > Vanilla Doom's external control API

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Forums Directory