Home   Help Search Login Register  

Author Topic: Dynamic OFP  (Read 2973 times)

0 Members and 1 Guest are viewing this topic.

Rappy

  • Guest
Re:Dynamic OFP
« Reply #15 on: 13 Apr 2003, 12:54:42 »
Nice idea :)

Wanted to start an AI improvement/randomisation script aswell to make it more intresting, challenging and varied.

Havent had time yet however.

The idea itself is nice however.
You could add stuff into classes.

Like depending on weapon/type, so an AI platoon with one or two rpg troops wont attack 4 tanks, rather call for more rpg soldiers and hide until their arrival, or even follow the tanks around to get their position constantly and follow their movement.

perhaps even mark their position/route on map via markers.

or will scatter and hide from choppers etc.

It could all prove very intresting and add tons of new stuff to the typical boring battles.

Kinnon

  • Guest
Re:Dynamic OFP
« Reply #16 on: 15 Apr 2003, 00:11:41 »
At the moment mine is only land and air. I like your thinking Strangelove. I have small 4-man patrols that do recon and order in the appropriate units to attack.

If they spot tanks but also a Vulcan then they order a group in to take out the Vulcan before sending in helicopters for the tanks.

The recon groups run and hide in forests if they feel threatened, and they each have a base in a randm forest from which they now rearm.

It's bloody slow going though, and OFP is kinda flaky, i'm getting variables corrupting themselves when they were fine just ONE LINE OF CODE BEFORE in the same script !!! ???

Offline benreeper

  • Members
  • *
  • I'm a llama!
Re:Dynamic OFP
« Reply #17 on: 15 Apr 2003, 05:21:05 »
I also would be very interested in the "OpFor" engine.  It will help with what I'm working on.

Ben

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Dynamic OFP
« Reply #18 on: 15 Apr 2003, 18:13:45 »
Good report, Kinnon.

Had 2 lonely days at work so i thought i'd better design my basic AI structure. (I'll try to solve this project with object orientated software design, that's a good way to train programming project skills for my job)

So far i think i've identified 4 object classes that will do the job (in Opf this could mean there are 4 main scripts running i suppose, not sure yet):

ThreatEvaluator:
This object/script oversees all friendly units and mainly deals with the question: if something happened, what was sighted, where and when was it reported ? Then it classifies the (maybe potential) threat and reports the threattype, position and time to other scripts.

GameplanManager:
Its main job is to generate/update/delete threat symbols on the map. Every symbol is connected with the time it was generated. To use the advantage of the Opf engine, i decided the GameplanManager will only work with the gamegrid (50mx50m). To my Manager the world of opf should 'look' like a big tictactoe game where certain fields are neutral, friendly or a threat.
Also, i want it to handle mixed threat symbols, that means a field could also be occupied by an infantry-threat and a tank-threat symbol.

TroopManager:
Its main job is to spawn troops of various types and numbers, give them orders and waypoints and takes care that a group is called back after a certain threat is 'dealed' with (in various ways). It's a dumb script that isn't  decisive, it just follows orders of the SituationAnalyser.

SituationAnalyser:
This is the decisive routine, sorta 'The Brain' - it depends on / works with infos / events from the other objects/scripts.
It takes resource levels, threat symbols and his 'personal' behaviour settings into account and decides what the TroopManager should do next.
It only reacts to changes of resources and threat symbols. A new threat will trigger an order to the TroopManager, who will spawn&command the appropiate troops. If resources drop, the Analyser will take appropiate steps to get more resources (reinforcements/supplies). If resources raise beyond a certain level the Analyser will take steps to built a new base. Once this base is finished the Analyser starts the new AI script, therefore creating a 'living' copy of its own.

By the way this works, the players will have to deal with lots of independant bases if they wait too long.

Ideas/Comments/whatever welcome  :)

Kinnon

  • Guest
Re:Dynamic OFP
« Reply #19 on: 15 Apr 2003, 20:50:01 »
Nice analysis. I now have the basic mechanisms for the units/groups (you should see the combined helicopter/multi-RPG attack on tanks) but have to work on a strategic-overview-brain thing, as at the moment the forces are purely reactionary, although with good planning a reactionary force seem to do quite well.

I've just had trouble with the main framework, i liked Planet of War but was disapointed that the computer didn't attempt to expand at all. So i think i'll start off simply and juts do a 'discover the base and destroy the enemy' type scenario, so the first step is to locate the enemy base.

I can't wait to sit down and play it i've been going for ... is it 3 weeks now ?

Tell ya what, bloody helicopters are difficult when it's a pure script and not a named unit, because practically every helicopter command requires an object to operate upon rather than a group or unit, i managed to solve it using a quirk in OFP. I couldn't get them to land when they RTB after being called out so i ended up saying 'unAssignVehicle _leader', and strangely enough, in a single-man chopper, he just lands, gets out then gets in again, which is fine, but if you ahve a pilot and gunner, the pilot gets back in again but the gunner runs into the rear passenger space !

I need to know more about the internals of this excellent but infuriating game but info seems thin on the ground, there used to be an OFP Internals site didn't there ?


Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Dynamic OFP
« Reply #20 on: 16 Apr 2003, 00:12:39 »
I wouldn't try to give exact orders to your groups at the front. That's where the 'normal' AI of Opf kicks in and it gets the job done. For my part, i just care about the 'conquer island and manage resources' strategic thing. Sending the appropiate units to where the action is hot will be enough for a first basic version, i think.

I take it OpF can solve logical things like 8 AND 10 (=8) ?
Never tested it. I'd need that for a unit vs unit table i made up today. Every bit stands for a certain unit (inf, aainf, tank, heli, etc) and by combining bits with AND the AI can judge what units are a good answer against mixed threats.
Say, that BMPs with AAInfantry have been spotted. My AI (as i plan it) will find out that it could send (for example) Tanks, Fighters and RPGInfantry. It wouldn't suggest attacking with Choppers due to the AAInfantry, nor it would suggest attacking with normal Infantry, due to the BMPs.

Just an idea.

Kinnon

  • Guest
Re:Dynamic OFP
« Reply #21 on: 16 Apr 2003, 18:40:53 »
Blimey ! Your using bitwise comparisons !!! It's not assembly language ya know :)

Offline benreeper

  • Members
  • *
  • I'm a llama!
Re:Dynamic OFP
« Reply #22 on: 17 Apr 2003, 00:31:22 »
LOL!

Great start.  I think the only that stalls good scripting in oFP is that the AI sometimes falls alseep.  An example is giving a formation command and a minute later they change formation (this is in safe mode).  

This is really the last piece to the OFP puzzle.

Ben

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Dynamic OFP
« Reply #23 on: 26 Apr 2003, 13:21:29 »
Blimey ! Your using bitwise comparisons !!! It's not assembly language ya know :)


Hmmm - in that case: could this be 'simulated' with boolean arrays ? Sorta like: if all fields say 'true', but 1 field is 'false', then the whole answer is 'false' ?

In other words, it's like comparing bit by bit that way. Shame OpF doesn't support bitwise OR & AND, it's written in c++ - it shouldn't be a problem.  :-\


Btw Kinnon: what's your status ? Anything works yet ?
For my part: the beast called RealLife kicked me around a bit lately, so i'm still in the planning process. Also i'm worried about all this server-side and client-side routines of OpF. If i got that right, one should plan with these problems in mind or the script won't work in MP. (?!)

OpF - you gotta love it  :-*
« Last Edit: 26 Apr 2003, 13:25:12 by DrStrangelove »

Kinnon

  • Guest
Re:Dynamic OFP
« Reply #24 on: 27 Apr 2003, 12:23:57 »
Well, i've got a working version that's nowhere near final but playable and fun.

It works with Command Engine 2, i've made tiny modifications to 1 or 2 CE2 scripts, nothing clever, just ensuring that my scripts get called by the CE2 main loop.

So far i have recon groups that wander around circularly-defined recon areas in a random fashion, when they spot enemy units then they call appropriate support, they do not rate the enemy at all, just call in infantry and BMP to attack infantry, helicopters to attack tanks, RPG infantry to go for Vulcans ...

They are purely reactive, but the management systems work well, support can't be called in if it's already busy, only one chopper at a time will try and land back at base etc ...

That's the old version though, i've started work on a strategic script now that analyses a threat before responding, and the individual response units respond more intelligently. For instance, infantry groups now attack from the cover of forests when possible rather than going straight for the enemy.

If you want i can mail you a copy of the old versoin, it's fun to play with ...

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Dynamic OFP
« Reply #25 on: 27 Apr 2003, 13:38:58 »
That would be awesome, of course i want it!  :)
If i find something very useful in your script, can i use & edit it in my ai script ? You'll get full credit of course. In turn i'll contact you when i have something up. That way our scripts could get better in a shorter time period.

Some questions:
---------------------
CE:
By using that it can't be used in MP, can it ? Last time i checked CE was purely SP (or did i miss something?).

Use forests for cover:
How do you find the pos of a forest object ?

Idea:
-------
It should be easy to customize an ai script to other units. Names of custom units should be defined at a central script, like units.sqs or something. That way ppl would need to figure out the internal names of their fav units and write them into it.

Another advantage of this is that modified 'units.sqs' could be swapped by ppl over the inet very easily.
« Last Edit: 27 Apr 2003, 13:44:45 by DrStrangelove »

Kinnon

  • Guest
Re:Dynamic OFP
« Reply #26 on: 27 Apr 2003, 17:31:35 »
Of course you can use any parts of it.

I don't know off the TOMH about CE2 and multiplayer ... But the point is this is an AI Opponent for single-player play anyway ... Since this is my first scripting project i am not going into the MP arena yet !

I don't know any way of finding the position of a forest object, so i just placed triggers in every forested area on jungle everon, then looked up the positions in the 'mission.sqm' file then deleted the triggers.

Universal script is a good idea, mine are all easily modifiable anyway, they operate using the name of the group so ....

Miles

  • Guest
Re:Dynamic OFP
« Reply #27 on: 04 May 2003, 20:47:43 »
Any news on this? I think it got moved back when they merged the forums.
« Last Edit: 04 May 2003, 20:49:38 by Miles »

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Dynamic OFP
« Reply #28 on: 05 May 2003, 00:01:36 »
I'm still in the planning phase, but almost finished now. I'll start coding the prototype within 2 weeks i guess.

(Still waiting for Kinnon's script)