|
I had that same problem a while ago so I feel your pain. I gave up making a custom inspector for it and just had it show both sets of options all the time (luckily I only had two options), even though half of them wouldn't be relevant.
|
# ? Aug 21, 2015 09:52 |
|
|
# ? Jun 5, 2024 16:52 |
|
Beer is not for children edit: https://www.youtube.com/watch?v=Zc6udR3VqK0 al-azad posted:Beer is not for the shower. I 100% disagree with this post. KRILLIN IN THE NAME fucked around with this message at 13:13 on Aug 21, 2015 |
# ? Aug 21, 2015 10:21 |
|
Beer is not for the shower.
|
# ? Aug 21, 2015 11:15 |
|
al-azad posted:Beer is not for the shower. Wow look at how wrong you are. Anyone doing LD33? Going to be my first LD, any tips? Probably only really going to have time to work on it Saturday for most of the day, then Sunday up into the late afternoon, so I think my timeline is going to have to be particularly condensed.
|
# ? Aug 21, 2015 14:12 |
|
I would but with work tomorrow and how things turned out with GBjam I think I need a bit of a break.
|
# ? Aug 21, 2015 14:21 |
|
sighnoceros posted:Wow look at how wrong you are. I've only ever done the group one, the individual one seems really crazy to try and keep motivated to see it all the way through. I kind of want to do this one but most the people I know are busy and I have a bunch of travel in less than a week, if I really like the theme I might try and do something but I don't feel like investing too much time on it.
|
# ? Aug 21, 2015 14:23 |
|
dreamless posted:Yeah, that's tricky. You can access fields that are part of serializable classes that aren't SerializableObjects through SerializableProperties, but you can't get a reference to the CommandParamPair object itself without doing some painful reflection stuff. I found this link in our custom editor code: http://answers.unity3d.com/questions/425012/get-the-instance-the-serializedproperty-belongs-to.html which might help. Hmm, does Unity serialize objects with it's own special serialization methods? Could I add the ability for Unity to serialize an object[]? I feel like this stuff should have been doable in Unity out of the box...
|
# ? Aug 21, 2015 14:36 |
|
sighnoceros posted:Wow look at how wrong you are. I'm giving it a shot- looks like it's gonna be basic 2D Unity, off-centre pixel art and automatic hitboxes. Joy.
|
# ? Aug 21, 2015 14:47 |
|
sighnoceros posted:Anyone doing LD33? Going to be my first LD, any tips? Make something, anything and submit it. That should be your only goal. If you need a second one try to make it fun. Find a concept quickly, try to make an engaging game as soon as your can then iterate and iterate on the fun. Don't worry about art quality or bugs until you have something that plays like a game. Personally I used to submit bad games to LD but for the last few I get too in my headspace and don't like the quality so end up submitting nothing, don't be me!
|
# ? Aug 21, 2015 14:54 |
|
al-azad posted:Beer is not for the shower. This heathen doesn't know about shower beer
|
# ? Aug 21, 2015 16:45 |
|
Zaphod42 posted:This heathen doesn't know about shower beer The shower beer is the best thing. Seriously.
|
# ? Aug 21, 2015 16:55 |
|
I have been doodling on a pseudo tile-based world editor for some time now, and centering my game around loading and running levels from it. It has data for walls surrounding the tiles in the four cardinal directions. When I started this, I was just using very regular, four-vertex planes, but have since started switching over to importing mesh data. That was a real adventure; think for a second what happens to all the triangle indices when you replace a wall of mesh X with a wall of mesh Y, having a different number of vertices. Anyways, I'm trying to figure out how to lay this out in a UI. Is there something in the wild I could examine that has something for: 1. Picking different types of walls. That is, flat walls, doorways, slightly-decorated walls. 2. Apply different textures to them. I'm thinking I just want one pane to pick the type of object, and another pane switch to the texture map that can be applied to the wall. That's what I'll do by default, but I would prefer to improve the user experience on the first attempt if there's anything out there that can improve on that basic premise.
|
# ? Aug 21, 2015 17:21 |
|
So I have this giant PlayerController.cs script in my Unity game and I'm trying to break it down in a smart way. I'm thinking of keeping the PlayerController and moving movement stuff into PlayerMovement.cs, shooting logic into PlayerShooter.cs, etc. I'm getting a little foggy when it comes to deciding how all these will work together in Unity's Entity-Component-System. For example. I want to be able to edit the public properties of these individual scripts in the Unity editor inspector so I have them derived from MonoBehaviour. BUT I want the scripts to be able to communicate with each other so for example, if I want PlayerController to be where I keep the OnTriggerEnter() logic then I'd obviously want to be able to call PlayerMovement.DoFlinch() and PlayerHealth.TakeDamage() but I would have to cache a reference to every component with a GetComponent call and that feels weird because there's nothing guaranteeing that I remembered to attach the requested component to the Player GameObject. Does it make more sense to use BroadcastMessage("OnHit") and not have to worry about what components are living on this GameObject? I hope this gives an idea of what kind of design questions I have and what I'm looking for!
|
# ? Aug 21, 2015 17:45 |
|
Rocko Bonaparte posted:I have been doodling on a pseudo tile-based world editor for some time now, and centering my game around loading and running levels from it. It has data for walls surrounding the tiles in the four cardinal directions. When I started this, I was just using very regular, four-vertex planes, but have since started switching over to importing mesh data. That was a real adventure; think for a second what happens to all the triangle indices when you replace a wall of mesh X with a wall of mesh Y, having a different number of vertices. I've been screwing around with Unity trying to make something similar, the best I could think of was to make a series of prefabs that could be dragged into a palette and maybe try to draw the mesh in scene view as you try and place it. For the texture I figured it could be as simple as just setting a different material or some kind of offset if you're using a tilemap. It sounds like you have the right idea in general though it sounds like you're making your own tools from scratch not using an engine. Not sure if it's quite what you're looking for but in terms of UI I always though the way blizzard made their tools for Warcraft / Starcraft was pretty intuitive. They'd always have stuff in a seperate window with different tooltips and previews and I believe you could add your own stuff to it using some internal DB tool? Best screenshot I could find of it: http://bradcook.net/games/articles/2002/08/warcraft3editor/images/hubshot1.jpg Speaking of, is there any good way in Unity to have the OnSceneGUI function not be attached to a CustomInspector? I was able to get it working from a window by adding my own function to the delegate, but it's not documented and when it's used it manages to override everything, including Undo/Redo and the like. Makes it a real pain to work with. StickFigs posted:So I have this giant PlayerController.cs script in my Unity game and I'm trying to break it down in a smart way. What we did for our game jam project was to use delegates and events, so we'd have the Player and then that'd have a Damageable component that we could look for an get a reference too at the start, usually with a way to add a generic Damageable component at runtime if one wasn't detected. Again, I don't know if it's exactly what you're looking for or if it might be something you'd already tried but it seemed to work for us. https://unity3d.com/learn/tutorials/modules/intermediate/scripting/events has some more details. Nanomachine Son fucked around with this message at 18:11 on Aug 21, 2015 |
# ? Aug 21, 2015 18:07 |
|
TheOrange posted:What we did for our game jam project was to use delegates and events, so we'd have the Player and then that'd have a Damageable component that we could look for an get a reference too at the start, usually with a way to add a generic Damageable component at runtime if one wasn't detected. Again, I don't know if it's exactly what you're looking for or if it might be something you'd already tried but it seemed to work for us. https://unity3d.com/learn/tutorials/modules/intermediate/scripting/events has some more details. In my case events won't work because I need to be able to pass parameters. How did you leverage delegates though?
|
# ? Aug 21, 2015 18:36 |
|
StickFigs posted:In my case events won't work because I need to be able to pass parameters. How did you leverage delegates though? Actually you can set them up to let you pass parameters, you just set up the delegate like this (terrible code, might work but I'm pulling it out of my rear end) code:
The only really weird thing I've run into with delegates in particular is that they don't get cleaned up properly when you reload a scene or reload scripts in the editor, so you have to specifically de-register them on a OnDestroy function. Nanomachine Son fucked around with this message at 18:59 on Aug 21, 2015 |
# ? Aug 21, 2015 18:48 |
|
TheOrange posted:I've been screwing around with Unity trying to make something similar, the best I could think of was to make a series of prefabs that could be dragged into a palette and maybe try to draw the mesh in scene view as you try and place it. For the texture I figured it could be as simple as just setting a different material or some kind of offset if you're using a tilemap. It sounds like you have the right idea in general though it sounds like you're making your own tools from scratch not using an engine. quote:Not sure if it's quite what you're looking for but in terms of UI I always though the way blizzard made their tools for Warcraft / Starcraft was pretty intuitive. They'd always have stuff in a seperate window with different tooltips and previews and I believe you could add your own stuff to it using some internal DB tool? Best screenshot I could find of it: http://bradcook.net/games/articles/2002/08/warcraft3editor/images/hubshot1.jpg quote:Speaking of, is there any good way in Unity to have the OnSceneGUI function not be attached to a CustomInspector? I was able to get it working from a window by adding my own function to the delegate, but it's not documented and when it's used it manages to override everything, including Undo/Redo and the like. Makes it a real pain to work with.
|
# ? Aug 21, 2015 20:27 |
|
Rocko Bonaparte posted:I am using Unity, but it sure feels like I'm doing everything from scratch. The GUI code is sad. I had to make my own selection grid for the different tiles since the built-in grid view--or whatever it is called--is pretty weak. Ah, ok. Yeah it leaves quite a bit to be desired, I look at some of the tools out there like ProBuilder though and it at least seems like you can leverage it in some interesting ways. I only got so far as making a tool that could instantiate new prefabs on the grid, but I figured if I could extend it into a window I could replicate the blizzard layout pretty easily. The problem was it disabled all the Unity built in stuff, even the settings for Skybox/Lighting in the scene view and all the keyboard controls, I ended up turning it into a toggle button instead but trying to fix mistakes got frustrating without Undo.
|
# ? Aug 21, 2015 20:43 |
|
StickFigs posted:Hmm, does Unity serialize objects with it's own special serialization methods? Could I add the ability for Unity to serialize an object[]? It does. This Unity blog post is still the best description we've got. It made more sense when I learned that the inspector and saving assets to disk are built out of the same stuff, so if you've got two references to a custom class in your MonoBehaviour, it'll show up as two separate foldouts in the inspector and be saved out separately even if you point them to the same object; if you set it to null, it'll be loaded in with default values, just like it shows up in the inspector. If you make a Dictionary it won't show up or save, etc. But if you have a reference to a Unity object (ScriptableObject/MonoBehaviour), it's stored as a reference, and you get the drag&drop/object picker box in the inspector. This is the only level where type information is saved. You've got a lot of freedom to go against the grain of Unity, but there are rabbit holes you can fall down; I've definitely spent an hour to get to the "hey, I've dumped level data to json!" stage and then kept tinkering with the thing for weeks when I really just want to be working on the game.
|
# ? Aug 21, 2015 21:21 |
|
StickFigs posted:Does it make more sense to use BroadcastMessage("OnHit") and not have to worry about what components are living on this GameObject? If you decide to go with this approach I'd take something like MessageKit and adapt it to be a local instance instead of a global static and use it to broadcast messages. I did something like that and it worked pretty well. So on Awake all the components that want to talk to each other can getcomponent the local message hub and then listen for messages and broadcast them. It also allowed other objects to getcomponent on a trigger hit or whatever and check for message hub on the hit gameobject and then send messages to it. I'm really not a fan of ever using SendMessage or BroadcastMessage. If you are just worried about remembering to attach components you could either use the RequireComponent tag or just have something fulfill the requirements on awake if it can't cache them. I tend to have a "BaseEntity" or "BaseCharacter" or whatever depending upon the game that things can getcomponent on and find all the usual components (movers, pathfinders, ITakeDamage, whatever) so they don't have to search for them all. FuzzySlippers fucked around with this message at 22:00 on Aug 21, 2015 |
# ? Aug 21, 2015 21:56 |
|
I remembered something I did with Unity that helped in my case when I wanted sub-groups of parameters to activate. Although I had too much trouble getting it to only show one subset at a time, I managed to contain each set in its own separate expandable subset.code:
So if you have a class with lots of parameters, you can at least put some in a Serializable subclass and attach that instead, and Unity will give you like an expandable dropdown thing with those parameters inside it in the inspector.
|
# ? Aug 21, 2015 23:05 |
|
It sounds to me like this is indeed a rabbit hole and I will just make every CommandParamPair have 1 of each potentially needed data type and add more as I go. It'll be ugly and confusing but it'll work! StickFigs fucked around with this message at 00:39 on Aug 22, 2015 |
# ? Aug 22, 2015 00:33 |
|
What a horribly cliche theme. edit for clarification: LD theme is "You are the monster" sighnoceros fucked around with this message at 02:31 on Aug 22, 2015 |
# ? Aug 22, 2015 02:25 |
|
TheOrange posted:Speaking of, is there any good way in Unity to have the OnSceneGUI function not be attached to a CustomInspector? I was able to get it working from a window by adding my own function to the delegate, but it's not documented and when it's used it manages to override everything, including Undo/Redo and the like. Makes it a real pain to work with.
|
# ? Aug 22, 2015 03:52 |
|
Rocko Bonaparte posted:It looks like I did not have a trick for this after all. The OnSceneGUI implementation I use is tied to a component representing my level data, and it includes some inspector code. Yeah I found what I was using here, but it's some kind of internal thing that doesn't seem to have proper documentation. One thought might be to create a Camera when you focus an editor window and draw that to a texture but you'd then have to implement a lot of the panning around and such on your own.
|
# ? Aug 22, 2015 04:01 |
|
I might as well show what has been keeping me off the streets: (clicky for animated) Not shown is a separate palette editor that lets me drag and drop textures that can then be added on. Those solid colors are really textures, so I can make it work. The user experience still sucks, and I realize I need to make a corner mesh for when two double-side walls meet at an angle. Also, the wall texture has an off-by-one problem; look at the white along the top of the walls. Finally, the preview wall is all broken. Oh well--at least I know some stuff to do. I keep telling myself it's still work doing the level editing because a lot of that goes right into the game idea. The pathfinder uses the level representation already, and I use the same code for loading the level to edit as I do to make the final game mesh out of it. It's just reaching in and inserting/removing/replacing mesh data as necessary.
|
# ? Aug 22, 2015 04:13 |
|
For those of you who have used unreal's Matinee system, is there any possible workflow that doesn't involve curating all of my cutscenes in the level blueprint? It seems like the entire system is built assuming that you want everything centralized, and it's not that hard to teach everything that needs to trigger a cutscene to find the persistent level and call an event, but it's a layer of abstraction that I don't need, and don't really wanna work around if I don't have to. Edit: I noticed it's Saturday, so here's what I've been getting in on- working stamina, calendar, interactivity on any object (it's driving the speech here), and day/night cycle. I'm doing 1 action/period right now, but it cues off of the stamina system, so I'm pondering giving you multiple actions per period. Omi no Kami fucked around with this message at 10:19 on Aug 22, 2015 |
# ? Aug 22, 2015 06:45 |
|
sighnoceros posted:What a horribly cliche theme. John you are the demons
|
# ? Aug 22, 2015 08:25 |
|
Make an old school advertainment game where you play as a can of Monster energy drink. Edit: but you end up inadvertently murdering some people and you have to cover it up by getting rid of the evidence.
|
# ? Aug 22, 2015 10:41 |
|
This is incredibly silly, but one of the reasons I'm keen on adding multiple actions/day is for that very energy economy: something I loved about both Dead Rising 2 and Disaster: Day of Crisis was the way your guy would grab a giant cheeseburger/soft drink/steak, desperately plow through it in seconds, then return, refreshed, to the business of murdering zombies or saving accident victims. There are lots of neat little stylistic flairs I could do with this too, like only letting you consume one item per period (for balance) and justifying that by having you carry it around with you, as if you're slowly dragging on your cigarette/pulling at your flask as you stomp around beating the streets.
|
# ? Aug 22, 2015 10:50 |
|
My last attempt at making a turn-based strategy game stalled out in a tangled mess of unityscript and spritesheets, so i figured i'd start over and learn a bit of C# while i'm at it. Also it's in 3D this time because having to create 4 sprites for each tile direction was driving me nuts. I started with a tile-based level editor. It's clunky as poo poo but at least it forced me to work out how to structure and interact with my level data. Should probably look more interesting when i get some of my actual art in there too.
|
# ? Aug 22, 2015 11:43 |
|
drat skippy, very nice work.
|
# ? Aug 22, 2015 12:27 |
|
sighnoceros posted:What a horribly cliche theme. Eh, I think that the people complaining just need to think through the theme a bit. It's extremely open to interpretation. I'm going for 'use surreptitious influence to create a cult of sufficient size.' You have to sew horror in the streets of Almost-Innsmouth.
|
# ? Aug 22, 2015 14:27 |
|
Rocko Bonaparte posted:I might as well show what has been keeping me off the streets: Honestly that doesn't look too bad to me, you could probably do with having some keyboard shortcuts to put the camera in isometric mode and quickly rotate it. For my preview wall I was drawing some lines using Handles / Gizmos rather than try to draw up the entire mesh. Not quite sure what's going wrong with yours, I don't understand too much about making my own custom meshes so I doubt I can be much help there. The off-by-one thing seems like it might be a float to int conversion or if your texture is using some kind of filtering / anti-aliasing. Also that GIF that Steampunk_Spoon posted looks slick as hell. Somfin posted:Eh, I think that the people complaining just need to think through the theme a bit. It's extremely open to interpretation. The theme doesn't seem that bad but all my ideas for it are way more conceptual than having any basis in a mechanical sense. Doing something with influences from Alien or The Thing would be awesome but I have zero clue how you make that work mechanically for something that needs to be made in 48 hours.
|
# ? Aug 22, 2015 14:45 |
|
Steampunk_Spoon posted:My last attempt at making a turn-based strategy game stalled out in a tangled mess of unityscript and spritesheets, so i figured i'd start over and learn a bit of C# while i'm at it. Also it's in 3D this time because having to create 4 sprites for each tile direction was driving me nuts. This looks really cool and useful Nice work.
|
# ? Aug 22, 2015 15:25 |
|
Bel Monte posted:Edit: You know what? I think I really just fragmented everything too much. Again. Going to consolidate these things. I shouldn't be having to check ID's every step of the way. I did something very wrong to my variable organization. This just sounds messy and I dont really understand what you are trying to do. But if all you are doing is searching through an array you can use Divide and Conquer techniques or multi threading to return an answer faster.
|
# ? Aug 22, 2015 15:37 |
|
TheOrange posted:The off-by-one thing seems like it might be a float to int conversion or if your texture is using some kind of filtering / anti-aliasing.
|
# ? Aug 22, 2015 17:17 |
|
PhantomZero posted:This just sounds messy and I dont really understand what you are trying to do. But if all you are doing is searching through an array you can use Divide and Conquer techniques or multi threading to return an answer faster. Basically, I have too many separate arrays for my liking. In order to modify one small value, I have to run through several ID matching between the arrays to make sure I'm on the correct value to change. So instead of just matching an ID number once, I need to do it multiple times for multiple arrays just to do anything simple, let alone complex. And I don't know if there's a faster way to find an ID number in an array other than to loop through the entire thing. So I loop through multiple arrays every time I want to find anything. To me, this is a recipe for major slowdown and unnecessarily large code for simple tasks. It may just be faster if the arrays are larger and a little cluttered than to cleanly separate values into categories of arrays. Edit: I originally did this because it looked nice and simple (an array for population, product stats, product sales, etc), until I started to try and have the program modify these arrays. So I really do think I went overboard... Unless there's a faster method I'm not aware of? Bel Monte fucked around with this message at 19:58 on Aug 22, 2015 |
# ? Aug 22, 2015 19:56 |
|
What kind of padding and fudging do I have to do in order to align textures well? I was working on my off-by-one problems with that level editor. My texture atlas is using a 256x256 texture, and the tiles inside are each getting a 32x32 region. Part of my problem was the UV mapping was assuming using a 0,0 -> 32,32 mapping instead of 0,0 -> 31, 31. However, that actually did not completely fix things. It looked like I had to do some some further fudging. It looks like I'm clear with something like 1,1 -> 31,31, but I'm losing a whole texture's pixel that way. I'm assuming I really need to do something like 0.1, 0.1 -> 30.9, 30.9, but I wanted to ask for pointers before just toying with it a bunch. I also noticed in Unity that I get into issues with faces hitting each other. Currently, my walls are three-dimensional and have edges on all sides. When I put two wall pieces next to each other, the leftmost wall's right side is touching the rightmost wall's left side. It looks like this causes some artifacting. I guess in the long term that I should just get rid of these surfaces, but I wondered if there was a mode or something I could toggle to reduce the artifacting.
|
# ? Aug 22, 2015 21:02 |
|
|
# ? Jun 5, 2024 16:52 |
|
Bel Monte posted:Basically, I have too many separate arrays for my liking. As long as you're dealing with an ID that is always unique, why not use a dictionary: https://msdn.microsoft.com/en-us/library/xfhwa508%28v=vs.110%29.aspx
|
# ? Aug 22, 2015 21:11 |