What is the best way to prevent invalid Race/Era pairs in STC?

Hi all,

I have been trying to find a way to query the selected races in the game setup screen so that I can enable or disable the “Start Game” button depending on the Era and Races selected by the player.

The reason for this is that in Star Trek there are many races which would be good to add in which aren’t shown in anything but one TV series, like the Borg only being in the TNG era. This has effectively precluded them from the mod so far as playable races and we are wanting to change that.

So far I have identified that the “DropDownListBox” named “ddLstChooseRace” in */ui/newui/shared/gamesetup_controls.lua is the actual dropdown for the race selection. But there’s nothing in there which seems to point to anything. This is likely just a target for something else to fill with the race data.

From the first image, I need to be able to get a list of the races selected (1), the era selected (2) and if there is an “invalid combination” like Cardassian + TOS anywhere in there the “Start Game” button (3) must be deactivated/greyed out (or have something covering it with “Invalid race/era selection” on it).

Any ideas? :confused:

If what you want were possible (sorry, I personally have no idea), wouldn’t it also be possible (and better) to have it so that selecting a race filtered the contents of the era list to only show valid options, and vice versa?

That’s another reason I posted here, there might be better ways of approaching the issue :stuck_out_tongue:

Having the race and era fields updated each time a race is selected or an era changed is not bad actually, if there’s a TOS only race selected then have the era change to TOS… If there’s a TNG only race selected in the next slot the first slot will change to “Federation” and the era will change to TNG… The options only stay put if there’s all “valid” options… I like that idea, no idea still if you can query the listed races though :confused:

//EDIT
Alternatively I could allow invalid selections to insta-fail a match (as there would be no starting fleet) and have a modal pop up when you go into the skirmish screen which shows a grid of valid/invalid race and era options.

I’m with what raw_bean said - Wouldn’t it be easier to hijack whatever system HWR uses to restrict Homeworld 1/2 races depending on the multiplayer mode? Just swap Homeworld 1, 2, and R modes for the different eras, and restrict accordingly.

Also, I think it would be neat to blow up some Connie’s with a Galor class ship. Or try to fight off some Borg with an NX-01. :smiley: Maybe include an “All Eras” option just for the giggles (yes I realize what that would do to balance… :cry: ).

I haven’t seen a skirmish setup where there was just Kushan and Taiidan or just Hiigaran and Vaygr… the new HWRM multiplayer setup is with all four races available. Where did you see that? It could be a clue :smile:

An end-to-end game mode (TOS to TNG) is on our product map, @herbyguitar has been championing this for a little while now actually. Balancing is actually not an issue, we have weapon and ship values which scale with the eras, so you can expect a TNG ship in the same role as a TOS ship to have a comfortable advantage. We’re wanting to convert what we have first and get something onto Steam before branching out though. So you could see that @sastrei, it will be possible :stuck_out_tongue:

Yay for all eras!

And my bad, I always presumed that was what the game mode setting was for. I see it does not restrict races like I thought it did.

@Mikail might know, he’s got a lots of experience with map/game mode scripting I think.

Edit: Here’s my crude idea from someone who doesn’t know a lot when it comes to scripting - how about inserting an “era select” screen between the main menu and the playersetup.lua screen? You could then, based on the era selected, go to playersetuptos.lua, playersetuptng.lua, etc. Each playersetup file would only have the appropriate races available to select.

While that isn’t a bad idea (and would allow for interesting skinning options for that and for other game modes later) it still leaves manipulation of that Race dropdown unanswered :confused:

Isn’t the option to play HW2 races only or HW1 races only or both, under “Game Type” drop down?

I didn’t think so… This requires fresh investigation

//EDIT
This is sadly not the case :’(

//MORE EDITS
There is however a line in the deathmatch file which points to the race.lua file… perhaps I could have a default race.lua for everything and then a race_ENT.lua, race_TOS.lua, race_TMP.lua and race_TNG.lua? This wouldn’t be hard to test…

//EVEN MORE EDITS
It doesn’t work, having the extra race.lua files and having the different game mode LUAs pointing to different ones did nothing… but… it’s such an elegant solution, just copy your race.lua, call it something else, set the races in it to playable or not playable as you would and have your game mode specific BuildAndResearch directory there, separate from the main one… then the races, and what they can build, are changed around as easily as changing the game mode…

@BitVenom, can this be a thing? Can the race.lua (or an override) be specified in the deathmatch.lua or equivalent please? :smiley:

1 Like

I’ll second that request :smile:

I used to think the same. Or I presumed that’s what it obviously has to be for.
…Intersting that it isn’t, it seems that I’m not the only one who’s intuition results in the same exact conclusion. So solid conclusion that you don’t even think about stopping and check whether it’s true or not, it just seems that obvious.

1 Like

What we are trying to avoid is for example ENT era vs TNG era Borg in skirmish, or MP. Yes there is an option for HW1, or HW2 races only, but there is also the option to play all of the factions. For vanilla that is great, but for our mods it might spell doom, because while some may use the options to keep eras separate. There will be others that will burn up the forums, or emails saying how come my NX Class cant take down a borg cube with one torpedo???!!! whaaaa!! whaa!! U ruined my life!! I’m gonna blow up your house, and kill your whole family!! (YES, I have received emails in that context! but i just blew them off.)

We want to make it to where even if you selected “all” only factions that are a match for each other are playable.

BitVenom we sure can use your help here.

So what on earth does it do?

Gives you options that were present there in respective original games, without additions that were put in by Remastered (crates, bounties…). For instance HW1 had Carriers Only mode, HW2 didn’t. So really what you saw when you bought the game back then in 1999 or 2003.

So, to make “carriers only” work now, it should point to a specific Set of startfleet.lua, correct? Could you tie the era menu to startfleets, and just not have certain sets? (Eg: Enterprise era races would have XIN_startfleet00, ENT_starfleet00, etc; TOS= KIRK_startfleet01, KHAN_startfleet01…; TNG= CAR_startfleet02, BRG_startfleet02…)
Era spanning races might be a problem (Bird of Prey, I’m looking at you), maybe there is a way to have KLN_…01 and _…02 with different build and research restrictions

We currently have the era options tied to starting fleets, that’s how we got it to work way back when :smile:
You can pick one of four eras and then off you go with a Flagship, an Outpost or a Full Fleet. The issue is not with the era selection or the starting fleets, it’s with the races. Since many people have asked for Cardassians, Borg, Dominion, etc and they only appear in one era we could never make these playable races as there are no TOS, ENT or TMP Cardassians, Borg or Dominion.

What we need is a way to filter the races available for each era, the only option we have at the moment is to not have starting fleets for invalid race and era combinations so if you choose a TNG only race and the TOS era you will instantly fail the match because you’ll have no ships in your starting fleet. This isn’t the best solution and trying to find an alternative that just prevents invalid race and era pairs is the purpose of this thread :smile:

The most elegant solution I’ve come up with is described above, where you can have an alternate race.lua file with the undesired races just set to “NotPlayable” so you end up changing game modes to play different eras (instead of having the dropdown in the options to pick starting fleets). This doesn’t work at the moment, but if it could (or a variant of it could) that would be fantastic! That’s why I name-dropped @BitVenom there :grimacing:

One radical solution might be to make every valid race-era combination a separate race, now that the caps on race count are lifted. It’d mean people can mix and match as they please, which could be a negative, but mono-era fights are a thing that lobby hosts could demand of their players and it’d remove the danger of invalid selections.

I can’t talk about what we’re doing… in detail. But I can say that the systems behind the game setup and data loading are getting huge edits. I don’t think ‘team layout’ logic will be in the next patch, but it is something we’re talking about - including allowing LUA to help with team assignments and ‘ready to start’ evaluation. Again, no details.

I’ll give you a few quick bullet points though - feel free to talk about what you might do with some of these - it may influence the next series of edits…

  • User selectable starting fleets (not just race)
  • Game rules with LUA readable properties, filters for Races, levels, etc.
  • Ships with easier variance on load (can read properties from rules, goodbye rubrics)
  • Wide open Race modularity, in-game LUA access to expandable race properties.
  • Rules definable by both user (skirmish/MP) and Campaign (not just SinglePlayerOptions.lua)

I’m being a bit obtuse because I have to be (not yet released) - but also because a lack of clarity/details may lead some of you to new ideas we can use, or even odd misunderstands that help improve the final product, etc…

3 Likes

Reading things like this once in a while is a modding motivational kick. It says “hey, the game is very much alive, you have no idea”.

Homeworld will never die. In another 20 years we’ll get another remastering in 50k or whatever ridiculous graphics level they can come up with.
Long live Hiigara!

2 Likes