Decompiling bots

General discussion of the port and Doom-related chat.
Post Reply
Const
New User
Posts: 7
Joined: Mon Jun 04, 2018 8:31 pm
Contact:

Decompiling bots

#1

Post by Const » Wed Dec 19, 2018 2:35 pm

Hi
I started working on developing decompiler for bot binary lumps. I aim for producing sources suitable for Dusk's bot script compiler.
Currently it can produce C-like sources, but they are not very readable. In case you want to try it, latest version is available here.
Java 8 or later installed is required. Example usage:

Code: Select all

java -jar debotc-0.1-SNAPSHOT-all.jar humanbot.lump
What help is needed:
To make output compatible with Dusk's compiler, I need a working binary for Windows or Mac. For some reason my builds of it crash with segmentation faults. Could someone build the compiler or may be you already have working binaries?
Compiler sources are available at https://bitbucket.org/crimsondusk/botc
Example simple bot script is attached to this message (not sure if it is really correct), so that you could verify a compiler binary and experiment with it.


ADDED: managed to build the compiler on my Linux machine and it works! So I replaced the previous attachment with an archive containing fixed sample code (for which the compiler doesn't throw errors) and a PK3 with corresponding compiled bot (the bot is broken, probably because some state indexes are wrong). This will be the syntax I will be aiming for with my decompiler.
Spoiler: Bot script example (Open)

Code: Select all

state "StandardRoam":
	event "KilledByEnemy"
	{
		changestate( 4 );
	}

	// ...
	// Since we're in our spawn state, look around for things that may be of our interest.
	mainloop
	{
		var int $tid;

		// Powerups are always beneficial!
		$tid = LookForPowerups( 0, true );
		if ($tid != -1) { SetGoal($tid); changestate( 2 ); }
		
		// If our health is lower than our base health, look around for medkits, etc.
		if ( GetHealth( ) < GetBaseHealth( )) {
			$tid = LookForBaseHealth( 0, true );
			if ($tid != -1) { SetGoal($tid); changestate( 2 ); }
		}
...
You do not have the required permissions to view the files attached to this post.

User avatar
Ænima
Addicted to Zandronum
Posts: 3489
Joined: Tue Jun 05, 2012 6:12 pm

Re: Decompiling bots

#2

Post by Ænima » Fri Dec 21, 2018 8:20 pm

:o


One step closer to making bots that target monsters!
­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­
Doom64: Unabsolved: New weapons, monsters, and gameplay twists for survival / coop !


ZandroSkins
: a pack made by our community

Const
New User
Posts: 7
Joined: Mon Jun 04, 2018 8:31 pm
Contact:

Re: Decompiling bots

#3

Post by Const » Sun Feb 24, 2019 2:27 pm

So I almost finished both botc decompiler and Dusk's compiler.
Beta of decompiler written in Kotlin Native (Java like language that compiles to natives executables) and its Linux build is https://github.com/TarCV/debotc/release ... ebotc.kexe
Compiler is in botc repository of the same GitHub account. (Linux build later today).
I'll provide proper Windows builds soon.

Fork of Dusk's botc compiler is open for adoption as I don't have enough experience with CMake crossplatform building.

And the main reason for this post - decompiled SkullTag/Zandronum bots are attached.
You do not have the required permissions to view the files attached to this post.

Post Reply