Line of sight:
We must first define which tiles can be seen across and which tiles cannot. Currently the Walkable map layer defines which tiles can be walked on and which cannot.
Optionally, it should be relatively simple to add a third category of tiles that can be seen across but not walked across (e.g. small plants and boulders, tree stumps). I think we can skip the possibility of a tile that can be walked across but not seen across, although one can imagine special cases ... magical veils, dense spider webs... But one thing at a time.
I'll investigate the code to see if it is as simple as adding a new color code to the Walkable layer. If not, then a separate Seeable layer could be created, but that's alot more work.
Also, the actual line of sight rules need to be determined. My first cut idea is that any tile is visible from the player's position tile if the line connecting the two tile centers does not pass through a vision-blocking tile. I could code and test this rule to see if the resulting lines of sight seem realistic.
This setup could be used for:
1) Changing the map display to account for partial lighting, such as a stationary candelabra that only lights part of a room, or a player-carried torch. LOS defines which tiles are lit, within range of the light if applicable.
2) Revealing only the part of a map, based on what the player can actually see. This could attract both the display of the main screen and the world map. Tiles that have never been in the player's LOS (while lit) would remain black.
3) Implementing ranged weapons and/or spells. Only a visible tile can be targeted. Optionally, we could allow a player indoors to shoot at an unlit tile, but the projectile would only get there if the target tile would be in LOS in full light.
All of this would require some upgrades to the data structure for the maps and the map display routine, but should be doable.
Any comments?
We have a new Beta: v0.8.13 ("Troubling Times") !
Useful links
Source code of the game - Contribution guide - ATCS Editor - Translate the game on Weblate - Example walkthrough - Andor's Trail Directory - Join the Discord
Get the game (v0.8.12.1) from Google, F-Droid, our server, or itch.io
Useful links
Source code of the game - Contribution guide - ATCS Editor - Translate the game on Weblate - Example walkthrough - Andor's Trail Directory - Join the Discord
Get the game (v0.8.12.1) from Google, F-Droid, our server, or itch.io
Line of Sight
-
- VIP
- Posts: 1353
- Joined: Tue Feb 08, 2011 7:05 am
- android_version: 7.0
Line of Sight
Norbert
Lvl:52 XP:2597576 AP:12 HP:124 AC:282 AD:30-42 CHS:27 CM:2.0 ECC:18% BC:132 DR:2
Skills: CS:2 IF:2 Ev:3 Rg:1 DgPro:1 1HPro:2 LtAPro:2 FS-DW:2 Sp-DW:1
Equip: FP BSS JoF RoP PRoB SrpHbk GoLF EnhCH EnhCB
Other: DotSP VD GoW FB TG RoD+6 Oegyth:6
Lvl:52 XP:2597576 AP:12 HP:124 AC:282 AD:30-42 CHS:27 CM:2.0 ECC:18% BC:132 DR:2
Skills: CS:2 IF:2 Ev:3 Rg:1 DgPro:1 1HPro:2 LtAPro:2 FS-DW:2 Sp-DW:1
Equip: FP BSS JoF RoP PRoB SrpHbk GoLF EnhCH EnhCB
Other: DotSP VD GoW FB TG RoD+6 Oegyth:6
- Fire7051
- Posts: 299
- Joined: Tue Aug 23, 2011 4:20 am
- android_version: 3.0
Re: Line of Sight
I love the idea and think that it would add a lot of depth to the enviroment. (I even thought up a helmet for this).Tomcat wrote:
2) Revealing only the part of a map, based on what the player can actually see. This could attract both the display of the main screen and the world map. Tiles that have never been in the player's LOS (while lit) would remain black.

If you were able to add it in fairly simply and it didn't make the file absolutely huge (I don't see any reason why it would) I say go for it!
Give a man a fish and he will eat for a day. Teach a man to fish and he will eat for a lifetime.
Give a man a fire and he will be warm for a day. Set a man on fire and he will be warm for the rest of his life.
Give a man a fire and he will be warm for a day. Set a man on fire and he will be warm for the rest of his life.
-
- VIP
- Posts: 6435
- Joined: Sat Jun 25, 2011 1:00 am
- android_version: 6.0 - Marshmallow
- Location: Fire Nation HQ
Re: Line of Sight
I could see this being a neat addition to any underground or any other area that isn't very well lit.
Great suggestions, would be great for Caves, Dungeons, dark buildings, caticombs, etc.
Very interesting ideas here.
Great suggestions, would be great for Caves, Dungeons, dark buildings, caticombs, etc.
Very interesting ideas here.
---------------------------------------------------------------------------------------
Player Name:Pyro
Lvl:24XP:244KAP:2/10HP:80AC: 189%AD:13-21CHS:-6CM: 0BC: 20%DR:2
IF:2Reg:2FSDW:1
May Elythara bless you and light your path!
---------------------------------------------------------------------------------------
Player Name:Pyro
Lvl:24XP:244KAP:2/10HP:80AC: 189%AD:13-21CHS:-6CM: 0BC: 20%DR:2
IF:2Reg:2FSDW:1
May Elythara bless you and light your path!
---------------------------------------------------------------------------------------