Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
User avatar
Kontra Kommando
Posts: 944
Joined: Mon Jan 20, 2014 6:46 pm
Location: LV-426

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by Kontra Kommando »

Me: create a powerup that gave you the ability to fly.

ChatGPT
Certainly! Here's an example of how you can create a power-up that gives the player the ability to fly using DECORATE:

ACTOR FlightPowerup : PowerupGiver { +INVENTORY.PICKUPFLASH +INVENTORY.ALWAYSPICKUP +INVENTORY.FANCYPICKUPSOUND Inventory.PickupMessage "You found the Flight Powerup!" States { Spawn: FLIG A -1 Stop } } ACTOR FlightPowerupEffect : PowerupEffect { Powerup.DurationTicks 4200 // Adjust the duration as desired States { Spawn: FLIG B 4 Loop Active: FLIG C 4 Loop Deactivate: FLIG D 4 Loop Duration: FLIG C 4 Loop DurationEnd: FLIG D 4 Loop } } ACTOR FlightPowerupPlayer : Inventory { +FLIGHT States { Give: // Put any player-specific visual or audio effects here TNT1 A 0 A_GiveInventory("FlightPowerupEffect") Stop Reset: // Put any player-specific visual or audio effects here TNT1 A 0 A_TakeInventory("FlightPowerupEffect", 1) Stop } }

In this example, we created an ACTOR called FlightPowerup that inherits from the PowerupGiver actor. Adjust the Inventory.PickupMessage property to display your desired pickup message. The States section defines the visual appearance of the power-up when spawned.

The FlightPowerupEffect actor represents the effect of the flight power-up on the player. Adjust the Powerup.DurationTicks property to set the duration of the flight ability. The States section defines the visual appearance of the power-up effect.

Finally, we created an ACTOR called FlightPowerupPlayer that inherits from the Inventory actor. It grants the FLIGHT flag to the player when picked up and removes it when the power-up effect ends. You can add player-specific visual or audio effects in the Give and Reset states.

Remember to include these definitions in your DECORATE lump or script file and adjust the graphics, sounds, and duration to match your desired resources and gameplay balance.
User avatar
Kontra Kommando
Posts: 944
Joined: Mon Jan 20, 2014 6:46 pm
Location: LV-426

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by Kontra Kommando »

Me: create a powerup that made everything xdeath or die by touching the player for 666 seconds.

ChatGPT
Creating a power-up that causes enemies to die upon touching the player for a specific duration can be achieved using DECORATE. Here's an example of how you can create such a power-up:

ACTOR DeathTouchPowerup : PowerupGiver { +INVENTORY.PICKUPFLASH +INVENTORY.ALWAYSPICKUP +INVENTORY.FANCYPICKUPSOUND Inventory.PickupMessage "You found the Death Touch Powerup!" States { Spawn: DEAT A -1 Stop } } ACTOR DeathTouchPowerupEffect : PowerupEffect { Powerup.DurationTicks 6660 // Adjust the duration as desired (666 seconds in this case) States { Spawn: DEAT B 4 Loop Active: DEAT C 4 Loop Deactivate: DEAT D 4 Loop Duration: DEAT C 4 Loop DurationEnd: DEAT D 4 Loop } } ACTOR DeathTouchPowerupPlayer : Inventory { +NOGRAVITY +INVISIBLE States { Give: TNT1 A 0 A_GiveInventory("DeathTouchPowerupEffect") Stop Reset: TNT1 A 0 A_TakeInventory("DeathTouchPowerupEffect", 1) Stop } } ACTOR DeathTouchPowerupDamage : Actor { Radius 20 Damage 1000 // Adjust the damage as desired States { Spawn: TNT1 A 0 A_FadeOut(0.4) Loop Death: Stop } }

In this example, we created an ACTOR called DeathTouchPowerup that inherits from the PowerupGiver actor. Adjust the Inventory.PickupMessage property to display your desired pickup message. The States section defines the visual appearance of the power-up when spawned.

The DeathTouchPowerupEffect actor represents the effect of the death touch power-up on the player. Adjust the Powerup.DurationTicks property to set the duration of the power-up effect. The States section defines the visual appearance of the power-up effect.

The DeathTouchPowerupPlayer actor inherits from the Inventory actor and grants the NOGRAVITY and INVISIBLE flags to the player when picked up. The player becomes invisible and unaffected by gravity during the power-up duration. You can customize the player's behavior and appearance during this time.

Lastly, we created an ACTOR called DeathTouchPowerupDamage that represents the damaging effect when enemies touch the player. Adjust the Radius and Damage properties to set the range and amount of damage inflicted upon enemies.

Remember to include these definitions in your DECORATE lump or script file, and adjust the graphics, sounds, and duration to match your desired resources and gameplay balance.
User avatar
Kontra Kommando
Posts: 944
Joined: Mon Jan 20, 2014 6:46 pm
Location: LV-426

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by Kontra Kommando »

Create a custom enemy that looks like a health pack. When the player attempts to pick it up it explodes like a barrel. It could happen if the player gets too close to it.

ChatGPT
Certainly! Here's an example of how you can create a custom enemy that looks like a health pack and explodes when the player gets too close to it:

ACTOR HealthPackEnemy : Health { States { Spawn: HEAL A -1 Stop Death: TNT1 A 0 A_PlaySound("health/pickup") TNT1 A 0 A_DamageType(-1, MOD_BARREL) TNT1 A 0 A_Explode(128, 128, 128, 0) Stop } }


In this example, the custom enemy is derived from the Health actor, which is usually associated with health pickups. The Spawn state displays the health pack sprite indefinitely.

When the enemy is killed or triggered by the player getting too close, the Death state is activated. It plays a sound, inflicts damage with the MOD_BARREL damage type (simulating the explosion), and triggers an explosion effect using the A_Explode action function.

Feel free to adjust the parameters and customize the behavior to fit your specific needs.
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by Caligari87 »

So have you tested any of these?

8-)
SanyaWaffles
Posts: 809
Joined: Thu Apr 25, 2013 12:21 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
Graphics Processor: nVidia with Vulkan support
Location: The Corn Fields
Contact:

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by SanyaWaffles »

Last one doesn't even use a proper built in Action Function.
User avatar
Kontra Kommando
Posts: 944
Joined: Mon Jan 20, 2014 6:46 pm
Location: LV-426

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by Kontra Kommando »

Yeah, there seems to be a major issue, unfortunately none of them work. I uploaded it to GPT 3.5 (GPT 4.0 has a cap, and you it uploads the document piece meal by maximum characters allowed in a prompt), which is not very good at coding. I read it is only in the 5th percentile in national standardized testing for coding. It is definitely suffering from "hallucinations", i.e. forgetting stuff, and making stuff up.

I finally have access to plugins, maybe there's something else that could be utilized. If not, perhaps sometime in the future hopefully.
User avatar
inkoalawetrust
Posts: 70
Joined: Mon Aug 26, 2019 9:18 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by inkoalawetrust »

Frankly with "Open"AI's approach in the past few years you might be better off waiting for language models NOT made by them to improve to do something like this. GPT-3.5 sucks ass compared to 4, but of course 4 has a stupid cap and is a paid subscription. Unless you are a billion dollar company "Open"AI doesn't care.
User avatar
Kontra Kommando
Posts: 944
Joined: Mon Jan 20, 2014 6:46 pm
Location: LV-426

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by Kontra Kommando »

I saw a rumor that the next update to ChatGPT plus will allow for people to upload their own files, for the AI to analyze.


There's other software that has already done this, but it is expensive.

I love the idea of AI, and all. But it is very frustrating to get it to work, the plug-ins are not always functional. Maybe it is because of massive usage, but overall my experience has been a let down. In theory, simply uploading all of the notepad files to the AI, should be sufficient. At least that is how they promote it. I know there's other nuances that would make it better, like tokenizing the information.

Nevertheless, i am hopeful that these issues will be resolved.

Open AI could end up being the "Myspace" of AI down the line, as we wait for the next "Facebook".
User avatar
Kontra Kommando
Posts: 944
Joined: Mon Jan 20, 2014 6:46 pm
Location: LV-426

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by Kontra Kommando »

I asked code interpreter for ChatGPT plus to write me code. This is purely from writing the prompt, I didn't use the assets I made. I haven't tried it though:

KK: write code in ACS to simulate blood dripping from a ceiling. Use hypothetical names for graphical assests

ChatGPT:

ACS (Action Code Script) is a scripting language used in the DOOM engine for controlling level events. ACS doesn't deal with graphical assets directly, but rather triggers and controls events and behavior in the game world. Graphical assets like sprites, textures, etc. are usually handled by the engine itself, not ACS.

If you want to simulate blood dripping from the ceiling, you might need to make a custom particle system or sprite, and then use ACS to trigger this effect at the right time and place.

Here's a very basic example of how you could use ACS to simulate an event like this:

#include "zcommon.acs" script 1 (void) { // The 'Thing_Spawn' function creates a new object at a specified map spot. // 'T_BLOOD' could be a custom actor you've created to look like a blood droplet. // 1 is the ID of the map spot where you want the blood to appear. // 0 is the angle, which doesn't matter for a blood droplet. Thing_Spawn(1, T_BLOOD, 0, 0); // The 'Delay' function causes the script to wait for a specified number of tics. // There are 35 tics in a second, so this will wait for about 0.3 seconds. Delay(10); // Then we spawn another droplet, and so on. Thing_Spawn(1, T_BLOOD, 0, 0); Delay(10); // We could repeat this as many times as we want to create a continuous dripping effect. // Note that this is a very basic example, and the actual code you'd use might be more complex. // For example, you might want to randomize the delay between droplets, or vary the position slightly each time. }

Remember to replace T_BLOOD with the actual actor ID of your blood droplet sprite, and replace 1 with the ID of the map spot where you want the blood to spawn.

You should also make sure to start this script when you want the dripping effect to begin. You can do this in various ways depending on your specific needs, for example, by attaching it to a trigger that the player activates, or by starting it at the beginning of the level using the OPEN keyword.
User avatar
ramon.dexter
Posts: 1529
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by ramon.dexter »

May I know why is better to teach AI old deprecated code, instead of zscript?
User avatar
Kontra Kommando
Posts: 944
Joined: Mon Jan 20, 2014 6:46 pm
Location: LV-426

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by Kontra Kommando »

It is the one I am more familiar with, so I made it sort of as a test.
User avatar
Kontra Kommando
Posts: 944
Joined: Mon Jan 20, 2014 6:46 pm
Location: LV-426

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by Kontra Kommando »

I didn't know it until yesterday, but the code interpreter beta-function allows you to upload your own files!

You can upload a zip file with multiple files and it will examine it as one submission, and the documents piecemeal.

I just tested the downloadable document in the OP, and these were the results...

Kontra Kommando:

using the documents in the zip file, make me a custom monster in doom that can fly, shoot rockets like the cyber demon, and has a hit-scan secondary attack.

ChatGPT Plus 4.0 Code Interpreter:

First, let's unzip the file and inspect its contents to understand the structure and the assets available for creating the custom monster.

The contents of the unzipped file include four text files named "ACS-DECORATE AI v1.0" (parts 1 to 4) and an "Instructions.txt" file. To proceed, I'll first take a look at the "Instructions.txt" file to see if there are any guidelines or directions provided for creating the custom monster.

The "Instructions.txt" file provides guidance on how to upload the files to ChatGPT, but it doesn't contain specific instructions for creating the custom monster.

To proceed, I'll review the contents of the "ACS-DECORATE AI v1.0" text files to gather information about the DECORATE and ACS scripting for Doom modifications. I'll start by inspecting the content of the first part ("ACS-DECORATE AI v1.0 1 of 4.txt").

The first part of "ACS-DECORATE AI v1.0" provides a list of built-in ACS functions that can be used in Doom scripts. These functions cover various topics, such as script control, mathematical operations, and more.

To create the custom monster with the desired abilities, we will need to examine the DECORATE scripting part, which likely covers the definitions of actors, their properties, and behaviors. Let's continue by inspecting the contents of the remaining parts of the "ACS-DECORATE AI v1.0" text files. I'll take a look at the second part next.

The second part seems to detail specific ACS functions, their parameters, and examples of how to use them. However, this section doesn't contain information related to DECORATE scripting for defining and modifying actor behaviors in Doom, which is what we need to create the custom monster.

Let's move on and inspect the contents of the third part ("ACS-DECORATE AI v1.0 3 of 4.txt").

It seems there's an encoding issue when trying to read the third part. This could be due to the presence of non-UTF-8 characters or specific byte sequences in the file.

I'll attempt to read the file using a different encoding method to bypass this issue. Let's try using the ISO-8859-1 encoding (also known as Latin-1) to read the content.

The third part seems to be discussing specific ACS functions, such as `A_GiveToTarget`, their usage, parameters, and examples. However, it still doesn't contain the DECORATE scripting needed to define and modify actor behaviors.

Let's proceed by inspecting the content of the fourth and final part ("ACS-DECORATE AI v1.0 4 of 4.txt") to see if it contains the DECORATE scripting we're looking for.

The fourth part appears to delve into DECORATE scripting, discussing specific actor types and their properties. This is more in line with what we need to create the custom monster.

To create the custom monster with the desired abilities (flying, shooting rockets, and a hitscan secondary attack), I will:

1. Create a DECORATE actor definition for the monster, inheriting properties from existing actors where necessary.
2. Define its states and behaviors, including its ability to fly, its rocket-shooting attack, and its hitscan secondary attack.

Let's begin by creating a new actor definition for the custom monster.

Creating a custom monster that can fly, shoot rockets, and has a hit-scan secondary attack requires careful consideration of the DECORATE scripting structure.

Here's a basic outline of what the DECORATE definition for our custom monster might look like:

```plaintext
actor CustomFlyingDemon : DoomImp { Health 400 Radius 20 Height 56 Mass 100 Speed 12 PainChance 200 +FLY +NOGRAVITY MONSTER +SHOOTABLE +COUNTKILL States { Spawn: TROO A -1 Loop See: TROO AABBCCDD 3 A_Chase Loop Missile: TROO E 10 A_FaceTarget TROO F 6 A_CustomMissile("Rocket", 0, 1, 0, 0, MISSILEMORE) TROO E 6 A_FaceTarget TROO F 6 A_CustomMissile("BulletPuff", 0, 1, 0, 0, MISSILEMORE) Goto See Pain: TROO G 3 TROO G 3 A_Pain Goto See Death: TROO H 10 TROO I 10 A_Scream TROO J 10 A_NoBlocking TROO KLM 10 Stop XDeath: TROO N 5 TROO O 5 A_XScream TROO P 5 A_NoBlocking TROO QRS 5 Stop Raise: TROO MLKJIH 5 Goto See } }
```

Let's break this down:

- The custom monster is based on the DoomImp but modified to fit our requirements.
- `+FLY` and `+NOGRAVITY` flags are added to allow the monster to fly.
- In the `Missile` state, the monster shoots a rocket (similar to Cyberdemon) and then performs a hit-scan attack (similar to the zombieman's rifle shot).
- I've used placeholder sprite frames (TROO A, TROO B, etc.) from the DoomImp. You might want to replace these with custom sprites for your monster.
- The `A_CustomMissile` function is used to shoot the rocket and the hitscan bullet puff.

This is a basic setup. Depending on the assets you have and the exact behavior you want, further modifications and refinements can be made.
User avatar
Kontra Kommando
Posts: 944
Joined: Mon Jan 20, 2014 6:46 pm
Location: LV-426

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by Kontra Kommando »

Something a bit more complex:

Kontra Kommando: using the zip file I provided create an ACS script that will send you to a random map between MAP01-MAP30 at the completion of each level.

ChatGPT:

To create an ACS script that takes the player to a random map between MAP01 and MAP30 at the end of each level, we'll utilize the `ChangeLevel` function in ACS with a random value for the map name. However, before proceeding, I'll review the contents of the provided zip file again to ensure that we're using any specific information or methods detailed in those documents.

From the content snippet provided, it seems the first part lists various built-in ACS functions. The function `Random` is of particular interest for our task since it can be used to generate a random number, which will then determine the next map the player is taken to.

The ACS script for random map selection between MAP01 and MAP30 can be formulated as follows:

```c
#include "zcommon.acs" script 100 (void) // Script to be executed at the end of a level { int randomMapNum = Random(1, 30); // Generate a random number between 1 and 30 str mapName = StrParam("MAP%02d", randomMapNum); // Convert the number to a map name format (e.g., MAP01, MAP02, ... MAP30) ChangeLevel(mapName, 0, CHANGELEVEL_NONE, 0); // Change to the randomly selected map }
```

To implement this:

1. Add the ACS script to a new script lump in your WAD or PK3.
2. Compile the ACS script using the ACS compiler to produce a BEHAVIOR lump.
3. Add the BEHAVIOR lump to your WAD or PK3.
4. In the map editor, set up a script trigger to execute this script when the level ends (e.g., upon pressing an exit switch).

This script will ensure that upon the completion of each level, the player will be taken to a randomly selected map between MAP01 and MAP30.
User avatar
Kontra Kommando
Posts: 944
Joined: Mon Jan 20, 2014 6:46 pm
Location: LV-426

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by Kontra Kommando »

The AI can produce DECORATE script (erroneously) on its own, but using the documents I compiled will allow it do improve the accuracy, since it can directly refer to the information.

Maybe this is a success after all :)
User avatar
ramon.dexter
Posts: 1529
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Doom ACS/DECORATE-AI (NLP Engineering Project) *Zip File!*

Post by ramon.dexter »

Okay, why are you teaching the AI model deprecated decorate and not zscript?
Post Reply

Return to “General”