.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   WinSPMBT (http://forum.shrapnelgames.com/forumdisplay.php?f=78)
-   -   Bug: Reassigning units (http://forum.shrapnelgames.com/showthread.php?t=48054)

scJazz November 19th, 2011 04:54 PM

Reassigning units
 
When moving units from one HQ to another sometimes the units are renamed in the way that things would be expected. The unit becomes the last unit in the formation. Most of the time however the units are renamed as the ZERO unit. Doesn't seem like this would be that difficult to clean up. Reassigned units should always be named as the last unit in that formation.

Can this be fixed please?

Suhiir November 20th, 2011 12:20 PM

Re: Reassigning units
 
From my own experience reassigning units I believe this is based on the rank of the leader of the reassigned unit.

Example: If the current formation leader is an E-4 and the leader of the unit being reassigned to it is E-5 the new unit with becomes the Zero unit in the formation.

scJazz November 20th, 2011 12:26 PM

Re: Reassigning units
 
Can't imagine that to be the case since the Platoon commander always remains the original ZERO unit.

jaywalker November 20th, 2011 02:25 PM

Re: Reassigning units
 
I think it may be due to the alphabetical order of the formations. For example, if unit B3 is reassigned to formation F then it takes the place of the orignial F0 unit, simply because B (its original parent formation) comes before F in the alphabet. Conversely, if unit F2 is reassigned to formation B, then it becomes the last unit in that formation, again, simply because F comes after B alphabetically.

DRG November 20th, 2011 02:37 PM

I cannot test this ATM but this could very well be the answer.

The game in a number of areas likes to go up or down lists one way or the other and it wouldn't surprise me in the least if it does there as well.

When the picklists look for an AI unit to put in a formation they always start at the bottom of the unit list then work to the top of the list. It's why we sometimes make what should be a more common vehicle rare near the end of the unit OOB list otherwise they get picked first all the time.

Don

scJazz November 20th, 2011 02:59 PM

Re: Reassigning units
 
Quote:

Originally Posted by jaywalker (Post 788925)
I think it may be due to the alphabetical order of the formations. For example, if unit B3 is reassigned to formation F then it takes the place of the orignial F0 unit, simply because B (its original parent formation) comes before F in the alphabet. Conversely, if unit F2 is reassigned to formation B, then it becomes the last unit in that formation, again, simply because F comes after B alphabetically.

OK, tested and this is the case. Still, I'm going to refer to this behavior as an undocumented design feature. Can it please be changed to reassigned unit is always the LAST numbered unit in the formation?

The unit being moved can not ever be moved to command. The engine knows or can at least find out how many units exist in a formation. Naming the moved unit to XXNN+1 doesn't seem overly taxing.

Mobhack November 20th, 2011 06:07 PM

Re: Reassigning units
 
Units don't have a "number" - they are numbered in the sequence they appear in the list of 500 units. Formations are also listed in order of the master list. The list is basically an ordinary C++ array.

Sometimes there may also be a gap in the list - due to removal of a formation, or deletion of units. The insertion of a new unit into a vacant slot way up the list sometimes will do odd things to numbering as well.

It is structural with the way the original SSI code was written.

Also - the formation command unit is not always the 0th unit, in a campaign, if the command unit was killed and another of the formation took over.

Cheers
Andy

scJazz November 20th, 2011 06:33 PM

Re: Reassigning units
 
Quote:

Originally Posted by Mobhack (Post 788954)
Units don't have a "number" - they are numbered in the sequence they appear in the list of 500 units. Formations are also listed in order of the master list. The list is basically an ordinary C++ array.

Sometimes there may also be a gap in the list - due to removal of a formation, or deletion of units. The insertion of a new unit into a vacant slot way up the list sometimes will do odd things to numbering as well.

It is structural with the way the original SSI code was written.

Also - the formation command unit is not always the 0th unit, in a campaign, if the command unit was killed and another of the formation took over.

Cheers
Andy

I understand what your saying. Still, if a unit knows that it has been reassigned to the "D" formation then it is possible to know that before the assignment there were X units in that formation. You would have to walk the Unit Arrays "Name" field to determine what X happens to be. Doesn't seem to be that big a deal. Doable?

And yes I know about the command unit not always being 0th in a campaign:) I have this handy sticky note on my monitor to inform me of each instance where this is now the case in this campaign. Handy thing to have when I do stupid stuff and get my platoon and company commanders killed :)

Mobhack November 20th, 2011 06:56 PM

Re: Reassigning units
 
There is no idea of "numbers of units in my formation" in the formation data - unless you want to loop through all units and count it every time you need to know...

Determining who is the commander etc is a fun process of following pointers from formation data to leader data and unit data etc.

Most of that is from the original "squeeze a quart into a pint pot" design of the original code, which was struggling to fit 50 unit s a side into the memory of an old 286 class PC with 1MB RAM. (Remember that SP 2's PBEM replay needed the full massive 4MB extension that a 386 gave you way back, and playing with all that himem stuff etc. :) - not all computers would have >1MB installed).

Basically, it is undo-able with the code base as it stands. Same as with a few other annoyances.

Andy

scJazz November 20th, 2011 07:45 PM

Re: Reassigning units
 
Quote:

Originally Posted by Mobhack (Post 788961)
There is no idea of "numbers of units in my formation" in the formation data - unless you want to loop through all units and count it every time you need to know...

*SNIP*

Andy

Exactly :) The only time you would need to know is if someone clicked the Reassign HQ button and selected a new Formation. So add the walk through the array right there.

Still... I'm getting the distinct impression you don't want to do that :)


All times are GMT -4. The time now is 02:09 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.