[QUOTE=KillaMaaki;45866697]I think in my own game there are only ever two situations in which I need to send an event [I]just[/I] for playing a sound, and that's:
A.) When a character speaks
B.) In-game announcer
Because both cases are controlled by the server, and for most of them the client doesn't have enough information to play the sounds based on other events.
For both of them, I use an enum which the receiving end (the client) actually does a ToString on and uses as a key into my custom audio system (I guess the closest equivalent would be Resources.Load?). So basically each enum entry is sound name. Maybe not the totally correct way to do things, but it was super easy and I was being kinda lazy.
[editline]1st September 2014[/editline]
Yeah, so? Is there anything wrong with that? Other than the fact that each player hears a slightly different oink variation?[/QUOTE]
A case where you can actually '[b]stream[/b]' sound is for when a player chats via mic. Other than that I can seldom think of any scenario where a user can't play a pre-existing sound upon an event.
Anyways, so I have the Bolt Master branch from Git, and it fails to run Build.bat because it won't load 'FakeLib.dll' inside of the FAKE\tools\ folder. It's there. I've checked. Fjholm told me it may have been because I don't have the .NET framework (4.x) installed (I have Windows 8 which auto-updates .NET to 4.5). Is there any other case why it fails to load the DLL? I could just wait until the next version with the .unityPackage, but I'm somewhat pressed on time to get stuff done.
Do you have the exact error message handy? Or a screenshot?
[QUOTE=sarge997;45866673][B]Oh my god, I'm so stupid... You're completely right layla.[/B]
But I do have one more question.
I'm trying to play random sounds, such as footsteps *But in my case, pig oinks* how can I atleast play the same sound for everyone? Right now I'm using Random.range, but obviously since it's running a different version for each client, it plays different sounds.
Here's my code.
[code]using UnityEngine;
using System.Collections;
public class Snorting : MonoBehaviour
{
public AudioClip[] sounds;
void Start ()
{
float oinkTime = Random.Range (3, 20);
InvokeRepeating("Snort", 0, oinkTime);
}
void Snort ()
{
audio.pitch = Random.Range (0.85f, 1.08f);
audio.clip = sounds [Random.Range (0, sounds.Length)];
audio.Play();
}
}
[/code][/QUOTE]
Generate the random sound on the client and then send it to the server and back to clients; super delay and unsafe from what I can understand
Generate the sound on the server and have it play at the player's position? Might have some delay though for distance.
I also have no idea or experience with networking so that's my guess!
If your random functions are deterministic, you can just send the seed out to everyone and guarantee the same sound will be generated on all clients. I don't know about the Unity random functions, but System.Random is deterministic.
The bigger question is whether that's even necessary (do you NEED each client to hear the exact same thing?)
Might add a little personality.
Do it with a global event that sends the pitch and the sound index.
[QUOTE=thomasfn;45867955]If your random functions are deterministic, you can just send the seed out to everyone and guarantee the same sound will be generated on all clients. I don't know about the Unity random functions, but System.Random is deterministic.[/QUOTE]
I guess if you just seed off of the server time and send that out it would work fine actually. Totally overstepped that little bit ;)
I need to write a character controller that supports high velocity movement and networking, I have a feeling straight raycasts won't work very good, what are some other methods I could use for detecting collisions at a high velocity?
You can ray-trace spheres/capsules
That's perfect, I had no idea Unity supported that. Cheers.
Heh, Unity works pretty fast sometimes. I submitted the bug that in DX11 with Autoconnect Profiler enabled the timestep gets screwed up, and apparently today they've already fixed it and it will be in the next major version of Unity (Unity 5??)
So, I've been using TNet for quite some time now. Should I switch for Bolt? If so, why?
[QUOTE=cam64DD;45871308]So, I've been using TNet for quite some time now. Should I switch for Bolt? If so, why?[/QUOTE]
Depends on your needs. If you want to write highly server-authoritative code for twitch-reaction games then Bolt is the better choice. If you're just writing, say, a little cooperative puzzle game or something for mobile then TNet is fine.
Used to be that uLink was the better option for fast-paced games and server-authoritative netcode, but I think Bolt is quickly becoming the cheaper/better option.
Bolt is frustrating sometimes, it needs a stable release. I've got a frankenstein bolt code base after fixing shit for myself. Though, that's mostly because I am using the dev branch. One thing I do miss about the old version is the prefabs attached that were instantiated no matter the map loaded, sure I can do that myself easily but it was nice to have something to do it for me.
I can't wait for the headless servers and virtual lan. Assuming fholm does end up adding them.
Headless server is already possible...? You can just make a special "server" build of your game which just reads from, say, a config file and immediately starts a server and loads a map on startup (that's how it was done in uLink), which starts up in headless mode.
As for virtual lan, I'd be really curious to know what that is. According to Wikipedia it's exactly what it sounds like, but I don't know why Bolt would need to do this...
I didn't know Unity had a headless command, I was talking to fholm about it and he said he was working on both(of course they are not definite features just yet). Not sure what he was referring to.
He only touched on the virtual lan and I can't remember exactly what he said but if I remember correctly it allows you to host a server to route connections allowing players to connect to each other with closed ports.
[URL="http://overdrive.freevar.com/Unity/WebPlaya3.html"]Here's a game I'm working on.[/URL]
It's going to be a team-based FPS where players will be able to fully customize their loadouts, thus creating their own classes.
For now, there are three weapons in: A rocket launcher, a grenade launcher and a truncheon.
I tried to make the game physics very arcade-y.
What do you guys think? Suggestions?
Also, for some reason, the game lags an awful lot on the webplayer. Is that just me?
It's 60FPS for me.
The physics overall feel very "mushy", which is probably not at all what you want for arcade-like physics. It should feel snappier, more responsive, and faster as well.
You might want to check out the Quake 3 source code for ideas on character physics. PM me if you'd like some translated snippets.
[QUOTE=cam64DD;45873219][URL="http://overdrive.freevar.com/Unity/WebPlaya3.html"]Here's a game I'm working on.[/URL]
It's going to be a team-based FPS where players will be able to fully customize their loadouts, thus creating their own classes.
For now, there are three weapons in: A rocket launcher, a grenade launcher and a truncheon.
I tried to make the game physics very arcade-y.
What do you guys think? Suggestions?
Also, for some reason, the game lags an awful lot on the webplayer. Is that just me?[/QUOTE]
Doesn't lag on my toaster.
You allow too much air control. That's a design problem, not an issue of realism. Corner abuse is too simple.
[QUOTE=Drury;45873661]Doesn't lag on my toaster.
You allow too much air control. That's a design problem, not an issue of realism. Corner abuse is too simple.[/QUOTE]
I just gave him some code snippets from my game (plus as much explanation as I could fit into the character limit) which were translated from Quake 3. Part of it should give him a configurable amount of air control (so anywhere from zero air control to lots of air control, with a single parameter)
Yap! I'm currently working on that.
Thanks for the help, guys. Let's see how this goes...
[QUOTE=KillaMaaki;45867247]Do you have the exact error message handy? Or a screenshot?[/QUOTE]
Yeah. Here it is. Sorry for late response.
[code]error FS0193: Could not load file or assembly 'file:///C:\Users\-snip-\
Documents\Projects\bolt-master\FAKE\tools\FakeLib.dll' or one of its dependencie
s. Operation is not supported. (Exception from HRESULT: 0x80131515)[/code]
Ah, you guys were right! Movement was a bit awkward. I guess I had gotten used to it, so I didn't really notice that.
I have changed my character controller script. Instead of ditching the rigidbody completely, I have changed my rigidbody-based character controller script, according to some of the concepts KillaMaaki explained to me. The player now has a much faster acceleration, and I am currently fixing the excessive mid-air control. This is hopefully going to fix some of the problems you guys mentioned!
Once again, thanks for the help, guys.
Just as a sanity check, try copying the whole path (starting at "C") minus the actual DLL and pasting it into Windows explorer.
If that doesn't work, try moving the whole folder to a different location. Like, say, create a Project folder at the root of your C drive and move the bolt-master folder there and try again.
[editline]2nd September 2014[/editline]
[QUOTE=cam64DD;45875060]Ah, you guys were right! Movement was a bit awkward. I guess I had gotten used to it, so I didn't really notice that.
I have changed my character controller script. Instead of ditching the rigidbody completely, I have changed my rigidbody-based character controller script, according to some of the concepts KillaMaaki explained to me. The player now has a much faster acceleration, and I am currently fixing the excessive mid-air control. This is hopefully going to fix some of the problems you guys mentioned!
Once again, thanks for the help, guys.[/QUOTE]
One thing to note is that if you go with rigidbody, you won't be able to implement server authoritative networking.
[QUOTE=KillaMaaki;45875063]
One thing to note is that if you go with rigidbody, you won't be able to implement server authoritative networking.[/QUOTE]
oh shit. Why not?
[QUOTE=cam64DD;45875103]oh shit. Why not?[/QUOTE]
Character controllers can be stepped at any time (via the Move method), which is necessary in order to implement Source engine style clientside prediction. The same cannot be said for rigidbodies.
[QUOTE=KillaMaaki;45875160]Character controllers can be stepped at any time (via the Move method), which is necessary in order to implement Source engine style clientside prediction. The same cannot be said for rigidbodies.[/QUOTE]
Aw darn. Guess it's time to scrap rigidbodies then..
[QUOTE=KillaMaaki;45875063]Just as a sanity check, try copying the whole path (starting at "C") minus the actual DLL and pasting it into Windows explorer.
If that doesn't work, try moving the whole folder to a different location. Like, say, create a Project folder at the root of your C drive and move the bolt-master folder there and try again.
[editline]2nd September 2014[/editline]
One thing to note is that if you go with rigidbody, you won't be able to implement server authoritative networking.[/QUOTE]
Yes the UNC path terminates to the correct destination, both in Command Prompt and in File Explorer. I also tried moving the project to another path, but same results. And I've been running the .bat script in Administrative mode, so it wouldn't have been folder permissions that would've gotten in the way if the folder permissions from the location I ran it from ended up affecting the outcome.
[code]C:\Storage\bolt-master>.\FAKE\tools\Fake.exe Build.fsx
error FS0193: Could not load file or assembly 'file:///C:\Storage\bolt-master\FA
KE\tools\FakeLib.dll' or one of its dependencies. Operation is not supported. (E
xception from HRESULT: 0x80131515)[/code]
Hey, right click the DLL and hit "Properties". Do you see a message at the bottom of the window saying "This file came from another computer and might be blocked to help protect this computer"?
[QUOTE=KillaMaaki;45875456]Hey, right click the DLL and hit "Properties". Do you see a message at the bottom of the window saying "This file came from another computer and might be blocked to help protect this computer"?[/QUOTE]
Thanks. That did it. Hate that new Windows feature.
Sorry, you need to Log In to post a reply to this thread.