Starting work on a 2d multiplayer game in unity. Ill be doing the transport layer and up networking myself because i just love doing that kinda stuff.
Had a few questions:
I want each server to support at least 200 players simultaneously, which ive achieved before in weaker engines (namely game maker 7 and 8). A problem ive encountered in the past is if a player spams movement packets by rapidly tapping left and right they will desync from the server because of the traffic they are generating. Is there a reliable way to get around this? I dont want to interupt players who accidently do this, but i definitely want to interupt players who are purposefully trying to fuck with the server.
Second question is about server sided collisions. I want to make the server in c++ or c#, what is the best way to mirror the collision boxes from the map for enemy and player movement? Obviously the server only needs the position and sizes, while the client has graphics. Store them in a file and load them intk the client and the server?
Send regular updates of where players are supposed to be
Anyone knows how to change the baudrate of an ESP8266 WIFI chip (version 1.2.0.0) ? I have used the "AT+IPR=9600" command. It worked well. I could then send data and receive data at this new baudrate. However, upon restarting the ESP8266 (AT+RST), it is now apparent that it has become bricked. The blue LED won't stop flashing. What caused it, how can I prevent it and how can I safely change the baudrate ?
I have seen people online say that you have to use the "AT+UART_DEF" command. However, this appears to be outdated as it does not work on my current ESP8266 version.
Thank you for the help !
Has anyone found any sort of testing framework that actually works for unity asset development? I'm drowning in stress half the time because some weird gotcha on some obscure platform fucks up the functionality and I can't dog my support tickets 24/7.
Is there any way in C++ to use a variadic template to pass a partial list of parameters, and for the remaining missing parameters to fall back on the default values (as per the function declaration?)
For example
void Foo(int number = 0, bool flag = false, std::string name = "qwe") {
// do things;
}
template<typename... Args>
void Bar(Args &&... ax) {
Foo(std::forward<Args>(ax)...);
}
In the above example, if I call "Bar()" with only 1 or 2 arguments, when the program reaches "Foo()" it won't use the default parameters specified, it will just be junk memory.
Working with Electron, and I'm trying to fill all of the monitors with one window. Here's the data I can work with using electron's screen module:
{ id: 2528732444,
bounds: { x: 0, y: 0, width: 3840, height: 2160 },
workArea: { x: 0, y: 0, width: 3840, height: 2130 },
size: { width: 3840, height: 2160 },
workAreaSize: { width: 3840, height: 2130 },
scaleFactor: 1,
rotation: 0,
touchSupport: 'unknown' }
{ id: 2779098405,
bounds: { x: 3840, y: 1069, width: 1920, height: 1080 },
workArea: { x: 3840, y: 1069, width: 1920, height: 1080 },
size: { width: 1920, height: 1080 },
workAreaSize: { width: 1920, height: 1080 },
scaleFactor: 1,
rotation: 0,
touchSupport: 'unknown' }
What would be the best way to use this data to create a rectangle that covers all of the monitors? I'm a bit too meat headed at the moment to think of a proper solution.
I'm not familiar enough with Electron to know for certain but it sounds like you're just going for one single rectangle across all monitors, right? Then you'd just want to iterate through all the monitors and take the highest x/y values + the largest width/height values and raw a rectangle from 0, 0 to mx+mw, my+mh I think.
Does anyone here believe in the balmer peak?
So say I have a massive list of recipe ingredients that I'd like to search through. I'm talking ~20,000 recipes with ingredient phrases for each such as ['1 cup Coconut Milk', '1 Packet Coromega Max Coconut Bliss', '3/4 cup Plain dairy, coconut or soy yogurt'] etc.
How do I create a comprehensive list of all ingredients from phrases like this without extracting each food keyword one by one?
Assuming you're storing this data in a database that you own, I would extract the ingredients and the amounts in some sort of new table and join them with recipes. I can't think of a better way than to extract them somehow. I feel like this is the right solution, but someone's gotta be smarter than me that can come up with something more helpful.
My google-fu skills have been pushed pretty far on this one.
I'm building a WPF application. It just deserializes an xml, and provides a ui to edit it. My view model setup was working out decently until I ran into this problem.
Let's say I have model "Animal" with "Dog" and "Bird" inheriting from it.
In my viewmodel, I have property
public ObservableCollection<Animal> Animals {get; set;}
I display each animal in a listview, but for birds, I want there to be a checkbox for "CanFly" (penguins and shit). How could I set up my viewmodel and binding to do this?
I've got a question that's had me stuck - it's related to my build system and my toolchain and all that fun jazz.
I'm adding to my allocation subsystem in VPR a debug visualization: VulpesRender/DebugVisualization.hpp at master · fuchstraumer/Vul..
Under the hood it uses ImGui - but the problem is that I can't figure out how to use ImGui in DebugVisualizationImpl without having vpr_alloc compile the ImGui sources or link to an ImGui library/DLL. I can't really do that, because if I add ImGui to vpr_alloc in either fashion it creates potential problems when I link to it or use it in projects that use/link to vpr_alloc at a higher level.
I'm stuck as hell and can't figure out how to handle this. I'm guessing my best bet is just to present an interface through which once can retrieve the data you'd need to render the debug visualization, but not actually record any ImGui commands in the debug visualization itself.
Hey, has anyone tried adding a run script to a PBX project from C# (Unity)? The PBX library built into unity doesn't support that. I'm trying with a python module, which works, but I need to call it from IronPython, and that gives me trouble. My exact same script works if I run it from python 2.7, but running it in IronPython gives me an error telling me bytes must be within range 0-255. I have the same 2.7 modules in my iron python site-packages folder.
To answer my own question, I found this: https://bitbucket.org/Unity-Technologies/xcodeapi/src/stable/Xcode/PBXProject.cs
Why they haven't released this to Unity 2018 yet, I don't know. Or maybe I will find out soon, I will test out AppendShellScriptBuildPhase now and see if it works.
Any help would be really appreciated,
I'm hoping someone can provide insight or advice as to my issue I'm having:
Project code here: https://github.com/Wackojacko10101/model_loading
I've hit a road block I haven't been able to solve myself,
I'm trying to take:
https://github.com/JoeyDeVries/LearnOpenGL/tree/master/src/3.model_loading/1.model_loading
http://ogldev.atspace.co.uk/www/tutorial38/tutorial38.html
The base of my code is 1 while I'm trying to take the model and "skinning" code from 2 to recreate the behavior of 2 in 1.
As far as I can tell the values for uniform "gBones" in the vertex shader ( model_loading/1.model_loading.vs at master · Wackojacko10101/mod.. ) aren't functioning as I expected, the transforms are there (I've confirmed this using getMat4:line 140 of model_loading/shader_m.h at master · Wackojacko10101/model_loadi.. )
but for any "gBones" index other than 0, it seems to be all 0s (rather than the value I'm providing) because those limbs all converge on the centre of the camera at all times for any value.
I think I'm setting up correctly:
The bone indexes and weights in model.h line 170 to 209 model_loading/model.h at master · Wackojacko10101/model_loading ..
The mesh buffers correctly in mesh.h (I added Vertex Attribute Arrays for position 5 and 6) line 140 to 144 model_loading/mesh.h at master · Wackojacko10101/model_loading ·..
The uniform values for "gBones" https://github.com/Wackojacko10101/model_loading/blob/master/main.cpp Line 125 to 134
Applying the transform in the vertex shader model_loading/1.model_loading.vs at master · Wackojacko10101/mod..
but rather than the model in the expected T-Pose (all bone transform matrices are meant to be set to the identity matrix so no change to it's position),
I get: (his limbs all converging on the point [0.0f,0.0f,0.0f])
https://files.facepunch.com/forum/upload/243470/0551728e-ecc8-40bd-9b2d-2c2b1169652e/image.png
Debugging OpenGL stuff can be tricky, I was once in your shoes as well.
Try to think of all the places the error could originate.
There could be an issue with the animation logic, setting the bone transforms on the GPU, or even the bone ID's/weights.
I recall following those tutorials as well and at one point my version of ASSIMP had issues (needed to update it) and another time 1 model animated fine while another did not.
@Karmah NSight is a great tool (Thanks for suggesting that), I've spent the last 2 days fiddling around in it
I've been able to confirm that the Bone Matrices are being set as I expected,
I've even been able to view the buffers to confirm the weights and indexes are there as I expected:
https://files.facepunch.com/forum/upload/243470/01d2882f-a331-4b9c-a511-993ebbf046ca/image.png
but I haven't been able to hit a break point in a shader =( (that would have been the ultimate tool to tracking down this issue), so I'll keep trying to figure out if that's possible.
Yeah shader debugging is even more tricky. The only real way I know how to debug a shader is to really comment out large chunks of it and work on a few variables at a time, letting it do a specific output.
I'm trying to figure out the math of how to do wall collision
The way I've always done it is: get the intersection of the move vector and the wall line segment, then move the player to the point of collision (or a few pixels off) so that the player stops at the wall. Now i want the player to slide against the wall if he moves toward to wall but slightly looking to the left or right.
In my head, the way I think it should work is:
1.) Player move vector intersects wall segment
2.) Calculate intersection
3.) give player like, 6 inches of space away from the wall
4.) calculate a vector with 6 inches of magnitude and a theta which is perpendicular to the wall segment, but still towards the player
5.) Move player to the end of this new vector
I went through step by step, breaking down the vertex shader into all the parts that could be causing me issues,
found the issue, something strange is going on the later values in the bone index values attached to vertexes.
Not gonna claim to understand why it's happening or that I've solved it,
I just have a work around for now,
changed the CPU side values for the bone indexes for vertexes to be vec4 (formally ivec4).
changed the GPU to cast the bone index values from float to int before accessing the bone transform array. (I have this sinking feeling this is a BIG performance hit, not that I care here)
I'm happy to have just found a work around,
I really appreciate pointing me towards NSight and the tips @Karmah ,
Thanks, for your help.
It's probably not that big of a performance hit - but be REALLY careful with implicit casting in glsl shader code. always favor explicit casts as you can get extremely fucky behavior otherwise. I highly recommend this extension to give you linting and warnings about this in Visual Studio:
https://github.com/danielscherzer/GLSL
Also be careful to not be copying data out of the bone matrices, as that'll really slow your shader down. I think Karmah was doing the same.
Lastly, NSight is good but I've had better experiences with RenderDoc. I'd recommend installing that and giving it a look as well.
When using persistent-coherent mapped buffers with both the READ and WRITE bits enabled, are sync-fences ever needed when reading back data from a persistently mapped buffer (assuming the only changes are done by the cpu, not the gpu)?
Like, lets say I write to the buffer from the CPU, and then want to read it back immediately, is it guaranteed to always return exactly what I just put in, or does the GL driver have to do any validation and can it get stalled?
In order to keep my code short and consise, I frequently store the pointers to individual entries in a mapped buffer and write to them, rather than storing local copies and writing them back into the buffer. (I made a helper-class that is like an stl vector / dynamic array, which encapsulates a persistently mapped buffer)
if it's coherent, then no. writes from host or device should both be visible to the other, and there should be no need for sync fences afaik. this is based mostly on what i know about Vulkan equivalents though, so I can't make any guarantees about how OpenGL handles it.
i will offer a diamond to anyone who tells me how this piece of code is incorrect
for (int row = 1; row < numRows-1; row++){
for (int col = 1; col < numCols-1; col++){
arrayNew[row][col] = ((arrayInit[row-1][col] + arrayInit[row+1][col] + arrayInit[row][col-1] + arrayInit[row][col+1])/4.0);
this is from the hotplate problem in C, so basically what it should be doing (to my understanding) is calculating an average from the top, bottom, left, and right elements in the array while ignoring the first and last rows and columns
now assuming this is in a while loop, why does this bottom out at a high value i.e 70 instead of approach 0 like it should? am i misunderstanding the math here?
If this piece of code is in a while loop then the result wil never change.
Check where you are storing the result and see if you can spot the issue.
i wasn't assigning the change outside of the loop
working now
hi, don't know if this is the place to ask but i need help with macros / excel.
what i have is a list of dates but they are in the format "ddmmyy" and i want to make them "dd/mm/yy" so that excel will accept it as a date and i can start to filter them. what i want to do is very simple, i just need to select a cell, press f2 to edit, move left 2, insert a forwardslash, move left 3, insert another forwardslash, and enter to move to the cell below. however when i record a macro it takes that literally so if i change the date to 01/01/18 on the first one it will change all of them to 01/01/18. there's like a thousand cells to go through across different workbooks, if someone could simplify this down id very much appreciate it
I'm trying to get the apparent perspective/side of a sprite based on the current position and look theta of the camera, and the direction that the sprite is turned. I did this before but I forgot how... It had something to do with the dot product of the vector created by looking at the sprite, and the vector of where the sprite is currently looking... I don't remember exactly how though. Anyone have any ideas?
Figured it out. acos(A * B), with a correction involved depending on which side the player is on.
https://my.mixtape.moe/xxywfc.mp4
Here's a mario sprite driving around. idk if you can see it in the video but there's wall collision on NPCs as well. Any jitters in the sprite animation is because I got lazy cutting the sprite out from the sheet and mario isn't centered in his image.
seems like these lads would do the job
Excel CONCATENATE function and "&" to combine strings, cells, co..
Excel substring functions to extract text from cell
Sorry, you need to Log In to post a reply to this thread.