Opened 9 years ago

Last modified 2 years ago

#3177 new enhancement

[PATCH] Implement camouflaging

Reported by: Itms Owned by: marder
Priority: Should Have Milestone: Work In Progress
Component: Simulation Keywords: patch design
Cc: Patch: Phab:D4291

Description (last modified by Itms)

Attached is a patch that implements camouflaging for Iberian swordsmen (just a test case, it would be nice if all Iberian infantry had it but it should be balanced).

It is quite huge because I had to re-implement Stamina, that depends on it in my design; if possible I will commit the stamina changes before, so the patch is easier to review.

Feedback is welcome! :)

Attachments (4)

camouflaging.patch (29.1 KB ) - added by Itms 9 years ago.
camouflage_off.png (3.0 KB ) - added by Itms 9 years ago.
camouflage_on.png (5.5 KB ) - added by Itms 9 years ago.
camouflaged.png (4.9 KB ) - added by Itms 9 years ago.

Download all attachments as: .zip

Change History (13)

by Itms, 9 years ago

Attachment: camouflaging.patch added

by Itms, 9 years ago

Attachment: camouflage_off.png added

by Itms, 9 years ago

Attachment: camouflage_on.png added

by Itms, 9 years ago

Attachment: camouflaged.png added

comment:1 by Itms, 9 years ago

Keywords: review removed

Putting this out of the review queue, it conflicts with capturing wrt. the UI.

comment:2 by Itms, 9 years ago

Milestone: Alpha 19Backlog

comment:3 by Palaxin, 7 years ago

Stamina was removed in r18002. Are there still any plans for camouflaging?

comment:4 by Stan, 7 years ago

#3468 Made the patch work sometime ago. While there are still plans for camouflaging, Itms told me that his patch that I rebased was not going to be included because it wasn't the proper way to do it.

comment:5 by Itms, 6 years ago

Description: modified (diff)
Keywords: design added
Owner: Itms removed

comment:6 by Imarok, 5 years ago

Component: UI & SimulationSimulation

Move tickets to Simulation as UI & Simulation got some sub components.

comment:7 by Freagarach, 4 years ago

I was thinking about some ways of properly using vision and camouflaging and thought of the following. It might be rediciously expensive or just plain wrong, but without bad ideas no good ones emerge.

Perhaps we can use a fraction for the visibility of terrain tiles? Each unit sees "0" of a tile beyond vision and "1" of a tile up front (cutoff of 0.1 for barely visible, i.e. current LOS). For the player visibility the max of the fractions of multiple entities is used. (That could even be extended such that having two entities seeing the same tile gives the player slightly more information.)

A unit can then have in their Visibility-component defined at which fraction of exploration it becomes visible to other players. Using stealth increases that fraction such that a unit should be closer before seeing it. Also bigger units (structures) can have smaller fractions, leading to one being able to see e.g. buildings earlier than smaller units.

The "ComputeLosVisibility"-function in CCmpRangeManager would not be too hard to update I think (if "los.IsVisible(i, j)" would return a fraction instead of a boolean). But of course there are many more things to consider.

comment:8 by Itms, 4 years ago

That would be ridiculously expensive indeed, but it's certainly a nice gameplay idea. Moving from bools to floats would make us change much code. It would already be better to use integers instead of fractions and define an integer visibility threshold... Another issue with non-boolean visibility would be that it would become impossible to use simple bitfields to describe a set of visibilities for each player (like we currently do).

Your idea gave me another which would be easier to implement: stealth units could have an aura which has the effect of decreasing the vision range of enemy units and/or buildings.

comment:9 by Silier, 2 years ago

Milestone: BacklogWork In Progress
Owner: set to marder
Patch: Phab:D4291
Note: See TracTickets for help on using tickets.