|
Orzo posted:Why is it only 50% of the time that both spheres get destroyed? It seems like it should be 100%, if both spheres are blue, and Unity consistently messages both game objects during collision. I'm having a hard time constructing code that would produce that result without it looking clearly intended to produce that result though. Maybe something like pseudocode code:
|
# ? Jul 2, 2013 23:16 |
|
|
# ? Jun 13, 2024 01:12 |
|
Why can't I do something like: 1. If collide with object, check to see if it's sphereBlue 2. Check if you or the object you collided with is moving faster. 3. If you're moving faster, grow larger. If you're moving slower, destroy yourself. I've been trying to code that myself, but I don't know how to check the velocity of the colliding gameobject. I have something like this which is popping errors because it isn't correct: JavaScript code:
|
# ? Jul 2, 2013 23:24 |
|
the posted:Why can't I do something like: Edit: equal speed, I should say. Objects won't collide with equal velocity. roomforthetuna fucked around with this message at 01:07 on Jul 3, 2013 |
# ? Jul 2, 2013 23:29 |
|
roomforthetuna posted:I addressed that in an edit earlier. First, you can't just do a "less than" on a velocity because it's not a scalar. You could do it on velocity.length (or whatever it is Unity uses for the magnitude of a vector), but then you'd still be occasionally getting a hosed result if the two objects have equal velocity. It is not a very good solution. Hmm, okay, thanks.
|
# ? Jul 3, 2013 00:35 |
|
You should be able to cast the colliding object into the object type you think it is and then get its velocity.
|
# ? Jul 3, 2013 01:48 |
|
Suspicious Dish posted:Yes, OpenGL calls take no time at all. You're not actually rendering in most cases, you're simply batching up commands to send to the GPU. There's really only one few place in modern GL where synchronization is required: The winsys's SwapBuffers equivalent (wglSwapBuffers/aglSwapBuffers/glxSwapBuffers/eglSwapBuffers). Huh, well that makes sense but is kind of inconvenient for this I guess. Fib posted:It's possible that valgrind is just so slow that it's hiding the rendering overhead. Your own code is being valground but the GPU is running as fast as ever. Thanks for the link. I'd intended to use regular CPU profiling to see which shaders were actually taking the time before actually profiling them with GPU things but I guess it's not possible. Maybe the GPU profilers can work on a bunch of shaders at once? Incidentally, though a moot point now, I believe valgrind will compensate for its own slowdown by not sampling its own instrumentation code, thus for (synchronous) stuff the profiling won't be skewed even if some of your stuff is valground and some isn't.
|
# ? Jul 3, 2013 16:35 |
|
The whole point of the GPU is so that the CPU doesn't have to hang up or wait or calculate anything. The GPU is a graphics accelerator that takes the load off of the CPU. All that the CPU does in terms of the driver is build up commands to send to the GPU, and compile shaders. In order to see what the GPU is doing, you need to use GPU profiling tools. There's apitrace, but that's not good for app development. Every vendor has its own set of profiling tools for its own OpenGL implementation.
|
# ? Jul 3, 2013 16:48 |
|
Suspicious Dish posted:In order to see what the GPU is doing, you need to use GPU profiling tools. There's apitrace, but that's not good for app development. Every vendor has its own set of profiling tools for its own OpenGL implementation. ... but that was 3 years ago, so for all I know that's since changed.
|
# ? Jul 3, 2013 18:05 |
|
Suspicious Dish posted:The whole point of the GPU is so that the CPU doesn't have to hang up or wait or calculate anything. The GPU is a graphics accelerator that takes the load off of the CPU. All that the CPU does in terms of the driver is build up commands to send to the GPU, and compile shaders. The whole point of the GPU is to make certain stuff really fast and parallel. Obviously the way it works is fine and sane and good, but if GPU calls blocked it wouldn't be that much different in practice since you're going to have to wait for the final result at the end anyway like you said and you can always do your own threading
|
# ? Jul 3, 2013 18:30 |
|
Well this is annoying. My monogame project in VS2010 suddenly won't debug. I press F5/click the debug button, and it just grays out briefly before returning to normal. Other projects still debug just fine. I made sure the program wasn't still running in the background and tried a reboot, but nothing seems to work.
|
# ? Jul 5, 2013 01:38 |
|
DarthJeebus posted:Well this is annoying. My monogame project in VS2010 suddenly won't debug. I press F5/click the debug button, and it just grays out briefly before returning to normal. Other projects still debug just fine. I made sure the program wasn't still running in the background and tried a reboot, but nothing seems to work. I'm not super familiar with VS 2010 or monogame but are there any errors that are preventing the game from compiling? Or any messages spit out into a build log?
|
# ? Jul 5, 2013 01:57 |
|
superh posted:I'm not super familiar with VS 2010 or monogame but are there any errors that are preventing the game from compiling? Or any messages spit out into a build log? No errors at all, and there doesn't appear to be any sort of log in the build path. I also tried rolling my project back to before this started happening and still no luck. (Note: no significant changes were made anyways, just some new code in an already existing class). Edit: Well whatever the problem was, it appears to have corrected itself. Kibbles n Shits fucked around with this message at 02:37 on Jul 5, 2013 |
# ? Jul 5, 2013 02:02 |
|
Was the answer to restart Visual Studio?
|
# ? Jul 5, 2013 03:54 |
|
Yodzilla posted:Was the answer to restart Visual Studio? Not unless I had to restart it 5 or so times for it to work. Oddly, disabling the "visual studio hosting process" let me debug again, but I rechecked it because I didn't know what I was doing. Then lo and behold, it started working again for reasons. But not right away. Pretty sure it's just trolling me.
|
# ? Jul 5, 2013 04:21 |
|
I have had the solution to that kind of a problem be "reboot" before - though on a later repetition I found out the actual problem was an invisible stalled debug process (not stalled in my code, but stalled before it had even actually started the program - stalled waiting for a connection to debug or something); killing that in task manager was a quicker solution.
|
# ? Jul 5, 2013 04:27 |
|
What would be the thread to talk about game design / mechanics?
|
# ? Jul 5, 2013 08:00 |
|
Probably this one: http://forums.somethingawful.com/showthread.php?threadid=3506853
|
# ? Jul 5, 2013 08:49 |
|
Unity question time. I have a player object with a Rigidbody and Box Collider. I want to have enemies that can walk on the ground, fall off ledges, and bump into the player. I also want the player to be able to pass through enemies during a small window of invulnerability after getting hit. I also don't want player pushing enemies or enemies pushing players. I've tried a ton of combinations of Box Colliders with Is Trigger true and false and Rigidbodies Components on the enemy but I can't seem to get everything I want at once. Anyone know how I can accomplish the above? If you need a more clear picture, think Rogue Legacy enemies that walk on the ground but you can walk through them once hit.
|
# ? Jul 6, 2013 03:17 |
|
Make enemies a layer, turn off collisions between player layer and enemy layer while invulnerable.
|
# ? Jul 6, 2013 03:24 |
|
roomforthetuna posted:Make enemies a layer, turn off collisions between player layer and enemy layer while invulnerable. This works perfectly but now I have a follow up question. I'm checking for both OnCollisionEnter and OnCollisionStay so that if you are inside the enemy when you come of invulnerability, I want to you get hit again. However, OnCollisionStay isn't triggering. I can only get OnCollisionEnter to trigger or I can only get OnCollisionStay to trigger IF you move while inside the enemy. That is, if you are inside the enemy and neither of you are moving, OnCollisionStay will not trigger. Is there a solution to this? EDIT: The solution was to call Rigidbody.WakeUp() after invulnerability wears off. poemdexter fucked around with this message at 03:57 on Jul 6, 2013 |
# ? Jul 6, 2013 03:35 |
|
Unity 2d collision question: I am making a simple 2d shmup with orthographic projection camera and textured quads. In the game the z axis is only for layering. I want to do collision checking by comparing 2d bounding boxes in the x-y plane. In other words simple 2d collision. How can I do that without having to re-implement the game object cycle (update, collision checking, physics, etc.) using some sort of game manager object?
|
# ? Jul 6, 2013 07:46 |
|
Shinku ABOOKEN posted:Unity 2d collision question: Or you could use a Unity Box2D or other 2D physics port, but that would probably require pro for a plugin and it's not like the slight wastefulness of using 3D collision detection is going to make a simple 2D shmup too slow.
|
# ? Jul 6, 2013 16:09 |
|
So I've kind of hit a brick wall.. anyone got any ideas for making an articulated hand as in Surgeon Simulator? I'm guessing in that game they used an IK rig, but it's a unity pro feature so I have to come up with something else. I tried faking it using rigidbodies and hinges for a couple hours and wasn't really happy with the results I was getting. Really hoping the best solution isn't to animate in Blender and export every possible hand pose.
|
# ? Jul 6, 2013 16:22 |
|
Anyone have experience doing networking in Unity? The built in stuff seems easy to use and there's several 3rd party options. I'm wondering if I should just skip all of that and unearth my lidgren client/server and just slap it in Unity. I'm also wondering how having the physics in Unity be non deterministic is going to affect multiplayer.
|
# ? Jul 6, 2013 17:11 |
|
poemdexter posted:Anyone have experience doing networking in Unity? The built in stuff seems easy to use and there's several 3rd party options. I'm wondering if I should just skip all of that and unearth my lidgren client/server and just slap it in Unity. I'm also wondering how having the physics in Unity be non deterministic is going to affect multiplayer. I did some basic networking with uLink. The nice thing is it runs in a Unity instance so you can incorporate Unity physics into it. The bad this is it runs in a Unity instance and unless you have pro, you can't run in headless mode. The built in networking is a stripped down version of RakNet AFAIK but I've read it's not all that optimized. It all depends on how complex of a networking infrastructure you're looking at. If it's just a simple small player count game, the built in would probably be just fine. If you're wanting to go with something more complex that allows a lot more connections, one of the 3rd party options would probably be optimal.
|
# ? Jul 8, 2013 00:39 |
|
Is there any way to use position tweening with GoKit in Futile? Since Futile objects don't have transforms (that I know of) I'm not sure how it'd be possible and it just outputs an error if you attempt. e: oh you can just pass "x" and "y" into floatProp Yodzilla fucked around with this message at 02:58 on Jul 8, 2013 |
# ? Jul 8, 2013 00:47 |
|
SuicideSnowman posted:I did some basic networking with uLink. The nice thing is it runs in a Unity instance so you can incorporate Unity physics into it. The bad this is it runs in a Unity instance and unless you have pro, you can't run in headless mode. I'm thinking a coop game so no more than maybe 4 people at once. I might give it a shot. Thanks.
|
# ? Jul 8, 2013 00:58 |
|
I ran into something funny tonight with Visual Studio. I have music playing with FMOD and when a breakpoint hits in debug mode, the music stops. But when I mouse over something to inspect its value, you hear the music for a split second, presumably because the debugger is waking up the thread in order to evaluate things.
|
# ? Jul 8, 2013 05:41 |
|
Is there a good place I should start with learning physics in Unity? I'm trying to understand how they and Futile mesh together and I'm using Matt Rix's game jam project as a reference but I'm sure that I just don't get all of the concepts yet. I guess what I'd like to do is get a simple vehicle working. I guess in 2D land that'd be a box collider body, two sphere colliders for wheels and then somehow connected with springs for the shocks? Would it even be possible to have the rotation of the wheels actually power the vehicle as opposed to faking it and just applying force to the whole object?
|
# ? Jul 8, 2013 14:31 |
|
Yodzilla posted:Is there a good place I should start with learning physics in Unity? I'm trying to understand how they and Futile mesh together and I'm using Matt Rix's game jam project as a reference but I'm sure that I just don't get all of the concepts yet. I'm still pretty new to the pure Unity side, but I think it's the rigidbody component that allows things to physically exist in the game world. The colliders are just there for collisions and triggers.
|
# ? Jul 8, 2013 15:16 |
|
poemdexter posted:I'm still pretty new to the pure Unity side, but I think it's the rigidbody component that allows things to physically exist in the game world. The colliders are just there for collisions and triggers.
|
# ? Jul 8, 2013 15:29 |
|
roomforthetuna posted:The colliders determine the shape, the rigidbody just holds the velocities etc. Example: say you wanted 3 hit volumes childed to your actor. So you make 3 child objects, each with its own Collider, marked as triggers. If each of those bodies doesn't also have a rigidbody, those geoms get ripped off of those child objects and stuffed onto your main parent object. Given that OnTriggerEnter et al don't make it possible to tell what trigger was actually hit, that's real bad. So, you put a rigid body on each of the children, mark it as kinematic so that it moves along with the parent, and then you get the events you'd expect.
|
# ? Jul 8, 2013 18:16 |
|
This is probably way too specific a question, but does anyone know a good, efficient way to draw a minimap/map overview in SDL2 (for a simple, tile-based game)? I'd like it to look basically like this for the minimap: and this for the larger map: So far I've tried three different things: first, I just did the very naive thing and rendered a shitload of 4x4 coloured, square textures--this has actually been the fastest method I've tried, and it works great for the minimap but it's absurdly slow when trying to draw an entire screenful of map this way. Next, I tried using SDL_RenderDrawPoints() to just directly render coloured pixels, but it was hilariously slow. Finally, I tried creating an SDL_Surface and filling in the pixel data, then creating a texture from that so that I'd only be making one render call. This seems like it should be a lot faster, but when I tried it the constant calls to CreateTextureFromSurface() and DestroyTexture() killed performance. (I could just draw the large map once and not allow the player to do anything that could change its appearance while it's up, but I really don't want to force the game to pause just because the map's pulled up.)
|
# ? Jul 8, 2013 18:45 |
|
Verus posted:Next, I tried using SDL_RenderDrawPoints() to just directly render coloured pixels, but it was hilariously slow. Did you make sure the surface was locked when doing this? I always forgot to do that and then wondered why drawing a couple of pixels was so slow.
|
# ? Jul 8, 2013 19:21 |
|
Verus posted:Finally, I tried creating an SDL_Surface and filling in the pixel data, then creating a texture from that so that I'd only be making one render call. This seems like it should be a lot faster, but when I tried it the constant calls to CreateTextureFromSurface() and DestroyTexture() killed performance. Probably the easiest thing would be to use something like this method, but don't destroy and recreate the texture the whole time. Keep the texture around and use SDL_UpdateTexture to change the pixel data. Since that function takes a rect, ideally you can update only the portions of the texture that have actually changed since the last frame. Edit: I'm not actually familiar with SDL and its functions, it might be faster to render over the changed bits of the texture rather than using SDL_UpdateTexture if that's possible. seiken fucked around with this message at 19:28 on Jul 8, 2013 |
# ? Jul 8, 2013 19:25 |
|
So I finally started messing with GoKit which really loving owns but that got me thinking about timers and such in general. With GoKit I can create tweens, chain them, pause them, loop them, whatever and have them issue a callback on completion. The pausing is important obviously because I want to be able to pause gameplay tweens without pausing all tweens because I'll still need them for the menu overlay. Now as far as timers go, I know Unity has the Invoke command where you can specify a method to call after X seconds but this just seems really bad and sloppy as there's no way to cancel or suspend an Invoke besides settings Time.timeScale to zero which is a bad idea for a number of reasons. So for actions that I want an easily pause-able timer for does it make sense to just have GoKit "tween" something out of sight just for the callback? That way I can use the framework as a really nice controllable timer as well as for its visual tweening abilities,
|
# ? Jul 8, 2013 21:12 |
|
Yodzilla posted:So I finally started messing with GoKit which really loving owns but that got me thinking about timers and such in general. With GoKit I can create tweens, chain them, pause them, loop them, whatever and have them issue a callback on completion. The pausing is important obviously because I want to be able to pause gameplay tweens without pausing all tweens because I'll still need them for the menu overlay. http://docs.unity3d.com/Documentation/ScriptReference/index.Coroutines_26_Yield.html Unity has WaitForSeconds(float seconds) but you need to throw it in a coroutine. I hope this answers your question somewhat.
|
# ? Jul 8, 2013 21:31 |
|
I'm vaguely familiar with coroutines but haven't used them. I guess in that case if you did set something like that up you'd have to control the pausing yourself through some global variable, no?
|
# ? Jul 8, 2013 21:38 |
|
Yodzilla posted:I'm vaguely familiar with coroutines but haven't used them. I guess in that case if you did set something like that up you'd have to control the pausing yourself through some global variable, no? Well I think this would be more if you knew exactly how long and when to pause outside of doing it within the tween chain. Are you talking about sorta pausing tweening to have maybe some UI menu come up. Like a global pause button?
|
# ? Jul 8, 2013 21:41 |
|
|
# ? Jun 13, 2024 01:12 |
|
Yeah basically what I'm doing now is when I create my tweens I'm grouping them into lists of game tweens and menu tweens. While in gameplay when you click the pause button to open the menu I'm pausing all game tweens but allowing the menu tweens to keep running. That way poo poo doesn't keep sliding around in the game world while you're paused. I was thinking that combined with the completion callbacks could make a really easy to use and easily to manipulate set of timers instead of relying on coroutines. I'm more just putting the idea out there instead of asking a question. I guess I'm more wondering if it's a good idea or if there are any downsides.
|
# ? Jul 8, 2013 21:47 |