Silier Posted May 15, 2019 Report Share Posted May 15, 2019 (edited) Step 1: Entity does not see terrain higher than its position. [done] Step 2: Entity does not see terrain behind hills [done] Spoiler Step 3: Entity height influences how high can see (height from outpost's footprint allows to see what is on the hill) [maybe better to use some new parameter than footprint ? ] Spoiler Step 4: Performance [maybe will not be needed] Last build version Windows: pyrogenesis.exe (outdated version) Related diff: https://code.wildfiregames.com/D1905 Edited May 19, 2019 by Angen 9 1 Quote Link to comment Share on other sites More sharing options...
Alexandermb Posted May 15, 2019 Report Share Posted May 15, 2019 Thats Nice! Could it work with structures too? using height for make tall structures block vision behind them. Example: Infantry can't see whats behind the walls unless they are in a siege tower. Stupid question: if i garrison an archer in a outpost would it increase their FOV by Step 3 or it would just affect when entity is in a hill. 2 Quote Link to comment Share on other sites More sharing options...
wraitii Posted May 15, 2019 Report Share Posted May 15, 2019 36 minutes ago, Angen said: Step 4: Performance That's the hard part... 2 1 1 Quote Link to comment Share on other sites More sharing options...
Silier Posted May 15, 2019 Author Report Share Posted May 15, 2019 4 minutes ago, Alexandermb said: Thats Nice! Could it work with structures too? using height for make tall structures block vision behind them. Example: Infantry can't see whats behind the walls unless they are in a siege tower. Stupid question: if i garrison an archer in a outpost would it increase their FOV by Step 3 or it would just affect when entity is in a hill. For start I plan only depending on terrain height and entity height. For example: towers will have bonus and will see over hills that are lower then their height. It could work with structures if their height would be added / substracted to terrain height in some cache to avoid obstruction checking when updating visibility. 2 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted May 15, 2019 Report Share Posted May 15, 2019 8 hours ago, wraitii said: That's the hard part... Perhaps if this feature was limited to static objects like buildings then it could remain relatively performant. 1 Quote Link to comment Share on other sites More sharing options...
nani Posted May 16, 2019 Report Share Posted May 16, 2019 Step 2 is basically the same as doing a 2d raycasting of the entity as if it were a light (see this). So I'm afraid here is where you will notice you are inadvertantly doing the same as generating shadows and the performance will drop down Quote Link to comment Share on other sites More sharing options...
Silier Posted May 16, 2019 Author Report Share Posted May 16, 2019 (edited) (here was firts compiled version - > moved to first post) Edited May 17, 2019 by Angen 1 Quote Link to comment Share on other sites More sharing options...
nani Posted May 16, 2019 Report Share Posted May 16, 2019 (edited) Very cool, I'm actually surprised that the fps went from 60 fps to only 15 fps when i had 300 units, I expected a much higher drop :D. What technique are you using for step 2 @Angen, partial vision update? Pic : I also seem to have found a bug ... (but wip right? :P) no units but map area visible: Edited May 16, 2019 by nani 1 Quote Link to comment Share on other sites More sharing options...
Silier Posted May 16, 2019 Author Report Share Posted May 16, 2019 @nani could you send me replay with bug? In svn los is computed in stripes from bottom of vision range to top. I changed computation to squares going from position to vision range borders. Although I had to remove incremental update of that stripes and replace it with total remove and add as it were before it was optimised. To the current blocking I have boolean map matching los map strucute. As I said I go from entity position out. So In every iteration I check first height and if still visible then I check related tiles which could block vision from position and when I have d result I update related boolean map for next iteration and show hide tile for player. 1 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted May 16, 2019 Report Share Posted May 16, 2019 (edited) Gorgeous! I get this error every time I run your exe. WARNING: Framebuffer object incomplete: 0x8CD6 ERROR: CRenderer::EndFrame: GL errors GL_OUT_OF_MEMORY (0505) occurred Edited May 16, 2019 by wowgetoffyourcellphone 1 Quote Link to comment Share on other sites More sharing options...
nani Posted May 16, 2019 Report Share Posted May 16, 2019 2019-05-16_0002.zip Quote Link to comment Share on other sites More sharing options...
Silier Posted May 16, 2019 Author Report Share Posted May 16, 2019 hm interesting gl error, thnx. 1 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted May 16, 2019 Report Share Posted May 16, 2019 Just now, Angen said: hm interesting gl error, thnx. I tried running it with GLSL off, but that just gave me a series of error windows that I tried to suppress and got this: PS: I wish we had the option to screenshot directly to JPG or some other compressed format so I wouldn't have to keep doing it manually in Photoshop™. 1 Quote Link to comment Share on other sites More sharing options...
Silier Posted May 16, 2019 Author Report Share Posted May 16, 2019 2 hours ago, nani said: 2019-05-16_0002.zip 10.66 kB · 1 download thnx excelent material for testing problem solved @wowgetoffyourcellphone I am sorry but I cannot reproduce your problem at all. What OS do you have? Quote Link to comment Share on other sites More sharing options...
OptimusShepard Posted May 16, 2019 Report Share Posted May 16, 2019 3 hours ago, wowgetoffyourcellphone said: WARNING: Framebuffer object incomplete: 0x8CD6 ERROR: CRenderer::EndFrame: GL errors GL_OUT_OF_MEMORY (0505) occurred Maybe you could try with setting the shadow quality to low, or completely disabled. 1 Quote Link to comment Share on other sites More sharing options...
Silier Posted May 17, 2019 Author Report Share Posted May 17, 2019 (edited) Update: Fixed behaviour of vision in water and improved detection of hills. Now unit will see up to the top of hill. So you will have not black holes unless hill is flat. Sometimes side of hill will not be detected if there is smaller hill before it and blocks vision of unit but I am afraid further improvement would need more complex computation and checking. Compiled version in first post. Edited May 17, 2019 by Angen 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted May 17, 2019 Report Share Posted May 17, 2019 This problem still exists. Can you issue a patch? Is the relevant patch code available? Quote Link to comment Share on other sites More sharing options...
Silier Posted May 17, 2019 Author Report Share Posted May 17, 2019 1 minute ago, gameboy said: This problem still exists. Can you issue a patch? Is the relevant patch code available? What do you mean by this problem ? 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted May 17, 2019 Report Share Posted May 17, 2019 YES 3 1 Quote Link to comment Share on other sites More sharing options...
nani Posted May 17, 2019 Report Share Posted May 17, 2019 What 1 2 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted May 18, 2019 Report Share Posted May 18, 2019 (edited) On 5/17/2019 at 9:29 AM, Angen said: Update: Fixed behaviour of vision in water and improved detection of hills. Now unit will see up to the top of hill. So you will have not black holes unless hill is flat. Sometimes side of hill will not be detected if there is smaller hill before it and blocks vision of unit but I am afraid further improvement would need more complex computation and checking. Compiled version in first post. Despite still seeing this I can still see the new vision working as advertised. Very nice. Though, it's disconcerting that I can't see atop mesas and such. Edited May 18, 2019 by wowgetoffyourcellphone 1 Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted May 18, 2019 Report Share Posted May 18, 2019 On 5/17/2019 at 8:18 AM, gameboy said: YES 1 Quote Link to comment Share on other sites More sharing options...
Silier Posted May 18, 2019 Author Report Share Posted May 18, 2019 3 minutes ago, Lion.Kanzen said: she/he is so cute 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted May 19, 2019 Report Share Posted May 19, 2019 My God, how can this problem be solved? What do I see? Is this a Lego building block? Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted May 19, 2019 Report Share Posted May 19, 2019 9 minutes ago, gameboy said: My God, how can this problem be solved? What do I see? Is this a Lego building block? many more nights and days my friend. 1 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.