Author Topic: Adding a custom "ark" the way to go to add a custom faction?  (Read 4778 times)

Offline swizzlewizzle

  • Newbie Mark III
  • *
  • Posts: 43
Adding a custom "ark" the way to go to add a custom faction?
« on: January 23, 2018, 08:57:11 am »
Just wanted to get the thoughts of you folks on the best entry point for setting up a custom faction.

I would like to have a custom faction brought into the game with it's own set of ships, including different ship cap rules, as well as some modifiers for resources and things like that.

Wanted to check - is creating a custom ark that can be selected from the map select menu the way to go about this? I'm assuming the type of initial Ark a player selects is then set as a flag of sorts in the game that could be used later on to build a whole bunch of additional logic onto the main game loop? (mainly on the slow game ticks.. no need to tie up the sim with needless computation)

Haven't really seen any discussions regarding something like this so thought I might as well start.

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: Adding a custom "ark" the way to go to add a custom faction?
« Reply #1 on: January 23, 2018, 09:08:31 am »
Setting the Ark just changes the visuals of the Ark. Look at what was done for the Dyson Sphere/Nanocaust/Devourer and imitate those.

Offline swizzlewizzle

  • Newbie Mark III
  • *
  • Posts: 43
Re: Adding a custom "ark" the way to go to add a custom faction?
« Reply #2 on: January 23, 2018, 09:14:35 am »
As far as I understand those were not designed to be selectable from the map setup as a player faction though? What is required is a way to have a entirely different set of constructable ships and research options as well as a game loop that applies custom logic to a player who has selected the faction.

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: Adding a custom "ark" the way to go to add a custom faction?
« Reply #3 on: January 23, 2018, 09:23:37 am »
Ah. Then yeah, you'll want to define a new ark that builds from a series of new build menus, which you've defined elsewhere. I'm not sure about the Tech side of things, but I expect that will be doable as well.

To do the custom logic in game you'll need to write it in C#. There's a per faction per sim step function and a per faction per second function which you can use when you are defining the new faction.

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: Adding a custom "ark" the way to go to add a custom faction?
« Reply #4 on: January 23, 2018, 09:31:44 am »
You may well also need to have a Faction as well as a specific Ark and say "You've got to enable these both together"

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Adding a custom "ark" the way to go to add a custom faction?
« Reply #5 on: January 23, 2018, 10:16:46 am »
It's possible to define an a different faction that's player-type and can be selected there, but if all you want is the same rules but a different set of units I suggest just having an alternate ark with alternate build menus.

You'd need to suppress the code that grants the free starship constructor, however, because otherwise it could still build the normal starships for you.

And actually I think you'd run into difficulties with all the planetary controllers also having the default build menus (space dock, starship constructor, turrets, etc), so having an exclusive unit set would be tricky (involves defining an alternate Controller and making sure it gets used).

So you might actually wind up needing to define an alternate Scenario and wire up the start-game button to use that instead of the normal one.

But I'm guessing that you can accomplish your immediate goals just with an alternate ark.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline swizzlewizzle

  • Newbie Mark III
  • *
  • Posts: 43
Re: Adding a custom "ark" the way to go to add a custom faction?
« Reply #6 on: January 23, 2018, 10:48:44 pm »
All sounds easily doable. Thanks Keith :)