Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 11-16-2011, 09:36 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Thank you for what you do!

Old Il-2 had an issue of kill stealing when the last who shot at an aircraft was credited a kill. The new CloD stat system is better because it allocates score proportionally to damage made which solves the stealing issue.

However as far as I understand there is an issue on the servers running AI removal scripts. When a script removes a slightly damaged plane hit by 1 bullet and safely landed at a friendly airfield it is considered as destroyed by the scoring system and a kill is allocated to the damager.

Pilot kill should have more weight in damage score imho as it is now. 40 to 50% of a kill should be added to attacker who made PK even if the plane was 60-80% damaged by other players. E.g. while unskilled pilots are wasting ammo on a He-111 a skilled pilot can make one pass and kill pilot that stops the bomber from hitting target.
Reply With Quote
  #2  
Old 11-16-2011, 01:15 PM
wildwillie wildwillie is offline
Approved Member
 
Join Date: Aug 2010
Posts: 111
Default

This will be an ongoing process and will take more than just my simple testing to work out all the details.

Right now I am using the OnActorDead method to determine kills. I'm hoping the damageScore.score will provide the appropriate allocation for the kill to each damage initiator. Since it has been just me doing all the killing during testing it will probably need some adjusting.

Also the OnAircraftCrashLanded method never seems to trigger. A few times when I have belly landed or wrecked my plane on landing it only triggers the OnAircraftLanded method.


The .mis file holds all the static objects which are easily tracked during a mission.

I will need some help with the Trigger stuff too.


As far as testing goes, I plan to have something ready the 1st week of December. I'm off for a week of hunting after Thanksgiving so nothing will get done then.

RAF238thWildWillie
Reply With Quote
  #3  
Old 11-16-2011, 02:09 PM
SNAFU SNAFU is offline
Approved Member
 
Join Date: Feb 2011
Posts: 324
Default

Did you manage to recognize static units with OnActorDead, that would be interesting. So far we only accounted for AI units with OnActorDead.

I also had problems with OnCrashLanded-Events but maybe you try landing in water, this is the only way I could reproduce a crash landing.

This is our scoring system (Kodiaks design and my interpretation ) so far, maybe you find it usefull, but is uncommented

Code:
 Dictionary<string, int> LWAvailableAirplanes = new Dictionary<string, int>()
    {
        //Internaltypename, Startcount
        {"bob:Aircraft.Bf-109E-3",60},
        {"bob:Aircraft.Bf-109E-3B",24},
        {"bob:Aircraft.Bf-109E-1",40},
        {"bob:Aircraft.Bf-109E-4",50},
        {"bob:Aircraft.Bf-109E-4B",24},
        {"bob:Aircraft.Bf-110C-4",24},
        {"bob:Aircraft.Bf-110C-7",24},
        {"bob:Aircraft.Ju-87B-2",60},
        {"bob:Aircraft.Ju-88A-1",40},
        {"bob:Aircraft.He-111H-2",60},
        {"bob:Aircraft.He-111P-2",20},
    };
    Dictionary<string, int> RAFAvailableAirplanes = new Dictionary<string, int>()
    {
        //Internaltypename, Startcount
        {"bob:Aircraft.SpitfireMkIa",30},
        {"bob:Aircraft.SpitfireMkI",60},
        {"bob:Aircraft.HurricaneMkI",50},
        {"bob:Aircraft.HurricaneMkI_dH5-20",50},
        {"bob:Aircraft.BlenheimMkIV",40},
        {"bob:Aircraft.SpitfireMkIIa",0},
    };


   Dictionary<AiGroundActorType,int> PointsforGroundTargets = new Dictionary<AiGroundActorType,int>()
    {
        {AiGroundActorType.AAGun, 2},
        {AiGroundActorType.AmmoComposition, 2},
        {AiGroundActorType.Amphibian, 2},
        {AiGroundActorType.ArmoredCar, 2},
        {AiGroundActorType.Artillery, 2},
        {AiGroundActorType.Balloon, 2},
        {AiGroundActorType.Bridge, 2},
        {AiGroundActorType.Bus, 2},
        {AiGroundActorType.Car, 2},
        {AiGroundActorType.ContainerLong, 2},
        {AiGroundActorType.ContainerShort, 2},
        {AiGroundActorType.EngineWagon, 2},
        {AiGroundActorType.FreightWagon, 2},
        {AiGroundActorType.Generator, 2},
        {AiGroundActorType.House, 2},
        {AiGroundActorType.LightTruck, 2},
        {AiGroundActorType.Listener, 2},
        {AiGroundActorType.Medic, 2},
        {AiGroundActorType.Motorcycle, 2},
        {AiGroundActorType.PassengerWagon, 2},
        {AiGroundActorType.Plane, 2},
        {AiGroundActorType.Predictor, 2},
        {AiGroundActorType.Radar, 2},
        {AiGroundActorType.RadioBeacon, 2},
        {AiGroundActorType.RadioBeamProjector, 2},
        {AiGroundActorType.SPG, 2},
        {AiGroundActorType.Tank, 2},
        {AiGroundActorType.Tractor, 2},
        {AiGroundActorType.Trailer, 2},
        {AiGroundActorType.Truck, 2},
        //Schiffe
        //{AiGroundActorType.ShipBattleship, 1},
        //{AiGroundActorType.ShipCarrier, 1},
        //{AiGroundActorType.ShipCruiser, 1},
        //{AiGroundActorType.ShipSubmarine, 1},
        {AiGroundActorType.ShipTransport, 25},
        {AiGroundActorType.ShipMisc,2},
        
        {AiGroundActorType.ShipDestroyer,50},
        {AiGroundActorType.ShipSmallWarship, 50},

        {AiGroundActorType.Unknown, 2}

    };

    Dictionary<string, int> PointsforAirTargets = new Dictionary<string, int>()
    {
        {"DiveBomber", 3},
        {"Bomber", 3},
        {"Bomber, DiveBomber",3},
        {"AmphibiousPlane", 3},
        {"TorpedoBomber", 3},
        {"Transport", 3},
        {"BNZFighter",1},
        {"Fighter",1},
        {"Glider",1},
        {"HeavyFighter",2},
        {"JaBo",1},
        {"SailPlane",1},
        {"Scout",1},
        {"Sturmovik",1},
        {"TNBFighter",1},
        {"UNKNOWN",1}
    };

 public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> damages)
    {
        base.OnActorDead(missionNumber, shortName, actor, damages);
		
		
if ((actor as AiGroundActor) != null && damages[0].initiator.Player != null)
            GamePlay.gpLogServer(null, "{0} was destroyed by {1}", new object[] { (actor as AiCart).InternalTypeName().Substring(4), (damages[0].initiator.Player.Name()) });
    	
        foreach (DamagerScore ds in damages)
        {
            int Addpoints = 0;
            int value;
            bool willReportDead = false;
            string TargetName = "";

            if (ds.initiator != null)
            {
                if (ds.initiator.Actor != null)
                {
                    if (actor.Army() != ds.initiator.Actor.Army())
                    {
                        if (actor is AiPerson) break; // At moment Pilotkills are not counted ;)

                        if (actor is AiAircraft)
                        {

							if (PointsforAirTargets.TryGetValue((actor as AiAircraft).Type().ToString(), out value)) // Erstetzt wegen Stukaproblem
                                Addpoints = PointsforAirTargets[(actor as AiAircraft).Type().ToString()];

                            TargetName = SplitName((actor as AiAircraft).InternalTypeName());

                            value = 0;
							if (actor.Army() == ArmyRed)
                                {
								BlueAirKills++;
                            if (RAFAvailableAirplanes.TryGetValue((actor as AiAircraft).InternalTypeName(), out value))
									{
								RAFAvailableAirplanes[(actor as AiAircraft).InternalTypeName()] = value - 1;
                                TargetName += " (" + RAFAvailableAirplanes[(actor as AiAircraft).InternalTypeName()].ToString() + " available)";  // Shows Counter for Planetype
									}
								}
							
							else if (actor.Army() == ArmyBlue)
								{
								RedAirKills++;
							if (LWAvailableAirplanes.TryGetValue((actor as AiAircraft).InternalTypeName(), out value))
									{
								LWAvailableAirplanes[(actor as AiAircraft).InternalTypeName()] = value - 1;
                                TargetName += " (" + LWAvailableAirplanes[(actor as AiAircraft).InternalTypeName()].ToString() + " available)";  // Shows Counter for Planetype
									}
								
								}
						}

                        if (actor is AiGroundActor)
                        {
                            if (PointsforGroundTargets.TryGetValue((actor as AiGroundActor).Type(), out value))
                                Addpoints = PointsforGroundTargets[(actor as AiGroundActor).Type()];

                            TargetName = SplitName((actor as AiGroundActor).InternalTypeName());
                        }

                        
                        willReportDead = true;

                        if (ds.initiator.Actor.Army() == ArmyBlue)
                        {
							BlueGrdKills++;
                            ScoreBlue += Addpoints;
							if (Addpoints <=0)
							{ScoreBlue += 3;}
                            GamePlay.gpLogServer(null, "Britisch {0} destroyed - Team scores now: RAF {1}- LW {2}", new object[] { TargetName, ScoreRed, ScoreBlue });
                            break;
                        }
                        else if (ds.initiator.Actor.Army() == ArmyRed)
                        {
							RedGrdKills++;
                            ScoreRed += Addpoints;
							if (Addpoints <=0)
							{ScoreRed += 3;}
                            GamePlay.gpLogServer(null, "German {0} destroyed - Team scores now: RAF {1}- LW {2}", new object[] { TargetName, ScoreRed, ScoreBlue });
                            break;
                        }
                    }
                }
            }
        }    
    }
Reply With Quote
  #4  
Old 11-16-2011, 02:15 PM
SNAFU SNAFU is offline
Approved Member
 
Join Date: Feb 2011
Posts: 324
Default

This was our solution for scores for triggered events. If the blue team should receive for example 50 points for a mission goal, I named the trigger "ScoreBlue50" and the following On Trigger Method added 50 points to the int ScoreBlue:

Code:
public override void OnTrigger(int missionNumber, string shortName, bool active) 
    {
       base.OnTrigger(missionNumber, shortName, active); 

  if (shortName.StartsWith("ScoreRed"))
        {
            StringBuilder b = new StringBuilder(shortName);
            string Number = b.Replace("ScoreRed", "").ToString();
            int Redresult = 0;

            if (int.TryParse(Number, out Redresult))
                ScoreRed += Redresult; 
  
            GamePlay.gpLogServer(null, "The RAF succesfully accomplished one objective: \nTeam scores - RAF {0}: LW {1}", new object[] {ScoreRed, ScoreBlue });
        }
		  if (shortName.StartsWith("ScoreBlue"))
        {
            StringBuilder b = new StringBuilder(shortName);
            string Number = b.Replace("ScoreBlue", "").ToString();
            int Blueresult = 0;

            if (int.TryParse(Number, out Blueresult))
                ScoreBlue += Blueresult; 
   
            GamePlay.gpLogServer(null, "The LW succesfully accomplished one objective: \nTeam scores - RAF {0}: LW {1}", new object[] {ScoreRed, ScoreBlue });
        }
}
Reply With Quote
  #5  
Old 11-16-2011, 02:23 PM
wildwillie wildwillie is offline
Approved Member
 
Join Date: Aug 2010
Posts: 111
Default

Yes the OnActorDead method picks up Static objects. Here is the line I pass from Clod to my program which identifies the Dead Ground Actor:

Code:
( 11/15/2011 4:01:27 PM ) New (STATS): DeadGA::1321390887075::0:Static24::1::bob:Artillery.3_inch_20_CWT_QF_Mk_I::AAGun::0:Static34::2::272406.84/200908.39
The "::" divides the data parts so it passes:
Event Type (DeadGA)
TimeStamp (In unix format)
Object Destroyed Name (0:Static24)
Object Destroyed Army (1)
Object Destroyed Model (The InternalTypedName )
Object Destroyed Type (AAGUN)
Destroyer (Who killed the object 0:Static34)
Destroyer Army (2)
Location of destroyed object (x/y)

The same goes for Chiefs and Planes. It still needs to be updated with the damage score value.

Thanks for the input. I think I will populate the objects in a database with their total available score there. That way it would be easier for Server Managers to adjust scoring without having to adjust code.

I've only crash landed on land. If I kill myself while doing this then the OnActorDead method gets called after about a million OnAircraftDamaged methods !


WildWillie
Reply With Quote
  #6  
Old 11-16-2011, 02:30 PM
SNAFU SNAFU is offline
Approved Member
 
Join Date: Feb 2011
Posts: 324
Default

Ok, interesting.

With static I meant "enviroment" types like static cars, tanks, planes in listed "Enviroment". Artillery-types are recognized, that`s why I had to rebuilt in all my missions the ground units to artillery types and that`s why I asked. Looking forward for your tool!
Reply With Quote
  #7  
Old 11-16-2011, 03:37 PM
wildwillie wildwillie is offline
Approved Member
 
Join Date: Aug 2010
Posts: 111
Default

SNAFU -

What do you mean by Environment types ?

Unfortunatly I'm not that versed in the FMB stuff. I thought any static planes, trucks, tanks, etc added to a mission were listed under the [Stationary] section of the .mis file.

AI objects are listed under the [Chief] sections.

Other building objects are under [Buildings] which would be great if we had a way to identify those being destroyed. That was always a problem with IL2 is you can create a factory complex, but had to place cars/static objects inside to register when they were destroyed.

Can you post an example of a .mis file with the environment types ?

Wildwillie
Reply With Quote
  #8  
Old 11-16-2011, 05:05 PM
SNAFU SNAFU is offline
Approved Member
 
Join Date: Feb 2011
Posts: 324
Default

With "Enviromental" Types I mean all objects listed in FMB under "Enviroment" (?not sure if thats is the right designation in the english installation, I have the german one installed). For excample this object:

Static274 Stationary.Bf-109E-1 de 280631.88 212409.64 3665.00
or this
Static278 Stationary.Renault_UE_Track_CargoSet2 gb 245508.16 233959.69 -120.00

Is not recognized with OnActorDestroyed of course, because it is no actor. Artillery-Objects in FMB as:

Static258 Artillery.Bofors_StandAlone gb 88914.33 195537.75 75.00 /timeout 0/radius_hide 0

are Actors and are therefore recognized - that was what I tried to say.

Last edited by SNAFU; 11-16-2011 at 05:11 PM.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:51 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.