|
SlightlyMadman posted:I'll look into 2DTollkit and SpriteManager 2 though, that's the first I've heard of them. Do they bypass the game objects? SlightlyMadman posted:Ah cool, that's strange to me that Unity can handle thousands of textured 3D cube objects, but not thousands of image sprites, but I guess that's the nature of the engine so it makes sense. I exclusively use SM2, and a buddy uses 2DTK. Both are fantastic libraries for doing 2d in Unity. I'm no sure what all the talk about exclusively doing stuff to GameObjects or not having them is about. As other experienced members have pointed it, Unity is just a component system, and GameObjects are at the core if you want transformable/renderable objects. Use what you need, remove the rest. I've made a game that Instantiates a couple hundred GameObjects on demand and recycles them from a spawn pool after, which ran great on mid-line smartphones. Most of the bottlenecks I ran into were not having the spawn pool, not so oddly enough instantiating too many SFX at a time (which lead to a sound specific spawn pool), and poorly optimized Update loops (not caching repeated lookups, etc.). If you are talking about PC dev then most of this is nearly inconsequential. If you are doing smartphone dev, the two biggest things you should care about are a) draw calls, and b) texture memory. The prior mentioned libraries do a great job of building sprite sheets, drawing them to an optimized mesh, and lowering your draw calls to the bare minimum number of textures loaded into memory. If all of your tiles can fit into a single sprite sheet, you will have exactly one draw call for your whole scene, even with a hundred instantiated tile objects. Having a hundred GameObject tiles in your scene at once might not be technically efficient from a nitpicky programmer point of view, but unless you are trying to run your game on an iPhone 3g or iPad 1, most of the above mentioned optimizations are probably just a waste of time. Build the easiest case first and focus on building your game, worry about optimizing later.
|
# ? Apr 3, 2013 00:44 |
|
|
# ? May 12, 2024 23:08 |
|
SlightlyMadman posted:There shouldn't be any empty squares in a terrain grid, or they'd be bottomless pits. I'll probably start with water, grass, and road, although I'll need to add multiple road puzzle pieces to join them together. I'll store the buildings in a separate array, so I don't have to iterate through terrain when I want to check buildings.
|
# ? Apr 3, 2013 00:52 |
|
roomforthetuna posted:In a 3D grid there would be empty squares. If you're just doing a 2D grid and drawing it in 3D then you're right, but don't model it on my code snippet! Yep, the idea is basically a 2D game but with a 3D camera you can move and pan around things.
|
# ? Apr 3, 2013 03:16 |
|
SlightlyMadman posted:Yep, the idea is basically a 2D game but with a 3D camera you can move and pan around things. EDIT: VV Personally, I do this kind of thing in the editor, and I either make a custom editor interface to do key/value pairs or I make two arrays - one for the Prefab GameObject, one for the string name that'll act as a key. Throw them into hash map, index via key, bing boom bam, done and user friendly. Shalinor fucked around with this message at 03:31 on Apr 3, 2013 |
# ? Apr 3, 2013 03:20 |
|
Shalinor posted:Even if you do need empty grids, just make a prefab that is an Empty Grid Prefab. It can just be a parent object with nothing actually in it, and then there you go, a hole in the grid that doesn't evaluate to NULL. public GameObject[] Prefabs; and then modify that array in the editor, which can be pretty useful when you're generating a tilemap from an array of numbers. (Though in some respects it can be better to fill the array in code because then you can copy-paste it around or match the indices to const values or the like, which you can't do as easily in the editor.)
|
# ? Apr 3, 2013 03:27 |
|
Ok, that turned out to be way easier than I thought!code:
Thanks for all your help, everyone!
|
# ? Apr 3, 2013 04:44 |
|
I'm making a little 2d platformer in Unity using 2dToolkit and I'm running across some (probably dumb) problems. I've got my little guy running around and swapping between levels and such, but each level is a different scene so when he switches between them, all of the player variables get set back to default. For example, I've got a jump height upgrade in the first level which increases 'jumpHeight' from 300 to 380 or whatever, but when I move onto the next level it resets to 300. I'm assuming this is because in each scene in the editor, I've manually placed the Player object, so when you load each scene, it just loads a new version of the player with all the default variables? The same problem is affecting my save/load function too, I'm using PlayerPrefs to save the level that you are on along with your position in that level, but if you saved in level 1 and then hit the Load button from level 2, it loads up level 1 but the player gets set to the default spawn location for that scene. I'm not all that experienced with Unity so I'm getting a little stuck! Any help would be appreciated.
|
# ? Apr 3, 2013 13:18 |
|
DontDestroyOnLoad will solve the problem of stuff disappearing between scenes. You'll need to handle the case of duplicate player objects, though - I can write up the necessary code later if you'd like to.
|
# ? Apr 3, 2013 13:46 |
|
Vlad the Retailer posted:DontDestroyOnLoad will solve the problem of stuff disappearing between scenes. You'll need to handle the case of duplicate player objects, though - I can write up the necessary code later if you'd like to. Thanks, I'd appreciate that a lot. Or even just writing a few words on how I'd go about it myself. That's the main problem I'm running into, I can't think of a way to spawn the player into a new scene without manually placing him there in the editor. I guess I'm just unfamiliar with Unity (and component based stuff in general really), so it's taking a little while to wrap my head around it.
|
# ? Apr 3, 2013 14:49 |
|
Stiggs posted:Thanks, I'd appreciate that a lot. Or even just writing a few words on how I'd go about it myself. That's the main problem I'm running into, I can't think of a way to spawn the player into a new scene without manually placing him there in the editor. I guess I'm just unfamiliar with Unity (and component based stuff in general really), so it's taking a little while to wrap my head around it.
|
# ? Apr 3, 2013 15:14 |
|
I'm a bit confused about the version of MonoDevelop that comes with Unity. It says it's version 2.8.2 but if you go to the MonoDevelop website it says there that there's 3.0 available but then if you click on the download link it says the latest stable version is 4.0.1? So is the version that comes with Unity just super out of date? e: oh Monodevelop is now something called Xamarin Studio? weird e: you know what, gently caress it I should just use Visual Studio. i like the quickness of MonoDevelop and Xamarin seems like a nice, newer version of that but both of them don't seem to support the whole "page up and down to see what variables this function takes in" that Visual Studios does. like, it pops up the window with overload options and shows you the up and down arrows to browse through them but only Visual Studio allows you to actually click on them and see what they are. for some reason MonoDevelop and Xamarin show you the arrows but nothing happens when you try to interact with them. i don't get it Yodzilla fucked around with this message at 17:16 on Apr 3, 2013 |
# ? Apr 3, 2013 16:50 |
|
Thanks for the help guys, managed to sort out my problems. All of you dudes that are helping people in this thread are awesome.
|
# ? Apr 3, 2013 22:10 |
|
Yodzilla posted:I'm a bit confused about the version of MonoDevelop that comes with Unity. It says it's version 2.8.2 but if you go to the MonoDevelop website it says there that there's 3.0 available but then if you click on the download link it says the latest stable version is 4.0.1? So is the version that comes with Unity just super out of date? Unity intentionally uses an old version of MonoDevelop. You can also use Unity with Sublime Text if you are looking for another lightweight alternative to VS. Its detailed here but I've only set up the proper Unity C# highlighting and haven't done the rest of the integration. MonoDevelop gets on my nerves sometimes but never so much I put in the effort to switch away completely. I end up with tiny annoyances with MonoDevelop I can't solve but they aren't big enough to switch me away. Example: MonoDevelop loves to collapse the solution explorer every time I add a new file to the project. Annoying if you are bouncing between a bunch of different files in a deep subdirectory.
|
# ? Apr 3, 2013 22:54 |
|
FuzzySlippers posted:Unity intentionally uses an old version of MonoDevelop. You can also use Unity with Sublime Text if you are looking for another lightweight alternative to VS. Its detailed here but I've only set up the proper Unity C# highlighting and haven't done the rest of the integration. MonoDevelop gets on my nerves sometimes but never so much I put in the effort to switch away completely. I end up with tiny annoyances with MonoDevelop I can't solve but they aren't big enough to switch me away. Example: MonoDevelop loves to collapse the solution explorer every time I add a new file to the project. Annoying if you are bouncing between a bunch of different files in a deep subdirectory.
|
# ? Apr 3, 2013 22:57 |
|
I actually hadn't really tried to use VS with Unity but I've been playing with it today after that post and I grabbed the trial of UnityVS. It does seem to offer some decent advantages over MonoDevelop especially now that the code in my current project has gotten large and tangled enough. Does everyone else just use MonoDevelop?
|
# ? Apr 4, 2013 01:08 |
|
Why do they intentionally use an old version of the application? Especially one that seems to be rather buggy.
|
# ? Apr 4, 2013 02:02 |
|
FuzzySlippers posted:MonoDevelop gets on my nerves sometimes but never so much I put in the effort to switch away completely. This is a great way to describe my relationship with MonoDevelop. Almost downloaded the free version of VS for C# just to use it with Unity but the hate towards MonoDevelop never gets so far.
|
# ? Apr 4, 2013 02:38 |
|
On the topic of MonoDevelop+Unity, I switched to UnityVS and it's really pretty great. I preferred using Visual Studio anyway so it's a lot easier to get things done, plus resharper seems to work fine with it too!
|
# ? Apr 4, 2013 06:15 |
|
FuzzySlippers posted:I actually hadn't really tried to use VS with Unity but I've been playing with it today after that post and I grabbed the trial of UnityVS. It does seem to offer some decent advantages over MonoDevelop especially now that the code in my current project has gotten large and tangled enough. Does everyone else just use MonoDevelop?
|
# ? Apr 4, 2013 09:58 |
|
SupSuper posted:I got rid of MonoDevelop ASAP (specially since Unity refuses to use anything else while it exists) There's an option in Unity that lets you select whatever editor you want it to use. When I had Monodevelop and Visual Studio 2010 both of them were in the dropdown and then when I installed Xamarin all I had to do was navigate to the .exe and it added itself to the list.
|
# ? Apr 4, 2013 14:54 |
|
Yodzilla posted:There's an option in Unity that lets you select whatever editor you want it to use. When I had Monodevelop and Visual Studio 2010 both of them were in the dropdown and then when I installed Xamarin all I had to do was navigate to the .exe and it added itself to the list.
|
# ? Apr 4, 2013 15:48 |
|
That's kinda weird. Although due to weirdness like that I've just started opening the code's .sln file instead of launching anything from the Unity project hierarchy. That way I can actually make changes to the project as a whole and it'll save properly instead of on a file by file basis.
|
# ? Apr 4, 2013 15:57 |
|
Yodzilla posted:There's an option in Unity that lets you select whatever editor you want it to use. When I had Monodevelop and Visual Studio 2010 both of them were in the dropdown and then when I installed Xamarin all I had to do was navigate to the .exe and it added itself to the list.
|
# ? Apr 4, 2013 16:03 |
|
Speaking of VS and Unity - can you use any old version of VS 2012 or does it only work with the higher end ones?
|
# ? Apr 4, 2013 16:31 |
|
devilmouse posted:Speaking of VS and Unity - can you use any old version of VS 2012 or does it only work with the higher end ones?
|
# ? Apr 4, 2013 16:39 |
|
devilmouse posted:Speaking of VS and Unity - can you use any old version of VS 2012 or does it only work with the higher end ones? Shalinor posted:Also, does it integrate the debugger (in the same attach-to-process way)?
|
# ? Apr 4, 2013 16:46 |
|
It works just fine with 2012 Express but haven't tried using the debugger in any way. e: woop beaten
|
# ? Apr 4, 2013 16:46 |
|
UnityVS works with express or pro versions of Visual Studio but some features only work with Pro.
|
# ? Apr 4, 2013 16:48 |
|
xgalaxy posted:UnityVS works with express or pro versions of Visual Studio but some features only work with Pro.
|
# ? Apr 4, 2013 16:52 |
|
The Gripper posted:The FAQ lists the Professional SKU as the minimum, and since Express can't load plugins I'm not sure what features it would support. Are you sure Express is supported? I guess I misinterpreted what the doc said here? http://docs.unity3d.com/Documentation/Manual/VisualStudioIntegration.html Edit: yea, I misread. :p
|
# ? Apr 4, 2013 16:57 |
|
xgalaxy posted:I guess I misinterpreted what the doc said here?
|
# ? Apr 4, 2013 17:17 |
|
Another useful thing with using Visual Studio is to install NShader and then set it up for Unity shader files. As for getting it to work with the editor, I find it works fine with 32-bit Windows, but *in my experience* on 64-bit Windows it tends to not work correctly (msdev.exe is open in the task manager, but the window doesn't open, so it opens monodevelop). As I use VS2008, I just create a new solution by copy and pasting the one generated by MonoDevelop, then editing the first line from: code:
code:
I have sent bugs to Unity, but they say "It'll be fixed in the next version" each time, which it seems to be, for about a week/first changing projects after install. I'm quite used to it now
|
# ? Apr 4, 2013 21:10 |
|
All of these goofy workarounds, and that I shift between Mac and PC pretty often, are why I keep using MonoDevelop. Even though it does suck out loud.
|
# ? Apr 4, 2013 22:34 |
|
I'm spending some quality time over the next few days trying to set up Win 8 in VMWare to run VS (building DLLs with MonoDevelop ughghghhg) with UnityVS and .NET Reflector / ILSpy. Maybe if I'm lucky, it'll be fast enough to not feel crappy. Right now, I'm just using emacs and ignoring all the IDE niceties on my Mac and just cursing when I have to build DLLs in MD. There's gotta be a better way!
|
# ? Apr 4, 2013 22:41 |
|
I may not be able to deploy anywhere with ease, but I love working with VS 2010/2012 with ReSharper and pure C#. I can't imagine a more efficient development environment.
|
# ? Apr 4, 2013 22:46 |
|
vim.
|
# ? Apr 4, 2013 22:48 |
|
xzzy posted:vim.
|
# ? Apr 4, 2013 22:52 |
|
Shalinor posted:At least you didn't say emacs. Do not open that box!! At some point, I'll have to do a writeup on our silly Haxe->C#/Unity and Haxe -> Javascript Frankenstein'd monstrosity.
|
# ? Apr 4, 2013 22:59 |
|
xzzy posted:vim. VsVim, best of all worlds, plus it keeps grubby coworker hands off your code during code reviews
|
# ? Apr 5, 2013 00:41 |
|
|
# ? May 12, 2024 23:08 |
|
No Safe Word posted:VsVim, best of all worlds, plus it keeps grubby coworker hands off your code during code reviews Wait, are you serious, does this exist, and is it any good? edit- Follow-up unity question: I decided planes will probably be better than cubes for the ground terrain, and I can do cool things like angle them to create hills. I made a new prefab for it, and associated it all of the exact same ways, but when I Instantiate it, nothing shows up. Is there something about planes that I'm missing, different from cubes? SlightlyMadman fucked around with this message at 00:49 on Apr 5, 2013 |
# ? Apr 5, 2013 00:42 |