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

Should terrain be able to have vision different to movement? #8816

Open
stevecotton opened this issue Apr 27, 2024 · 5 comments
Open

Should terrain be able to have vision different to movement? #8816

stevecotton opened this issue Apr 27, 2024 · 5 comments
Labels
Enhancement Issues that are requests for new features or changes to existing ones. Question Issues that are actually questions rather than problem reports. Terrain Issues that involve terrain definitions or their implementation in the engine.

Comments

@stevecotton
Copy link
Contributor

Describe the desired feature

Units can already have separate vision and movement costs for a given terrain.

Terrain can already have defense calculations that are different to movement calculations, as in the many mixed terrains with

  • movement = worst of (underlying terrains)
  • defense = best of (underlying terrains)

However, terrains always use the movement calculation for vision too. They don't support saying "this is a rusty gate, the movement is worst of (flat, impassible) but the vision is best of (flat, impassible)", instead there are hacks such as THoT S09's trick of giving all the dwarves [vision_costs]impassable=3.

The question is, it it worth the effort to add it, will it be fun for players?

Note: there's already parts of an implementation, such as the terrain_type::vision_type() function. That doesn't get used in the pathfinding, and I'm considering removing it entirely - I just implemented a call to it from the help topic generator, only to find that it returns bogus results (saying "best of" rather than "worst of").

@stevecotton stevecotton added Enhancement Issues that are requests for new features or changes to existing ones. Question Issues that are actually questions rather than problem reports. Terrain Issues that involve terrain definitions or their implementation in the engine. labels Apr 27, 2024
@CelticMinstrel
Copy link
Member

To put it into simple and concrete terms, this seems to be a question about whether we should add vision_alias in [terrain_type]?

I'd be in favour of that, but I can't really comment on whether it would be fun.

@soliton-
Copy link
Member

Given that there are already workarounds in mainline that this would eliminate the need for it’s definitely something to consider. I would think it generally makes more sense for vision to be best of and see no reason why we shouldn’t be able to specify that just as with movement and defense.

I think a relevant question is how much it would complicate the engine. It seems like that shouldn’t be a lot though?

@gfgtdf
Copy link
Contributor

gfgtdf commented Apr 27, 2024

Imo different vision code than movement cose on terrain does make a lot of sense, a commom usecase is probably to make all unit be able to see over chasms.

@Jonathan-Kelly
Copy link
Contributor

And see over deep water.

@stevecotton
Copy link
Contributor Author

I've created #8818 specifically for the water and chasms. I think it would be done with [movetype][vision_costs] rather than the alias system, because it needs a way to say that something is low cost; the alias system can only say "this chasm's vision cost is best of (impassible, flat)", which still leaves merfolk with quite limited vision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Issues that are requests for new features or changes to existing ones. Question Issues that are actually questions rather than problem reports. Terrain Issues that involve terrain definitions or their implementation in the engine.
Projects
None yet
Development

No branches or pull requests

5 participants