• What Do You Need Help With? V6
    7,544 replies, posted
It completely depends on what you are making, Generally the first aproach+second aproach is the way to go, Pos+Dir+Owner, bullets will fly exactly the same way on all clients and the server, so they don't need to be updated after they where fired. Then for the bullets that change based on input i would send a Pos+Direction+Speed+Owner, and send an update when the input changes.
What if the client doesn't receive the create packet? Use acks?
Instead of different create packets and update/position packets, what about just an existence packet that says there's a projectile at this location etc. etc.
I've just started learning C# a few days ago using this website; [URL]http://www.freewebs.com/campelmxna/tutorials.htm[/URL] Today is my first day coding with what I learned on there(Only got to tutorial 10 so far.) but came across a problem. I have no errors in my unfinished code, yet the start button to test it is grayed out and I can't start it at all. What do I do? Sorry, best thread I could to ask this. (Using Visual Studio C# Express 2010)
[QUOTE=account;39777337]Instead of different create packets and update/position packets, what about just an existence packet that says there's a projectile at this location etc. etc.[/QUOTE] Because this ties you down to ~110 projectiles, unless you split them among packets which feels weird.
[QUOTE=WTF Nuke;39777300]What if the client doesn't receive the create packet? Use acks?[/QUOTE] Well, i wouldn't exactly know, but the only thing that's really important is that you make sure, that the client doesn't completely goes out of sync when it drops a few packets. First of all you should number your packets so that the client knows when packets aren't arriving. (packets sometimes also arrive in a different order then they where send) Secondly you could split your networking in too channels, Unreliable: Stuff like Entity position Updates that get synced 20+ times per second, can get missed once, and you get setup your engine in such a way that it interpolates/extrapolates the missed packet. Reliable: Stuff like you getting kicked, or the server changing map. Data that both is very rare and very important, atm this happens and your packet doesn't arrive you will have to rerequest the packet from the server, and cache packets until the stream can be restored again.
I feel like the need for reliable packets on each entity creation is rough. How about using multiple packets, and if a packet of those multiple is not received, then no entities get deleted. If an entity is not referenced in the packet, then it is assumed to be deleted. This way, I can have as many entities as I want, send their positions and all the information required to reconstruct the scene at any given time, and not worry about caching and the like. For reliable packets, I could just make the server require an acknowledgement from the client for those types of packets only, such as a disconnect or a kick. If enough packets are sent, such as for a kick, then the server will just stop sending packets all together.
As I've mentioned in [url=http://facepunch.com/showthread.php?t=1250048&p=39742934&highlight=#post39742934]another[/url] thread implement acknowledgement and re-transmission. If I still had my book from Computer Networks I'd show you.
Alright, but regardless of if I use acks, should I use delta transmission or position transmission? The latter may possible use multiple packets (which seemed strange to me before but I'm more open to it now).
[QUOTE=WTF Nuke;39778750]Alright, but regardless of if I use acks, should I use delta transmission or position transmission? The latter may possible use multiple packets (which seemed strange to me before but I'm more open to it now).[/QUOTE] Each pose their own problems. I'd do position, since deltas have the nasty habit of accumulating floating point errors over time. You can look at how Valve implements their net-code for ideas [url]https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking[/url]
What's the syntax in python 2.5 for Tkinter.Text widgets when you want to enter data into it and how do I change the title bar of the window in Tkinter?
[QUOTE=WTF Nuke;39777882]I feel like the need for reliable packets on each entity creation is rough. How about using multiple packets, and if a packet of those multiple is not received, then no entities get deleted. If an entity is not referenced in the packet, then it is assumed to be deleted. This way, I can have as many entities as I want, send their positions and all the information required to reconstruct the scene at any given time, and not worry about caching and the like. For reliable packets, I could just make the server require an acknowledgement from the client for those types of packets only, such as a disconnect or a kick. If enough packets are sent, such as for a kick, then the server will just stop sending packets all together.[/QUOTE] [QUOTE=WTF Nuke;39778750]Alright, but regardless of if I use acks, should I use delta transmission or position transmission? The latter may possible use multiple packets (which seemed strange to me before but I'm more open to it now).[/QUOTE] All this completely depends on what you are making. - If you have 1k entities, confirming their existence every network update is a waste - If you have a lot of entities Position transmission probably wont be efficient enough.
[QUOTE=OldFusion;39779326]All this completely depends on what you are making. - If you have 1k entities, confirming their existence every network update is a waste - If you have a lot of entities Position transmission probably wont be efficient enough.[/QUOTE] I agree, but these entities will be rapidly created and destroyed, and there will be a max of 300, so I feel that this is the easiest way to do this.
[QUOTE=OldFusion;39779326]All this completely depends on what you are making. - If you have 1k entities, confirming their existence every network update is a waste - If you have a lot of entities Position transmission probably wont be efficient enough.[/QUOTE] How is position transmission any worse than delta transmission? Why can't you batch these together? Is the collision detection being done client side? If it's only for effect it doesn't need to be synced.
[QUOTE=LtKyle2;39777354]I've just started learning C# a few days ago using this website; [URL]http://www.freewebs.com/campelmxna/tutorials.htm[/URL] Today is my first day coding with what I learned on there(Only got to tutorial 10 so far.) but came across a problem. I have no errors in my unfinished code, yet the start button to test it is grayed out and I can't start it at all. What do I do? Sorry, best thread I could to ask this. (Using Visual Studio C# Express 2010)[/QUOTE] It's because you have no startup project selected.
Stylistically are parens preferred around control-flow expressions in Python: [code] if a in b and b in c: or if(a in b and b in c): ? [/code]
Quick question, there was a small project in a list of beginner tut's that i am trying to complete, its basically asking the user to input the amount of pancakes 10 people eat, one by one, then it spits out the who ate the most. bonus, if you can get it to spit out each person's results. Now im trying to do this by arrays, and i have some semblance of a script written up here [url]http://pastebin.com/0ubKdyzf[/url] My problems, are getting the cin >> to equal each different array value, from person[0] - person[9] (no idea how to do that) And, i have no idea how to differentiate between each numbers value, without a TON of if else > < statements. Any tips?
[cpp]cin >> person[pan];[/cpp] [editline]3rd March 2013[/editline] There might be a need for some conversion to int before, though, not sure about that. [editline]3rd March 2013[/editline] Seems like there isn't a need to convert it to an int first, so you can just use that code I posted.
[QUOTE=Gulen;39782950][cpp]cin >> person[pan];[/cpp] [editline]3rd March 2013[/editline] There might be a need for some conversion to int before, though, not sure about that. [editline]3rd March 2013[/editline] Seems like there isn't a need to convert it to an int first, so you can just use that code I posted.[/QUOTE] Im sorry if i sound dumb, i haven't learned that much c++ yet; Can you explain what person[pan] does?? I dont understand why the other variable is in brackets, much less whats happening in that statement. IT does work tho, ty.
[QUOTE=Bladezor;39780822]How is position transmission any worse than delta transmission? Why can't you batch these together? Is the collision detection being done client side? If it's only for effect it doesn't need to be synced.[/QUOTE] I wasn't sure what he meant with Delta Transmissions It could be either: - The delta of the objects in the world (aka stuff that moved/changed only gets send) - The delta of the object positions (this would probably save a few bytes as you could pack it, but if the previous datagram got lost you automaticly go out of sync)
[QUOTE=Septimas;39783115]Im sorry if i sound dumb, i haven't learned that much c++ yet; Can you explain what person[pan] does?? I dont understand why the other variable is in brackets, much less whats happening in that statement. IT does work tho, ty.[/QUOTE] Yeah sure. What you're doing when you declared the int person[10], is you made an [i]array[/i] which consists of integers, and that has 10 slots. An array is like a list of variables. Had you only done int person, you'd have created one variable, of the type int (integer), but since you have the [10] on the back, you're creating an array. What I'm doing, is I'm accessing the variable at a certain slot. You can put any integer in the square brackets, and as long as the integer i in the range of the array (in this case, between 0 and 9) it'll give you the variable at that slot. And you can use it like an other variable. Since you have a for loop here, the variable [i]pan[/i] is changing for every time you go through the loop, and so you are always getting a different variable.
[QUOTE=Gulen;39783249]Yeah sure. What you're doing when you declared the int person[10], is you made an [i]array[/i] which consists of integers, and that has 10 slots. An array is like a list of variables. Had you only done int person, you'd have created one variable, of the type int (integer), but since you have the [10] on the back, you're creating an array. What I'm doing, is I'm accessing the variable at a certain slot. You can put any integer in the square brackets, and as long as the integer i in the range of the array (in this case, between 0 and 9) it'll give you the variable at that slot. And you can use it like an other variable. Since you have a for loop here, the variable [i]pan[/i] is changing for every time you go through the loop, and so you are always getting a different variable.[/QUOTE] Thank you so much! You're a godsend. I sat there last night for over an hour looking at that damn script trying to figure out how to work it. So, what you're saying is since the person[10] creates 10 different variables, 0-9 and in the for loop for (pan = 0; pan < 10; pan++) ---- That is changing the value of pan, each loop, to +1 of its previous, and since using that inside of it, would make pan = 1, or 2, etc and putting that value inside the array, allows the array to pull that value, creating the individual array values?? Just making sure im understanding it correctly.
[QUOTE=Septimas;39783442]Thank you so much! You're a godsend. I sat there last night for over an hour looking at that damn script trying to figure out how to work it. So, what you're saying is since the person[10] creates 10 different variables, 0-9 and in the for loop for (pan = 0; pan < 10; pan++) ---- That is changing the value of pan, each loop, to +1 of its previous, and since using that inside of it, would make pan = 1, or 2, etc and putting that value inside the array, allows the array to pull that value, creating the individual array values?? Just making sure im understanding it correctly.[/QUOTE] That's correct. To clarify, pan starts at 0, not 1.
[QUOTE=ArgvCompany;39783463]That's correct. To clarify, pan starts at 0, not 1.[/QUOTE] Sweet! Thanks mate. I was really stumped over how that script was working, i think now that i understand it, i could go back and do other projects a LOT easier. Cheers :)
[QUOTE=OldFusion;39783162]I wasn't sure what he meant with Delta Transmissions It could be either: - The delta of the objects in the world (aka stuff that moved/changed only gets send) - The delta of the object positions (this would probably save a few bytes as you could pack it, but if the previous datagram got lost you automaticly go out of sync)[/QUOTE] Sorry, I meant the latter. I think I'll go with all positions transmitted, and assume deleted until otherwise stated. I might run into multiple packets, but only rarely as they will get destroyed due to collisions shortly after. Thanks everyone for the help!
[QUOTE=LtKyle2;39777354]I've just started learning C# a few days ago using this website; [URL]http://www.freewebs.com/campelmxna/tutorials.htm[/URL] Today is my first day coding with what I learned on there(Only got to tutorial 10 so far.) but came across a problem. I have no errors in my unfinished code, yet the start button to test it is grayed out and I can't start it at all. What do I do? Sorry, best thread I could to ask this. (Using Visual Studio C# Express 2010)[/QUOTE] The button is probably disabled then. Try setting its Enabled property to true.
[QUOTE=eternalflamez;39784654]The button is probably disabled then. Try setting its Enabled property to true.[/QUOTE] It's a console application. I mean the green arrow in Visual Studio.
Question, In my pancake glutton project, i figured out how to list all the users who ate them etc, How do i somehow sort through all the entries, and only display the greatest and the least?? Is that possible/ [editline]3rd March 2013[/editline] And if you dont mind please explain how it works if there is such a command or something
[QUOTE=Septimas;39786020]Question, In my pancake glutton project, i figured out how to list all the users who ate them etc, How do i somehow sort through all the entries, and only display the greatest and the least?? Is that possible/ [editline]3rd March 2013[/editline] And if you dont mind please explain how it works if there is such a command or something[/QUOTE] When searching for a max or a min, you just need to know the "current" max or min, and then check each value to see if its greater(less) than it. So in C++: [cpp]int max, min; max = min = array[0]; // Set them to the first element so we have something to compare to initially for (int i = 0; i < length; i++) { if (array[i] > max) max = array[i]; if (array[i] < min) min = array[i]; }[/cpp] So we looped through the entire array, and every time we saw a value in the array that was greater (less) than the current max (min) up to that point, we made the current max (min) that value.
[QUOTE=LtKyle2;39784778]It's a console application. I mean the green arrow in Visual Studio.[/QUOTE] Uh, maybe this helps: [quote=google] I have determined the solution to this problem. When I checked my solution properties, "Multiple Startup Projects" was selected. This was a problem because one of the projects was a database project. Changing the Startup Project to "Single Startup Project" and selecting the proper project allows me to debug the solution. [/quote]
Sorry, you need to Log In to post a reply to this thread.