A semi-RTS approach.. Starting small.

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

A semi-RTS approach.. Starting small.

Post by Lancefighter » Sun, 24. Jan 10, 02:29

So this thread is going to chronicle my efforts to change x3tc into an RTS, piece by piece. It is also going to serve as a place where I can go to get input on various things.. More on that later. I have a basic outline of how I would like to start out in my head, but I will certainly need some insight into a few things i probably have overlooked.

here is my basic overview so far:

The player has an HQ. This is going to be assumed.
the HQ will be modified in such a way that it requires only a few key items to run - Say for instance, mere ore/silicon is a good start. I have briefly considered using 'unused' items I can find as materials.. Opinions?
Naturally, the HQ will require very little in terms of actual time to create stuff. However, It will require time to accumulate the materials instead.

Material accumulation will rely on two things - Systems you own, and Core systems you own. (sector takeover script suggestions? Will I need to write my own?)
Owning a system will probably require a trading station, where materials will accumulate before being transported to your HQ via script-controlled (player owned? Or neutral race?) TS ships. Time and Territory are the only two factors here - each system you own produces so much an hour, and that is your allotment for new ships.
Core systems will operate the same way, just produce more materials in less time, and require an equipment dock or shipyard. (note, probably just EQ dock for now..)

Building ships will be done with the resources that are gathered. I plan on writing a script to fit out ships with options you select, to a point. (for instance a m4 would only be given anti-fighter guns, and a m3 only given bigger guns..) Not really sure if i could police this without editing tships, something id rather not do. Otherwise, a menu system with options for each upgrade/etc will probably work. I havent written a menu before, but I think it shouldnt be new hard with the new TC menu controls.

As for fleet size - I am looking for some way to limit the maximum fleet the player can field. I dont want it in such a way that the player can merely wait for a while to accumulate enough resources to just go and kill everything in one fell swoop. Besides, thatd probably get boring anyway. Is there any way I could prevent this, short of capping the wares at the HQ at a certain level?

Blueprints - where will the player get these from? Ive considered both hostile and non-hostile means ...
For example, should the only way for the player to aquire new shiptypes be to capture an existing ship of that type to build? It would fit in with a pirate lifestyle, but capturing isnt a rather easy idea in some cases; As well, I dont particularly want the /player/ involved in combat that much. The player, as overlord, should be busy overlording.
The second option, purchasing them through missions of some sort? Should they be unlockables (you own 5 systems, now you can build a m7?)
As per race affiliations, would it really be 'fair' to lock the player into a certain race? I suppose through removing the reverse engineering queue on the HQ this would be possible, but giving people a choice is always good. Is it possible to make RE"ing take a lot of time, but construction not so? (i think so, but I havent TC installed at the moment >.> downloading from steam at the moment)

Which brings me to the next point, how much scripting can be done out of game? I rather dislike having x3tc loaded merely to write code, and the way TC does it is rather annoying at times. I recall a external scriptor for x3r, has that been continued? i dont remember :\

The initial release will have almost no AI; I havent a great deal of scripting experience, and I have virtually no AI experience.

As for actually doing the stuff:
The HQ modifying I can do
I think i could write an AL plugin to manage the materials.. I would have to read some tutorials, but I think its doable
the shipbuilding menu and such is my next big hurdle - ive never written a real menu either.. (but there are tutorials for that too I believe)
Blueprints and fleet size I will leave alone for now, as I dont even know where I want to go with those.

Anyway! The first official release will probably involve the following:
The HQ properly modified
A custom start with plots disabled (save the hub.. maybe), most sectors explored, and a TL with a jumpdrive, HQ, and arrow.
and the resource system implemented.

The core system, id say.
ok, now that that is written up, hopefully it should help me get these ideas finalized and into code

User avatar
Lord Dakier
Posts: 3243
Joined: Fri, 8. Dec 06, 13:45
x4

Post by Lord Dakier » Sun, 24. Jan 10, 03:16

Teladianium is used for most constructions out of space and I presume the only reason why you don't fetch it when you buy a station is that it all comes with it and the TL team put it all together.

Silicon is used for anything with an AI which is what our lovely better is made from so we need that for ships

E-Cells power things and how would a generator work without its needy power to power the system. The only other way around this would be to create a new ware called Nuclear Energy Cells which would be used... I actually like Nuclear Energy Cells better lol.

Computer components would be used for system and so on being that they cost so much you don't want too much.

Teladianium = 25% ship cost
Silicon = 50% ship cost
Energy Cells = 15% ship cost
Computer Components = 10% ship cost

The number of wares for a ship you could decide upon simply by class so the cost of resources to build the ship then x4 you would come up with an appropriate selling price to which it would be brought/sold for.

Just a little idea for the using shipyards to sell ships and make further cash.

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Sun, 24. Jan 10, 03:25

well thats kinda something else - Im not sure cash should even be required. Money is the universal exchange and all, but I would rather money not be an object, literally :p

Teladianium is something I didnt think of - Its a finished good that only requires energy cells to make, similar to ore. It would be fairly easy to use existing commands to 'fake' a small economy based on that.

However, keep in mind I am going for simplicity - I dont wish to complicate things by actually mining stuff (until later perhaps). Initial releases will have a fake economy only, with trading stations merely spawning transporters with the proper goods.

poiuytrewq
Posts: 9
Joined: Tue, 12. Jan 10, 03:36

Post by poiuytrewq » Mon, 25. Jan 10, 04:27

This sounds awesome already. Wrote out a long reply but then realized I was just asking you for what I'd said in the other thread. :P It may be some time away but do you plan to keep the vanilla galaxy as is towards the end of this project?

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Mon, 25. Jan 10, 04:42

Actually - I plan to keep the vanilla galaxy most of the time.. Of course, a few modifications..
For instance, in theory each race would only start with a small area, giving the player a much better chance at doing a land grab in the beginning. As it is now, the player would have very few places to call his own..

User avatar
nman
Posts: 230
Joined: Mon, 30. Jun 08, 04:34
x3tc

Post by nman » Mon, 25. Jan 10, 10:02

How do you plan to deal with the player's point of view? Will the player have their own ship that they fly? That doesn't seem rts-ish. Or will the player have a camera that flies by in all 3 dimensions, or will you lock the camera to, say, a set distance above the sector, looking down, and only able to pan in 2 dimensions?

For resources, remember to keep it simple. Command and Conquer uses 1 resource, Supreme Commander uses 2, Age of Empires uses 4 (IIRC). I'd suggest using energy (solar plants), and minerals (ore/silicon, just lump both into the same category. Perhaps edit the galaxy to have zero silicon mines, and only use ore). In an RTS, people prefer the playing, and less of the multi-resource scramble. The more resources you have, the more the game becomes an economy simulator.

I have ideas for starts though:
Yaki Captain: Start out owning the 3 Yaki sectors, practice taking over savage spur, and then take down the paranid sectors. For this one, only have the 7 sectors from Emperor's Mines to Emperor's Ridge be paranid, and reassign the other sectors to other races. This would be an easy campaign intro, sort of like the Quick-start option from Reunion, because you start out with just enough to get you going, in this case, it's 3 sectors.


Argon/Teladi Revolution: You start out in Avarice, so this could be either an Argon or Teladi start. You're a former business CEO who created his own private army, and declared independence from the 6 races. You claimed control of Avarice, stole the ships of anyone going between Montalaar and New Income, and seriously pissed off the Teladi/Argon. This would be sort of a medium difficulty, as you start with the mines in the sector, and a power plant, but one race hates you and the other one dislikes you. You have to quickly take out the 5 argon or teladi sectors near you, then take over the other race's 5 sectors, and then branch out through Pirate, Xenon and Boron sectors.


Kha'ak assault: Simple. You're a kha'ak. You're in the Unknown sector south of Menelaus's Oasis. This would be a hard one as you start with zero assets aside from your HQ and your initial ships, and thus will have to conquer your way into obtaining vital resources.


Terran Conquest: A pretty straight-forward goal: Rule humanity.Start out in US4 under oort cloud, and take over the other 3. Then branch out until you control all 25 terran sectors, and rule the known universe! At least, that's until the long-deactivated gate that's conveniently floating around Asteroid belt activates (seriously Reunion and TC piss me OFF that they never mention WHY they kept a gate around), leading you to have to start out, once again, conquering the universe. This one could start out medium, but then gets harder once the universe expands, and you're forced to invade argon space that has dozens of different directions for enemies to attack from.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Re: A semi-RTS approach.. Starting small.

Post by Gazz » Mon, 25. Jan 10, 10:15

Lancefighter wrote:As for fleet size - I am looking for some way to limit the maximum fleet the player can field. I dont want it in such a way that the player can merely wait for a while to accumulate enough resources to just go and kill everything in one fell swoop. Besides, thatd probably get boring anyway. Is there any way I could prevent this, short of capping the wares at the HQ at a certain level?
If there are still AI shipyards and the player has credits, you simply cannot prevent a shopping spree.
Shipyards are rebuilt if you just destroy them but the "AI ship rebuild" flag may work to prevent that. It works for minable asteroids.

If you do it by PHQ building only, you have a controllable trickle.

Best would probably be to also eliminate a PHQ ship building key resource from the universe. If your scripts are the only source of this ware, you are in complete control of the player's building capabilities.
This resource would act as the unit cap because the player could then choose to build many small or few big ships. Based on rank or whatever "barracks" building you use, you can increase or decrease the ship pool whenever you wish.
Building times should be increased considerably, though.

Using PHQ building you'll have to adjust the prices of all ships, though, because the price distributon certainly won't make much sense in your basecraft universe.
It would also be a bit cryptic because you can't easily have something as nice as 10 fleet points = 1 M3.
Well, maybe you can. =) Food for thought.

Blueprints - where will the player get these from? Ive considered both hostile and non-hostile means ...
For example, should the only way for the player to aquire new shiptypes be to capture an existing ship of that type to build? It would fit in with a pirate lifestyle, but capturing isnt a rather easy idea in some cases; As well, I dont particularly want the /player/ involved in combat that much. The player, as overlord, should be busy overlording.
An AI ship could be "scanned" using a special script of yours - not the instaclick scanning of cargo.
Then this ship type could become a "research option".

Ideally you'd require research points for that. There are a few technical sounding installations (factories), that could be used for that. Once built, the ware they produce is routinely transferred into virtual research points.
Ideally, you should add a research point ware so it doesn't mess with other factories.
You can also turn off a factory's production and completely substitute it with a script. No messiness then and no need for a special ware beyond the resources. Every x min, resources vanish and research points are credited.


Keep in mind that you do give away a lot of "replayability" in allowing the player to build every ship type in the game.
Captured/reverse engineered ship types (if allowed at all!) should have a much higher (like 3x or more) buy/upkeep cost than native ships.
And/or have a very low total cap for non-native ships.

It's easier to balance one race at a time than to attempt to instantly create a game as balanced as Starcraft or the likes.
Other game starts can be added at a later time...

The second option, purchasing them through missions of some sort? Should they be unlockables (you own 5 systems, now you can build a m7?)
As per race affiliations, would it really be 'fair' to lock the player into a certain race? I suppose through removing the reverse engineering queue on the HQ this would be possible, but giving people a choice is always good. Is it possible to make RE"ing take a lot of time, but construction not so? (i think so, but I havent TC installed at the moment >.> downloading from steam at the moment)
There are many ways to design building restrictions.
Systems owned is easy.
Expensive (to maintain) support structures built is another way. Build 1 Military Outpost to generate 30 medium class points. These generate an "allowance" usable for anything up to M6.
A Major Fleet Base may generate 100 large class points to build M1 or many many fighters...

These fleet bases would gobble up x resources every 5 min. or become inactive.
Their support points are no longer usable then.
This means that you have a simple way to add generic maintainance for ships without having to bother with bookkeeping for every stupid fighter.
A resource-eating script is like 10 lines tops and the effects only need to be checked if a ship is ordered to be built. (or when the available/used points are to be displayed)

And you can use ready-made factory supply scripts for supplying stations with these resources. No need to reinvent the wheel. A full blown fleet supply system is far harder. So if you make the (managing-wise) easy stuff the requirement but cheat on the fleet supply, you cut out the annoying parts without a net cheat.

This also forces the player to "build a base" beyond his PHQ. Probably only possible if close to applicable resources?
That allows you to mess with the player by forcing him to build his barracks or "gold mines" in remote spots that need to be defended.
No putting all eggs in one easily defended home system with only one access gate. =)

Adding vulnerabilities is a key item for balancing RTS expansion.
Limiting station building per sector forces the player to expand and hold territory if he wants to build more stuff.


Another thing is - screw ship equipping.
For a RTS approach this is entirely too much micromanaging. Every ship built has it's default gear and that's it.
However, akin to Warcraft or WH40k you could allow to reseach unit upgrades, like a laser for the rear turret of certain ships or ship variants.
The Nova Raider comes with X weapons, the Nova Sentinel with Y weapons...
These should be (TShips) installed hardware so the ships already spawn with them and the lasers/shields cannot be moved to other ships.

If a ship is upgraded to "have a turret", it is in fact switched for another ship that is hardcoded to have a turret and a hardcoded matching laser preinstalled.
No chance for a player to mess around minmaxing single fighters. They are built like Starcraft Wraiths and sent in the enemy's general direction. =)

This would eliminate the lowest level of micromanaging from the game and better suit the tone of a basecraft game.

Missiles should also be more limited. Having 10 or 15 missile types for a "swarm" fighter like a mere M3 is nuts. At least in a basecraft environment.
Fighters should have 1 or maybe 2 missile types tops, allowing far more distinct fighter classes.
This would also massively reduce micromanagement because missiles would automatically be refilled at carriers and stations - no questions asked.
The necessary "maintainance" for that is already paid for by the upkeep of the fleet bases.

Jumpdrives? Simplify.
Only capital ships can jump. (make the jumpdrive ware XL =)
Their jumpable range is capped to x sectors around the nearest fleet base (so the player has to build even more outposts =) but they automatically - if somewhat slowly - regenerate up to x EC, depending on ship type and/or class. (another option for balancing strategically mobile forces vs more ponderous brawlers)

So...
no bothersome ship equipping or hunting for any available lasers,
no missile shopping / producing,
no EC resupply.

The focus would be on commanding the units, not wiping their noses. (or other tinny body parts)


While starting small is a good idea, it doesn't hurt to have a long term plan. Saves lots of rewriting if the new parts won't match with what's already there. =)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Mon, 25. Jan 10, 14:37

Of course, a simpler "supply" system might do for a start.

Points = number.of.sectors * whatever

Then the player gets temporary points (with a max of 30-50% above that) for every enemy ship killed but loses double points for every ship lost.

So by playing warlord and constantly supervising battles, the player could increase his power base. Slack a while and it quickly drops back to the default points created by sectors. Then it gets harder to play aggressively but allows for more time to concentrate on the business angle.

Sure the warlord play is powerful but as soon as you lose a few ships, you find out that you can not reinforce and press the attack. You're notoriously overextended and forced to play aggressively to keep it up.
And then you could be evil and say that missile or other resupply will also be partial and/or slower if the player has ships above his supply level. Must attack! Must attack! Outrunning your supplies is a bad idea. =)
That would actually include a (semi realistic!) strategy element where most "RTS" really only operate on a tactical level.

There are many approaches, depending on how strong you want the base building part to be...


Another thing - maybe you don't want to deal with single fighters. Let the player buy fighter wings of 3-6 ships and "reinforce" them at the click of a button while docked.
Scratch another slice of micromanaging. =)


Awell. Just a few ideas...
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Mon, 25. Jan 10, 16:09

Gazz, that kind of info is exactly what im looking for

A lot of the stuff you said would easily fit into the master plan, but then again, its also a tad bit information overload - I am trying to find a nice easy place to start.. Even though its rather clear to me this wont be nice, nor easy

For shipyards, what about merely removing wares from them?

Also, messing with tships isnt exactly something I had intended this early (it was in the back of my mind somewhere.. but its just a lot of work >.< )

And.. well, the long term plan is a tad more complicated. I had briefly considered maintaining some ability to merge this with other mods, but maybe I should not even bother with that?

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Mon, 25. Jan 10, 19:02

If you use the ships as is you'll be hard pressed to noticably simplify the gameplay to a level of commanding cap ships and wings of fighters.
Every single fighter has far too much individuality. Too much detail.

With regular droppable lasers the players would just min/max their fighters, arm them with superweapons like EBC and a huge load of the best missiles and proceed to own the universe.
And to counter that, the AI will field half equipped ships.

You can't even begin to do any balancing like that. Well, maybe you can but I can't see how.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Mon, 25. Jan 10, 19:20

well the general idea would be to script-equip them when built.. But I suppose you are right; Given the current universe, there is nothing I really could do to stop the player from doing that.

Unfortunately, destroying it all and starting 'clean' would require significantly more effort in the short run I would think?

I suppose, it would be possible to strip down tships so I get what I want; one m5, one m4, one m3 etc per race, and then equip them with what I want equipped.. I cant quite imagine the effort required to totally go through tships and change all that though >.<

The_Hypo
Posts: 1642
Joined: Sun, 7. Mar 04, 02:10
x3tc

Post by The_Hypo » Mon, 25. Jan 10, 20:54

I'm salivating already :P

I've also got a few ideas to throw in the pot if you'll let me.

First, Gazz is right about just having standardized units that spawn with X weapon, but how about either a purchasable upgrade for all units of that type that will allow them to say, mount EBC's or perhaps mount an extra 25MJ shield, or something. Perhaps you could instead have it for individual fighter wings so you could have one fighter wing with PACs and another with HEPTs.

Somewhat related to the previous paragraph you could have one unique "flagship" that you could build at the beginning of the game that would start off as a standard M7, lets just say, and you can buy upgrades for it increasing its shield strength and being able to upgrade its weapon load-out as you see fit eg, upgrade shields from the initial 1GJ -> 2GJ -> 4GJ -> 8GJ -> 12GJ whereas for weapons you could decide what was on each turret eg, left starts out with Flak but could be changed to PPC's/Gauss/whatever. This would be the only ship you could kit out like this and perhaps there could be a way of colouring only this one ship with the PHQ allowing it to feel a bit like your avatar?

My favourite thing about any RTS has always been stealing the enemy's units and a way you could accomplish this would be increasing the bail rate of ships and having a special salvage ship that would claim the specified bailed ship. Another way would be to have specialized capture vessels, to capture fighters you could have a fighter squadron equipped with high shield damage and low hull damage weapons to maximise capture potential. For capital ships you could have ships that's sole purpose is the launching of boarding pods that spawns with 20 marines at say 4 star everything (again with possible upgrades to 5 star or something) but would very slowly regenerate them, or you could pay in resources, to instantly regenerate them at a military base.

Feel free to ignore/pilfer/modify these ideas to suit your whims :)

Bye :)

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Tue, 26. Jan 10, 10:37

Lancefighter wrote:well the general idea would be to script-equip them when built.. But I suppose you are right; Given the current universe, there is nothing I really could do to stop the player from doing that.

You'd have 2 completely different systems.
Captured AI fighters (you cannot prevent that easily...) would come with tradeable weapons that you can eventually condense on a few captured "super fighters".
Of course you could add all kinds of maintainance scripts that check all ships and events to keep "normal" ships and weapons out of the player's hands but that's a lot of work and CPU load just to... save some work. =)

Unfortunately, destroying it all and starting 'clean' would require significantly more effort in the short run I would think?

This mod requires starting a new game anyway so no need to waste a thought on savegame compatibility.

But if you mean TShips - yeah.
A lot of the simplification is centered on turning highly modifyable ships into basecraft-style "units".
That the player will have ideally equipped ships is an advantage you need to negate if you want to balance this thing.

Oh, and min/max cargo/engine/rudder tunings would be identical for all ships. That way AI ships would finally have full tunings, too...

I suppose, it would be possible to strip down tships so I get what I want; one m5, one m4, one m3 etc per race, and then equip them with what I want equipped.. I cant quite imagine the effort required to totally go through tships and change all that though >.<
You can script everything, forcing ships to regularly restore "their" weapon set or somesuch.
But then you'd have to configure the script to know what each ship is supposed to have and of course, make it work. That won't be any less work than configuring the ships directly... without any script overhead.

It might also screw with missions if you radically alter the indices in TShips and you'd be rewriting Jobs.txt or end up with an empty universe.


Sure you can come up with a completely different plan but this particular concept of simplification lives and dies with TShips.
And it's only one idea. In the end you'll have to decide what you want to do.


Another thought on captured ships:
Non-native ships can not be repaired or resupplied with ammo/missiles. (spare parts don't match =)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Wed, 27. Jan 10, 06:05

No, i suppose I cant enforce captured ships..

But then again - If the player isnt the one shooting the ship, will it ever bail? I really dont want the player inhabiting combat ships often..
Although, to enforce this I could merely make the strafe speed 0 :twisted:

You are certainly right about ship fittings and such - it would be best if it was released with a tships modification. However, yeah, this would virtually require a stripping and remaking of both the universe, and the jobs file.. And honestly, im not sure how to do either of that :(

cargo, rudder, and engine, I assume i would just set to 0 for all ships and do the work on properly getting the right numbers (i assume a simple excel macro would work that part out for me though..)

Missions.. well, I might just have to eliminate all missions. Of course, I would also want to give the player something worth fighting over.. but then again, once the player takes it, I havent a clue how I would properly program an AI to try and take it back!

As per captured ships.. Is it possible to make each type of ship use their own parts? Khaak ships do this with nividium.. Hell, it might actually be possible to use 'Argon Parts' as an item, and then ' Split Parts', teladi, etc. Of course, 'fleet points' would also be able to make a showing as general 'all races' type things..

In theory, raiding hostile transports would net you the wrong type of parts, (or perhaps just 'spare parts' required as well? dunno..) to gain more fleet points...

As for missiles - what happens when you set missiles as a tships equipment? do they get resupplied at docking? or just have an infinite supply... ?

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Wed, 27. Jan 10, 07:35

There is a resupply script run on the docking signal.
AI ships generally have random (and pretty high) resupply settings but since stations / carriers hardly ever have missiles at all - much less matching ones - it's also pretty pointless.

For a RTS useable missile system, cap ships (which hardly ever dock) should regen missiles slowly and fighters everytime they dock anywhere - regardless of the stock level.
One way would be to tie that into one of the cap ship's basic fight scripts because that is run regularly - and it doesn't matter if missiles regen or not if the ship doesn't fight. =)

Imagine Starcraft if you had to manually reload the missiles of every single Wraith when it lands...

Missiles don't need to be ship hardware. Don't think that is intended for consumeables.
Just 1 missile type per ship (maybe 2 for cap ships) to keep the micromanagement down.

You are certainly right about ship fittings and such - it would be best if it was released with a tships modification. However, yeah, this would virtually require a stripping and remaking of both the universe, and the jobs file.. And honestly, im not sure how to do either of that Sad
Well, unless you keep all ships in TShips. =)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Wed, 27. Jan 10, 07:45

so the resupply settings are a function of.. tships? I thought that was part of jobs?

as per the basic fight scripts - i havent looked into them much, but I assume there is a fight.look.for.random.bad.guys.to.kill script? If so, putting a check for any owned fighter's missile types and adding a few should be easy enough..
Of course, if a capship is homebased to another capship.. I should put in a check for that, naturally.

Would you recommend I use the resupply settings on individual fighters? Would I not need to script force them to /have/ a resupply setting first?

And keeping all ships in tships would just be.. Complicated. I dont intend to use most of them, and thus I dont want most of them used. For instance, I have absolutely no plans for /any/ of the variants, besides the ts variants. If i leave them there, then they will be for jobs to take care of, as I certainly am not going to go through every single ship to give it weapons...

Also, how does tships equipment work with regards to ships with turrets?

User avatar
Serial Kicked
Posts: 3823
Joined: Fri, 12. Aug 05, 20:46
x3tc

Post by Serial Kicked » Wed, 27. Jan 10, 09:46

(yes, i lurk here too, in case of useful ideas for my own project :mrgreen:)
Lancefighter wrote:so the resupply settings are a function of.. tships? I thought that was part of jobs?
No, no. it's in the script files like Gazz stated, the one called when a ship dock at a station. IIRC, military base dependent ships also include a resupply subroutine (basically go dock at homebase every X battles) in their patrol script. Tship is only used to define ship stats and models.
Lancefighter wrote:as per the basic fight scripts - i havent looked into them much, but I assume there is a fight.look.for.random.bad.guys.to.kill script? If so, putting a check for any owned fighter's missile types and adding a few should be easy enough..
Even if it's mainly a matter of taste. I think that writing a task that automatically resupply missiles & e.cells periodically on the ship it's run would be kinda easier than altering official scripts (anyway a secondary task is probably necessary on ships handled by the RTS)
Also, how does tships equipment work with regards to ships with turrets?
Tship isn't used to "equip" the ships. Jobfiles do, well, more or less (you can allow/forbid some weapons, and set rudders/engine/shields). But i wouldn't recommend using jobfiles at all in a RTS oriented mod, at least for the part that is effectively used by the RTS ("decorative" free traders, tp liners and such can still stay there).
But then again - If the player isnt the one shooting the ship, will it ever bail?
Yes it's possible to do so, and somewhat easy to implement, give a look at the NPC Bailing Addon script from ThisIsHarsh for a sample code. Btw there's also a NPC boarding script somewhere that could give you some leads.
Would you recommend I use the resupply settings on individual fighters? Would I not need to script force them to /have/ a resupply setting first?
imho you shouldn't even worry about resupply until the whole thing is already working. But, anyway. Depend of the homebase. Fighters carried by M7/M1/.. can have the resupply setting enabled so they can get missiles & e.cells easily from the carrier (which slowly generate those supplies), others should be self sufficient.
X3:TC/AP Pirate Guild 3 - Yaki Armada 2 - Anarkis Defense System

Anarkis Gaming HQ
Independent Game Development
X3 Scripting and Modding Station

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Wed, 27. Jan 10, 13:37

There is a SIGNAL_DOCKED, to which you can attach your own resupply script.
Keeps the number of active scripts down.
Generally, if you're not in a hurry then Signals are a good way to get ahold of ships without having to actively search for them.

Cap ships that land rarely or not at all can't rely on that so you'd only need special handling for those.
I'd suggest Signal_Attacked and/or _changesector.
Or just use it as a hook to attach a permanent resupply script to that cap ship.
Or append the ship to a global array that is served by a central resupply script. Keeps the number of active scripts down and if that is an ALP, you never need to worry about version updates or chasing down lost scripts. ALP are cool like that.


Sure you can write your own streamlined version of TShips but you should still include the mines/LT/drones/sats. These indexes are hardcoded.


Actually, if you kill Jobs and the MD missions there should no longer be another source of "old" ships. All that show up in the galaxy will be the ones you allow.

Personally I'd go with the full TShips (Size matters not, young padawan!) and get the benefit of a functional Jobs.txt. It's not smart or strategic but you get some traders, roaming military and police patrols, pirates buzzing about...
Merely a way to create a basic population. For any kind of strategic AI you'd have to spawn more ships anyway in order for the AI races to have any chance whatsoever against an attacking player. Jobs alone is insufficient for defending a sector or installation.
Well, or roll your own from the ground up...
New TShips, new Jobs. Missions would be a nice way to keep the player busy but without a standard TShips you'd end up rewriting many or all of the ship refenrences inside.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Wed, 27. Jan 10, 18:43

@ Serial Kicked - I rather expected you would, actually :)
It seems I should probably just use an ALP for resupplying ships..

Of course, then capital ships would need their own fitting of some sort? If i were to create a turret script that decides what lasers to use and then assigns turrets to jobs, that should work... maybe? Im fairly sure theres a better way somewhere.

im not particularly worried about the size of tships :wink: but yeah, jobs will be required until I can write up my own artificial life.
However, I was under the impression that jobs had really basic requirements? like 'an m3, spawning with [wing group as defined somewhere else], with [task]'... does it actually reference specific ships (other than perhaps the argon one and such) ?

User avatar
Serial Kicked
Posts: 3823
Joined: Fri, 12. Aug 05, 20:46
x3tc

Post by Serial Kicked » Thu, 28. Jan 10, 06:10

Yeah you expected it, but still I dunno if it's wise to give more advices to a potential adversary :mrgreen:. Btw, for those who are completly lost in this conversation, check this topic to understand what the hell we are talking about. More seriously, I've not read the whole topic (for the very good reason that my own project is doing fine and has nearly nothing to do with this one). But i still can give you a few free tips.


First, the most obvious ones:

1/ Understand that's a very heavy project. So you'll need a lot of paper and a pen first. Said like this, it seems stupid, but it's not. You really need to put your whole logic in a nice looking chart otherwise you'll get lost at a point or another. Seasoned programmers may skip this part, but as i assume you're not one, believe me, get a pen and make a chart ;)

2/ Keep It Simple and Stupid (can't stress that part enough)! Forget about supplies, forget about missiles, forget about carriers. All of this can appear much later. Forget about captures, and so on. Already try to spawn a *new* race that will basically work. Everything else is a f...(swear word forbidden here ^^) detail. Test the thing on a very, very small map with only 2 factions and a few ship types.

3/ Read game AI related websites (google "game AI"). There's a bunch of (free) PDF online that will give you some leads on RTS related AI. Even if most of these docs are probably too technical for you, you'll still get a bunch of advices that you could use.

4/ Buy coffee and/or energy drinks. A hell lot.

Then, the less obvious ones:

1/ Don't think you can use 3rd party scripts. Yes, you can use libraries, but don't think that a few modifications on IR (can't recall if it's you who have suggested that) will give you a RTS. Anyone who've read the code knows that all "fight AI" scripts (including mine, to a lesser extend 'cause PG has been designed to be compatible with Factions:AI) simply can't be altered to fulfill your needs.

2/ In your case (but not mine ^^), you need a clean world. No jobfiles, no already spawned factories, no nothing. From a single spawned HQ (according to your project's needs) you should get an expanding empire.

3/ You REALLY (in red, bold, size 200) need to know how your AI will handle offensive and defensive fleets. Writing an AI that will basically mine roids and collect money is "easy" (ahem). Writing one that will dynamically attack/defend sectors is another story.

4/ I should also warn you about something, because i've encountered this issue while writing the basics of the F:AI code. Writing the AI for ONE race is "somewhat" (notice the quotes) easy, LV already did it, i did it too, and basically all one-faction-scripters did it too. But writing something that will handle all factions is a real pain (and, NO, IR doesn't apply).

Can't say much more right now, but if you've got any specific question i'll be glad to give advices.
X3:TC/AP Pirate Guild 3 - Yaki Armada 2 - Anarkis Defense System

Anarkis Gaming HQ
Independent Game Development
X3 Scripting and Modding Station

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”