|
PnP Bios posted:I did a writeup on how reflection can be useful for building a game editor for your .NET game. Let me know what you think? The engine I'm working on is a hybrid of Stackless Python and C++ though, so I don't have that problem since I'm using wxPython to create my editor (which is awesome). But that information will be useful if I ever decide to work on a C# project. By the way, is anyone here familiar with RakNet? I've just checked it out and I'm really impressed at the features it offers and how easy it is to set everything up. It's exactly what I wanted since I didn't want to have to use TCP or make my own solution for reliable variable replication. It's also extremely easy to set up and integrate.
|
# ¿ Dec 4, 2010 23:57 |
|
|
# ¿ Apr 28, 2024 12:34 |
|
Otto Skorzeny posted:Source is an abomination for many, many reasons
|
# ¿ Dec 6, 2010 06:18 |
|
Vino posted:Source was built out of Half-Life which was built out of Quake. Therefore it carries all of the old engine structure paradigms around with it. For example it's the only AAA engine I can think of that still uses BSP as its main scene management. It's tools are poorly supported and under-featured (Hammer only recently included a crappy lighting preview) and Valve provides little or no documentation other than the wiki which is not really enough.
|
# ¿ Dec 6, 2010 08:01 |
|
haveblue posted:As I understand it Unreal works at the level of individual variables. Object instances are identical on the server and all clients (with the server authoritative) and certain members are tagged as replicated, which causes them to be asynchronously kept up to date with the values of their remote equivalents. You can request different priorities, interpolation types, etc for each of them. The core network layer marshals all the pending updates into bundles, invisibly. Just from looking at that I was able to figure out how it was working and create almost identical functionality for my own game, and it took much less time than I thought. Even better, I was able to easily integrate it with RakNet's Replica Manager plugin. At first I wondered if I was maybe overdoing it a bit, but making it has been an interesting experience, and the code is open source if anyone wants to take a look or use it themselves.
|
# ¿ Dec 7, 2010 10:34 |
|
Vino posted:That Unreal code didn't look nearly as legible. What the hell is NEQ and GetOptimizedReqList() ? GetOptimizedRepList() ("get optimized replication list") is the function that is called in order to figure out which variables need to be replicated based on a set of conditions and whether or not their values have changed. The 'Recent' argument is a pointer to a copy of the object which is casted so that the current value can be compared with the recently sent value. 'Ptr' is a pointer to an array used to store indices. If a variable needs to be replicated, then its unique index is added to the array and the pointer position is advanced by one. DOREP is the macro that does all that. If you're familiar with the replication statements in UnrealScript, GetOptimizedRepList() is the C++ version of that. It's called optimized because it is much faster than the UnrealScript equivalent. Overall I think it is a really nice way to do things. It's very flexible. The code you posted from Source doesn't look like it has the same purpose as that. Inverness fucked around with this message at 17:27 on Dec 7, 2010 |
# ¿ Dec 7, 2010 17:22 |
|
horse mans posted:I'm starting to tackle a refactor towards composition and component systems in my engine (2D sprite-based), and I'm curious about how other people are doing this. I'm using C# and went with a simple object oriented approach:
Basic movement is done by setting the velocity property of a movement component.
The movement never actually interacts with any rendering code. That is handled by a separate system which finds all visible renderer components and provides them with an interface that they can use to draw sprites. A sprite component would only draw one, while an animation would draw several. Here is the aforementioned level link behavior: http://pastebin.com/xWmA5a5t I also construct my actors by declaring their components and properties in archetypes. These are merged with whatever is specified at spawn time either by code or by an individual object in the level editor. code:
|
# ¿ Jun 19, 2014 00:23 |
|
Sagacity posted:Sure, that would be inefficient. But you can just cache that information. This is where messaging would be appropriate (i.e. "a new entity has arrived, it has these components: x, y, z"). Efficiency is much less of a problem if the action is infrequent. You need to be careful to avoid premature optimization. Collision checking and rendering are both frequent so in my case there is a list of both types of components for each map. If I want to do something different like damaging all actors within an area that intersected with my sword swing, then I would be checking each of the actors in that area with health components: code:
Just remember that premature optimization is the enemy. Inverness fucked around with this message at 23:46 on Jun 19, 2014 |
# ¿ Jun 19, 2014 23:37 |
|
The King of Swag posted:I'd like to know how you feel about this hybrid style, and I'd also like to hear what others think of the different proposed styles. Rather than multiplying units by a floating point, have a static method to create them. code:
code:
Inverness fucked around with this message at 03:24 on Jul 7, 2014 |
# ¿ Jul 6, 2014 18:26 |
|
OneEightHundred posted:Keep in mind that part of why TimeSpan works the way it does is because its underlying type is essentially favored by the operating system, and its smallest representation divides evenly into every larger representation, so you never have to worry about getting subtle rounding errors from feeding a value to it and then reading it back out the way you would with most units of measure. In this case, if mass stored as milligrams internally, then 1 pound would get you 453592.37 mg and 7000 grains... 453592.37 mg (64.79891 mg times 7000). So they would be exactly equal there.
|
# ¿ Jul 7, 2014 06:03 |
|
Jewel posted:That's why you're supposed to always compare with a small error margin with floats? Even resharper gives you a warning if you just use "x == y" and offers to autoreplace it with "Math.Abs(x - y) <= TOLERANCE" (where TOLERANCE is a custom value like 0.001) a.Equals(b, 0.001) for manual way to do it along with a.NearlyEquals(b) that uses a common tolerance. The King of Swag posted:The equality comparison for all types must already be overloaded to comply with IEquatable<T> (all types implement IEquatable<T>, IComparable<T>; they'd be almost useless with keyed or sorted containers without those), and since I'm using Unity, I do the comparison between values with Mathf.Approximately. So far it seems to work great. A standardized unit is already stored internally, and converted to the format needed on request. Also, multiplication with floating point numbers should work fine as it makes perfect sense. 1f * Length.Foot should give you a Length with a value of two feet. C# doesn't have a separate *= operator though anyways. If boxWidth *= 2f is legal then boxWidth = boxWidth * 2f is what it will actually be doing since you will have needed to define the * operator to do that.
|
# ¿ Jul 7, 2014 16:57 |
|
Really? RakNet source has always been free to download. You still have to pay if you want to use it commercially.
|
# ¿ Jul 7, 2014 18:51 |
|
The King of Swag posted:Two floats with the "same" value that were come across with different calculations, will more often than not, not actually equal each other. Making the default equality operator actually check for exact equality is almost never what you want, which would make feeding them into a collection a serious pain. The best solution would be having the default equality operator perform a tolerance check, and then have another ExactlyEquals() method that will perform an exact equality check. The question arises as to what does a user do if they don't like the tolerance of the default equality comparison. People have different needs after all. That tolerance is also obscured from a casual glance at the code unless you go into the documentation to check what it is. Maybe you could do something like specify the tolerance for the default comparisons statically or for a specific thread, but it still seems like it is introducing uncertainty. You're changing the behavior of the equality operator by having it be tolerant by default. It's something I specifically advise people against doing when it comes to languages that have operator overloading.
|
# ¿ Jul 7, 2014 20:12 |
|
The King of Swag posted:I'm going to put some serious consideration into this; probably mock something up and see how unwieldy it is to use compared to how it is now. I have the feeling (actually, I'm almost certain) that it'll make them unwieldy to use as keys in keyed collections, but might make other comparisons easier to make, if I allow for variable tolerances; either on a type or per-instance basis. This is a struct I made to test my ideas: http://pastebin.com/vLCfUg3q It seems Mass.OneKilogram.Kilograms is not a clean 1.0 but 0.999 repeating due to the number of digits involved with that property. Not sure how much of a problem that would be for a user. Seems like a double for internal storage would be better anyways as opposed to what is basically fixed point math. Since you're doing this specifically with Unity which prefers floats over doubles, you could have your properties provide floats by default with another for doubles. so m.Pounds would return a float and m.PoundsAsDouble would return a double. Alternatively if you want to focus outside of Unity, m.Pounds for double and m.PoundsAsSingle for float. Inverness fucked around with this message at 22:48 on Jul 7, 2014 |
# ¿ Jul 7, 2014 22:44 |
|
C# also offers the 128-bit decimal type. Never used it and no idea how it performs. It's mostly intended for financial calculations it seems.
|
# ¿ Jul 9, 2014 00:36 |
|
The King of Swag posted:Just to comment again on the floating point issues; I just finished writing (and verifying it works with tests) a fuzzy comparator and hashable fuzzy comparator. Following Inverness's suggestion, I made the different types perform regular equality checks instead of fuzzy equality checks. If you explicitly want fuzzy equality or comparison, you can do this: When you want to customize the hashing behavior of a dictionary, you should provide the dictionary a custom IEqualityComparer<T> implementation. Dictionaries and other properly designed hashing collections use an instance of this and can take one as a constructor argument. When you don't provide one, C# creates a default equality comparer that calls the GetHashCode() and Equals() methods of the instance object. A custom equality comparer need not even touch these methods. Default equality comparer types exist for things like case insensitive string comparison and such. Your other example: code:
code:
Both of these will fit in with the conventions used by the .NET Framework and other libraries. If you decide to do it this way, you would construct your custom equality comparer instance with the customError and customULPTolerance arguments that will be used when calling Equals() on the instance. code:
code:
Inverness fucked around with this message at 00:05 on Jul 12, 2014 |
# ¿ Jul 11, 2014 23:55 |
|
It seems Unreal Engine 4 already has preview notes for 4.4. They're just wrecking the competition. One of the advantages Unity had over UE4, 2D support, is a gap being closed by the Paper2D extension.
|
# ¿ Aug 2, 2014 22:50 |
|
It doesn't help that Unity chose to implement their own version of Mono instead of licensing the existing one. Which means tremendous amounts of work are going to go into reinventing the wheel in order to keep their version of Mono up to date with C#. Those are resources that could have been spent improving Unity itself. Considering the pace Unity is at now, I expect the gap between their Mono version and the latest C# to widen and complaints to increase as people lose the ability to have the same source run on all of Unity, .NET, and Mono. UE4 removed UnrealScript because they finally got to the point where the cost of having to implement things in UnrealScript with all of the interop overhead, lesser debugging features, and weaker IDE tools outweighed the benefit of avoiding C++ for higher level code. Jo posted:I'm in kinda the same boat. The right way (or any way) to do stuff in Unreal feels masked behind a bunch of boilerplate. Maybe the Unity style of "everything is a surface-level component" leads to obtuse or bad design in larger projects, but boy does it help early on.
|
# ¿ Aug 4, 2014 03:26 |
|
xgalaxy posted:This is exactly the thing I'm battling now with my posts in another thread regarding SeviceStack. The stock library functions fine under Xamarin.iOS and Xamarin.Android but didn't work on Unity. Luckily this particular library was really easy to port. However, other libraries which utilize .NET 4+ that work perfectly fine on Xamarin are not portable to Unity without tremendous amounts of effort, especially if they make heavy use of new .NET features like tasks and async / await. If they have the resources to sink into making a C# to native compiler or maintaining their own version of Mono they should drat well have the resources to pay up for the latest Mono version. darkpool posted:I've been at a bunch of Unity events this year, once I was at dinner with the management just after the UE4 source announcement and the discussion went something like this. You don't really need anymore evidence than this that Unity is on a downslide that will require a management change to get off of their asses. Jo posted:Let's take this example. I want to create an item which is visible, has physics, and can be picked up by the player. In Unreal I'd probably subclass Actor, right? Your unity example has you holding a permanent and then checking the distance between the player and the pickup for each pickup while ignoring any possible collision volume or mesh. Yet your UE4 example is doing it more properly by creating a sphere for collision and specifying the static mesh for the visual aspect. The two examples really aren't showing the same thing. You're right that you have more code to implement that, but then C++ is more verbose and UE4 more powerful. It would only be something you'd need to implement once really before reusing the class. roomforthetuna posted:UE4's "flappy chicken" demo appears to be 28MB on Android. As some kind of person from medieval times this makes me sad - you could totally have played a game like that on a machine with 16K. Even allowing for higher resolution graphics and a reasonable amount of bullshit 3D interface wrangling surely we shouldn't be excusing this "everyone has infinite everything" approach to modern software development. We'll never get nice things if we keep making the same old poo poo take up the full hundreds-of-times expanded capacity of our computer-machines. Get off my lawn. Edit: dupersaurus posted:In a competition of capability vs barrier to entry, Unity's still and likely will be top dog for awhile. We the regulars are often of a level in which Unity's deficiencies compared to UE4 might start to matter (and even then a lot of us are still using Unity); but to someone coming in new as a "making games sounds fun" person, or even an experienced hobbyist, how likely are you actually going to recommend UE4 over Unity? I can't imagine that's something that's going to change soon or very easily, no matter how much Unity might (a big might) screw things up. I haven't used Unity myself so I can't really make a real comparison. Inverness fucked around with this message at 23:10 on Aug 4, 2014 |
# ¿ Aug 4, 2014 23:06 |
|
It depends on what you mean by "not doing anything in the editor". If you mean minimizing it or not having it focused, yeah I'm sure there is room for optimization there if UE4 doesn't do it already. If you mean having it activate but just not moving your mouse doing any input then that will not help as much because, unlike your typical desktop application, the GUI is rendered by the engine at some high FPS and redrawn constantly just like anything in the game.
|
# ¿ Aug 5, 2014 23:21 |
|
Jo posted:I don't think I'm storing a reference to the player in the Unreal code, am I? I _am_ in the Unity code because it makes it faster to check the transform. In the UE code, if I gave the item to whatever pawn collided with APickup, is there a chance a non-player character could pickup the item, or are the pawns solely players? quote:The Unity example is checking to see if the distance from the player is less than the pickup threshold, yes. I get that it means the player could theoretically pick up an item through a wall, but that fix is a raycast away. Wouldn't a sphere collider in the Unreal example also have the same problem of picking up things through walls? Why is a sphere collision 'more correct' than checking the distance? quote:I think it's not an unfair comparison. I'm showing what it takes to have an object which is visible, has physics, and can be picked up (or have a pickup function be called) in Unity and in Unreal. The means by which they need to have this done are different, yes, but I think it qualifies well my argument that Unreal has more 'boilerplate' code to get things going. I can't just make a component and attach it to an object. I need to either make a new object, subclass an object (maybe rework my hierarchy), or fiddle with Unreal's component system (which I haven't tried yet). It's not so much that C++ is more verbose than C# (it is, but that's not really why the example is longer), it's because when I make an object in Unreal I need to define my Mesh object, my collision primitive, set the possibly overridable OnPickup function, and do all sorts of other things rather than add another behavior onto an object which has all these. The difference in length stems from (I'd estimate) 50% component versus inheritance and 50% C++ vs C#. The reason I didn't feel it was a fair comparison is because both engines have existing systems for handling collision that you were not using. Raycasting every frame on a specific player reference seems like just about the worst way to do it. I'm sure the Unreal code would end up larger but it'd still make a better comparison if you were doing it properly for both. Now then, I was just looking through the code for the newest ShooterGame example project for UE4, and found a pickup class that demonstrates just what we were talking about : ShooterPickup.h ShooterPickup.cpp ShooterPickup_Ammo.h ShooterPickup_Ammo.cpp
|
# ¿ Aug 6, 2014 01:52 |
|
Jo posted:That's true. I guess I could have an extra collider in Unity and use the OnCollisionEnter. I hadn't thought about that when I wrote it, but it would make the Unity code shorter. I'd just override the OnCollide or OnCollisionEnter. No need to raycast or any of that. That balances out the demo and Unity still ends up being less code. Again, this is just a side-effect of mostly component based versus inheritance based. That's what leads me to say Unreal Engine requires more boilerplate: to add functionality to what we'd think of as an in-game object, you need to subclass an object with the functionality, rather than simply making a component. I believe the latter leads to shorter code and faster development, but allows people to make bad decisions and doesn't punish lazy programming. But still, remember that you're making your PickupHandler MonoBehavior to add in your code that actually works with the components. That is equivalent to the subclassing in Unreal in regards to where your component-using logic is going. Making an actor subclass with logic that uses components attached to it isn't that much different from making a component subclass that uses components attached to a common actor. Though of course the actor subclass is more limited in how you use it compared to a component. Inverness fucked around with this message at 03:42 on Aug 6, 2014 |
# ¿ Aug 6, 2014 03:37 |
|
echinopsis posted:Is there an issue using this preview version of UE4 4.4 to start to develop on? I mean I know I'm very new and it's very likely by the time I start making what I really want to I'll start fresh anyway and it might not be preview by then but regardless is it difficult to import from say 4.3 to 4.4 or whatever?
|
# ¿ Aug 12, 2014 11:57 |
|
Unreal Engine 4.4 is released Only one month after 4.3.
|
# ¿ Aug 15, 2014 01:55 |
|
Quiet_ posted:I made a whole "game" with a hud and enemies, win/lose conditions, weapons etc etc in just blueprints. I could see getting into c++ nitty gritty for things as echinopsis says (accessing vertex info)
|
# ¿ Aug 15, 2014 13:20 |
|
Obsurveyor posted:I think you're confused because they already have two different license models. What they said was customers don't really want a royalty-based one. If there is not enough demand then there's no business reason to spend the money for all the infrastructure that supporting and, more importantly, enforcing the royalty model would require.
|
# ¿ Aug 15, 2014 13:40 |
|
Here is a blog post about a team that switched from Unity to UE4 and feel much better about it. The screenshots comparing their old Unity vs new UE4 build is like night and day. I doubt that's the best Unity can do so they most not have been comparing things evenly there. http://martiancraft.com/blog/2014/08/an-unreal-decision/ I also noticed that the new Content Examples project for 4.4 includes a level demonstrating Paper2D features. One of the things I thought might be useful is a sprite animation tool that doesn't involve whole separate frames but instead defining sprite parts then animating them by changing their position over time. I started to make one in C# but never had the motivation to finish. None of the existing tools I found that might have enough functionality for me even supported defining a sprite based on a part of a texture instead of a whole one. What I have in mind is pretty simple too. You define a set of sprites for an animation. Each sprite is defined as a rectangle from a source image. This sprite set could be exported or imported as necessary. For each frame in the animation you merely place sprites on a 2D plane. Things like custom properties could be defined per animation or per frame for things like when to play a sound or when to indicate damage should be trigger in an attack. Texture substitution would also be available in-editor so you could reuse the same animation with differently textured sprites as necessary. Maybe one day I'll work up the motivation to finish it. Inverness fucked around with this message at 14:43 on Aug 15, 2014 |
# ¿ Aug 15, 2014 14:24 |
|
Sagacity posted:You seem to be describing something like Spriter? xgalaxy posted:Bone based animation for Paper2d is on their trello roadmap.
|
# ¿ Aug 15, 2014 15:59 |
|
I'm also someone that fell in love with C# after moving away from C++. I don't think moving from C# to C++ in UE4 for development would be too much of a hurdle. I say this mostly because Epic seems to be good about structuring their code and providing the tools so you can get the most done with the fewest amount of lines possible. And yes the C++11 and C++14 features are a positive. That's not even getting into Blueprints. UE4 4.5 will also be introducing hot reloading for gameplay code. You'll be able to write all of the C++ you need and compile and load it into the game without ever restarting the editor. Of course that doesn't help if you crash the game. It's also odd for me to think about how that is even possible. I suppose its a unique advantage due to the nature of C++. You certainly can't reload assemblies in C# without placing them into a separate app domain that introduces marshaling overhead at the boundary. On a C++ note, even though I rarely touch it nowadays, Microsoft's glacial pace when it comes to supporting the new standards irritates the gently caress out of me. Inverness fucked around with this message at 04:58 on Aug 16, 2014 |
# ¿ Aug 16, 2014 04:55 |
|
Shalinor posted:If you crash your game in UE4 in editor, does it take the entire editor down with it, or is editor state independent / you can recover from a crash or an infinite loop without losing everything since the last time you saved?
|
# ¿ Aug 16, 2014 17:54 |
|
They sure changed their tune pretty fast, though not with the parts that matter the most.
|
# ¿ Aug 22, 2014 02:17 |
|
A recent Epic blog post included a link to an architectural demonstration with UE4: https://www.youtube.com/watch?v=UwEuSxAEXPA
|
# ¿ Aug 28, 2014 01:00 |
|
lethal trash posted:At my office we've been having so many problems using git as our primary source control for all assets. So now we're looking at alternatives, those being Perforce and Plastic SCM. I don't think we'll be going with Perforce, so that really only leaves Plastic SCM. I tried it out a little bit last weekend for the LD30 and I was pretty pleased. It was fast, the error messages were helpful and everything worked nicely. I am wondering if anyone else has used Plastic and if they can share their experiences? If you've used it in a production environment even better. I really want to know about the gotchas that come after longer use.
|
# ¿ Aug 29, 2014 16:23 |
|
I didn't even know SourceTree existed until now. I always just used TortoiseGit and TortoiseHg. I assume this is better?
|
# ¿ Aug 29, 2014 20:11 |
|
Stick100 posted:Yup you are 100% correct. If source control protocal doesn't give you exclusive checkout you're then no client will help. Does perforce allow exclusive checkout? It's also compatible with Git. Perforce is the name I see tossed around for companies that would need some high quality centralized version control, so I would probably go with it if git was unsuitable. UE4's integration is also a good reason if you use that.
|
# ¿ Aug 29, 2014 20:28 |
|
echinopsis posted:I'm thinking about Source Control purely as a backup (I am a 1 man thing) so based on this discussion I can't work out which is the easiest and best AND FREEEST for UE4
|
# ¿ Aug 29, 2014 21:05 |
|
echinopsis posted:Thanks. I believe I need a plugin for UE4 right? You don't need to use GitHub. You can create a Git repository and just keep it local without pushing it anywhere. You don't need to use GitHub or Bitbucket unless you want to back things up externally and share with others. GitHub does not actually allow you to create private repositories for free. Bitbucket does though.
|
# ¿ Aug 30, 2014 00:04 |
|
Someone might have made a Git plugin for UE4. Edit: Now that I read what you said in more detail. Can you elaborate on the trouble you had. You first should learn to use Git before you try to integrate it into your workflow. Just tossing it in is asking for trouble. I don't even know how UE4 handles version control. If you tried to get a Git plugin without actually getting Git you probably had trouble.
|
# ¿ Aug 30, 2014 00:15 |
|
Which line is the error message indicating?
|
# ¿ Sep 9, 2014 04:26 |
|
pianoSpleen posted:The only place it gets awkward is if there are specific instance traits that only certain ItemTypes can have (for example, a "Condition"/"Durability" trait for only armour). There are a few workarounds but they're all a bit clunky. If you have a limited amount of types and want to be more strict, using an enum for all possible types is fine.
|
# ¿ Sep 20, 2014 22:08 |
|
|
# ¿ Apr 28, 2024 12:34 |
|
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 |