• GMod - What are you working on? August 2017 (#72)
    224 replies, posted
You could always allow the values of the struct to be functions so that you don't have to make enums for everything.
How do you mean? Currently they are integer constants which are mapped to functions which have the predicate and stuff.
[code]net.RegisterStructure("my_struct_weps", { name = {function(sVal) net.WriteString(sVal) end, function() return net.ReadString() end}, ammo = {function(iVal) net.WriteUInt(iAmmo, 32) end, function() net.ReadUInt(32) end} })[/code] Not meant to explicitly replace the enums, but would allow for custom net.* functions and complex type behaviour as an option.
Thats basically how it gets mapped. I thought about allowing for custom read/write functions but I couldnt think of a valid use case. netStructures (TM) supports what I would consider the "valid" set of primitives but I'm open to suggestions. I'm about to make a post for it in releases. [editline]27th August 2017[/editline] [code] [STRUCTURE_INT8] = { name = "int8", predicate = function(v) return isnumber(v) and v >= -128 and v <= 127 end, write = function(v) net.WriteInt(v, 8) end, read = function() return net.ReadInt(8) end }, [/code]
[QUOTE=G4MB!T;52619345]I made a thing to replace `net.Read/WriteTable` and its actually better (size wise). :snip:[/QUOTE] That sentence in the quote really threw me off, I thought you found some magical way to do literally the same generic thing net.WriteTable does but somehow with significantly less bandwidth. I was getting ready to tear you a new one about missed edge cases and trying to fix what ain't broken. This is a pretty nice and creative way to abstractly send tables with a known structure. I love it! [editline]28th August 2017[/editline] feels almost like OOP
isn't it basically protobuf but for glua?
[QUOTE=G4MB!T;52619391]Thats basically how it gets mapped. I thought about allowing for custom read/write functions but I couldnt think of a valid use case. netStructures (TM) supports what I would consider the "valid" set of primitives but I'm open to suggestions. I'm about to make a post for it in releases. [editline]27th August 2017[/editline] [code] [STRUCTURE_INT8] = { name = "int8", predicate = function(v) return isnumber(v) and v >= -128 and v <= 127 end, write = function(v) net.WriteInt(v, 8) end, read = function() return net.ReadInt(8) end }, [/code][/QUOTE] Can people register their own "structures"?
Yes that's literally the point of it all. [url]https://facepunch.com/showthread.php?t=1576614&p=52619582#post52619582[/url] [editline]27th August 2017[/editline] Unless you mean register for your own network type then no.
[QUOTE=G4MB!T;52620053]Yes that's literally the point of it all. [url]https://facepunch.com/showthread.php?t=1576614&p=52619582#post52619582[/url] [editline]27th August 2017[/editline] Unless you mean register for your own network type then no.[/QUOTE] That is indeed what I meant.
At the moment you can't because I don't know why you would need to. If you can give me at least 1 valid use case I'll add it.
[QUOTE=G4MB!T;52621403]At the moment you can't because I don't know why you would need to. If you can give me at least 1 valid use case I'll add it.[/QUOTE] Any time you need to write an int that isn't aligned to a power of 2 or lower than 8, a matrix, a normal vector, a float, etc. Essentially, your strict enumeration system limits the efficiency the net library allows for -- the concept is great but it could really use a way to add complex networking.
Well I could add those. It supports number (double) and vector but I've never known anything else to be networked. Like I said I could add those or let the user add those. Which do you think would be better?
[QUOTE=G4MB!T;52621910]Well I could add those. It supports number (double) and vector but I've never known anything else to be networked. Like I said I could add those or let the user add those. Which do you think would be better?[/QUOTE] You should add a way for people to register their own without modifying your script imo.
Ye alright I'll work on it. [editline]28th August 2017[/editline] @code_gs Just updated it. [url]https://bitbucket.org/GamerGambit/netstructures/commits/98b74032cd3f75813632d17aac7da5b726f04338[/url] [editline]28th August 2017[/editline] Oh ye I made it so that types and structures can not share the same name because they are both used as strings, hopefully that wont be a problem.
Just added support for sequential table structures :D [code] net.RegisterStructure("my_struct_sq", {STRUCTURE_ENTITY}) net.WriteStructure("my_struct_sq", player.GetAll()) [/code] [code] net.ReadStructure 48 1 = Player [1][Gambit] net.ReadTable 104 1 = Player [1][Gambit] [/code] [editline]28th August 2017[/editline] Also, for those who want it and havent seen my post in Releases, the source is available here: [url]https://bitbucket.org/GamerGambit/netstructures/src/c8e0fe4c6e6c76deec5987e302ca541c4031d08a/lua/autorun/netstructure.lua?at=default&fileviewer=file-view-default[/url]
[video]https://youtu.be/EiwnicU4ybw[/video] More visualizers but with StarFall.
Work in progress of my UI and custom settings menu All blur is done in a single stencil pass. scoreboard and spawnmenu included. (so we aren't redrawing the blur for every single UI element) [thumb]https://i.cubeupload.com/9ru52L.png[/thumb] [thumb]https://i.cubeupload.com/FdIwmw.png[/thumb] [thumb]https://i.cubeupload.com/roNYh5.png[/thumb]
[QUOTE=bobbleheadbob;52612579][video=youtube;f91Y_vXoLic]http://www.youtube.com/watch?v=f91Y_vXoLic[/video][/QUOTE] How well is performance with say 100 units moving at once? [editline]28th August 2017[/editline] It's been a year since I last touched my rts mod. I should bring some competition. >:) [video=youtube;qLGzxJSb56Q]https://www.youtube.com/watch?v=qLGzxJSb56Q[/video]
[QUOTE=find me;52623982]How well is performance with say 100 units moving at once?[/quote] [video=youtube;mvnnaknyW6s]http://www.youtube.com/watch?v=mvnnaknyW6s[/video] EDIT: Low FPS is partly because I'm doing it on a listen server where my PC computes both clientside and serverside. Idk if this is good or not. Is it good?
[QUOTE=bobbleheadbob;52624553][video=youtube;mvnnaknyW6s]http://www.youtube.com/watch?v=mvnnaknyW6s[/video] EDIT: Low FPS is partly because I'm doing it on a listen server where my PC computes both clientside and serverside. Idk if this is good or not. Is it good?[/QUOTE] Maybe more low-poly models with extreme lod will boost a lot of FPS?
[QUOTE=rebel1324;52624738]Maybe more low-poly models with extreme lod will boost a lot of FPS?[/QUOTE] I've set the LOD to 3. Nextbots just don't like to play nice when it comes to FPS, from what I've seen.
[media]https://www.youtube.com/watch?v=Fpdn8bxvgO8[/media] Now v0.9 .. 'soon' - Raindrops will now appear on the screen, when looking into the oncoming rain. - Clientside and serverside settings for easy access. (CAMI support for server-settings) - Weather-Controller now shows what entities the map supports. - SF can now use map-bloom. - At clear night, you get a chance to see shooting stars. - Fixed shadows getting 'stretched'. - SF will now turn on/off the maps-'light_spot' doing nighttime/daytime. - SkyBox now gets scanned properly. - No temperature color-overlays. [To-Do] - Add 'rain-dust' particles - Override the env_sun and make my own. - Windsounds. - Cleanup/fix a few scripts. - Test on a few selected servers. [Gave up/look into later] - env_wind seems to only work in CS:GO and up :\ - Clouds appear to be a pain to add atm. Might come in v1.1 Places/things on the map I didn't show in the video [t]https://cdn.discordapp.com/attachments/298193993781477383/351838772851245056/unknown.png[/t]
[QUOTE=Nak;52624837]stuff[/QUOTE] Is this a day/night/weather thing? Can it replace Atmos?
[QUOTE=G4MB!T;52624894]Is this a day/night/weather thing? Can it replace Atmos?[/QUOTE] Yes, but SF scales in quality by measuring your FPS (Unless you set it manually in the settings). This allows me to add more effects without killing potato-PC's out there. It also have a system in place, to make the clients calculate the transitions. Saving on data.
Good good.. Ill take 2 please.
[QUOTE=bobbleheadbob;52624553][video=youtube;mvnnaknyW6s]http://www.youtube.com/watch?v=mvnnaknyW6s[/video] EDIT: Low FPS is partly because I'm doing it on a listen server where my PC computes both clientside and serverside. Idk if this is good or not. Is it good?[/QUOTE] You get more fps than me playing gmod with 50 addons Yeah good :v:
im working on a jedi academy/outcast/moviebattles saber system port: [video=youtube;bOrYy5N_c90]https://www.youtube.com/watch?v=bOrYy5N_c90[/video] its not perfect and alot of movement animations are still missing. The animation transitions are a bit choppy and im not sure how to fix this. im planning to add acrobatics and force powers aswell
[video]https://youtu.be/e-CU7heZs9M[/video] Working on a Car Modification shop for Monolith. It's going well so far, just gotta start with the Bodygroup system now.
[QUOTE=Nak;52624837][media]https://www.youtube.com/watch?v=Fpdn8bxvgO8[/media] [/QUOTE] A lot of particles in that video seem way too big.
Gonna throw some UI in here of recent projects for feedback! [QUOTE][IMG]https://i.gyazo.com/a1b1fcc3a248c7fe6c8ac187ef17aa3c.gif[/IMG] [IMG]https://i.gyazo.com/06dfe6e028801c04b77f25ee7eb98373.jpg[/IMG][/QUOTE]
Sorry, you need to Log In to post a reply to this thread.