Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Black Wolf on June 16, 2004, 05:16:05 am
-
http://www.hard-light.net/vwbb/showthread.php?threadid=9856
It was, rightly, pinged for being OT in the TBP forums, so I figured it should be brought over here.
OK. The theory is this. An additional option, probably out of the tech rooms mission selector, that'll autogenerate simple dogfights. Obviously, we're not talking about campaign quality missions here, but rather very simple mission archetypes that are varied based on the users choices and a degree of randominity. We've all played games that do it - many FPSes have a version of it for example, and I think that FSes misison design system would actually be pretty much ideal for this kind of addition.
This is how I reccomend it be done. First, the player is allowed to choose from a series of mission types
Defence.
The typical Defend a capship against bombers mission. If motion (waypoints) is possible, then the mission could be further split into defending a capship through to a node, or defending a capship waiting for a new subspace drive, ala the [V] mission with the Aquitaine. The mission could also be to defend an Arcadia.
Assault
A typical attack a capship misison. The player flies either in a bomber, or is tasked with defending another bomber wing.
Strategic Assault
The player is sent in alone or with a small wing, tasked with the performance of a very specific objective (probably eliminate turrets/subsystems) without destroying the target ship.
A difficulty setting (Easy, Medium or Hard, specific to the mission being generated rather than the players chosen difficulty (very Easy - Insane)) would be set to define the missions parameters for a simple mission, then the player could modify them specifically himself for an advanced if he chose to. These could be
Environment - Nebula, Asteroid Field, Open space, EMP Nebula
Player Faction - GTVA (Terran), GTVA (Vasudans) SOC, NTF, HOL
Hostile Faction - Shivans, or any of the above (Putting Shivans as friendly would probably be difficult)
Rank (To define available weapons/ships, ie. an ensign in the Vasudan GTVA may be limited to Horuses and Serapises, an Admiral can have Bakhas and Ptahs)
Reinforcements - On/Off
And probably a few others as well. Some of these would have to be randomized in a simple mission, like the environment (perhaps weighted so that the numbers of Open Space>Asteroid Fields>Nebula>EMP Nebula), while others, like the rank, would be obviously defined as part of what makes the mission easy, medium or hard.
OK. Step 2 - the briefing.
Obviously, the computer can't generate full on briefings. But I reckon that it wouldn't be hard to set up some generic briefings (at least half a dozen for each mission type, so it doesn;t get stale) with a system where the various names are simply referenced.
EG.
"Welcome pilots. The (HOSTILE FACTION) has been harrassing shipping in (SYSTEM NAME). We've tracked their base of operations back to (SYSTEM NAME) IV, and the (SHIP NAME)(Note - all ships would need to be prefixed (GTCv, GTD) for this to work well). Your wing will assist the (FRIENDLY FACTION) to eliminate it."
Etc. Depending on the complexity of the codes, and the amount of information they can be set up to give, we can go further, telling the pilot about possible enemy resistance, who he'll be going in with, whether reinforcements are available etc.
Part 3 - The mission itself. This would obviously be the part that would need the most coding, and be the most complex, and obviously I'm no coder, but I think that there would be some things that could be done to make things simpler.
Firstly, naming the ships wouldn't be a problem. A set of tables could be set up, with, say, 50-100 names for various species. The prefix could be applied based on the class and faction (EG, HLD, NTCv etc.).
Fighters could be told to arrive from relevant locations at various intervals, with numbers, waves, intervals etc. all defined, again possibly by table, depending on the difficulty setting. Making use of the "near-ship" arrival would make things stay together a bit more too. More tables would define the quality and types of ships used by each faction.
Obviously, complex AI couldn't be figured in, but initial orders, defined by thetype and difficulty of the misison, would probably be enough, even if you just limited then to Guard and Chase.
The premade mission backgrounds Lightspeed is shipping with his nebs these days would be all you'dneed for that aspect of the mission, or you could possibly splice in something like Kazans random Background generator.
Capships could be integrated based on the difficulty (IE. on easy you get a capship for assault missions, on hard you might get one arrayed against you in defence missions, though of course this would have to be partially random) and then told to arrive like fighters. The quality of caps would also be controlled by the difficulty and a random figure. For example, on a Medium defensive mission, you have a 15% chance that a capship might arrive to attack your vessel. There's a 75% chance this vessel will be a Cain (Or Fenris, or Aten) and a 25% chance it'll be a Lillith (or Levi or Mentu)
A set of prewritten messages, again using the codes from the briefing, could be used to signify predictable events, like the arrival and departure of ships, hull percentage dropping, time to departure etc.
The debrief would work like the briefing, but would obviously have to be more complex, depending on whether you pass or fail.
Right. My first suggestion, as a complete non coder, is that, if youguys choose to look into this, you look into it based on having FS2 modify existing .fs2s, that could be set up in FRED and shipped with FSO. You'd already probably have to use Lightys misison files for the BGs, so it might be an idea to insert the Debriefing sexps (even if the stages were left blank, to be called from a table for randomness). It strikes me that this might be simpler than trying to code. This could also be useful for briefing Icons, as the code would tell it whether it needed to switch to cruiser, corvette, destroyer etc., but the .fs2 would tell the icons and the camera where to position themselves. Of course, this may be relatively simple to code, and buildig off an existing .fs2 may be very difficult, but it is just a siggestion.
My second suggestion is that you forgive me for suggesting so many tables. :nervous:. My motivation here is to make it easy for mods to insert additional stuff for this feature. As Karajorma mentioned in the VWBB thread, this would be really great for Inferno and TBP, but they'd need the ability to modify things (EG, put the EA in place of the NTF in factions, change the ship preferences, etc.) without going into the code. Similarly, they may need to rebalance, eg. in the SW Mod, capital ships might be a lot more powerful than standard FS2 caps, and so we might need to bring down the percentage probability that you'll face any.
My final...not really a suggestion...anyway, finally, if someone does pick this up, or WMCoolmon decides to run with it, I'd be willing to assist in non code ways, such as moifying the interface, writing up Name tables, writing briefings etc.
I do realize this'd be a lot of work, but it does have several advantages IMO. For one thing, there's the already mentioned extention of the life and appeal of TCs - once you've completed inferno's released campaign, go and play at taking out a GTVA capship as a pilot in the EA. Or you might not even need a TC. Maybe you just feel like a bit of good old FS2 fun, but you don;t have any decent campaigns you haven't played to death, or you're stuck on a particularly hard misison. Plus, in addition to a new PXO replacement and the graphical upgrades, I think this could become one of the SCPs major upgrades to the game, and quite possibly get more people playing. That sort of instant action has proven very popular in the past, and I see no reason why it couldn't apply to FS2.
-
I totally agree with all BW said. I am afraid I cannot really help, but I am willing to try, if you can wait 3 weeks 'till I pop in (exams).
If you need more MODs to request this, FSCZ hereby requests it.
-
Oy.
Wow, you've definitely put a lot of thought into this. :p The thing is that it would be a huge amount of work. It would probably be straightforward to code, but you're asking for a lot of code here. Your best option would be to make a standalone program to generate .FS2 files based on your criteria.
-
Not to mention the art that would be required.
-
Maybe if we got fs2 to run programs from inside the actual game it could help? This way you could also run FRED2 from inside fs2, and it could provide a nice way to add expansions like a random mission generator, or maybe even use a program such as winamp to help play .mp3's or .ogg's ingame.
-
:shaking:
When you put it that way...
Like Goober said it'd be an enormous amount of work, and I'm definitely not comfortable enough with the mission code to be able to help with much besides creating briefings or voices and such.
If it does get worked on, I think it would be much easier to have template missions, ie assault.fs2, that have different things replaced according to a table rather than generating a whole new mission each time. It'd also let you expand it to use mods easily, or toss in some extra fighters, or have a central plot with the randomly-generated ships.
-
Originally posted by Liberator
Not to mention the art that would be required.
As mentioned, I'd be willing to do that stuff - there really wouldn;t be that much if you loaded it from the Tech room - a modified monochrome and base pic layout, a few more button pics, and then the base screen itself. I've had a lot of experience playing with the FS2 interface files, it could be done.
Originally posted by Goober5000
Wow, you've definitely put a lot of thought into this. :p The thing is that it would be a huge amount of work. It would probably be straightforward to code, but you're asking for a lot of code here. Your best option would be to make a standalone program to generate .FS2 files based on your criteria.
I pretty much figured there'd be a lot of code involved, though I still think it'd be a worthwhile aim to put that amount of code to. I realize that everyone has other stuff to do, but putting the idea out there can't hurt right :D
-
Not unless it involves FS3 or geomapping :D :nervous:
-
It sounds cool to me. Also, how about just a straight head to head battle in addition to that? Where we pick the freindly fighters, bombers, and capital ships (and types) and also the enemy fighters, bombers, and capital ships (and types). They then proceed to blow eachother up.
I also do like Black Wolf's idea too.
-
pffft......no need for such code changes.....the gauntlets are good enough atm :P
-
I could hack together a basic mission generator as BW described in a week or 2, 3 at the most, but it would be stand-alone, DOS only, and buggy as all Hades, Hell and some other afterlives combined.
Doing this externally might be the easiest option, but it would require some more stuff. What we could do is make a Launcher/Mission gen combo, that takes the stuff BW described, gens the FS2 file, and launches the game using command lines, starting the generated FS2 file.
I geuss that might be possible, but it'd be slower and messier.
-
I wouldn't mind trying a bit of coding for a mis-gen, actually. Would be a good way to get back in coding - albiet I'd have to write it in Java (at least initially - I've only just started learning C++). Time is still a problem for me, though, so I'm not 100% sure (looking for work and also maybe taking up a short 10-week placement )
Is there a command-line option to start up FS2 on a selected mission? Could very easily merge that into the mis-gen I think*
Main trick would probably be in reading the tbl files to get info, so the program would work with mods, et al. Unless someone wants to help me by ripping out the parsing code from the SC and generating an output format which I could map to a Java / platform independent interface*.
(*I want to do a bit of work in language-independent coding sometime)
I can tell you one thing, though - it could be very useful for model testing.
-
If you do it in C++ I can help in a week or 3, 4. If you don't mind someone who needs C++ for dummies for every command. (I am intending to start with C++ after my exams, so...)
-
Originally posted by kasperl
If you do it in C++ I can help in a week or 3, 4. If you don't mind someone who needs C++ for dummies for every command. (I am intending to start with C++ after my exams, so...)
My intention would be a Java implementation, broken into encapsulated sub-components, and then gradually replacing each sub-component with a more optimised C++ implementation as and if necessarry. I don;t know enough of C++ to implement from scratch at present.
-
Yeah, if anyone wanted to experiment with programming this, we'd welcome the help. We'd only have a few requirements:
1) It must be a standalone program. Combining it with FRED or FS2 would create bloated code. Don't worry about integration; it should be a simple matter to execute the program from a button in FRED or the FS2 tech room.
2) It should be written in C, C++, or Java.
This would be an ideal way for someone to ease their way into the SCP, or even to join as an associate member just to see what we're doing. Take aldo for example... aldo, if you wanted to try coding this, we'd be glad to give you SCP internal access and provide you with any pointers you needed.
Interested?
-
Originally posted by Goober5000
Yeah, if anyone wanted to experiment with programming this, we'd welcome the help. We'd only have a few requirements:
1) It must be a standalone program. Combining it with FRED or FS2 would create bloated code. Don't worry about integration; it should be a simple matter to execute the program from a button in FRED or the FS2 tech room.
2) It should be written in C, C++, or Java.
This would be an ideal way for someone to ease their way into the SCP, or even to join as an associate member just to see what we're doing. Take aldo for example... aldo, if you wanted to try coding this, we'd be glad to give you SCP internal access and provide you with any pointers you needed.
Interested?
If someone can provide me with a 'template' fsm file (i.e. which I can use to establish a basis for output*), I'll give it a shot - albeit I can probably only spare a few hours a day or so at present. I wouldn;t imagine I'd need SCP internal access until the first java program was written - albeit would probably need community input to figure out the depth of the options.
EDIT * - also for developing an abstract class representation. I guess this would be crucial - i.e. how much the user should have to do.
-
as I said when talking about ferrium, I can only dream to have a mission generator connected to a persistent variables system... you know, you could make some interesting things...
-
Right.... did some very early thinking about key issues (this list will definately change if and when i start proper work on this)
Issues;
mission types?
x / y/ z placement (maybe require some form of AI to make sensible judgements RE alignment in particular - maybe also set a
preference for variation)
Background placement (just randomly? - or use region templates?)
How to parse in ship / weapon data and use it? (specifically RE: mod recognition)
Random ship / loadout?
Language independence (for future integration / enhancement?)
!!!Level of user control (key! - need to judge interface too)!!!
Interface itself (what to include, what level of complexity, whether to have some form of very basic 'battleships' style placement?)
SEXPs - what to use and how to control
Briefing generation (templated?)
Factions (how to Id & set hostiles, what about new species entries?)
waypoint setup?
how to time / judge arrival of hostile / friendly wings? And also speed caps?
Basically, there's going to be 'complexity watershed', where you'll need to write what is effectively an AI expert system to create a complex mission. One thing I realised is that, if you want an escort mission, you have a very difficult issue in timing when hostiles will arrive and where. Even stuff like initial orientation is important - and not to mention if you want fighterbay arrivals.
So.... I'd suggest concentrating on simpler missions types. I think any mobile escort missions would require a degree of planning and judgement that is very difficuly to emulate in code - at least in terms of an initial implementation.
What I'd suggest is starting with simple attack / defend missions set around a single static target, such as an Arcadia or destroyer. That should be a relatively simple way to work-out and setup a simple fsm output algorithm.
Another key issue is identifying the ships themselves. This is going to be quite tough, because of the orientation and beam-free issues. i.e. not only will i need to figure out the ship names (for fsm use), but also their types for setting up where they can use. It may be easier to create a simple config file with short entries ala;
$ship: unique-name
$type: fighter/bomber/capship
$player: yes/no
$faction: list? or hostile/friendly?
(or similar)
For the generator. Depends on the user, of course. from a personal point of view, I would like to start with this approach - which would still leave the possibility of adding in a tbl parsing module later on. Same goes for other tbls - OO will make it piss easy to add new parsers later on, there's a fair old number of patterns that allow dynamic / static changing of class types without affecting the rest of the program.
In terms of loadout, i'd say it's best to keep the default and allow the player to alter their loadout - with every weapon unlocked. Again, this'll require a way to get weapon info.
(ASIDE!!)
NB: I did think of a neat gametype idea which may / may not work - have a pool of 'neutral' ships. As the player racks up kills - or as the opponent does, the neutral ships join their side. I'm not sure how easy this would be to implement in a generator, but it could be a neat alternative to straight skirmishes.
-
Originally posted by aldo_14
If someone can provide me with a 'template' fsm file (i.e. which I can use to establish a basis for output*), I'll give it a shot - albeit I can probably only spare a few hours a day or so at present.
A few hours a day would be great... that's about what people on the team contribute (sometimes more, sometimes less) depending on their schedules.
As for a template, why don't you just start up FRED, add a single "when true do-nothing" event and save it as your basic mission?
-
Man, wish I had not be on a bit of a vacation. This was something that we wanted to do with the Imperial Alliance project. If anything was done with this it was going to be even a little simpler. We were semi planning on doing one like the combat chamber in Xwing Alliance. There would only be two sides, yours and hostile. There would not be any of that logic involved what side is friendly/hostile to whatever side. There would be no briefing. I think it would be possible just to skip the briefing and go straight to mission. I think it would be rather simple just to have generic flight groups (attack/bomber/protect cap/destroy cap/etc) saved as templates inside the code or maybe even as a text file. Then you give the user a simple GUI to pick what options they want for the mission. If they want two attacking wings then it just pulls the generic attack module and puts it in the file. Could then let the user choose how many craft are in the wing, whatever weapons, change the craft. Here it would be nice to read in the ships.tbl and fill out a couple of drop down boxes with the usable weapons for the selected craft.
I don't think it would be very hard to do a console/Win32 mission designer. The real trick (and I know it could be done) would be to intergrate it into the FS2 interface. It would be possible to create something using just the standard FS2 controls. The only tricky part I would see is making a list box or something that contains all of the flight group info. Editing all the other attributes could easily be ripped from controls that are already used in the game.
-
First off, 'tis awesome that someone is at least looking at trying this :D It will be a major bonus for the SCP if it gets off the ground. Second, I think I may have solved several of your issues in my first post Aldo, but I'll go through my ideas again, to see if they're viable.
x / y/ z placement (maybe require some form of AI to make sensible judgements RE alignment in particular - maybe also set a
preference for variation)
FS2 already allows you to tell fighters to warp in "near ship", and set the distance from that ship. I use it a lot in TI missions for moving vessels. It's not perfect (as the distance can be controlled, but not direction, and AFAIK orientation is random) but it's not too bad either.
Background placement (just randomly? - or use region templates?)
Lightspeeds existing background templates would be ideal here, if they can be thrown in there. They're already built as .fsm files, so building off these might be a good way to start, or the relevant background sections could be stored in a table somewhere.
How to parse in ship / weapon data and use it? (specifically RE: mod recognition)
OK. I probably should have been a bit more specific here, but I was thinking something like this.
$Faction: NTF
Available FIGHTER: "GTF Loki" "GTF Myrmidon" "GTF Hercules"
Available BOMBER: "GTB Zeus" "GTB Medusa"
Available CRUISER: etc. etc.
The capital text would refer to the existing ship type flags that the ships.tbl alrerady uses. This would give the mission an idea of what it could call when you tell it to warp in a wing of fighters, and make it easy to modify. EG
$Faction: SOC
Avaliable FIGHTER: "GTF Erinyes" "GTF Banshee"
[/color]
!!!Level of user control (key! - need to judge interface too)!!!
This I don't really know - would depend on the complexity of the code, ie. what you make available for the player to control. I've given most of my suggestions for what the user could control in the first post though.
Interface itself (what to include, what level of complexity,
Presumably linked to the above.
whether to have some form of very basic 'battleships' style placement?)
I don't really think this'd be neccesary. If you primarily make this about Capships (either attacking or defending) You could define the Capships as always existing at 0,0,0. The hostiles could warp in using the "near ship" thing, and Alpha wing could be defined as always starting at, say, 2000,1000,3000 or wherever.
SEXPs - what to use and how to control
I doubt you'd want to use too many sexps, unless you could make them fire based on the "central ship" or "Hostile Largeship". If you could do this, then simple message stuff (Destroyed, arrived, hull below 50% etc.) might be all you'd want to use. If not, you might be able to set up a system similar to what FS2 already does (The AWACS messages are a good example)
Briefing generation (templated?)
Templated yeah. If you'll code the flags I'd need, I'll write the generic briefings. :)
Factions (how to Id & set hostiles, what about new species entries?)
If you use the above suggested table setup, factions could simply be tacked on to the end.
In terms of loadout, i'd say it's best to keep the default and allow the player to alter their loadout - with every weapon unlocked. Again, this'll require a way to get weapon info.
Available ships/weapons could be determined by a difficulty setting. EG, on Easy, Kaysers and Maxims are available. On Medium, you lose those. On hard, you lose those, the and Prometheus S and Circe as well.
You seem to have a pretty good grasp of how to solve a lot of them of course, and As I've mentioned, I'm no coder, so I have no idea if what I'm suggesting is even viable, but hopefully I'll be able to be of some help in the whole process.
-
I'm thinking of architectural stuff, mostly.... namely using certain design patterns (specifically prototype) to allow 'templated' mission generation objects, and soforth.
I'm also thinking now that it may be better just to plain read the tables and only check certain flags in them, etc. Best for use simplicity, really.
some other thoughts (I'm just using this thread as a sketchpad);
factions - will almost definately need a config file, probably a simple mapping between species and faction name
briefing - probably use a simple template format, with random strings which have spaces for names, etc. I've used this before for commentary in a game I wrote at uni - provided I can figure out a nice generic set of strings, should be easy.
ship names - either user specified or taken from a 'pool' defined in some config file. May impact on the faction definition .
briefing - specifically, the icons. Could be tough to setup this, I need to check the format in the files and figure out how to id and specify the proper icons to use. Simple to setup positions, though....
debrief - probably very crude setup - shouldn't be a major issue, as there's no story to convey. Again, probably based around generic pass / fail strings.
messaging (escort / attack) - will ignore this probably and leave it down to the automatic messaging
Now, one major thing I'm considering is using a proper template - i.e. a suitably generic fs2 file for a certain mission type, which is parsed in and suitably tweaked by the program ala the prototype design pattern (which is going to be used in some form to support definition of more random mission types). I'm not sure on this yet, need to try and decide whether there'd be a benefit....
one example could be an escort mission - the path to travel and wings would be defined, the generator would alter this by modifying the ship to be escorted, tweaking the arrival, etc, times and also changing what types / factions of ship would arrive. This could become too general, though.... of course, the other side is that a suitable setp fs2 file could be used to get all the that would normally be required from the tbls.
-
This makes my head hurt, but it would be cool to see, none the less. It would bring a huge replay value to Freespace 2 cuz once u play all the campaign missions, and have done all the single missions and gauntlets, you're basically stuck like a pig.
-
Replay value? Don't make me laugh.
Its fun several times, but since there still only a limited number of random factors, it is almost as generic as it can go.
Granted, it probably does good job in balance testing mods but in my opinion it will give you only a short time of fun.
Not to mention this takes a lot of time and patience to make it even workable, and then bug free.
-
Originally posted by Mr. Fury
Replay value? Don't make me laugh.
Its fun several times, but since there still only a limited number of random factors, it is almost as generic as it can go.
Granted, it probably does good job in balance testing mods but in my opinion it will give you only a short time of fun.
Not to mention this takes a lot of time and patience to make it even workable, and then bug free.
It can't hurt to try, can it?
-
Good stuff there, BW. Especially the "Available FIGHTER:" etc. Though I'd suggest using a parenthetical list to stay close to the table format.
-
Originally posted by aldo_14
It can't hurt to try, can it?
Yeah, don't piss in our cherrios, Mr. Fury :sigh:
-
OK, I've spent a bike ride thinking about this, and I think what you want to is the following.
You make a file, a template, containing the basics of a mission. Anything you want randomised, you simply use a certain tag, like $RndShip or $RndInterceptor. The program would acces Ship.ini or Interceptor.ini, and simply take a random entry out of it. If you want something like a ship name, you obviously want it to be the same across the plane, so you define it at the top of the file, like this:
$VarCapname1 = $RndTerCapname
Then, where ever you want the name to be listed, you use $VarCapname1 instead of a name.
If you want a random number, you simply do this:
%VarNumber001 = %Rnd(Min,Max)
Min and Max would be the minimum and maximum numbers.
The FS2 file wouldn't see this, just the implemented name, or number.
You could adapt the files easily, and add anything to randomize. If you support multi lined items, you can do random backgrounds too. And if you want to expand the lists, you only need to make it, and give it a unique name.
The program would output a fs2 file, where the random declarations are gone, and the ship names and stuff are all in place.
This way you make it as modable, and simple as possible. Expansion is always possible, but this would be, in essence, a very simple parsing job.
The input from the mission maker would be more work, but they asked for it. :)
-
Originally posted by Mr. Fury
Replay value? Don't make me laugh.
Its fun several times, but since there still only a limited number of random factors, it is almost as generic as it can go.
Granted, it probably does good job in balance testing mods but in my opinion it will give you only a short time of fun.
Not to mention this takes a lot of time and patience to make it even workable, and then bug free.
I disagree. Take Inferno for example. They've provided the player with a crapload of mods, fighters, capital ships, bombers etc, and several new factions (SOC, EA, Ancients). But you only ever get to play as a Terran, in the GTVA, fighting the EA or the Shivans. This would allow you to test fly the EA ships, play with their weapons. Or see whether the ancients, with Alpha One on their side, could take on a shivan destroyer. It might not add huge replay value to FS2 itself, but it'd be hugely important for big mods. Plus it'd be good fun for just satisfying the occasional urge to kill some Shivans.
Aldo - while I'm not great on the technical side of things, for the names, a list would be better, since it would make it easier to set up individual misisons IMO. Grabbing 50 names off Mythica or out of a history book would be all that'd be needed per faction (and I'd be willing to do it if it was needed). They'd have to be chosen based on Faction, but class wouldn't be much of an issue, as basically, they'd all be warship names.
-
Originally posted by kasperl
OK, I've spent a bike ride thinking about this, and I think what you want to is the following.
You make a file, a template, containing the basics of a mission. Anything you want randomised, you simply use a certain tag, like $RndShip or $RndInterceptor. The program would acces Ship.ini or Interceptor.ini, and simply take a random entry out of it. If you want something like a ship name, you obviously want it to be the same across the plane, so you define it at the top of the file, like this:
$VarCapname1 = $RndTerCapname
Then, where ever you want the name to be listed, you use $VarCapname1 instead of a name.
If you want a random number, you simply do this:
%VarNumber001 = %Rnd(Min,Max)
Min and Max would be the minimum and maximum numbers.
The FS2 file wouldn't see this, just the implemented name, or number.
You could adapt the files easily, and add anything to randomize. If you support multi lined items, you can do random backgrounds too. And if you want to expand the lists, you only need to make it, and give it a unique name.
The program would output a fs2 file, where the random declarations are gone, and the ship names and stuff are all in place.
This way you make it as modable, and simple as possible. Expansion is always possible, but this would be, in essence, a very simple parsing job.
The input from the mission maker would be more work, but they asked for it. :)
I would rather avoid using config files, though. Largely because there would be little difference in terms of parsing those vs the tbl files.
NB: Let's not argue about the value of this, ok? It won;t serve any purpose to do so - if i do start work on this, it will be as much for my own benefit (i.e. practice & for my CV) as for the benefit of others.
-
Well, you could call the lists tables if you wanted, but why bother with parsing a table and hard-coding stuff about mission type if you can make input files and pull some names/classes/locations out of a hat?
-
Hehe, looks like I spirred up the discussion somewhat. Although I do disagree about usefullness of this feature, I will leave it at that.
Howewer, if this is to be added. Please make it a stand-alone executable and not an extension to existing fred2 and fs2 executables.
-
Originally posted by kasperl
Well, you could call the lists tables if you wanted, but why bother with parsing a table and hard-coding stuff about mission type if you can make input files and pull some names/classes/locations out of a hat?
Because dealing with a generic mission file as input is potentially more difficult than using the tbl files. And, also, the aim is to minimise user interaction - i.e. avoid anything which requires the user to specify information, and especially where they have to specify it in a controlled format.
Ideally, all user interaction should be through a simple GUI. I'm thinking of the types you see in flight sim mission generators - usually just specifying a very brief 'type' of mission, then the player (and ally) fighter types and finally the number of enemies.
I'm still considering templates, but it's more likely I'd use template methods to generate missions, rather than relying upon specific-format files.
Originally posted by Mr. Fury
Hehe, looks like I spirred up the discussion somewhat. Although I do disagree about usefullness of this feature, I will leave it at that.
Howewer, if this is to be added. Please make it a stand-alone executable and not an extension to existing fred2 and fs2 executables.
That would be the plan. The most integration would be using a command line +parameter call to start fs2 and run the mission file after completion.
-
I've decided I can't work on this, for personal reasons.
Sorry.
-
Erruh? :wtf:
-
I'll probably snap it up, but I'd probably be doing it slowly, my way, and not in the next 3 to 4 weeks.
If anyone else wants to take this on, I'll help if necesary, or just STFU and get out of the way. Remember, this would be my first ever contact with C++.