|
dupersaurus posted:If I'm making a tick manager in Unity, should I be using C# events, or roll my own with linked lists or something? Events are drat handy, but I don't know what sort of extra performance overhead (if any) is there with them, with dozens of listeners frequently coming in and out. The big problem with events is making certain you correctly unhook them or they can stop your objects from properly being garbage collected. This will be true for any object that takes a delegate to an instance method though. C# built in events are really just sugar for delegates with a few differences which protect the delegate list. A custom event system would really just be building what is there already unless you are planning on having some other way for interested parties to invoke their behavior when they see an event other than through delegates. xgalaxy fucked around with this message at 18:10 on Sep 22, 2014 |
# ? Sep 22, 2014 18:02 |
|
|
# ? Apr 19, 2024 06:36 |
|
xgalaxy posted:The big problem with events is making certain you correctly unhook them or they can stop your objects from properly being garbage collected. This will be true for any object that takes a delegate to an instance method though. C# built in events are really just sugar for delegates with a few differences which protect the delegate list. A custom event system would really just be building what is there already unless you are planning on having some other way for interested parties to invoke their behavior when they see an event other than through delegates. I'm just looking to the replacement of having Update() or FixedUpdate() on everything that needs a tick. I've used C# events enough I'm comfortable with making sure to unregister the listeners. I'm just wondering if there's some hidden overhead cost that might make itself apparent if there are many many listeners on one event, compared to just maintaining and iterating over a linked list.
|
# ? Sep 22, 2014 19:02 |
|
dupersaurus posted:I'm just looking to the replacement of having Update() or FixedUpdate() on everything that needs a tick. I've used C# events enough I'm comfortable with making sure to unregister the listeners. I'm just wondering if there's some hidden overhead cost that might make itself apparent if there are many many listeners on one event, compared to just maintaining and iterating over a linked list. Out of pure curiosity what's wrong with FixedUpdate and Update? Do you want more variable actions? If you wanted something to occur only once every X number of Fixed Updates then you could easily just count up and use a Modulo operator to break out. It seems like you're introducing a lot of potential additional debugging so I'm curious what you feel you're missing with the combination of Update/FixedUpdate.
|
# ? Sep 22, 2014 19:28 |
|
Stick100 posted:Out of pure curiosity what's wrong with FixedUpdate and Update? Do you want more variable actions? If you wanted something to occur only once every X number of Fixed Updates then you could easily just count up and use a Modulo operator to break out. My understanding has been that the MonoBehavior callbacks aren't the quickest tools in the shed as they're not actually method calls (a variation of the "don't leave empty callbacks" rule), and since I could see needing possibly hundreds of objects updating at each tick (the wisdom of that decision is another discussion entirely), I'm looking to slim down. So only the TickManager gets Update and FixedUpdate, with the method of passing the calls to listeners being the topic of my question.
|
# ? Sep 22, 2014 19:56 |
|
The problem with all of the MonoBehavior engine call-in sites such as Awake, Start, Update, etc. is that they are invoked on the C/C# engine layer via reflection instead of being an actual call site. Why Unity decided to do these things this way instead of making them optional overrides in Monobehavior is anyone's guess. But because they are invoked like this they actually incur some overhead. Most "professional" Unity codebases I've seen had a single point of entry for the Update / FixedUpdate calls. Eg only one Monobehavior instance had those functions implemented.
|
# ? Sep 22, 2014 21:06 |
|
xgalaxy posted:The problem with all of the MonoBehavior engine call-in sites such as Awake, Start, Update, etc. is that they are invoked on the C/C# engine layer via reflection instead of being an actual call site. Why Unity decided to do these things this way instead of making them optional overrides in Monobehavior is anyone's guess. But because they are invoked like this they actually incur some overhead. Most "professional" Unity codebases I've seen had a single point of entry for the Update / FixedUpdate calls. Eg only one Monobehavior instance had those functions implemented. *this assumes you're making a custom toolset, but you basically already need to do this for a team of any size / procedural games / moddable games / etc EDIT: I know some (crazy) people have also done this and stitched to a (EDIT: HAXE!) codebase, for some reason having to do with making it easier to staple their codebase into a Web environment when necessary. Really, the language your "rest of it" is in is irrelevant at that point, just so long as you establish and maintain that firewall. Shalinor fucked around with this message at 22:31 on Sep 22, 2014 |
# ? Sep 22, 2014 21:32 |
|
Shalinor posted:I continue to think that the only sane way of using Unity in a professional / big studio setting is to treat the whole mess like a very complex multiplatform rendering engine w/ a physics engine et al, and put "everything else" in a custom C# codebase with loose, wrapped bindings to the Unity side of things. It solves moddability*, fixes scaling in terms of number of designers on a project*, it's more performant, the result is more source-exposed, AND you can decouple the whole mess and glue it to another engine if Unity jumps the shark eventually (which is insurance against its closed-source nature). I've heard you and others talk about this path, but how do you actually go about doing it?
|
# ? Sep 22, 2014 21:52 |
|
dupersaurus posted:If I'm making a tick manager in Unity, should I be using C# events, or roll my own with linked lists or something? Events are drat handy, but I don't know what sort of extra performance overhead (if any) is there with them, with dozens of listeners frequently coming in and out. It's basically like adding and removing characters from a string. Whether this is okay for you depends on how frequently you're adding and removing objects. In general though I wouldn't use events because you have no control over ordering or anything else. I think you're better off using a linked list for managing objects that a frequently added and removed but need to be iterated over. In my own game I add each actor to a linked list then store the LinkedListNode in the actor so I can easily remove the node on destruction without iteration. In my case I manually iterated over the linked list by doing: code:
|
# ? Sep 22, 2014 23:10 |
|
Inverness posted:Multicast delegates are immutable arrays of function pointers. What you're doing when you add a handler to an event (which are syntactic sugar over multicast delegates) is creating a new object with all of the old delegates plus the new one. Every add or remove adds memory pressure, and removing delegates is costly since you have to find a match in the array. Invocation of a multicast delegate is fast though. Exactly what I was looking for, thanks. I started a linked list implementation just like that, but then began to wonder. When buffering insertions and deletions from the list, do you use linked lists for the buffers, too?
|
# ? Sep 22, 2014 23:50 |
|
Something I wanted to talk about was a named hierarchical object system like what is found in Unreal. All objects in Unreal have a name and outer object. Together these form a unique dotted name for an object by combining the name with all outers in a form like World.Level.Actor. As for why I'm bringing this up? My game had two different ways of handling loading. I had normal assets like textures which were loaded synchronously when a level was loaded using a ContentManager and then data declaration objects which were all preloaded ahead of time and accessed through a different kind of service. I also had the issue of what I wanted to do when handling references to either of these types of objects when doing serialization, and how I could handle something like asynchronous loading of assets using C#'s async/await magic. I found the answer by creating the previously described system. I love it because it solved several problems at once. Since assets, data objects, levels, and actors in the levels now had names as part of a unified system, it means I could use one solution for resolving references to them during load, and have a unique persistent name during serialization. The persistent nature of their names also meant I could create reference objects that would allow any named object to be asynchronously loaded on demand. For example, doing something like: code:
It works really well. When I finished this I really enjoyed setting up artificial delays in the loading task and seeing my textures and other assets pop-in as they finished loading. dupersaurus posted:Exactly what I was looking for, thanks. I started a linked list implementation just like that, but then began to wonder. When buffering insertions and deletions from the list, do you use linked lists for the buffers, too? In my case, insertions can happen during the update since I'm not actually using the linked list's enumerator, but my deletions are buffered in a list. Though that is more to keep actors from becoming invalid at unexpected times.
|
# ? Sep 23, 2014 00:13 |
|
Inverness posted:I did that to avoid allocating an enumerator for every level 60 times a second, but that was before I found out that .NET Framework collection enumerators use structs instead of classes, so that isn't really necessary. Only if you compile your code with Visual Studio. Unity mono compiler does not do this. Which is why a lot of performance articles on Unity say to avoid foreach, for example. P.S. I'd love to see that asset loading code. xgalaxy fucked around with this message at 01:13 on Sep 23, 2014 |
# ? Sep 23, 2014 01:10 |
|
Actually, come to think of it, why do I even need to use a C# LinkedList? All of the scripts already share an ITicker interface (that could become a class); I could take a page from Unreal (2.5, at least) and make the tickers themselves the linked list. All I do is iterate (this wouldn't require a foreach), append, and remove... This seems sound, but I feel like there's something about it that would bite me in the rear end.
|
# ? Sep 23, 2014 03:05 |
|
I'm having some trouble generating colliders for my 2D tilemaps in Unity. I have a working implementation that creates edge colliders, but I'm running into problems with objects easily passing through and getting stuck inside the floor or walls. I figure switching to polygon colliders instead of edge colliders so that the terrain is actually solid should fix that. I can't for the life of me figure out how to generate polygons instead of edges, though. I can trace the outline of a chunk of terrain, but I'm not sure how to handle cases where it has holes in it like this: code:
|
# ? Sep 23, 2014 08:06 |
|
Hey Guys, For a game we've made, we use Marmoset Skyshop shaders. Although this doesn't happen the majority of the time, I've noticed that on some PCs everything looks all weirdly lit up. I picked up a laptop ASUS G750 (has a NVIDIA GTX 870M) myself, and see it happening too. Any idea why this happens?
|
# ? Sep 23, 2014 22:04 |
|
Scene is lit; working as intended. Really though, there's no way to know what's wrong with it without a reference or explanation beyond "weirdly lit". Unless the anomaly can't be seen in the thumb, in which case
|
# ? Sep 24, 2014 15:36 |
|
Did you take a picture of your monitor with your phone? Seriously though, we need a comparison shot to have any idea what you're talking about. As a side note, if that's an in-game shot and not a photo you might want to clean the vaseline off the player's glasses.
|
# ? Sep 24, 2014 16:30 |
|
dizzywhip posted:I'm having some trouble generating colliders for my 2D tilemaps in Unity. I have a working implementation that creates edge colliders, but I'm running into problems with objects easily passing through and getting stuck inside the floor or walls. I figure switching to polygon colliders instead of edge colliders so that the terrain is actually solid should fix that. What I did was just feed all the tiles into http://www.angusj.com/delphi/clipper.php and do a union, then use the result to build a polygon collider. Ragg fucked around with this message at 16:44 on Sep 24, 2014 |
# ? Sep 24, 2014 16:42 |
|
Ragg posted:What I did was just feed all the tiles into http://www.angusj.com/delphi/clipper.php and do a union, then use the result to build a polygon collider. Hey that's great, thanks for the link! It works great for generating the polygons. Unfortunately the polygon colliders didn't quite solve the problem I was having like I'd hoped. I think the real problem is the way I'm applying knockback forces. I've got some ideas on how to fix that though.
|
# ? Sep 24, 2014 23:14 |
|
Does anyone have any recommendations/experience with maintaining code in Unity3D that's shared across multiple projects? Like, if I wanted to spin a 3rd person controller or camera under source control and keep it up to date between multiple projects? I've played with .git submodules in other settings with mixed results, but most resources I've found on them say they're a pain to use. Are submodules worth the trouble? Are there any decent alternatives?
|
# ? Sep 25, 2014 04:02 |
|
Gunzil posted:Does anyone have any recommendations/experience with maintaining code in Unity3D that's shared across multiple projects? Like, if I wanted to spin a 3rd person controller or camera under source control and keep it up to date between multiple projects? I've played with .git submodules in other settings with mixed results, but most resources I've found on them say they're a pain to use. Are submodules worth the trouble? Are there any decent alternatives? I use SVN's externals. I assume it's similar to git's submodules? But yeah that would be the main way to do it.
|
# ? Sep 25, 2014 10:13 |
|
SVN externals aren't really the same thing as submodules in GIT. GIT submodules are fine as long as everyone on your project is aware of how they work. If you are spending time to teach people how to checkout a project that has submodules then you will be pulling your hair out.
|
# ? Sep 25, 2014 15:58 |
|
I'm just jumping into 2D Unity development and have been learning the ins and outs of the Animation system. Everything is fairly straightforward, but I have a question about adding Colliders to an Animation. What is the best way to handle animating/adding/transforming Colliders during a frame by frame animation? For example, hitboxes during the attack frames of a fighting game character. Kinda like this: Does anyone have a point of reference or a best practice for this type of thing?
|
# ? Sep 26, 2014 05:22 |
|
Time for more UE4 news! Epic showed off a new VR demo at Oculus Connect, which sends your view, on rails, down a city street and lets you look around as action occurs in slow motion around you. Oculus Showdown/Carflip demo video, Epic's Oculus Connect Blog Entry. My favorite tutorial author Zak Parrish released a series of Paper2D training videos last week, which have you recreate the 2D Game Template from scratch, with some extra features. The release cycle for 4.5 has been stretched out a bit compared to the previously almost monthly cycle, as they've been cramming more features and bug fixes in. They previously talked about their internal testing day which had the UE4 devs making games to identify pain points and generate a list of feature requests. This patch should address a chunk of those. The Patch Notes will be out shortly, but the latest UnrealEngine livestream (audio is bit messed up but bearable) featured Mike Fricker, Technical Director and Wes Bunn, Technical Writer from Epic discussing upcoming changes. The highlights start just after the short Community Spotlight, featuring some cool architectural visualization projects.
Wes then discussed Animation Retargeting (@32m36s). Using an intermediate Rig asset, animations can now be shared among skeletons with different structures and bone names. There's a quick demo showing off the workflow by retargeting the UE4 default animations to the characters from the free Mixamo pack. You can also adjust reference poses in the editor. In-depth documentation coming soon! They closed out the broadcast with Community Q&A (@43m46s). forfeit fucked around with this message at 14:12 on Sep 26, 2014 |
# ? Sep 26, 2014 13:58 |
|
The Q&A portion of the Twitch video above, they did say that HTML5 packaging should be in 4.5 as long as Quality Assurance testing didn't kick it back.
|
# ? Sep 26, 2014 14:45 |
|
forfeit posted:UE4 drat, that sounds pretty great. Thanks for the write up!
|
# ? Sep 26, 2014 17:18 |
|
Regarding fonts I use in my game, what do I have to watch out for, license wise. Am I free to use anything that comes with Windows?
|
# ? Sep 26, 2014 23:20 |
|
I can't wait for a dynamic GI to come out. That is my personal number 1. What's that game being made with UE4 that has a LPV style GI (like cryengine) and when it comes out they might port the GI engine to UE4?
|
# ? Sep 26, 2014 23:21 |
|
echinopsis posted:I can't wait for a dynamic GI to come out. That is my personal number 1. What's that game being made with UE4 that has a LPV style GI (like cryengine) and when it comes out they might port the GI engine to UE4? You looking for Light Propagation Volumes?
|
# ? Sep 26, 2014 23:33 |
|
echinopsis posted:Regarding fonts I use in my game, what do I have to watch out for, license wise. Am I free to use anything that comes with Windows? You can include any fonts you want as long as you are storing your fonts in a format that isn't using the the glyphs data directly, eg. you are using a tool to convert a font to a bitmap font and then using the bitmap in your game to render your fonts in game. If you aren't doing something like that then you need to either get rights to use it or look for open source versions.
|
# ? Sep 27, 2014 00:15 |
|
BabelFish posted:You looking for Light Propagation Volumes? "Light Propagation Volumes are a feature in development and not ready for production." e: I want it to "just work", basically, not hack it in. xgalaxy posted:You can include any fonts you want as long as you are storing your fonts in a format that isn't using the the glyphs data directly, eg. you are using a tool to convert a font to a bitmap font and then using the bitmap in your game to render your fonts in game. If you aren't doing something like that then you need to either get rights to use it or look for open source versions. That's kinda what I thought, so I guess I will re-iterate my question. Do I have the rights to use the windows fonts in my game, not as rendered images? Also, the way you create a font in UE4, it kind of renders it to bitmap first, right? Does this mean you can just use any font basically? echinopsis fucked around with this message at 00:45 on Sep 27, 2014 |
# ? Sep 27, 2014 00:43 |
|
echinopsis posted:"Light Propagation Volumes are a feature in development and not ready for production." echinopsis posted:Also, the way you create a font in UE4, it kind of renders it to bitmap first, right? Does this mean you can just use any font basically? Slate however (last I checked) uses the straight .ttf files, no rendering out to bitmap first. It's way better then a bitmap for scaling font sizes, but you need the very expensive licenses. We just ended up going with free fonts There's a ton of them out on the internet. BabelFish fucked around with this message at 01:49 on Sep 27, 2014 |
# ? Sep 27, 2014 01:40 |
|
What kind of data structure should hold a character's stats? I'm creating a character generator that's meant to be part of a larger project later on, and I was wondering whether I should hardcode all the stats and fields (like class, level, skills, HP) as individual attributes, or if they should be kept in a hash or something under a generic "fields" attribute.
|
# ? Sep 27, 2014 03:05 |
|
Pollyanna: Can you think of a situation where you'd want to generically iterate through all stats? If so, using a Map might be appropriate. If not, a struct/class/record/whatever is simpler. If you're using ruby there's barely an appreciable difference anyway.
Internet Janitor fucked around with this message at 03:48 on Sep 27, 2014 |
# ? Sep 27, 2014 03:20 |
|
BabelFish posted:Ahh, I doubt they'll integrate the external developer one while their own official version is in active development, but I have no seen official comment in either direction. There is buzz on the UE4 forums about how they are going to incorporate the LPV from this big new game someone (lionhead?) is making once it's done, but they can't do it until it's done, and they are developing it together. Maybe I've got my story mixed up
|
# ? Sep 27, 2014 03:46 |
|
I really do hope Unity 5's lighting engine is a bit less embarrassing, but I can't imagine it'll hold a candle to UE4 even pre-LPVs. Still, it'll be interesting to see.
|
# ? Sep 27, 2014 03:49 |
|
I'll be interested to see what they've improved on it, LPVs can be tricky to work with because of bleeding. I feel like a manifold-based solution would probably be better, but I'm not sure if there are any good ways to do that.
|
# ? Sep 27, 2014 04:00 |
|
Internet Janitor posted:Pollyanna: Can you think of a situation where you'd want to generically iterate through all stats? If so, using a Map might be appropriate. If not, a struct/class/record/whatever is simpler. If you're using ruby there's barely an appreciable difference anyway. A Map is also good if you want to work with a more freeform stat system, where there are tons of stats, but only a few are defined for each character. In any case, when it comes to major systems like this, where you'll have references to them all throughout your game, it's not really important to choose the best implementation right off as long as you put that implementation behind a layer of abstraction. Externally, you should see character.getHealth() (or character.getStat("Health")) rather than character.stats[0].
|
# ? Sep 27, 2014 04:03 |
|
echinopsis posted:I can't wait for a dynamic GI to come out. That is my personal number 1. What's that game being made with UE4 that has a LPV style GI (like cryengine) and when it comes out they might port the GI engine to UE4? I'm guessing you're thinking of Lionhead's Fable: Legends stuff? That is what's in the beta UE now, far as I know. This isn't exactly my field but I wouldn't expect any of the current real time GI methods to "just work". Voxel cone tracing, LPVs, etc all tend to be quite scene sensitive in that they make pretty strict assumptions on the indirect lighting being low frequency and try to estimate it in some very low resolution structure. If you make a scene where those assumptions don't hold (if the indirect radiance variation is beyond the Nyquist limit of their storage grids, essentially) then you get light bleeding, block artifacts and other objectionables. Baking has the same issues of course but there the solution is "easy" in the sense that you can often just up the resolution on your spherical harmonic grid or whatever where you happen need it. It's a much harder problem for a dynamic, real-time approach.
|
# ? Sep 27, 2014 04:04 |
|
Xerophyte posted:I'm guessing you're thinking of Lionhead's Fable: Legends stuff? That is what's in the beta UE now, far as I know. Good points. Perhaps a combination could be employed? I just find a bit of frustration when you have a gorgeous looking level but your dynamic objects just almost look out of place. I have a lot of trouble making my static lights cast dynamic shadows so it looks like nothing is making shadows. Also because UE4 can't do any kind of area lighting dynamically so you end up with crisp shadows (from dynamic objects) from large lights that are casting soft shadows on static objects. Welp
|
# ? Sep 27, 2014 04:08 |
|
|
# ? Apr 19, 2024 06:36 |
|
Hi everyone!! There’s a big lack of good generic tweening libraries for .Net, and any that are available have a poor API or missing functionality or are just.. really bad, so I made Betwixt. I made it for games and that's what I'm currently using it for; it's entirely generic so it works with any custom type you feed it. I can’t show much since it’s a library meant to be used, and not a standalone application, but at the very least I made a small application to draw all of the built-in easing functions, all of which are completely optional as the API lets you easily and extensively create your own easing functions in pretty much any way you want. I hope you give it a try if it interests you, or maybe just take a look through the source. You can find the repository the source and downloads are located at on github right over here: https://github.com/Jewelots/Betwixt This is my first actual release of something like this so please let me know if I've done something horribly wrong with the code or the git or anything
|
# ? Sep 27, 2014 04:09 |