• Unity3D - Discussion V2
    2,866 replies, posted
  • [QUOTE=KillaMaaki;52244392]Bad for performance in what situation? Are we talking one-off style events or a per-frame thing? Because for one-off events you are never going to notice a slowdown with [I]any [/I]event system (which is what it sounds like is being asked about, as for a button press in the example given). EDIT: Side note, more cloud rendering. This time it's a video :O [video=youtube;LJuQX_zqJ90]https://www.youtube.com/watch?v=LJuQX_zqJ90[/video] I'm getting much closer to being able to package this thing up and get it released. Want to work on more weather stuff but it's getting close :D[/QUOTE] I love it! Are you planning on having actual weather effects, such as rain, lightning, etc?
  • [QUOTE=Janooba;52248134]I love it! Are you planning on having actual weather effects, such as rain, lightning, etc?[/QUOTE] Absolutely. Actually, one thing I'm trying to do is make a nicely generic sound and particle system. The idea is you provide curves to particle effects and sound volumes which control the particle system's emission for a variety of parameters (cloud cover, temperature, moisture, etc). So for example you could hook up temperature curves to your precipitation and have it basically crossfade over to a snow effect as temperature drops below the freezing point. I also want to hook up sun height in the sky (rather than time of day, since TOD isn't a terribly good indicator of dawn or sunset depending on the latitude/longitude values you enter), so that you could also hook up for example birdsong vs crickets or whatever other night sounds you wanted with relative ease (plus the scripts show off how to read those values, so you could use them as a reference for stuff like turning on lights at night or whatever). I also have a built-in lightning effect, it took some work to implement but you can set the position and intensity of a virtual point light which lights the clouds (I wanted lightning bolts to appear positional, rather than just artificially brightening the clouds). Also one of the features I'm happy with is that weather is basically designed as a continuous function of position, time, and climate. At the moment it uses camera position but want to make it so you can pass a custom position offset (for example, for open worlds). And climate is a struct which contains temperature range, moisture range, and cloud cover ranges. The idea is that you could interpolate between different climate values at different times of year, and/or in different areas of your world, and also because it's a continuous function of position and time, weather events are actually persistent. So you could theoretically follow a storm as it moves through the game world. It also means you can watch storms approach from the horizon XD
  • [QUOTE=KillaMaaki;52248149]It also means you can watch storms approach from the horizon XD[/QUOTE] That's the part I like most about this whole thing. Watching an impending storm roll in is something you don't really see often in games, and could really add to the atmosphere, especially in a survival game where riding through a storm might need preparing.
  • I appreciate the help from you all, but in asking my button question, I realised that I don't know as much about C# as I should, specifically what delegates are and how they work. I've got some reading material to cover that though, so I'll go over that on my own. I would like to ask if anyone here knows of any good documentation for building multiplayer games in Unity? I know, I know, I should learn to code first before jumping into multiplayer games, but I went through [URL="https://unity3d.com/learn/tutorials/topics/multiplayer-networking"]this tutorial[/URL] and it all seemed fairly straight-forward to me. However, there's a few things I don't understand how to do, like make player-classes or build a round-based gametype, so I'd appreciate any materials that focus on that.
  • New video of what I'm now calling "SkyRay". [video=youtube;ZwFfq7SLnT4]http://www.youtube.com/watch?v=ZwFfq7SLnT4[/video] - I was previously porting over atmospheric scattering code from Unity's builtin skybox. I've now got a completely new method which precalculates sun angles and ray angles into a set of 3D LUTs (64x64x64) and just samples from that texture at runtime. The new scattering is based on Eric Bruneton's precomputed atmospheric scattering method, known for being one of the better-looking methods. It tends to produce much better sunset and twilight colors (for example, it even reproduces earth's shadow on the atmosphere at sunset). An editor utility is provided which allows people to compute their own, based on custom planet radius, atmosphere radius, atmosphere density, scattering wavelengths, atmosphere color, etc. - For a while I had automatic sun colors based on rayleigh scattering. Now I've gone back to a custom gradient, but you can now auto-generate a gradient from rayleigh scattering, and then go in and manually tweak. For example, in the above video I've tweaked the sunset colors for a slightly more saturated orange. - Showing off the weather system with a storm cloud rolling in and raining over the player. Particles and sounds can be easily tied into various values driven by the weather engine (cloud cover, moisture, temperature, etc).tc). Also, the cloud rendering has been verified 100% compatible with WebGL 2.0 (requires ES3.0 or higher, so it doesn't work in WebGL 1.0) [B]EDIT so I don't just make a double post.[/B] MOON PHASES! And also better moon position calculation. [t]http://i.imgur.com/jkMKTTa.png[/t] Just ended up doing a dot product of sunlight direction with spherical normal map. Turns out it's relatively accurate to real-world moon phases (checked with online lunar calendars), and I didn't even have to try and find an algorithm for moon phase calculation. It just works. Also using a whole new CelestialBody system. My sun and moon now go through the exact same code, but with different parameters which define their orbits (as well as the starfield, which now rotates independently of the sun). Which also means custom planets with custom orbits can be passed into the same calculations. Which is awesome.
  • Do many/any of you compile your scripts exclusivelly to DLL's? And then use these in Unity
  • [QUOTE=Fourier;52377270]No Richy19, why?[/QUOTE] I just wondered what the workflow was for most, I find using DLL's make it neater and let you use newer features (this may be mute in newer versions of unity) but come with some downsides (mostly the click-logger kinda breaks)
  • Hello, what is best way to do code multiplayer in Unity? I want multiplayer to be like in CS:GO. I want to do MP, where: - server is authoritative, - players only send commands where they want to go (WASD), server simulates and corrects players - client-side prediction - lag compensation, server simulates for each player Any suggestions? Would appreciate any links to assets/libraries/tutorials. [QUOTE=Richy19;52382350]I just wondered what the workflow was for most, I find using DLL's make it neater and let you use newer features (this may be mute in newer versions of unity) but come with some downsides (mostly the click-logger kinda breaks)[/QUOTE] Ahh ok :). Yes, it might be neater also in performance sense, since you don't need to recompile everything every time. But that is good only for stable code.
  • [QUOTE=Fourier;52393064]Hello, what is best way to do code multiplayer in Unity? I want multiplayer to be like in CS:GO. I want to do MP, where: - server is authoritative, - players only send commands where they want to go (WASD), server simulates and corrects players - client-side prediction - lag compensation, server simulates for each player Any suggestions? Would appreciate any links to assets/libraries/tutorials. [/QUOTE] It's been a few days so I'm not sure if you've already found a solution, but the built-in Unity networking seems like it would work for you. Have you checked it out much?
  • [QUOTE=Fourier;52393064]Hello, what is best way to do code multiplayer in Unity? I want multiplayer to be like in CS:GO. I want to do MP, where: - server is authoritative, - players only send commands where they want to go (WASD), server simulates and corrects players - client-side prediction - lag compensation, server simulates for each player Any suggestions? Would appreciate any links to assets/libraries/tutorials. [/QUOTE] This is basically the 'default' multiplayer configuration. I think you'll find that nearly all popular plugins to be suitable, or simply use Unity's UNET.
  • Thinking about doing something like this but open source [url]https://www.assetstore.unity3d.com/en/#!/content/3931[/url] Wondering about turning a font into a mesh and how much effort that is.
  • Just in case anyone isn't aware already, Unite keynote will begin in less than an hour. [video]https://youtu.be/-jZdMFPACpU[/video]
  • Wow, that keynote. I almost regret posting it. It's been nothing more than "here are some features that will come sometime soon possibly I don't know." And "This is a $30 game, we need to make it free to play, How can I make money on it?" They forgot to mention that cloud build and collaborate will not be free anymore (after October it'll be 9$/month).
  • The networking solution Forge Networking Remastered became open source a few days ago. [url]https://github.com/BeardedManStudios/ForgeNetworkingRemastered[/url] So that's neat.
  • [QUOTE=sarge997;52408050]The networking solution Forge Networking Remastered became open source a few days ago. [url]https://github.com/BeardedManStudios/ForgeNetworkingRemastered[/url] So that's neat.[/QUOTE] sarge997 is this better than Unitys native API?
  • I haven't used UNet enough to properly say. Only time I've used UNet was a year or two ago, when it was relatively new, and by new, I mean it was full of bugs. That's not saying Forge doesn't have problems either, I'm sure it has plenty, but at least now since it's open source, it should be improved quite fast? I'd say it's worth trying at least, if you're looking for a networking solution.
  • [QUOTE=Fourier;52409374]sarge997 is this better than Unitys native API?[/QUOTE] an often forgotten feature is the fact that it's open-source. if you have trouble understanding why something is not working right you'll be able to step line-by-line and possibly modify it if it doesn't work the way you'd like.
  • With open source thing I agree deeply. Also documentation is not that bad at all.
  • Where's a good place to start learning unity, like well rounded wise not just how to make a specific program or game? I've done a few things on their website and i'm familiar with the UI. Just trying to learn C# and how it relates to the objects i'm creating.
  • [QUOTE=Parakon;52415926]Where's a good place to start learning unity, like well rounded wise not just how to make a specific program or game? I've done a few things on their website and i'm familiar with the UI. Just trying to learn C# and how it relates to the objects i'm creating.[/QUOTE] [url]https://cgcookie.com/learn-unity/[/url]
  • Ballistics with walls of increasing density: [vid]https://i.gyazo.com/277ac6a3131d77fc93476c77bdb6f369.mp4[/vid] A question with those with more experience in Unity; Currently this is based on Update and deltaTime. Would it be better to use FixedUpdate for this?
  • [QUOTE=spiritlol;52422615]A question with those with more experience in Unity; Currently this is based on Update and deltaTime. Would it be better to use FixedUpdate for this?[/QUOTE] Depends. Unity does physics in fixed update so that the total amount of calculations done doesn't increase with framerate, you might want to do the same. Then only interpolate in normal (per frame) update for visual effect.
  • [QUOTE=spiritlol;52422615]Ballistics with walls of increasing density: [vid]https://i.gyazo.com/277ac6a3131d77fc93476c77bdb6f369.mp4[/vid] A question with those with more experience in Unity; Currently this is based on Update and deltaTime. Would it be better to use FixedUpdate for this?[/QUOTE] Visually it will be more appealing with update/lateupdate physically it will act better in fixedupdate
  • [QUOTE=Fourier;52425458]Visually it will be more appealing with update/lateupdate physically it will act better in fixedupdate[/QUOTE] FixedUpdated
  • Thanks for the input. I'll probably switch to fixedupdate as they are only visible in that video for debugging purposes. Edit: Moved it over to fixedUpdate and also updated the penetration to be more reliable at detecting the depth of the object the bullet struck. An added benefit of moving to fixedUpdate was I was able to make more accurate but less visually impressive slow mo for debugging by delaying the updates via a counter. While the slow mo I used in the video I posted above looks very nice it does not matchup 1 to 1 with the outcomes at normal speed.
  • How would i go about changing a button argument through script? [IMG]http://memestatic.fjcdn.com/pictures/Dont+mind_e53b3f_6319711.jpg[/IMG]
  • [QUOTE=keeperman;52427925]How would i go about changing a button argument through script? [IMG]http://memestatic.fjcdn.com/pictures/Dont+mind_e53b3f_6319711.jpg[/IMG][/QUOTE] Don't think you can change the parameter you entered in the inspector via script. You can add a new one via button.onClick.AddListener(() => { MyFunction(myParameter); })