MantisBT - Zandronum
View Issue Details
0003578Zandronum[All Projects] Suggestionpublic2018-12-16 14:042018-12-29 08:07
FConst 
 
normalminorN/A
newopen 
 
 
0003578: Make bot scripting function available in ACS
TL;DR: make bot scripting functions (like go to nearest bot node or to nearest power up) available in ACS, so that users could write our own bots as script libraries or include them as part of their mods.

Since bot script compiler is long time lost nobody can write new bot scripts.
And as we now have quite powerful ACS scripting engine with libraries, auto-loading and named scripts, I think we actually don't need a separate scripting engine just for bots.
This is why I propose adding support of bot scripting functions to ACS engine, so that anyone could write their own bots as acs libraries or add them to their mods. Also bot functions will probably allow implementing smarter AI for monsters.

In case there are no objections to this idea this request can be assigned to me. This should be relatively easily to implement, so even my limited free time should be enough.
No tags attached.
Issue History
2018-12-16 14:04FConstNew Issue
2018-12-16 22:21Blzut3Note Added: 0020254
2018-12-17 20:46FConstNote Added: 0020268
2018-12-17 20:47FConstNote Edited: 0020268bug_revision_view_page.php?bugnote_id=20268#r12321
2018-12-18 02:56Blzut3Note Added: 0020269

Notes
(0020254)
Blzut3   
2018-12-16 22:21   
Dusk wrote a new botscript compiler a long time ago. I think it's complete, but it's been way too long. See ticket 0001657.

I don't really have a comment on the rest of the suggestion. Given the state of the bot code I can't imagine it being an easy task to mix like you suggest.

Mixing the VMs is perhaps of slightly dubious benefit since it would prevent effective encapsulation of the bot code (and the reason that ZDoom didn't pull the bot code is because it's already too intertwined). Technically the VMs are very similar so it's not impossible by any means, and removing effectively code duplication is a good thing. I'm just not sure that giving them access to map global variables is a great idea.
(0020268)
FConst   
2018-12-17 20:46   
(edited on: 2018-12-17 20:47)
That's a good point about global variables. I'll expand it a bit: probably you want bot script lumps to be not protected - i.e. wads with them are allowed to be optional (really, they just control player pawns, why anyone but the server have to have them).
But that doesn't eliminate the idea of using bot functions to enhance monster AI in mods. Not sure if there is high demand for it.

A bit offtopic, but I'm not sure where to talk about it: do you think it would be hard to write a decompiler for existing compiled bot scripts? And are we legally allowed to modify them?

(0020269)
Blzut3   
2018-12-18 02:56   
I don't think it would be particularly hard to write a decompiler. The original BOTSCRIPT compiler was likely based on the ACS compiler (if not literally, probably largely inspired by it). The reference ACS compiler is basically your text book compiler and nothing more, so the byte code it generates is pretty easy to find patterns in.