• GMod - What are you working on? March 2017 (#67)
    213 replies, posted
Been working on my new Advanced Cameras tool. The initial version is [url=http://steamcommunity.com/sharedfiles/filedetails/?id=881605937]already released[/url]! Most of its features are shown off up to 1:00 in the video below. Not pictured: button reassignment (you can see the menu option for that at 0:25), multiplayer support (pretty much works flawlessly in multiplayer). But at 1:00 we get to the interesting part - projection! I'm making a projected texture to show exactly what's in the frame of the camera without having to actually look through it. Should be pretty useful! Still some stuff to do, currently this uses hard-coded values for a 16:10 projection, but I've also prepared a 16:9 texture as well a 4:3 one. I also hard-coded it to be yellow. [media]https://www.youtube.com/watch?v=RzDKlf9o0D4[/media]
[QUOTE=NeatNit;51996651]Been working on my new Advanced Cameras tool. [/QUOTE] Video is private.
[QUOTE=bobbleheadbob;51996698]Video is private.[/QUOTE] Last time I'm uploading through geforce experience. I swear I picked public in there, and also after it finished uploading I noticed it was private and already set it to public. I have no idea what happened. All fixed now!
[QUOTE=NeatNit;51996651]Been working on my new Advanced Cameras tool. The initial version is [url=http://steamcommunity.com/sharedfiles/filedetails/?id=881605937]already released[/url]! Most of its features are shown off up to 1:00 in the video below. Not pictured: button reassignment (you can see the menu option for that at 0:25), multiplayer support (pretty much works flawlessly in multiplayer). But at 1:00 we get to the interesting part - projection! I'm making a projected texture to show exactly what's in the frame of the camera without having to actually look through it. Should be pretty useful! Still some stuff to do, currently this uses hard-coded values for a 16:10 projection, but I've also prepared a 16:9 texture as well a 4:3 one. I also hard-coded it to be yellow. [media]https://www.youtube.com/watch?v=RzDKlf9o0D4[/media][/QUOTE] Projection should be disabled in the eye of the camera so everything doesn't have a yellow hue.
[QUOTE=bobbleheadbob;51997789]Projection should be disabled in the eye of the camera so everything doesn't have a yellow hue.[/QUOTE] The are 2 reasons why I won't be changing this. The first and most important one is that I like it this way, and so does the guy who requested this tool and this feature in the first place. There's something extremely satisfying knowing that there are shadows but you can't see them because you're exactly looking through ​the right spot. It also helps to debug in case the impossible happens and the projection origin becomes different from the camera position. The second reason is that at the moment, projections are handled entirely serverside exactly like Lamp does it. In multiplayer you might have one person looking through the camera and another person currently relying on the projection to do some work. Obviously the projection shouldn't be turned off for the latter guy just because the former is looking through it. It's possible to move all of the projection code to the client using ProjectedTextures but that would be a big pain, throwing away half the current code, and wouldn't allow me to make use of NetworkVarNotify to update the projection like I'm doing now. It's important to keep in mind the purpose of this feature - to be able to tell at a glance what it visible to the frame and what isn't. While looking through the camera, it's irrelevant whether the light is on or not, so the light doesn't harm the purpose. [b]tl;dr it's intentional[/b]
You could also draw the frustums. That way you would know the edges of a camera's view in mid air. Check this for code: [url]https://bitbucket.org/fpeijnenburg/falcos-private-scripts/src/45223894777a207b87cc9f51fac0845ade599e95/lua/fscripts/viewFrustum.lua?at=master&fileviewer=file-view-default[/url] Actually combining it with your technique may give a nice effect.
[QUOTE=FPtje;51999332]You could also draw the frustums. That way you would know the edges of a camera's view in mid air. Check this for code: [url]https://bitbucket.org/fpeijnenburg/falcos-private-scripts/src/45223894777a207b87cc9f51fac0845ade599e95/lua/fscripts/viewFrustum.lua?at=master&fileviewer=file-view-default[/url] Actually combining it with your technique may give a nice effect.[/QUOTE] I am planning something cool with the frustum, but only for the next update. The projection should be released tonight or tomorrow. I'm interested in the code you linked, how can I test it and see what it does and how it looks? I'm still probably going to write all of my code myself, because I just love doing it, but it's always good to see what others have done and perhaps learn from it. :smile:
[QUOTE=NeatNit;51999364]I am planning something cool with the frustum, but only for the next update. The projection should be released tonight or tomorrow. I'm interested in the code you linked, how can I test it and see what it does and how it looks? I'm still probably going to write all of my code myself, because I just love doing it, but it's always good to see what others have done and perhaps learn from it. :smile:[/QUOTE] It's included in the Falco's Small scripts [url=http://steamcommunity.com/sharedfiles/filedetails/?id=104808533]workshop addon[/url]. The drawing of frustums is enabled by default for players and cameras. Just create a server, load Falco's small scripts (lua_openscript_cl autorun/client/falcoutilities.lua), spawn a bot or camera and see what happens. Also, here's an [I]ancient[/I] screenshot of the script (from 2012): [img]https://steamuserimages-a.akamaihd.net/ugc/541820317363280783/78F7D7CA7DA4775B3BB35D7388674E0770082527/?interpolation=lanczos-none&output-format=jpeg&output-quality=95&fit=inside|1024:575&composite-to%3D%2A%2C%2A%7C1024%3A575&background-color=black[/img] The light blue frustum is from the camera, the green one from YAWA (god I miss that fucker's awesome voice). On the left you can see another green frustum from someone looking slightly up. At the bottom of the screenshot you can see a grey "mrsneakydevil". That means mrsneakydevil can see me. Whether a player can see me is calculated using the view frustum. Back in the good old days I used this to sneak around Sam Fisher style. With this script I knew exactly what people could see and what they couldn't see, with some precision lost though by the fact that I have to assume that people run 16:9 with 90 degrees FOV. Sneaking about with prop surfing and this script genuinely feels like playing splinter cell or some other sneak game. It's hilarious because you're sneaking around actual people rather than NPCs. It's more unpredictable, but strangely still doable.
[QUOTE=FPtje;51999572]It's included in the Falco's Small scripts [url=http://steamcommunity.com/sharedfiles/filedetails/?id=104808533]workshop addon[/url]. The drawing of frustums is enabled by default for players and cameras. Just create a server, load Falco's small scripts (lua_openscript_cl autorun/client/falcoutilities.lua), spawn a bot or camera and see what happens.[/QUOTE] Awesome, I'll check it out tonight when I get home. How come you need to openscript it if it's in autorun?
[QUOTE=NeatNit;51999578]Awesome, I'll check it out tonight when I get home. How come you need to openscript it if it's in autorun?[/QUOTE] Garry hates clientside scripting, specifically the kind of clientside scripts that you could load in any server. Back in the scriptenforcer days they'd run automatically when in autorun. When sv_allowcslua was introduced, clientside autorun scripts didn't autorun anymore unless they were sent by the server or something. Reproducing this is easy: - Put a lua file in lua/autorun/client or lua/autorun - Join a server with sv_allowcslua 1 - Find that your script isn't being run until you manually run it with lua_openscript_cl
So I made a huge mistake, I decided my first try at modelling would be to try and port the weapons from borderlands, using modular design and then use TFA base to put it together and let people choose what parts they want, fuck me was that a huge mistake. Granted as a proof of concept its decent but Im no modeller. For shits and giggles here is a sniper I put together quickly (Not using the modular design, just the parts) [t]https://i.gyazo.com/b06f33bcac4644ea17850944302dad4e.png[/t]
Doing some favor for my friend [media]https://www.youtube.com/watch?v=QV3_fl25Pa0[/media] [media]https://www.youtube.com/watch?v=d30SW5fcwx4[/media]
Well I decided to continue with the project, naturally I've hit another roadblock. Bloody prop is invisible... Here is a screenshot of it anyways (Coloured green so you can see it <3 ) [t]https://steamuserimages-a.akamaihd.net/ugc/170415189361269051/6705FC1B808A479EB7790BFAE5887155EE5D8ACC/[/t] Edit: Ayy fixed it thanks to the lovely people in the modelling subforum [t]https://steamuserimages-a.akamaihd.net/ugc/170415189361432408/F96FD8C58A93BAE22C856273EC72B15DEECC2AC9/[/t] Edit 2: I get the feeling I'm going to need to resize these... [t]https://steamuserimages-a.akamaihd.net/ugc/170415189361976682/BB84DA2DA7DE1BC4EFD621D063FC4301C14AF96A/[/t] Edit 3: Im not sure if I like it, it looks really low res and Im not sure why (Could just be the texture or I messed something up) [t]https://steamuserimages-a.akamaihd.net/ugc/170415189362301697/177B054F801AFDD2F3FA779135DF8F1271D2375F/[/t] [t]https://steamuserimages-a.akamaihd.net/ugc/170415189362377146/65DEA2DAF130E8AF7757B69C36002FB1E33437B0/[/t]
Zone designator for a few script ideas I have. [video=youtube;L8QLaVzzJ9k]http://www.youtube.com/watch?v=L8QLaVzzJ9k[/video] Also check out the [URL="https://facepunch.com/showthread.php?t=1558060"]new version of draw.Arc()[/URL] if you haven't seen it.
[QUOTE=bobbleheadbob;52014828]Zone designator for a few script ideas I have. [video=youtube;L8QLaVzzJ9k]http://www.youtube.com/watch?v=L8QLaVzzJ9k[/video] Also check out the [URL="https://facepunch.com/showthread.php?t=1558060"]new version of draw.Arc()[/URL] if you haven't seen it.[/QUOTE] You've made me realize that I want a workshop for code libraries. I want to subscribe to code like your arc and just have its newest version included into my addons automatically if I use it
[QUOTE=bobbleheadbob;52014828]Zone designator for a few script ideas I have. [video=youtube;L8QLaVzzJ9k]http://www.youtube.com/watch?v=L8QLaVzzJ9k[/video] Also check out the [URL="https://facepunch.com/showthread.php?t=1558060"]new version of draw.Arc()[/URL] if you haven't seen it.[/QUOTE] Oh man, I would love this, I have so many ideas for it.
[QUOTE=a1steaksa;52015136]You've made me realize that I want a workshop for code libraries. I want to subscribe to code like your arc and just have its newest version included into my addons automatically if I use it[/QUOTE] We could go back to 2009 and use SVN for everything.
[QUOTE=bobbleheadbob;52014828]Zone designator for a few script ideas I have. [video=youtube;L8QLaVzzJ9k]http://www.youtube.com/watch?v=L8QLaVzzJ9k[/video] Also check out the [URL="https://facepunch.com/showthread.php?t=1558060"]new version of draw.Arc()[/URL] if you haven't seen it.[/QUOTE] This has a lot of potential, I'm just thinking of a bunch of stuff that I can use this for :v:
[QUOTE=Rocket;52016750]So... a package manager?[/QUOTE] Sure. I mean, ideally I wouldn't have to actually include the libraries with my code but rather they would be downloaded when the game or server is launched such that things like the arc library would always be up to date. It would probably help to keep workshop file sizes a bit lower. I don't know that it's a workable idea, but its just something I realized would be convenient to have.
[QUOTE=a1steaksa;52017376]Sure. I mean, ideally I wouldn't have to actually include the libraries with my code but rather they would be downloaded when the game or server is launched such that things like the arc library would always be up to date. It would probably help to keep workshop file sizes a bit lower. I don't know that it's a workable idea, but its just something I realized would be convenient to have.[/QUOTE] You can make your workshop addon have a dependency on other addons. It could all be done through the workshop. I would just need to publish my little snippets on the workshop and that would be annoying.
[QUOTE=bobbleheadbob;52017552]and that would be annoying.[/QUOTE]How so?
[QUOTE=NeatNit;52017635]How so?[/QUOTE] It's just a process, and it's harder to edit the code of a workshop item.
You can make a batch file that updates it in one click
[QUOTE=Rocket;52017677]There's two problems with that. First, you might run into a "left-pad" scenario: the creator of the package removes it, breaking all of your scripts. If they're more malicious, they might replace it with a blank file, so even prohibiting people from deleting packages wouldn't eliminate that possibility. Second, there could be a situation where the author pushes a breaking change to their package, either by mistake or as a deliberate decision to change the way their package works. Then your scripts would be broken unless the author either fixes their mistake or you update your package to work around it. Even if a versioning system like semver were used to decide upon whether a package could be updated without breaking changes, that still doesn't prevent the possibility of new bugs or inaccurate versioning of changes. Not to mention that quite a few people in languages with package managers decide to just specify a wildcard for the required version of a package. And this isn't something you directly control - it could be a dependency of a dependency that specifies a wildcard version, and then when that dependency updates it'd cause your script to break, through no fault of your own. Shipping dependencies with your code seems like a waste, but it's the best way to ensure that you know that your script will work.[/QUOTE] It gets even worse when dependencies depend on other frameworks that depend on dependencies of dependent dependencies. [editline]26th March 2017[/editline] what the fuck did i just type
[QUOTE=Rocket;52017677]There's two problems with that. First, you might run into a "left-pad" scenario: the creator of the package removes it, breaking all of your scripts. If they're more malicious, they might replace it with a blank file, so even prohibiting people from deleting packages wouldn't eliminate that possibility. Second, there could be a situation where the author pushes a breaking change to their package, either by mistake or as a deliberate decision to change the way their package works. Then your scripts would be broken unless the author either fixes their mistake or you update your package to work around it. Even if a versioning system like semver were used to decide upon whether a package could be updated without breaking changes, that still doesn't prevent the possibility of new bugs or inaccurate versioning of changes. Not to mention that quite a few people in languages with package managers decide to just specify a wildcard for the required version of a package. And this isn't something you directly control - it could be a dependency of a dependency that specifies a wildcard version, and then when that dependency updates it'd cause your script to break, through no fault of your own. Shipping dependencies with your code seems like a waste, but it's the best way to ensure that you know that your script will work.[/QUOTE] The "left-pad" instance was more to do with npm's micro-packaging craze. (Did you know you needed a test suite to test the number pi?)I think something like this that is non-trivial to implement and widely useful is the ideal unit for a library. That said, your point about the code being updated with something malicious is probably well founded. I wouldn't expect it from most places, but this is a community built around modding a dust-sphere experience and drama seems to be the norm.
[QUOTE=Rocket;52017748]Yeah, automatic package updating would be a field day for the kind of people who put backdoors in workshop addons.[/QUOTE] But no more so than someone updating a standard workshop addon. The only issue I really see with it is the issue of someone updating to a blank file and suddenly you have nothing. That I don't know of a fix for
Like everything new versioned package managers have pros and cons. They make this easier to make, organized, and smaller if used correctly. edit: restrict editing of previous versions to deter backdoor bs
[QUOTE=Rocket;52019865]The number of circumstances where a person wants to include a new version of a dependency automatically, without any kind of review of the new version, will almost certainly be far fewer than the number of circumstances in which a person who created a dependency wants to fuck someone else over.[/QUOTE] It's been discussed before, but you could probably just run the code through a filter before it gets pushed, and if there's anything that brings up a red flag, somebody can investigate it. One of the downsides to this though is that the amount of false positives would probably outweigh the benefits of having the system in the first place.
[QUOTE=VeXan;52020401]It's been discussed before, but you could probably just run the code through a filter before it gets pushed, and if there's anything that brings up a red flag, somebody can investigate it. One of the downsides to this though is that the amount of false positives would probably outweigh the benefits of having the system in the first place.[/QUOTE] Filters can be bypassed. "Oh whoops I just happened to forget to sanitize user input, sorry about that guy wiping your database. Won't happen again."
Some sort of "package manager" as a concept is a great thought. In practice, it's not very good and wouldn't even be all that beneficial in the best of scenarios. If addons were strictly a "package" based system, then it would be the obvious direction for dependencies. However, addons are just files in folders that might be in an archived format (gma). The best way to manage dependencies is to create a "dependency" workshop/legacy addon that you force everyone to download in addition to your content. That way, YOU have full control over what is in the dependency and also minimize the duplicated code. For bigger libraries, they could work as standalone workshop/legacy dependencies. This is already how some stuff currently works on the workshop. Stargate, or CAP (Carter Addons Pack), uses a modular workshop addon system. FA:S weapons have a "core" download with others that only work when core is installed. Even wiremod has a main download with some optional extras. Honestly, this is basically a non-issue. While it is interesting to think about, it's just not a real-world possibility without massive issues that would most likely be more trouble than what it would try to solve.
Sorry, you need to Log In to post a reply to this thread.