|
I started tooling around in Unity yesterday and I think I'm misunderstanding something fundamental somewhere. I've made a project with a sprite that you can move around, the script for which is this:code:
|
# ? Nov 19, 2013 16:02 |
|
|
# ? Jun 12, 2024 14:04 |
|
Pilchenstein posted:However, when you move it around, it seems to have inertia - it takes a second to get going and a second to stop after you stop pushing inputs. Have I stuffed up the script somehow (this is my first experience with C#) or should I be using FixedUpdate() instead? Edit: GetAxisRaw also doesn't even do the "you were pressing the input for half a frame" math that would make it actually good. Don't know if GetAxis does any of that either, or if it just smooths in an unpredictable way. Also if you want a little bit of smoothing you can change the rise/fall values for GetAxis in the Input Manager. roomforthetuna fucked around with this message at 16:26 on Nov 19, 2013 |
# ? Nov 19, 2013 16:20 |
|
roomforthetuna posted:That's something to do with the GetAxis function - in trying to make keys perform like Axes it does a little "gradual change" thing over a couple of frames. If you want immediate response use GetAxisRaw, which omits the smoothing. GetAxisRaw makes it behave like I was expecting, so thanks for that. It does occasionally seem to jump when you're moving around now though, like it's dropped a few frames - is that something to do with getting the raw input or is playing stuff inside the editor prone to the odd stutter? I've literally only got the one sprite in the scene so far, so performance shouldn't be an issue.
|
# ? Nov 19, 2013 18:05 |
|
devilmouse posted:We keep our source in git(hub) and our assets in Perforce and everything moves along swimmingly.
|
# ? Nov 19, 2013 18:23 |
|
Little update on new Unity, there seems to be a bug wherein you can't do rigidbody2D.mass=n; - it compiles and runs but the mass doesn't change. Which is a bit of a bugger for dynamically generated objects. Can't even generate a component from a prefab, only a whole object, so it's a pain in the rear end to work around too.
|
# ? Nov 19, 2013 18:38 |
|
Out of curiosity, how well does Unity handle stuttering issues for fixed timestep updates? I know that they recommend setting the 'interpolated' mode on the main character (and I assume that they always interpolate the camera), but what about other things, like slow moving projectiles? I know that if I don't interpolate frames in my own engine with a delta time of 1/60, I get stuttering on all sorts of things, not just the player. Anyone have experience with this?
|
# ? Nov 19, 2013 19:16 |
|
Orzo posted:Out of curiosity, how well does Unity handle stuttering issues for fixed timestep updates? I know that they recommend setting the 'interpolated' mode on the main character (and I assume that they always interpolate the camera), but what about other things, like slow moving projectiles? I know that if I don't interpolate frames in my own engine with a delta time of 1/60, I get stuttering on all sorts of things, not just the player. Anyone have experience with this? From my limited experience, I'd say OK as long as you aren't make huge jumps in position. Also note that what you see when you play in the editor is a bit different then a real build. I've noticed increased smoothness in web builds compared to in editor. Building to PC is the same. For some reason, the editor just likes to stutter.
|
# ? Nov 19, 2013 19:22 |
|
Yeah there are definitely quick effects and such in Drive to Hell that I can barely see in the editor that are just fine in builds. I just figured it was because building optimizes things on top of not having the editor's overhead.
|
# ? Nov 19, 2013 20:07 |
|
devilmouse posted:The biggest is that it handles the large binary files that games tend to generate without issue or having to jump through any hoops (. Then things get murkier...
|
# ? Nov 19, 2013 20:33 |
|
Meridian Rizing posted:This isn't directly game development related but it involves Unity and mesh and geometry reduction. You could use MeshLab to cleanup/reduce your meshes before importing into Unity.
|
# ? Nov 19, 2013 22:57 |
|
I'm so loving sick of the crap version of Monodevelop that Unity ships with that I'm installing Xamarin again. Of course it being the same goddamn thing it can't help but sucking fat loving balls at everything it does so now I have duplicate mono frameworks installed on my system along with duplicate Android SDKs because Xamarin is too goddamn dumb to use the one I already have. But seriously HOW DO YOU gently caress UP AN IDE THIS BADLY. Command-A for select all is a no brainer to support and not only does Monodevelop break sometimes and switch that command to be build but it NEVER allows it in other text fields in the editor like search boxes and such. Why the hell not? Who made this poo poo?
|
# ? Nov 19, 2013 23:25 |
|
I've not installed it yet, but Unity 4.3 ships with a much newer version of Monodevelop.
|
# ? Nov 20, 2013 10:39 |
|
Dirty posted:I've not installed it yet, but Unity 4.3 ships with a much newer version of Monodevelop. It also seems to be a much more broken version!
|
# ? Nov 20, 2013 13:07 |
|
Zizi posted:It also seems to be a much more broken version! Then perhaps I'll keep holding off on that install!
|
# ? Nov 20, 2013 15:33 |
|
Yeah I don't get it. Monodevelop technically doesn't exist any more, it's been rebranded as Xamarin Studio as of what would have been Monodevelop 4. But somehow Unity managed to convince them (or something?) to include a custom build which is nothing but an out-of-date version of Xamarin rebranded back to being Monodevelop. It's baffling.
|
# ? Nov 20, 2013 15:36 |
|
Yodzilla posted:Yeah I don't get it. Monodevelop technically doesn't exist any more, it's been rebranded as Xamarin Studio as of what would have been Monodevelop 4. But somehow Unity managed to convince them (or something?) to include a custom build which is nothing but an out-of-date version of Xamarin rebranded back to being Monodevelop. It's baffling. I love how default settings is tabs out to 8 and you can't tab to indent past brackets anymore. Hit Ctrl-S to convert all your code to poo poo! I'm probably going to grab my old install of Unity just so I can use the old monodevelop with 4.3.
|
# ? Nov 20, 2013 16:15 |
|
Dirty posted:Then perhaps I'll keep holding off on that install! But the rest of the enhancements are pretty drat sweet. I skirt around the monodevelop issue by using vi.
|
# ? Nov 20, 2013 17:04 |
|
xzzy posted:I skirt around the monodevelop issue by using vi. I haven't done much with Unity yet. I just installed it two days ago and haven't had time to play with it. But, I just use vim GUI with Omnisharp plugin installed. Seems to work well enough.
|
# ? Nov 20, 2013 17:14 |
|
I hope ya'll are on non-Windows machines, all this talk about developing C# code in an IDE that isn't Visual Studio.
|
# ? Nov 20, 2013 17:20 |
|
Orzo posted:I hope ya'll are on non-Windows machines, all this talk about developing C# code in an IDE that isn't Visual Studio. I write code on mac, linux, AND windows machines. xcode is probably my favorite IDE, but vi is overall easier because there's no IDE that I like that runs on all three platforms.
|
# ? Nov 20, 2013 17:25 |
|
Yeah that's cool, I was just making the assertion that if your primary dev workstation is Windows AND you're writing C#, you should be using Visual Studio and not some monodevelop garbage. Out of curiosity, why do you use all 3? Do you not have a primary workstation, or are you talking about different jobs/hobbies?
|
# ? Nov 20, 2013 17:29 |
|
Orzo posted:Yeah that's cool, I was just making the assertion that if your primary dev workstation is Windows AND you're writing C#, you should be using Visual Studio and not some monodevelop garbage. You still can't debug/set breakpoints for Unity outside of MonoDevelop can you?
|
# ? Nov 20, 2013 17:31 |
|
Orzo posted:Out of curiosity, why do you use all 3? Do you not have a primary workstation, or are you talking about different jobs/hobbies? Work machine/laptop is a mac, home machine is Windows, and the linux machine is mostly there to test compatibility. I don't actually do much Unity work on Linux, though I technically could because it has access to all my project folders. It's also my go-to environment for tinkering with new ideas, usually in python. OSX has a nice python install but it's a pain in the rear end under windows, so I just ssh into the linux box and do everything there.
|
# ? Nov 20, 2013 17:43 |
|
xzzy posted:xcode is probably my favorite IDE Look at this guy and his terrible opinions
|
# ? Nov 20, 2013 17:46 |
|
Obsurveyor posted:You still can't debug/set breakpoints for Unity outside of MonoDevelop can you? UnityVS fully integrates debugging with visual studio. The only problem I've had with it is that complex variable watches don't always seem to work correctly.
|
# ? Nov 20, 2013 18:08 |
|
Orzo posted:Yeah that's cool, I was just making the assertion that if your primary dev workstation is Windows AND you're writing C#, you should be using Visual Studio and not some monodevelop garbage. I have a Windows machine at work, a Windows machine in my office at home that I do my side stuff on + gaming and a MacBook Pro that I use for my iOS development and work on the go. I've got Windows 8 on it as well and I could do my Unity work in there but I'd rather not as I'm making a mobile game and need the whole iOS/Xcode stuff all the drat time. That's when I use Monodevelop/Xamarine. Xcode is fine for doing native Objective-C stuff but I wouldn't touch it for anything else.
|
# ? Nov 20, 2013 18:33 |
|
Yodzilla posted:I have a Windows machine at work, a Windows machine in my office at home that I do my side stuff on + gaming and a MacBook Pro that I use for my iOS development and work on the go. I've got Windows 8 on it as well and I could do my Unity work in there but I'd rather not as I'm making a mobile game and need the whole iOS/Xcode stuff all the drat time. That's when I use Monodevelop/Xamarine. Xcode is much better at C and C++ then Visual Studio.
|
# ? Nov 20, 2013 19:18 |
|
xgalaxy posted:Xcode is much better at C and C++ then Visual Studio. But my ~find in files~ and ~comfort zone~!!!
|
# ? Nov 20, 2013 19:23 |
|
I haven't coded in C or C++ in years so I'll take your word for it.
|
# ? Nov 20, 2013 19:24 |
|
Orzo posted:I hope ya'll are on non-Windows machines, all this talk about developing C# code in an IDE that isn't Visual Studio. I just used what Unity threw at me because at the time I wasn't really sure where everything was, or how using a non-Unity provided IDE would work. And I started off with UnityScript. I've just finished porting my project over to C#, though, so I don't really have an excuse now. I quite often start coding by double-clicking a script in Unity. I'm not exactly wedded to that particular action, but out of curiosity is it possible to configure Unity to send you to a preferred IDE instead? Or should I just be firing up Visual Studio myself?
|
# ? Nov 20, 2013 19:25 |
|
Dirty posted:I just used what Unity threw at me because at the time I wasn't really sure where everything was, or how using a non-Unity provided IDE would work. And I started off with UnityScript. That depends: http://docs.unity3d.com/Documentation/Manual/VisualStudioIntegration.html Yes, if you have Visual Studio Professional.
|
# ? Nov 20, 2013 19:28 |
|
xgalaxy posted:Xcode is much better at C and C++ then Visual Studio.
|
# ? Nov 20, 2013 20:00 |
|
What about any decent autocomplete for Sublime Text? The monodev text editor is terrible. Edit: or even an addin to just allow better text and file manipulation. Multi Cursors, Multi Highlighting, folder/open files list/viewer Sgt. Raisins fucked around with this message at 20:42 on Nov 20, 2013 |
# ? Nov 20, 2013 20:31 |
|
Sgt. Raisins posted:What about any decent autocomplete for Sublime Text? The monodev text editor is terrible. Depending on who you talk to here, we use ST3, Vim, or Emacs. All of them have enough auto-complete support through various packages to allow you to be as lazy as you want with Unity.
|
# ? Nov 20, 2013 20:46 |
|
Last few posts have definitely talked me into picking up UnityVS.
|
# ? Nov 20, 2013 20:47 |
|
Orzo posted:Yeah that's cool, I was just making the assertion that if your primary dev workstation is Windows AND you're writing C#, you should be using Visual Studio and not some monodevelop garbage. ... but mostly because I switch between Win and OSX sometimes, and I hate my tools changing when I do. Currently planning to move over to the Mac for mainline dev, since the iMac is waaaay faster than my aging laptop
|
# ? Nov 20, 2013 22:52 |
|
Okay, I didn't get any suggestions from the making games thread, so I'll ask here with a bit more detail. I'm currently working on basic interface in Unity for Android, and am having... not really a problem, but an unexpected behavior that's annoying. My game involves a 3D map that the player can navigate via dragging the terrain around (on PC, as you can try here, it's click+drag). This works flawlessly in the PC web player version, but the movement has a delay in the Android version using my tablet's touchscreen (it's a Nexus 10, if that matters). I don't know whether this is inherent to touchscreens, since my experience with them in a gaming context is pretty minimal, or if there's something in Unity and/or my code that's adding the delay. Again, the PC version is completely responsive and uses almost exactly the same code, so I'm quite confused. All that my script does is remember when the mouse is held down or a particular touch is maintained, remembering the previous location of the mouse or touch, and then raycast against a horizontal backdrop plane in order to determine how much to move the camera. There's probably a more efficient way to do this, but this was the easy way to code it. Here's my actual code: code:
|
# ? Nov 21, 2013 00:53 |
|
Nothing looks weird about your code (Disclaimer: I don't use US or much mobile) so I would do standard debug stuff: try the touch events in a simpler scene, try it on a different device, etc. Anyone seen this article on gamasutra about memory management in Unity? Any more expert opinion about how valid it is? In particular, what's so bad about LINQ? I use it all the time in my UI code and so far I haven't seen any performance problems though I certainly don't do anything in an update loop like his example.
|
# ? Nov 21, 2013 02:15 |
|
FuzzySlippers posted:In particular, what's so bad about LINQ? I use it all the time in my UI code and so far I haven't seen any performance problems though I certainly don't do anything in an update loop like his example. The article explains exactly what the issue is (LINQ is based on closures which require heap allocations in C#). If you haven't seen perf issues then you're just not doing anything complex enough to care, so you can safely ignore it until you can't any more.
|
# ? Nov 21, 2013 08:28 |
|
|
# ? Jun 12, 2024 14:04 |
|
I'm dodgy on this topic so bear with me. quote:LINQ has to create intermediary arrays to arrive at the final result, and doesn't have a system in place for recycling them afterwards I pool all my objects, but I would have assumed the hundreds of megs of graphics getting thrown around would always be the performance bottleneck rather than worry about thousands of KB for delegates or such (outside of some particularly egregious runaway allocation in your game loop). I'm a noob with no c++ experience so I don't have any background in memory management.
|
# ? Nov 21, 2013 10:30 |