Jump to content
Sign in to follow this  
Ezcoo

Dynamic "per-pixel" content in UI (how to print data from sonar probe on the screen)

Recommended Posts

Hi,

I got the idea of creating a simple sonar mod yesterday. I've developed the sounding algorithms like sounding cone area (sea bottom and objects between the probe and bottom) and obstacle reflected signal strength detection in pseudocode now (more info here: http://forums.bistudio.com/showthread.php?148719-ARMA-3-Addon-Request-Thread&p=2515516&viewfull=1#post2515516) and I'm quite happy with them. (I'm still looking for a partner that would be interested in translating the pseudocode into SQF and create the UI *cough* :p) But as I'm not familiar with UI creation at all, I still have this issue to solve; is it possible to print the data that the receiver has gathered on the screen of the sonar in real time like on this video?

(skip to 0:24)

The UI wouldn't have to be that detailed; eg. 240x320 px screen would do (or 480x640 px if there are no remarkable issues that the higher res might cause), and the printed data could be just in binary form (0/1, contact or no contact – signals weaker than detection threshold would be considered as "no contact" naturally). Would it be possible to create the UI with the same concept than in the video: the realtime data would be printed to the rightmost pixel column, and then just moved column by column to the left every time when new pixel column was printed to the right side of screen, till it would go off the screen and disappear? To be more exact, is this functionality possible at all?

I believe that optimization wouldn't be an issue if the concept itself was possible. I have sketched some possible solutions related to optimization already (such as printing the "contact" pixels only, and using a letter with very small font size to simulate a pixel instead of printing an actual image of pixel), but I have no idea that is the whole functionality with the "data history" even possible to create.

PS. If you're interested (check specs from the link above), feel free to add me on Steam or PM me... :D

Thanks in advance!

Edited by Ezcoo

Share this post


Link to post
Share on other sites

While I can't offer any help, I'd be very interested in the results of this project. It would be ideal for my destroyer. Best of luck!

Share this post


Link to post
Share on other sites
While I can't offer any help, I'd be very interested in the results of this project. It would be ideal for my destroyer. Best of luck!

Thanks! That's exactly the reason why I'm interested in creating this – the naval features of the game have a huge potential in my opinion, it just needs some work so that we could unleash the potential in it, and I'd like to contribute in it with this mod. It would be really cool to see the mod being used by other community members like you! :)

Btw, I can explain the functionality more in-depth if there are people who are interested in this. I'm quite excited about this, because I found out that it's possible to make very realistic outcome with quite simple algorithms! :)

Share this post


Link to post
Share on other sites

From what I recall there were similar projects already done - might be useful how they were done.

I believe by Spooner and Mandoble for example.

Share this post


Link to post
Share on other sites
;2516965']From what I recall there were similar projects already done - might be useful how they were done.

I believe by Spooner and Mandoble for example.

Thanks for the tip! Do you remember what projects exactly used the similar kind of stuff? I found quite a lot of stuff by them eg. from Armaholic. Eg. SPON projects look quite promising. I read from the Spooner's website that the SPON Core that he used as core for his own projects became later part of CBA, so maybe CBA could make the drawing and data history possible...?

Share this post


Link to post
Share on other sites

Thanks!

I'd like to point out that the algorithms for everything necessary have been completed though. The sender unit pings the sea bottom, and both the bottom and the objects between the receiver and bottom that are in the area of detection reflect the pings so that the receiver unit detects them, if the intensity of the signals is greater than the detection threshold (the sea bottom is detected always). The algorithm calculates then the distances between both sea bottom and the detected objects in water and the receiver unit in 3D space, and prints them on the screen then. Strong signals produce thick lines on screen, and weak signals produce weak lines. The size of an object and the distance between the receiver and the object affects to the strength of the reflected signal, so small objects might not be detected in greater depths. But for example a diver swimming underneath the boat in relatively low depths (diving depths) would show as a big "banana" (as I call them) on the screen in real time. The aforementioned is executed even +10 times in second (with every ping, ping interval depends on the depth like in real life), but it doesn't matter because the scripts are so lightweight that they shouldn't cause FPS drop at all (tested the calculation times in editor, total calculation time shouldn't exceed 1 ms at any point, probably even much less than 0.5 ms).

The only issue at this moment is the drawing/printing of data on the sonar screen. It's something that I'm very likely unable to figure out as I'm not familiar with the UI creation at all, and that's where I need help.

PS. If it helps, I've been using sonars my whole life, so I'm kind of familiar with how they work.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×