Factories turning the produced units towards the rally point

Factories turning the produced units towards the rally point

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Factories turning the produced units towards the rally point

Post by KDR_11k »

Would be really useful for mods with short production times for units to have units come out turned towards the rally point (use a straight line for that computation to keep it simple and considering the way the pathfinding works it might need using only the 8 cardinal directions, too).

EDIT: Would be useful to have a possiblefacings tag that's an 8-bit mask stating which directions the unit can face so factories with two or more exits can pick the closest one.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

Just having units exit the factory in a predictable manner might be useful to prevent jammed units. I find units often start pathfinding right into nooks within the interior footmaps, then never seem able to exit. The next unit blocks their escape and you damn near have to end production altogether to fix the snarl.
User avatar
BlackLiger
Posts: 1371
Joined: 05 Oct 2004, 21:58

Post by BlackLiger »

Frankly, I've always wondered about OTA's factories. Why didn't they just put the nanolathes on extending arms and have them move around the unit, rather than spinning the unit? (Yes, I know at the time, this would have been overly complex animation)
User avatar
Erom
Posts: 1115
Joined: 25 Apr 2006, 05:08

Post by Erom »

They don't want to cross the streams?
User avatar
BlackLiger
Posts: 1371
Joined: 05 Oct 2004, 21:58

Post by BlackLiger »

Erom wrote:They don't want to cross the streams?
loller
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

It's extremely easy to make units always face the factory exit. Simply remove the "spin pad" command in the factory script.

A bit more complex, but still easy, the script can execute some "turn pad ..."; to change at will which way the produced units must face.

However I don't see any ways for factories to be informed of which direction if the waypoint. Not to mention that on a well populated map, the shortest path isn't a straight line (as the straight line is most often obstructed), and keep changing.
... it might need using only the 8 cardinal directions, too).

EDIT: Would be useful to have a possiblefacings tag that's an 8-bit mask stating which directions the unit can face so factories with two or more exits can pick the closest one.
Pff, don't go overboard with the tag inflation where it's not needed. Would be cleaner to pass the direction as an usual 16bit angle to a new script function, and have that function turn the pad, or turn it to closer exit depending on unit location. Something like:

Code: Select all

SetExitDirection(heading)
{
	turn buildpad to y-axis heading speed <30>;
}
So that a mod with a very weird pentagonal factory is free to do:

Code: Select all

SetExitDirection(heading)
{
	turn buildpad to y-axis (heading/13107)*13107 now;
}
To turn with a 72° increment.

But just to make it clear, yes that is the way I said I don't see, but I don't want such a new function, because waypoint can change while a unit is under construction, and the direction of the waypoint is not the direction one must go to reach it (since there's obstacle to avoid on the way).


So in short, ask the author of your favourite mods to remove every "spin pad" from their script, it should remove most of the "Units bump into factories wall" issues. And now tha
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

Something for the factory to get the health of the unit currently being built would be fine. Then just stop-rotate and turn to axis <0> would be perfect.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

Dragon45 wrote:Something for the factory to get the health of the unit currently being built would be fine. Then just stop-rotate and turn to axis <0> would be perfect.
You mean the new cob get/set constant, 73 UNIT_BUILD_PERCENT_LEFT basically BUILD_PERCENT_LEFT, but comes with a unit parameter, that we have had since 70b1?

Asking for features that are already in isn't a good move!

But it doesn't work, because when there's 1% left, you don't know how long before it's done, not to mention ultra cheap unit might jump from 5% to ready without passing by 4,3,2,1, and when there's 0% left, it's too late the unit has left the pad already.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Not to mention that on a well populated map, the shortest path isn't a straight line (as the straight line is most often obstructed), and keep changing.

That's why you'd queue up multiple move orders, one to determine the exit and the rest to move where you want to. If a complete path finding solution can be done fast enough to not cause lag that'd be fine, too. I'm mostly thinking of completely open factories like Nanoblobz's Autofac and quick production speeds like most Nanoblobz units.
Bishounen
Posts: 14
Joined: 22 Aug 2006, 22:50

Post by Bishounen »

I just try to make sure that I point my factories at the most open area when I lay them down, and then set up a queued series of move orders for that entire factory. This way i know that my units will go where i want. If they get stuck on something, it's not hard to select the factory and set up a new move queue.

The thing that kills me is when one factory will refuse to follow the queue, and I keep getting the "Unable to reach destination" error when it's a clear shot on flat ground. it drives me nuts to keep having to come back and select a big circle of units to move them to the proper area, just to have new units get "stuck" in the same manner.
Post Reply

Return to “Feature Requests”