Jump to content

New Training System (Proposed for A28)


guerringuerrin
 Share

Recommended Posts

When we try to produce units from multiple barracks at the same time but don't have enough resources to assign the desired number of units to each barracks, it often happens that units are added to the production queue of already occupied barracks, while free barracks remain idle. This results in long production queues accumulating in fewer barracks than we actually have available, and it also locks up resources that remain reserved for those units.

This week, I have been working on a mod to fix this bug in 0 A.D.'s training system. Additionally, I added an option to define the maximum number of units in the production queue. This works the same way as for free barracks: if some of our barracks have reached the maximum queue limit, new units will only be assigned to the free barracks. I'm sharing two videos showing the behavior.

When producing in batches, the mod takes into account the number of occupied "slots" in the queue. That is, it does not consider the number of units produced but rather the number of assigned batches in the queue.

Also, I added an alternative production system based on the standard system from AoE2, where units are assigned, as we issue the command (via hotkey or click), to the free barracks or the one with the fewest queued units.

For now, this system only applies to individual units (not batches). This means we can combine both systems—producing one unit per barracks each time we issue a command or distributing multiple batches among the selected barracks when using batch production.

The spirit of this mod is to offer an alternative approach to what I consider to be design flaws in 0 A.D.'s vanilla training system. Distributing it as a mod gives us the opportunity to conduct the necessary tests and receive feedback with a view toward its implementation in the next release.

I want to give a special thanks to @Atrik for pointing me to the necessary game files to modify and for sharing a preliminary code to implement this mechanism.

 

To install: unzip the content of the folder into your mod's folder. (I plan to make the .pyromod file and add it to mod.io in the future)
CustomTrainer.zip

 

Edited by guerringuerrin
  • Like 4
  • Thanks 2
Link to comment
Share on other sites

  • guerringuerrin changed the title to New Training System (Proposed for A28)
14 hours ago, guerringuerrin said:

When we try to produce units from multiple barracks at the same time but don't have enough resources to assign the desired number of units to each barracks, it often happens that units are added to the production queue of already occupied barracks, while free barracks remain idle. This results in long production queues accumulating in fewer barracks than we actually have available, and it also locks up resources that remain reserved for those units.

I agree it is not smart, I also face that issue.

14 hours ago, guerringuerrin said:

Also, I added an alternative production system based on the standard system from AoE2, where units are assigned, as we issue the command (via hotkey or click), to the free barracks or the one with the fewest queued units.

Not exactly correct as far as I remember. AoE2 assigns the barrack based on the training/research time of queued items. So if barracks A has 1 item and barracks B has 3, next unit could still be assigned to B if A is researching a long technology.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

9 minutes ago, Feldfeld said:

I agree it is not smart, I also face that issue.

Not exactly correct as far as I remember. AoE2 assigns the barrack based on the training/research time of queued items. So if barracks A has 1 item and barracks B has 3, next unit could still be assigned to B if A is researching a long technology.

Thanks, FeldFeld, thats interesting. I thought it was only about amount of items in the queue. I might modify that feature to fully mimic that behavior besides it's not the main purpose of this mod, tho. But some players might find better to play that way.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...