Essential code?

Go down

Essential code? Empty Essential code?

Post by HomerPepsi on Wed 06 Feb 2013, 05:36

Do people still code in Ultimate AI or anything any more? Same with the
Do Cover script? Whats bit's are necessary now with the EDX and it's
quick start??


HomerPepsi's OFDR Filebeam Folder
HomerPepsi's YouTube Channel
HomerPepsi
HomerPepsi
Veteran

Location : Adanac
Points : 87
Reputation : 2
Join date : 2012-12-18

http://filebeam.com/folder/10717

Back to top Go down

Essential code? Empty Re: Essential code?

Post by tjdagger on Wed 06 Feb 2013, 06:54

Hi HomerPepsi,
I'm working within the EdX framework. The difference between using the stock mission editor and the EdX is the ability to use event functions inside SecondaryScripts.
What?
In an ordinary stock mission it was a real hassle to use secondary scripts. You needed a bunch of complex code to enable variable values to be passed back and forth between scripts, you couldn't use things like onEnter. Instead you need to call everything on the level script and then direct everything towards a secondary location... etc, etc, etc.
What Tvig has essentially done is taken all that complex code and structured it straight into the waypoints.lua file. This is a read only file that the game uses, originally to contain all the complex code relating to waypoints and paths. It now also has complex stuff to allow for events to register on secondary scripts.
...So?
So this means you place stuff on the map, then code just for that stuff. Then you can place stuff on the map and code for it on another script. This way you keep your code from growing into a 10,000 line monster that devours all logic and your sanity along with it.
You code just the same as you do now, but you can keep track of it much easier. There are some "best" methods and basic "do's" and "don't" that are specific to multi-scripting.
The Edx also allow for flexible code sharing. If fact this has been my focus with modules. Setting them up so that anyone with the same database could easily use them.
Further more Tvig has also created a network of functions with an EDX prefix. These are ready to use just like the OFP functions. Most are variations of custom functions he developed for some of his "Iconic" missions.
But in order to get started with EdX you don't need to know more than you currently do. It would simply make sense to continue learning in an easier environment.
Oh!... and Edx has a debugger. I found problems I didn't even know existed! Which made my code better.

Cheers,



Essential code? 8adb54ef2dbe24a4ccf87626e12261e7

tjdagger
Admin

Location : Silverdale, Queensland, Australia
Points : 107
Reputation : 7
Join date : 2012-12-17
Age : 43

Back to top Go down

Essential code? Empty Re: Essential code?

Post by HomerPepsi on Thu 07 Feb 2013, 15:43

So does this mean we do not have to include the ultimate AI lua script anymore, or if I wanted my mission to use UAI, I would need to grab and put it in the mission.lua (not level.lua). I've got a pretty good grasp of the EDX, so I guess the a simpler way to ask what I'm asking is: What tweaks if any to the AI are included with EDX in the waypoint.lua?

There are two specific AI scripts I'm wondering if I should include: TemplarGFX's Do Cover and UltimateAI.

Tj, I'm currently working on a SFGW style mission (reverse engineering an old SFGW mssn file, I hope you don't mind). Base camps with combat zones. It would seem that with the EDX, I'd be able to write a secondary script for each trigger zone - would that be the most efficient way of doing things? I feel like this appoach would allow for zone specific code isolation for easier debugging. Then, just use a mission.lua to store all the global functions like hot keys commands. Let me know what you think!


HomerPepsi's OFDR Filebeam Folder
HomerPepsi's YouTube Channel
HomerPepsi
HomerPepsi
Veteran

Location : Adanac
Points : 87
Reputation : 2
Join date : 2012-12-18

http://filebeam.com/folder/10717

Back to top Go down

Essential code? Empty Re: Essential code?

Post by Guest on Thu 07 Feb 2013, 20:48

You can still use UAI exactly as you would have used it before. Import it as a secondary script and call it from the mission script or whatever other script you want to use. I'm not sure how the do cover script is configured so there is a chance that he has event handlers referenced in the script that may interfere with the EDX scripts. You can try to implement it the same way though and see what the results are.

Your method of design for the mission you said you're working on is exaclty what the EDX was designed to do. Carefully monitor your script count as I'm not sure what the upper limit is for number of scripts in a mission, if there is one of course. If you have any other questions or problems with implementation feel free to give me a buzz. I'd be happy to help you out.

Cheers Very Happy
Anonymous
Guest
Guest


Back to top Go down

Essential code? Empty Re: Essential code?

Post by tjdagger on Sat 09 Feb 2013, 23:43

HomerPepsi wrote:
Tj, I'm currently working on a SFGW style mission (reverse engineering an old SFGW mssn file, I hope you don't mind). Base camps with combat zones. It would seem that with the EDX, I'd be able to write a secondary script for each trigger zone - would that be the most efficient way of doing things? I feel like this appoach would allow for zone specific code isolation for easier debugging. Then, just use a mission.lua to store all the global functions like hot keys commands. Let me know what you think!
I don't mind at all (flattered in fact).
As Tvig points out, the EdX was designed with script specific, code separation, easier tracking and debuging as the main goals. This is what makes it easier in general to use.
Personally I have been for some time been of the opinion that secondary script code should be designed to fulfil a very defined and specific purpose. Flexible and robust enough to cover all possible situations related to that specific purpose and generic enough so that I can reuse the script in any mission and achieve the same results. Couple these concepts with related prop sets and suddenly it begins to look like a reusable module.
You could certainly code a script for each triggerzone or you could create triggerzone types. For example I have a bunch of scripts, each one essentially handles what happens when you enter and leave triggerzones. I use tables to store the name of triggerzones on the map. The names are listed only on the script that applies to it. The first thing that happens with my scripts for triggerzones when you enter or leave is the name of the zone is checked in each script to see if it exists in that script.
So... the player enters a zone, the name of the zone is checked to see what script it is on. If it's on the mortar script, then all the stuff to spawn in a mortar will happen. It will then check the next script and so. Any scripts that don't have that trigger listed on them will perform no further action.
I have scripts for zones that spawn in units only, it also handles foot patrols, defences positions despawning, entity limit checks and every other possible situation for those troops spawned in... and that's it!
I have another which spawns in ground vehicles and manages their movements and spawning and despawning. Another script handles aircraft spawning, patrols and air bases. Another for bunkers, another for structures. I have plans for a mod for beach assaults and boat handling. I have some for particle effects, objects and placeables.
Each script though has been made to work independent from the others. I've tried to make them so the least amount of coding is required to setup new zones. I can basically place stuff on the map and assign it to a script with one line of data and it will perform complex tasks automatically from there on.
If you played The Perfect Plan, would you believe that once I got my modules right, it took me less than a day to extend the mission are to 4 times it's original size. This included placing all the bunkers, units, defences, patrols, vehicles and objectives.
I havn't released all these module yet, for a number of reasons. Firstly time, but also I'm not sure the best way to communicate how to use them. Dose a brochure type step by step visual setup work better than me mumbling on a video? I believe the best way would be to hook up on skype and talk someone through it at their pace. This of course is limited by time zones and personal commitments for all involved.
But I will say this, if anyone is interested in learning to use modules, coding in general or even discuss mission making theory then by all means I will find the time to hook up on skype and get chatty. It's this creative side of the game which has held my keen interest for so long. The fact that I can enjoy and play what I create is simply a bonus.

On another note, I've not really used the Do Cover script, I understand what it does and I haven't really found a use for it in my missions. It works extremely well for the purpose it was design for... large scale (lots of units) close quarter, tight combat.
I used the Ultimate AI in previous missions, but not for a while now. Personally I find the AI to be more than adequate especially one you've mastered controlling the entity limits. Instead I focus more on unit placement and unit behaviour, putting the right guys at the right places to do the right job. From there the games solid game play does the rest.


Essential code? 8adb54ef2dbe24a4ccf87626e12261e7

tjdagger
Admin

Location : Silverdale, Queensland, Australia
Points : 107
Reputation : 7
Join date : 2012-12-17
Age : 43

Back to top Go down

Essential code? Empty Re: Essential code?

Post by John J. Stevens on Wed 13 Feb 2013, 09:28

Homer-

I wrestled with the DoCover script for some time under the belief that I wanted to provide better troop reactions in the field, town or forest. Basically Tvig convinced me that the original AI logic is really quite fine and does the appropriate cover/conceal movements inside the AIconfig or a lobotomized version of the UAI code module.

I lean towards the UAI approach only to keep things mission modular but it easy to assume the value of troops natively having a broader cover radius to work from at all times like we do with Ambient light or AIconfig mods.


The reason we decided it need to be mission specific was simply the engines apparent decision tree being created - while we will never understand the EXACT way it works, we did deduce by observation and some basic understanding of logic tree structure that the more "obstacles" and "cover" around the bigger the decision tree.

This is one of the reasons I understood TemplarGFX modified much of the AIconfig stuff because he was doing WHOLE ISLAND missions rather than area skirmishes. Put it another way, if the AI has to think about infinitely more cover combinations in a 100meter radius in a town than in a field, it will slow down the reaction time by having MORE decisions.

Ideally we would throttle this radius differently in these environments and even tighten them if when in a close combat environment like the containers or towns because cover 100 meters away is a death wish when under attack (yet another trigger to consider different from patrol).

Either case, we did verify that AI will innately use the tree lines for cover IF given the opportunity see it in their radius - the trouble comes when they are in town and have so many more to think through. In the end I lean to having the engine do as much as it can without over engineering a programmatic solution to doing the same thing. If AI is to be used effectively in this engine, i think we need to first concentrate on the basics of movement and cover (in the engine) and less on the tactical aspects that human players would be able to deduce. Put it another way, the AI is for ambient combat movements (guarding/patrol/defense), the PLAYERS are the real time decision players(more tactical).


Essential code? Steven13
John J. Stevens
John J. Stevens
Admin

Location : WV/PA
Points : 284
Reputation : 21
Join date : 2012-12-19

Back to top Go down

Essential code? Empty Re: Essential code?

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum