Modern Combat Script Test

Modern Combat Script Test

64

419

Testing Ground for RPG Style Modern Combat Script

Note: This is script demo and not a legit RP bot. Code link in last section.

Test out explosive, projectile, and melee probabilities in roleplay.


It's an all out war in some shit-hole war-torn country!

Will our soldier, Bob, survive the roll of the dice?


Picked a random ass image for the thumbnail

Art Source: Drunken-Lord


Note: This script will likely be very dependent on the type of LLM you use and how it interprets distances.

I used DeepSeek V3 0324, your mileage may vary with other LLMs.


How does it work?

TLDR: Bot rolls dice various times and the success (survival) is based on RPG-style combat attributes

So far, I have three categories of effects that can happen to {{char}}.

  • Explosive

  • Projectile

  • Melee

We will also talk about the concept of "modern combat attributes" that will sway these effects.


Explosives

Explosives have a splash effect with the chance of being affected tapering off as distance increases.

Two things are to be worried about in regards to explosives: shrapnel (or projectile) and concussive force.

So, we can define our injected prompt as such (example, may not be exactly the end product):

# {{char}} should react to an explosion in this way:

- Close range: ["flinch", "concussed", "incapacitated"] from the blast, and shrapnel (projectile) ["is", "is not"] directed at them.

- Medium range: ["unphased", "flinch", "concussed"] from the blast, and shrapnel (projectile) ["is", "is not"] directed at them.

- Long range: ["unphased", "flinch"] from the blast.

Bracketed values here are determined through dice rolls made by the bot.

The bot's attributes here don't do much other than see if they survive since explosives do whatever the hell they want to do.


Projectiles

This is probably going to be the common case in terms of combat in roleplay, so I think the approach will need to be pretty involved.

There's pretty much three outcomes I can think of when getting shot at: being unharmed, wounded, and outright killed.

But, sprouting from those outcomes, what else can happen?

- unharmed; you can be unphased or suppressed

- wounded; you can be numbed, suppressed, or shocked. The wound can be a light, serious, or mortal. "Mortal" would allow the bot to at least shoot back one last time before it dies.

- killed; like a dome shot or something? yeah, it's over.

Then, we'll need to see if the bot will return fire against their assailant effectively, based on the bot's skill and their status. (assuming that the bot isn't killed.)

So we can have our prompt be as such:

# {{char}} should react to being shot at, or a projectile directed towards them, in this way:

And then, each distance (near, medium, long) will get the following (Some sentences won't be there depending on what happens. For example: "unharmed" will not generate the "The wound is..." line):

Will be ["unharmed", "wounded", "killed"] by the projectile. The wound is ["light", "severe", "mortal"]. {{char}} is ["unphased", "numbed", "suppressed", "shocked"]. If it makes sense to return fire, they will do so ["effectively", "ineffectively"].

The bot's attributes play into this a bit more, factoring in their "physical" attributes (will they die/move out of the way?), their "mental" attributes (will they be pinned?), and "combat" attributes (will they react effectively?)


Melee

And, of course, you can always get into a scrap with someone instead of blowing them open with a 7.62 or 5.56 round.

This will be the simplest of prompts and simpler in derivation than the melee combat script in my other bots.

# In melee combat, {{char}} should fight ["effectively", "ineffectively"].

Since this will probably not happen as often as I think, this will just remain dead simple.


Modern Combat Attributes

I'm going to take inspiration from Escape from Tarkov and use some of the stats there. I think these are all pretty much self explanatory.

Physical

- Vitality - health, basically

- Agility - how fast/well they move

- Resilience - resistance to damage

- Strength - how strong they are

Mental

- Perception - ability to perceive things in the battlefield

- Stress Control - ability to stay calm under pressure

Combat

- Handling - ability to aim and fire a weapon

- CQC - close quarters combat ability

- Melee - how well they can fight with their hands

These values should be set from 0 to 100 and should be tailored to reflect the bot's personality. As a guideline, I think we can scale things as such:

(0 - 40: bad), (40-60: average), (60-80: good), (80-100: excellent)

So a sniper character should probably have "Handling: 85" but "CQC: 50" or something like that.

These values are weighed differently per engagement distance: For example, CQC playing more heavily in "close range" but weighed far less (or not even considered) in "long range".

What stats contribute to and their weights (all weights should total to 1):

These are honestly kind of random, so yeah, feedback is welcome on balancing these.

Blast survival:

- all ranges: resilience (0.7), stress control (0.3)

Projectile hit:

- near: perception (0.2), agility (0.4), cqc (0.4)

- medium: perception (0.5), agility (0.5)

- far: perception (0.7), agility (0.3)

Wound severity:

- near: vitality (0.3), resilience (0.4), cqc (0.3)

- medium: vitality (0.5), resilience (0.5)

- far: vitality (0.3), resilience (0.7)

Mental effect:

- near: perception (0.1), stress control (0.4), cqc (0.5)

- medium: perception (0.3), stress control (0.7)

- far: perception (0.1), stress control (0.9)

Retaliation effectiveness:

- near: perception (0.1), handling (0.4), cqc (0.5)

- medium: perception (0.3), handling (0.7)

- far: perception (0.5), handling (0.5)

Melee Success:

- strength (0.4), melee (0.6)


Code

I'm happy to share the code, which you can find here on my GitHub.

MIT license is applied, which just ensures that it's as permissible as possible!

I would appreciate credit if you do decide to use the script seriously. :)

proxy allowed

Published chats

0

comments

Leave a comment or feedback for the creator ❤️