Jump to content


Photo

Automation features and discussion

automation

10 replies to this topic

#1 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1359 posts

Posted 12 January 2019 - 04:12 AM

*
POPULAR

I have previously posted about automation efforts in this thread about watching over asset files.

I decided to create a more generic thread for whatever discussions related to automation.

 

The most recent version of automation library and scripts (by the time this topic was created) can be downloaded from this link.

More information can be found in readme.md.

It should run properly against any beta version of TDM 2.07.

 

Some new Python 3 is required to run automation stuff.

I'm afraid that decent skills in Python are needed if you want to do anything advanced with it.

If you have some tedious work that you regularly do with TDM, and feel that it can be automated, post ideas here.


  • STiFU, freyk, Anderson and 2 others like this

#2 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1359 posts

Posted 12 January 2019 - 04:15 AM

Here is a video showcasing automation commands (you can type them into console.py, and I intend to integrate them into automation library in future).

I managed to complete the shortest TDM mission without directly interacting with the game.

 

Beware: the video is long and very boring :mellow:

 


  • freyk, Anderson and Abusimplea like this

#3 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1359 posts

Posted 12 January 2019 - 04:21 AM

Just now automation has been used to start every FM released to date.

It is about 125-128 missions already :o

That's a huge number :wub: , and merely starting and cheat-completing them all takes something like 90 minutes :wacko:

 

If anyone is interested in this feature, see complete_any.seq (commands sequence) and foreachfm.py (the runner script) in the automation package.


  • Anderson and Abusimplea like this

#4 Abusimplea

Abusimplea

    Advanced Member

  • Member
  • PipPipPip
  • 512 posts

Posted 12 January 2019 - 05:16 AM

That changes everything - hardcore ghosters will have to play the game without a mouse using your remote to get any satisfaction now. :P


  • nbohr1more likes this

#5 freyk

freyk

    Advanced Member

  • Member
  • PipPipPip
  • 731 posts

Posted 12 January 2019 - 05:50 AM

At this moment, i can only say to this automation feature: WOW! :blink:
Immediately got some ideas for it. Like a TDM-Tweaker, video-problems debugger, benchmarker, etc.
 
Now to find a small python collection package (or one-single binary), to run scripts from. 
Do you know something i can use.
Like winpython?
 
 
Btw,
nice to see midnight commander in action.
I'm a bit more a totalcommander (ultima prime) user myself.

Edited by freyk, 12 January 2019 - 06:12 AM.


#6 STiFU

STiFU

    Uber member

  • Development Role
  • PipPipPipPip
  • 3444 posts

Posted 12 January 2019 - 07:25 AM

So, who is going to train a deep neural network now to play tdm with this? ;-)

#7 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1359 posts

Posted 12 January 2019 - 10:10 AM

Now to find a small python collection package (or one-single binary), to run scripts from. 
Do you know something i can use.
Like winpython?

Never used anything except CPython myself.

People use py2exe or pyinstaller to produce a standalone executable.

I'll try them in future (after I get rid of ugly sys.path hack).
 
 

nice to see midnight commander in action.
I'm a bit more a totalcommander (ultima prime) user myself.

Thou shalt not confuse the great Far Manager with the ugly Midnight Commander!

Anyway, all of them are descendants of the same Norton Commander.



#8 jaxa

jaxa

    Advanced Member

  • Member
  • PipPipPip
  • 1375 posts

Posted 12 January 2019 - 11:29 AM

Automation should be used to create missions, not play them! Like Swift Mazes but more advanced...



#9 STiFU

STiFU

    Uber member

  • Development Role
  • PipPipPipPip
  • 3444 posts

Posted 13 January 2019 - 04:56 AM

I figured, I'll use automation for testing if my fix for #4952 works. :-)

I have added two new commandline args "num_repeats" and "repeat_seqFile" to foreachfm.py. If both are specified, the regular seqFile is only executed once as a form of initialization and then repeat_seqFile is executed periodically as specified in the num_repeats argument.

 

This way, I can now easily repeatedly enter the fighting area and let myself get killed by the AI with a simple a script as this:

#teleport to fighting area, wait to be killed

setviewpos -551.59 -1949.04 -180.94 -16.0 -176.5 1.1

$time.sleep(20.0)

This is really awesome and makes our lives a lot easier, so thanks stgatilov!! :-) I have the debugger attached. If I eventually hit a set breakpoint, my fix works! :-) If the game crashes, it doesn't. ^^

 

By the way, I accidentally once tele-fragged the AI because I had used a too low sleep timing. :-D



#10 STiFU

STiFU

    Uber member

  • Development Role
  • PipPipPipPip
  • 3444 posts

Posted 13 January 2019 - 06:09 AM

Ok, so far, I didn't manage to reproduce the behavior with this sequence. So I was thinking to add random rotations and movements as well as the occasional attack. So, how to feed random values from python to the automation interface? One way to achieve this would be to have python write a new .seq file with the desired commands and have that .seq file executed. I guess, there is no other interface to achieve that right now, is there?



#11 STiFU

STiFU

    Uber member

  • Development Role
  • PipPipPipPip
  • 3444 posts

Posted 13 January 2019 - 07:42 AM

After three hours of running, the game crashed in Automation::ParseAction() with a Null-pointer exception because 

idFile *f = fileSystem->OpenFileRead(logFile->GetName());

apparently failed to open the file for some reason and f==NULL is not asserted. I wonder why it cannot open the file anymore. I backuped the pdb and saved both a full dump and a minidump, if you want to investigate the issue closer. The full dump is 5 gigs, though.

 

This is not the crash I was hoping for... If it had crashed during LeaveSearch() again, I would've known that my fix does not work. Now, as it stands, I haven't learnt anything, except that this is maybe the wrong way to reproduce the issue or that it is incredibly rare!

 

Callstack:

TheDarkModx64.exe!idCommonLocal::GetConsoleContents(int begin=31058, int end=31058) Line 502 C++
TheDarkModx64.exe!Automation::ParseAction(Automation::ParseIn & parseIn={...}) Line 298 C++
TheDarkModx64.exe!Automation::ParseMessage(Automation::ParseIn & parseIn={...}) Line 269 C++
TheDarkModx64.exe!Automation::ParseMessage(const char * message=0x00000232c0554cb0, int len=107) Line 256 C++
TheDarkModx64.exe!Automation::Think() Line 533 C++
TheDarkModx64.exe!Auto_Think() Line 538 C++
TheDarkModx64.exe!idEventLoop::RunEventLoop(bool commandExecution=true) Line 171 C++
TheDarkModx64.exe!idCommonLocal::Frame() Line 2450 C++
TheDarkModx64.exe!WinMain(HINSTANCE__ * hInstance=0x00007ff7e4f40000, HINSTANCE__ * hPrevInstance=0x0000000000000000, char * lpCmdLine=0x00000232df913bbe, int nCmdShow=10) Line 1363 C++




Reply to this topic



  



Also tagged with one or more of these keywords: automation

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users