CSlint advice needed

Post new scenarios and mods here to share with other gamers.

Moderator: Campaign Series Matrix Edition Development Group

Post Reply
User avatar
Schlonz
Posts: 251
Joined: Sun Aug 26, 2007 10:10 am

CSlint advice needed

Post by Schlonz »

Could it be that the "move_norush" and "move_roam" commands don't work properly?
When using "move_rush" everything is fine. When I replace "_rush" with one of the other options, the specified unit doesn't move at all.
"I've got a plan so cunning, you could put a tail on it and call it a weasel."
- Blackadder
User avatar
Jason Petho
Posts: 17706
Joined: Tue Jun 22, 2004 10:31 am
Location: Terrace, BC, Canada
Contact:

Re: CSlint advice needed

Post by Jason Petho »

Without seeing the code, it is difficult to see why your change of move_rush to move_roam doesn't work.

They do operate differently, although they look the same.
User avatar
Jason Petho
Posts: 17706
Joined: Tue Jun 22, 2004 10:31 am
Location: Terrace, BC, Canada
Contact:

Re: CSlint advice needed

Post by Jason Petho »

Also a screenshot with the coordinates turned on would help
User avatar
Schlonz
Posts: 251
Joined: Sun Aug 26, 2007 10:10 am

Re: CSlint advice needed

Post by Schlonz »

Li Ping, the unit in question, is a Chinese commander, currently located at hex 8,4 --> _LI_PING_368 = {368} -- [P] [8,4] [004003] Commander 3
If the US captures Obj2, he should move to hex 1,0.
As I said, it works fine with "_rush", but not with other move options.
Sorry, I can't upload a screenshot now.

------------------------------------------------------------------------------------------------------------
function on_objective_capture (hc, value, values, side) -- DO NOT REMOVE

-- US side captured Objective2 message
if owned(OBJECTIVES[2], US_SIDE) then
move_rush(_LI_PING_368, "1,0")
inc_event_points(SIDE_A, 25)
message_once("Successful Capture of the Obj2",
"Well done! You secured the Obj2\n" ..
"\n" ..
"\n" ..
"\n" ..
"Capturing the Obj2 has gained you 25 EP's.", US_SIDE, US_SIDE)
end
----------------------------------------------------------------------------------------------
"I've got a plan so cunning, you could put a tail on it and call it a weasel."
- Blackadder
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

Re: CSlint advice needed

Post by berto »

In order for us to help debug this for you, you would need to post here a .zip file including all pertinent scenario files:

.scn
.org
.map
.lua
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
Schlonz
Posts: 251
Joined: Sun Aug 26, 2007 10:10 am

Re: CSlint advice needed

Post by Schlonz »

Here are the requested files.
The scenario doesn't make any sense, it's for test purposes only.
Thanks for your commitment and patience....all of you.
Attachments
Scenarios.zip
(7.75 KiB) Downloaded 22 times
"I've got a plan so cunning, you could put a tail on it and call it a weasel."
- Blackadder
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

Re: CSlint advice needed

Post by berto »

Schlonz wrote: Mon Feb 28, 2022 8:47 pm Could it be that the "move_norush" and "move_roam" commands don't work properly?
When using "move_rush" everything is fine. When I replace "_rush" with one of the other options, the specified unit doesn't move at all.
They work properly. But there many, many things the EAI (game Engine AI) considers when assessing an SAI (Scripted AI) order. For example:
  • the distance to the destination
  • the nearness of the enemy, if any
  • the nearness of friendlies, if any
  • the availability of covering terrain, if any
  • the unit's vulnerability (highly so for leaders)
  • other
not to mention much randomness. The algorithms are extraordinarily complex.

In this quite artificial test situation, basically the EAI has decided it is safest to stay put, and possibly remain concealed thereby, while movement might unconceal the leader. After all, there is no urgency, because the order is move_norush(), right?

In scripting the AI, you will occasionally run afoul of the nuances. In this highly artificial test situation, this is one of those instances.

In this situation, if you really want to force the leader to retreat by itself to a fairly distant destination with no friendlies or covering terrain nearby and enemies just around the corner, the correct order is to move_rush(). Make sense?

Whatever works. Use it!
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

Re: CSlint advice needed

Post by berto »

It will become clearer over time that the game's SAI is only half of the AI story, not even that; the other half is the EAI, assisted by the AAI (Adaptive AI).

The SAI paints in broad strokes with a wide brush, works best at company level and higher. The EAI paints the finer details, works best at directing the individual platoons. The AAI adds a touch of color.

When scripting the AI, don't think of micromanaging each and every counter's movement and action hex by hex. It doesn't work that way.

There are so many factors involved, the algorithms are so complex, so much randomness is built into the system, you can never precisely direct or anticipate what the SAI/EAI/AAI will do in combination.

Are there ways to force the AI to do exactly what you want? Yes, things like attack_fanatical() etc., and actprob 100%, and single-hexside DIR, and 0 radius, and other parameters available as inputs to many of the SAI functions. But better to loosen up, to coax the AI and to nudge it and to give it leeway to do its own thing.

Kind of like how quantum mechanics' uncertainty principle describes the physical world, with the game's AI, you never quite know what it will do, it will be full of surprises. Think of the replayability!
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
Schlonz
Posts: 251
Joined: Sun Aug 26, 2007 10:10 am

Re: CSlint advice needed

Post by Schlonz »

Thanks for clarification, Berto.
"I've got a plan so cunning, you could put a tail on it and call it a weasel."
- Blackadder
Post Reply

Return to “Scenario Design and Modding”