Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phantom Changes(ReducedTasks) #96

Draft
wants to merge 8 commits into
base: mainline
Choose a base branch
from

Conversation

VirusTLNR
Copy link

a fix to add a setting for reducing the phantoms tasks.. 100% = normal tasks, 50% = half tasks, 5% increments inbetween, currently only random tasks are removed, but i have tried to put in a framework calculation for take a balanced amount of tasks from short, long and common tasks, so if someone knows how to remove a specific task type, then changing it to that will be the final piece to the puzzle.

Also fixed the Polus Admin Phantom Vent Spawn bug by shifting the location up on the Y axis by 1 point.

I have limited this change to only this vent, but using the same change i have made for this, it can be applied to other vents, just needs further if-statements.

a fix to add a setting for reducing the phantoms tasks.. 100% = normal tasks, 50% = half tasks, 5% increments inbetween, currently only random tasks are removed.
@Anusien
Copy link
Owner

Anusien commented Dec 6, 2021

Can you pull out the Phantom vent spawn stuff and make this just the reduced tasks?

@VirusTLNR
Copy link
Author

Can you pull out the Phantom vent spawn stuff and make this just the reduced tasks?

sure, ill try to do it right now, was just using my limited time on the game summary so wasnt looking at this.

vent changes were fixed in another commit so are no longer needed.
@VirusTLNR VirusTLNR changed the title Phantom Fixes(PolusAdminVentSpawn+ReducedTasks) Phantom Changes(ReducedTasks) Dec 13, 2021
@VirusTLNR
Copy link
Author

felt i should make it clear with a comment, i removed the vent parts and all the unnessecery lines, just the task setting and calculations/etc left so this should work now.

not working yet, but in comments is the new method, just need to commit to work on something else.
@VirusTLNR
Copy link
Author

re:- the WIP commit i just made, the problem im having is that removing the task then doesnt allow removing of another task, will work on this shortly so we can remove the right tasks.

@VirusTLNR
Copy link
Author

i think i have this working... here is the log output from my last test... sorry that this is really long, but a lot of output for my testing :)

5 short tasks, 2 long, 2 common = 9 tasks
phantom had 1 short and 2 long tasks removed, so it had 6 tasks, due to weighting it is 1 task extra removed, but commons count as extra due to being high risk of being caught.. the weighting can be changed if this is disagreed with as long tasks take longer time, so they should technically be the higher weighted task.

this is the % of tasks for the phantom.. 75%.. so in an unweighted world... this would be 75% of 9.. which would be 7 tasks remain.
[Message:Town Of Us] taskpercentagechange=75

i have valued common tasks as 6, long tasks as 3, and short tasks as 1... leading to 6+6+3+3+1+1+1+1+1 = 23 total task weight
[Message:Town Of Us] weightedtaskvalue=23

23 * 75% = 17.25.. so this is actually calculating wrong.. i will fix this
[Message:Town Of Us] newweightedtaskvalue=17

the above is ceiling'ed.. so this should actually be 18, but we will use 17 for the purpose of checking the rest of this output
[Message:Town Of Us] newWTV=17

now looping through the weighting calculation... w = current weight used, CTB/STB/LTB = if false, this task type is allowed on this pass... it always attempts common, then long, then short... and so basically, the order is common/long, then short, then common/long then short, until it reaches the new weight value.
[Message:Town Of Us] w=0
[Message:Town Of Us] CTB=True
[Message:Town Of Us] LTB=True
[Message:Town Of Us] STB=False
[Message:Town Of Us] NewST=1
[Message:Town Of Us] w=1
[Message:Town Of Us] CTB=False
[Message:Town Of Us] LTB=False
[Message:Town Of Us] STB=True
[Message:Town Of Us] NewCT=1
[Message:Town Of Us] w=7
[Message:Town Of Us] CTB=True
[Message:Town Of Us] LTB=True
[Message:Town Of Us] STB=False
[Message:Town Of Us] NewST=2
[Message:Town Of Us] w=8
[Message:Town Of Us] CTB=False
[Message:Town Of Us] LTB=False
[Message:Town Of Us] STB=True
[Message:Town Of Us] NewCT=2
[Message:Town Of Us] w=14
[Message:Town Of Us] CTB=True
[Message:Town Of Us] LTB=True
[Message:Town Of Us] STB=False
[Message:Town Of Us] NewST=3
[Message:Town Of Us] w=15
[Message:Town Of Us] CTB=False
[Message:Town Of Us] LTB=False
[Message:Town Of Us] STB=True
[Message:Town Of Us] None Added
[Message:Town Of Us] w=16
[Message:Town Of Us] CTB=False
[Message:Town Of Us] LTB=False
[Message:Town Of Us] STB=False
[Message:Town Of Us] NewST=4
[Message:Town Of Us] w=17
[Message:Town Of Us] CTB=False
[Message:Town Of Us] LTB=False
[Message:Town Of Us] STB=True
[Message:Town Of Us] None Added

this shows the old task counts, vs the new task counts, as you can see, 1 shorts and 2 long's are removed.
[Message:Town Of Us] OLD Tasks Count (ST/LT/CT)=5/2/2
[Message:Town Of Us] NEW Tasks Count (ST/LT/CT)=4/0/2

this step now loops through the total difference in tasks the phantom has.. it checks each task type based off how many of each task type should be removed, and removes one task if it finds a matching task of that type, then loops again, this will probably lead to the same tasks being removed sometimes, so maybe a shuffle is required on the tasks.
[Message:Town Of Us] i=1
[Message:Town Of Us] STdiff=1
[Message:Town Of Us] LTdiff=2
[Message:Town Of Us] CTdiff=0
[Message:Town Of Us] ST Task.Name=PhantomTask
[Message:Town Of Us] ST Task.Name=_Player
[Message:Town Of Us] ST Task.Name=FixWiring(Clone)
[Message:Town Of Us] ST Task.Name=ScanBoardingPass(Clone)
[Message:Town Of Us] ST Task.Name=WeatherGi(Clone)
[Message:Town Of Us] ST Task.Name=UploadSpecimin(Clone)
[Message:Town Of Us] ST Task.Name=UnlockManifoldsTaskPb(Clone)
[Message:Town Of Us] Virus 2 -> TaskRemoved:- UnlockManifoldsTaskPb(Clone) aka UnlockManifoldsTaskPb
[Message:Town Of Us] ST Task Removed:- UnlockManifoldsTaskPb(Clone)
[Message:Town Of Us] i=2
[Message:Town Of Us] STdiff=0
[Message:Town Of Us] LTdiff=2
[Message:Town Of Us] CTdiff=0
[Message:Town Of Us] LT Task.Name=PhantomTask
[Message:Town Of Us] LT Task.Name=_Player
[Message:Town Of Us] LT Task.Name=FixWiring(Clone)
[Message:Town Of Us] LT Task.Name=ScanBoardingPass(Clone)
[Message:Town Of Us] LT Task.Name=WeatherGi(Clone)
[Message:Town Of Us] Virus 2 -> TaskRemoved:- WeatherGi(Clone) aka WeatherGi
[Message:Town Of Us] LT Task Removed:- WeatherGi(Clone)
[Message:Town Of Us] i=3
[Message:Town Of Us] STdiff=0
[Message:Town Of Us] LTdiff=1
[Message:Town Of Us] CTdiff=0
[Message:Town Of Us] LT Task.Name=PhantomTask
[Message:Town Of Us] LT Task.Name=_Player
[Message:Town Of Us] LT Task.Name=FixWiring(Clone)
[Message:Town Of Us] LT Task.Name=ScanBoardingPass(Clone)
[Message:Town Of Us] LT Task.Name=UploadSpecimin(Clone)
[Message:Town Of Us] Virus 2 -> TaskRemoved:- UploadSpecimin(Clone) aka UploadSpecimin
[Message:Town Of Us] LT Task Removed:- UploadSpecimin(Clone)
[Message:Town Of Us] Remaining Tasks Diff (ST/LT/CT=tasksremoved)=0/0/0=3
[Message:Town Of Us] Task Removal Ended!

below is just a list of all tasks (tasks for the map + the phantom's tasks listed as "MyTasks")
[Message:Town Of Us] -----
[Message:Town Of Us] AllTasks:- Short/MonitorOxy
[Message:Town Of Us] AllTasks:- Short/UnlockManifoldsTaskPb
[Message:Town Of Us] AllTasks:- Short/StoreArtifacts
[Message:Town Of Us] AllTasks:- Short/FillCanisters
[Message:Town Of Us] AllTasks:- Short/EmptyOneGarbageLifeSupp
[Message:Town Of Us] AllTasks:- Short/DShipChartCourseTask
[Message:Town Of Us] AllTasks:- Short/MedScanTask
[Message:Town Of Us] AllTasks:- Short/ClearAsteroids
[Message:Town Of Us] AllTasks:- Short/WeatherCA
[Message:Town Of Us] AllTasks:- Short/WeatherMlg
[Message:Town Of Us] AllTasks:- Short/AlignTelescope
[Message:Town Of Us] AllTasks:- Short/RepairDrill
[Message:Town Of Us] AllTasks:- Short/RecordColdTemperature
[Message:Town Of Us] AllTasks:- Short/RecordHotTemperature
[Message:Town Of Us] AllTasks:- Long/UploadWeaponsPb
[Message:Town Of Us] AllTasks:- Long/UploadOffice
[Message:Town Of Us] AllTasks:- Long/UploadElectricTask 1
[Message:Town Of Us] AllTasks:- Long/UploadSpecimin
[Message:Town Of Us] AllTasks:- Long/UploadLifeSupp
[Message:Town Of Us] AllTasks:- Long/StartReactorTaskPb
[Message:Town Of Us] AllTasks:- Long/RefuelTask
[Message:Town Of Us] AllTasks:- Long/OpenWaterways
[Message:Town Of Us] AllTasks:- Long/InspectSample
[Message:Town Of Us] AllTasks:- Long/ReplaceWater
[Message:Town Of Us] AllTasks:- Long/WeatherGi
[Message:Town Of Us] AllTasks:- Long/WeatherIro
[Message:Town Of Us] AllTasks:- Long/WeatherPd
[Message:Town Of Us] AllTasks:- Long/WeatherTB
[Message:Town Of Us] AllTasks:- Long/RebootWifi
[Message:Town Of Us] AllTasks:- Special/ResetReactorTask
[Message:Town Of Us] AllTasks:- Special/FixLightsTask
[Message:Town Of Us] AllTasks:- Special/FixComms
[Message:Town Of Us] AllTasks:- Special/NoOxyTask
[Message:Town Of Us] AllTasks:- Special/SeismicTask
[Message:Town Of Us] AllTasks:- MyTasks/PhantomTask
[Message:Town Of Us] AllTasks:- MyTasks/_Player
[Message:Town Of Us] AllTasks:- MyTasks/FixWiring(Clone)
[Message:Town Of Us] AllTasks:- MyTasks/ScanBoardingPass(Clone)
[Message:Town Of Us] AllTasks:- MyTasks/WeatherGi(Clone)
[Message:Town Of Us] AllTasks:- MyTasks/UploadSpecimin(Clone)
[Message:Town Of Us] AllTasks:- MyTasks/UnlockManifoldsTaskPb(Clone)
[Message:Town Of Us] AllTasks:- MyTasks/DShipChartCourseTask(Clone)
[Message:Town Of Us] AllTasks:- MyTasks/RecordColdTemperature(Clone)
[Message:Town Of Us] AllTasks:- MyTasks/MonitorOxy(Clone)
[Message:Town Of Us] AllTasks:- MyTasks/ClearAsteroids(Clone)

@VirusTLNR
Copy link
Author

VirusTLNR commented Dec 18, 2021

and fixed the minor issue in the calculation..

so now..
5 short tasks, 2 long, 2 common = 9 tasks
75% for phantom is..

[Message:Town Of Us] taskpercentagechange=75
[Message:Town Of Us] weightedtaskvalue=23
[Message:Town Of Us] newweightedtaskvalue=17.25
[Message:Town Of Us] newWTV=18
[Message:Town Of Us] OLD Tasks Count (ST/LT/CT)=5/2/2
[Message:Town Of Us] NEW Tasks Count (ST/LT/CT)=3/1/2

so as you can see a normal crew has 9 tasks (this is not the phantom, this is a different crew)
image

and the phantom has a correct weighted amount of tasks removed up to a maximum of the new weighted value (in this case, all 18 weight was used)
image

ill clean up the code, change the message back to being debug logs, and make a commit, then this should work in entirety.

change of task weighting can come in a future update if we feel the weights are wrong, but for now this works 100%
@VirusTLNR
Copy link
Author

this should now work.

Removing reactor as its not needed, only used for debugging log lines in phantom task update which can be later removed.
@VirusTLNR
Copy link
Author

on the new among us version, this is bugged.

tasks are reduced (for example, from 10 to 7 tasks).. 7 tasks get completed, but the game does not end... end game summary says 7/10 tasks completed for the phantom.

@VirusTLNR VirusTLNR marked this pull request as draft February 21, 2022 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants