Skirmish Battles with Random Enemy

PC : Battle Academy is a turn based tactical WWII game with almost limitless modding opportnuities.

Moderators: Slitherine Core, BA Moderators

junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

I ran a few tests with

1 KT 170 Panther 140 Wespe 100 team 0 510 pt allowed 200

3 KT 3 panther 3 wespe team 1 allowed 600

First run, team 0 picked a wespe, team 2 3 panthers and 1 wespe. After that it seemed to mix it up with an occasional KT.

Too bad the limit is 7 teams. I think we have to go with the team 1 example. Unless we don't use the points system.
You can call me junk - and type that with one hand.
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

Actually, you have 8 teams .... 0 - 7 inclusive.

If you want to add a small random deploy, I wrote a simple script for Panzer Attack (normandy2) below. The team functions are in the functions.bsf ...

It's self explanitory... it randomly selects an AI team from 0-5 and randomly moves them from 0-10 tiles, with a 100% to do it.
The comment in the code explains the parameters ... create a normandy2.bsf and paste the code in.
You can mess around a bit. I tried it a few times, adds a bit of uncertainty.
If you're curoius about other variants let me know, I can post them.

Code: Select all

include "functions.bsf"

FUNCTION StartTurn(side)
{
int r ;
int t ;

	if( GetTurn() == -1 )
	{
		r = Rand(0,10) ;
		t = Rand(0,5) ;
		// TeamReposition(side, team, radius, chance)
		TeamReposition(1, t, r, 100) ;		
	}
}

Last edited by Merr on Mon Nov 22, 2010 1:42 am, edited 1 time in total.
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

I assume I need to set deploy in the editor?
You can call me junk - and type that with one hand.
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

junk2drive wrote:I assume I need to set deploy in the editor?
nope ... it doesn't care about the teams deployment status ... the code simply moves them if it meets the conditions in the TeamReposition code.

It's simple ... drop the code in a normandy2.bsf and play... yeah, plug and play.

Actually, I wish the PLUGIN's acted like that, you know, a few buttons to activate/deactivate variants when you start the scenario, to add some flavor.

EDIT ... As you know, there isn't a BSF for the Panzer Attack skirmish ... so the above code is all you need in the new normandy2.bsf, simple few lines.
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

Ok maybe tomorrow. I burned out today trying to get the VP tool to work for defend flags.

BTW I found that deployment is limited to the LOS area. I had a battle where I had to change some numbers to get a LOS spot off the middle of my map. Somewhere in some file you can set a LOS area big enough to give the player some room to deploy.
You can call me junk - and type that with one hand.
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

Here it is, you change the last set of numbers to the x,y numbers on the map.
//include "Functions.BSF"

// This function is called at the start of every turn (both player and enemy turns).
// You would tend to use this for events that happen at the start of a turn
FUNCTION StartTurn(side)
{

// GetTurn() returns the current turn number,
// -1 is a special "turn" that is called in the beginning when the scenario is loaded.
if (GetTurn() == -1 )
{
// Setup VPs
PreBattleSetup() ;
}
else
{
// Check if any victory conditions are met
VictoryConditions() ;
}

SetBriefingScreen("munda3_map", "Anim3", "IDS_M3_INTRO");

if (GetTurn() == -1 )
{
// Setup VPs, damaged tiled, ...
PreBattleSetup() ;

SkipFirstPlayerTurn() ;
}
else
{
if(side == 0)
{
// Check if any victory conditions are met
VictoryConditions() ;
}
}

if(side == 0)
{
// intro message
if(GetTurn() == 0)
{
ClearAreaLOS(50, 50, 16, 16, 0) ;
ShowBriefing() ;
}
}
}
You can call me junk - and type that with one hand.
bones65
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 246
Joined: Mon Mar 08, 2010 1:50 am
Location: devon u.k.
Contact:

Post by bones65 »

the replayability value of the game would be sooo much more if you could select your own forces (or majority of) and map in multiplayer!! this was suggested months ago (and dismissed!) but at least the review(s ) i've read have marked B.A. down on this very point.. pPLEEEEEZZZE consider it, junk old chap, and i typed your name (and the rest of this!) with one finger! :roll: ps when o when is blitz france out!! ?
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

Here is a one scen campaign with random Germans and you get US with deploy.

I made the map from a Slith map with the Y key (after removing all the units first), removed the hedgerows, set the flags, AI teams, points, aggression and Random, all with the tools.

The Germans have a choice of StuGs, Panthers, PZIVs, and 251/2s.

Enjoy, I didn't test it all the way through.

http://dl.dropbox.com/u/6754176/Random_Deploy.zip
You can call me junk - and type that with one hand.
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

I forgot to mention that you purchase your forces too.

I didn't try Merr's random enemy deploy yet.
You can call me junk - and type that with one hand.
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

junk2drive wrote: I didn't try Merr's random enemy deploy yet.
Good! :wink: That little code is a sample that works only with the mentioned scenario. The code would need to be tailored for each scenario.

BTW ... I had a look at the code for the random enemy generation. Works something like this ..

1. It selects the available units on the team piecemeal as long as there are points available.
2. If it selects a unit that costs too much then it will search again to fill in the last remaining points.

Now, what this means is that you may end up with almost the same force everytime IF you don't have a large variance in price cost.
Also, the quantity comparision between the forces selected make a huge difference.

For example ; This is the contents of team 1 ....
5 Panthers ... total cost 695
5 PzIVg ... total cost 540
Total sum .... 1235
Buy points set to 695 ... I chose this because this guarentee's me 5 tanks on team 1 no matter what the mix.

Ok, lets work out the odds as we go ... As you can see, there is a 50-50 chance it will select a Panther or a PzIVg as the first unit.
Lets say it chose a Panther ... Now the odds are in favor of a PzIVg being selected ... 5 vs 4.
For discussion sake, the second unit it chose was another Panther ... odds greatly lean to a PziVg again for the third ... 5 vs 3.
Lets stop here and tally the points remaining ...
2 x Panther = 278 .... 695-278=417 ... It can still buy another Panther but again, odds favor PzIVg.

I'll end the example here because you get the picture.
I figured if you are eventually going to write a tut I thought that I would make it clear how it's generating the forces.

Merr
Rizik
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 9
Joined: Tue Nov 16, 2010 5:07 pm

Post by Rizik »

Junk,

I played your deploy scenario. Everything worked great. That's what I wanted. Nice job.
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

Let me know if you win. I can't so far.
You can call me junk - and type that with one hand.
Rizik
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 9
Joined: Tue Nov 16, 2010 5:07 pm

Post by Rizik »

I won the first time but lost the second. There's progress for you. :)
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

I finally beat this by trying a different route combined with the random AI force not including any Panthers.
You can call me junk - and type that with one hand.
pipfromslitherine
Site Admin
Site Admin
Posts: 9876
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Junk, once you and the guys are have kicked it around a little let me know and I will add it to the ingame downloads so more people can take a beating from it :)

Cheers

Pip
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

There could definitely be a more polished battle made. I was just showing the group how easy it is to make one and inspire them to give it a go.
You can call me junk - and type that with one hand.
maximvs
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 321
Joined: Thu Oct 05, 2006 5:11 pm
Location: Nottingham UK

Post by maximvs »

Great scenario Junk, I've only played it once so far - and won, but I only had one tank and one infantryman left (and two mortar teams who couldn't move), so it was a really close thing!
bones65
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 246
Joined: Mon Mar 08, 2010 1:50 am
Location: devon u.k.
Contact:

Post by bones65 »

just play tested your random skirmish junk.. brilliant.. but the forces were not varied enough.. needs to be a selective choice rather than a .. wildcat or 76 ? although i do understand that u r just trying to inspire others to do this 'kind of thing' 8) .. i ended up with a handful of units inc 2 tanks, but that's cos i made an all out effort for the panther in the beginning, and infantry assaulted it :P .. this type of 'force buying at the start is where the game is heading i think , and it's great that ones like you are leading by example... p.s. don't worry about you tube users who say they wouldn't buy this game because of the graphics, i think the graphics make this game , and give it a unique 'charm'. people who worry about graphics, just move on after 5 mins when a newer more 'realistic graphic' comes out regardless of whether the game is any good or not! :roll: cant wait for panzer corps now lol!! .. wont stop me playing this though! :wink:
Igorputski
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 300
Joined: Sat Nov 14, 2009 1:08 pm

Re: Skirmish Battles with Random Enemy

Post by Igorputski »

junk2drive wrote:I spent the evening playing the Normandy Skirmish D-Day battle. 1 turn short of taking enough flags to win, grrrr.

I found it to be entertaining and look forward to trying again, knowing that the enemy will have a different makeup next time.

Has anyone else tried these random battles?

Is it worth my time to put together more of these for you to play?
YES DAMN STRAIGHT IT IS. I need more random MAPS or rather more MAPS with the capability of making more random battles from those maps. So get to drawing and editing. Want desert, trees, hills, villiages, towns, cities, outposts, river crossings, fjords all the good stuff from Combat Mission or Steel Panthers or Panzer Command will do. :)
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Re: Skirmish Battles with Random Enemy

Post by Merr »

Igorputski wrote:YES DAMN STRAIGHT IT IS. I need more random MAPS or rather more MAPS with the capability of making more random battles from those maps. So get to drawing and editing. Want desert, trees, hills, villiages, towns, cities, outposts, river crossings, fjords all the good stuff from Combat Mission or Steel Panthers or Panzer Command will do. :)
I'm working on a random scenario as I type .... You like Airborne Drop missions ?

If not ... oh well :wink:
Post Reply

Return to “Battle Academy”