FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.77k stars 408 forks source link

Custom medical outpost modules can always generate on habitation outposts #10779

Closed UnhappyWithMyUsername closed 1 year ago

UnhappyWithMyUsername commented 1 year ago

Disclaimers

What happened?

When creating and saving medical outpost modules and setting them up to only generate on a custom outpost, they still generate on habitation outposts.

Reproduction steps

  1. Create a custom outpost location (Or use my mod Pirates Ahoy! on the workshop and skip to step 3.)
  2. Create a medical outpost module and only allow it to generate on this new custom location
  3. Play campaign or use leveleditor to generate default habitation outposts. Some will generate with the custom medical outpost module.

image image

Bug prevalence

Happens every time I play

Version

0.20.16.1

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

Regalis11 commented 1 year ago

I was unable to reproduce this in the v1.0.2.0 build: has most likely been fixed by the changes we've done to the outpost generation logic.

NilanthAnimosus commented 1 year ago

Tested against Release/1.1 commit https://github.com/Regalis11/Barotrauma-development/commit/7fced5fab4930f4f0a5af757a241740bad4081e3

At first I thought I couldn't repro this using the mod Pirates Ahoy! (steam workshop link), as the medical outpost module never generated in regular outposts in the level editor.

Changing to city type however, I managed to get this to occur. checking the settings of the module in question I don't think it should be attempting to spawn there so images and details attached:

location type: Outpostlevel outpost parameters: City Level seed: IkgJj9E8 submarine: Selkie Module spawning incorrectly: PIRATEARMORY1

module has been set to location type "PirateOutpost" module type "ArmoryModule".

it could be related to this: image

image image

Regalis11 commented 1 year ago

Addressed in https://github.com/Regalis11/Barotrauma-development/commit/06367ca7706b39dcbfb877ba1042add33d9b6957

The generator was allowed to choose a "wrong" kind of module (e.g. normal module in abandoned outpost or vice versa) if it couldn't find any valid place for the correct kind of module. Now if we can't find a valid place for a required module, we retry generating the whole outpost, the same way we do if the selected modules can't be placed without overlaps. Only on the last retry we resort to the wrong kinds of modules.

Jasontti commented 1 year ago

Tested. No issues found. Closing ticket.