|
Yeah Unity won't serialize multidimensional arrays and it sucks. I needed them in the editor, too, and this is how I got around it: code:
|
# ? Oct 15, 2014 02:00 |
|
|
# ? Apr 26, 2024 14:46 |
|
What's wrong withC# code:
Edit: Oh, completely missed needing them in the editor. It's not that hard to write a custom editor property for a type like this. Jewel fucked around with this message at 02:11 on Oct 15, 2014 |
# ? Oct 15, 2014 02:08 |
|
Onion Knight posted:Yeah Unity won't serialize multidimensional arrays and it sucks. I needed them in the editor, too, and this is how I got around it: In his particular case you don't even need a multi-dimension array. In a single-dimension array, the index of each cell can be calculated by something like: code:
|
# ? Oct 15, 2014 02:41 |
|
BabelFish posted:UE4 4.5 is out: https://www.unrealengine.com/blog/unreal-engine-45-released Streaming Media and UMG are awesome and much welcomed additions for me, but I am disappointed that HTML5 packaging didn't make it to the binary editor this version. Maybe in 4.6...
|
# ? Oct 15, 2014 12:52 |
|
Lowen SoDium posted:Streaming Media and UMG are awesome and much welcomed additions for me, but I am disappointed that HTML5 packaging didn't make it to the binary editor this version. Maybe in 4.6... I'm pretty excited about C++ hot code reloading, although I'm not expecting the same state of bliss I get from Common Lisp development in Emacs + Slime, I'm hoping it will alleviate some issues I am having with UE4. I'm mainly developing on OSX and my main interest is procedural generation of meshes and so far my love affair with UE4 hasn't really gotten off the ground yet. Being more a code / no-IDE kinda guy I'm having a hard time getting comfortable with UE4. The whole workflow when adding new C++ classes to a project feels clunky and I constantly feel I'm missing some fundamental knowledge to make development in UE4 go more smoothly. Anyway, just a minor rant because I've been frustrated at my inability of getting to grasp with UE4 while it seems so easy for everyone else. aerique fucked around with this message at 14:20 on Oct 15, 2014 |
# ? Oct 15, 2014 14:18 |
|
aerique posted:Anyway, just a minor rant because I've been frustrated at my inability of getting to grasp with UE4 while it seems so easy for everyone else. I've been having the same issue. Maybe it's because I'm so used to my workflow in Unity but I've found UE4 to be utterly miserable every time I fire it up. I'm going to make my third attempt to transition this weekend but I don't have my hopes up. It doesn't help that every time I try one of their official tutorials, it doesn't compile and I lose interest before I have a chance to figure out why. I'm probably just spoiled.
|
# ? Oct 15, 2014 17:08 |
|
Are there any decent resources on entity systems? Im an idiot and im working on builder/strategy kind of game. Im using Ashley framework right now. I like it, but some extra resources would be great.
|
# ? Oct 15, 2014 18:28 |
|
evilentity posted:Are there any decent resources on entity systems? Im an idiot and im working on builder/strategy kind of game. Im using Ashley framework right now. I like it, but some extra resources would be great. http://gameprogrammingpatterns.com/component.html That whole website is awesome actually.
|
# ? Oct 15, 2014 18:38 |
|
Onion Knight posted:Yeah Unity won't serialize multidimensional arrays and it sucks. I needed them in the editor, too, and this is how I got around it: Not sure if there even is a better way. Formatting all of your DOM (.xml, .json) to work like arrays is my preferred way to go since Unity doesn't serialize anything more complicated than a List/Array. Trying store your data in a more complicated fashion and having it "stitched up" at runtime is way more work than it's worth: e.g. having two arrays in a .json (one representing keys, and the other representing values) and having them assembled into a Dictionary during some initialization function when the object is instantiated. What are you trying to deserialize that can't be represented using plain-old arrays?
|
# ? Oct 15, 2014 20:37 |
|
aerique posted:Anyway, just a minor rant because I've been frustrated at my inability of getting to grasp with UE4 while it seems so easy for everyone else. I haven't heard anyone say it's been easy to start coding in, but blueprint works well. I wish Unity 5 with good lighting/WebGL and the ability to use more than 3.2gb in the editor would get here already. That or the ability to use C# on UE 4. If you watch the live stream with a European developer (can't recall the name) they show tons and tons of blueprint and he explains that they use C++ for just a few things here and there (he really wanted to get the system clock) and then expose that up to blueprint. Stick100 fucked around with this message at 21:48 on Oct 15, 2014 |
# ? Oct 15, 2014 21:46 |
|
poemdexter posted:http://gameprogrammingpatterns.com/component.html Yeah thats pretty good, Ive read it all some time ago. A refresh wont hurt. I would love something larger in scope though. Most of the stuff ive found are a bunch of blog posts.
|
# ? Oct 15, 2014 23:53 |
|
I changed it to a single-dimensional array, and obviously, it works right away.code:
code:
|
# ? Oct 15, 2014 23:55 |
|
Stick100 posted:I haven't heard anyone say it's been easy to start coding in, but blueprint works well. I wish Unity 5 with good lighting/WebGL and the ability to use more than 3.2gb in the editor would get here already. That or the ability to use C# on UE 4. Yeah my general approach to getting to grips with UE4 is to start with everything in blueprints and then boil it down to C++ once I get it working. The API across both seems to match up quite closely. There will also be a few thing you will keep to blueprints anyway. (Animation/Behavior Tree related)
|
# ? Oct 16, 2014 00:44 |
|
Unity Serialization callbacks: http://docs.unity3d.com/ScriptReference/ISerializationCallbackReceiver.OnBeforeSerialize.html This will allow you to serialize manually things that are not supported out of the box. Also there is this from 1.5 years ago that is a bit out of date but is mostly relevant. https://www.youtube.com/watch?v=MmUT0ljrHNc
|
# ? Oct 16, 2014 13:01 |
Boz0r posted:My next problem is that I have an ObjectField which loses its reference when serializing. Also, although the tile array gets saved now, it also doesn't retain its reference to the actual objects in the scene, so if I delete them in the array, they don't get deleted in the scene. This might be a problem with deep copying, where when the array is serialized, all the objects in the array are just copies of the scene objects instead of being the same object. If it is, I had the same problem when I saved my level data - what I ended up doing is replacing all the scene objects with the ones in the array when the data was loaded. You have to be careful with this though, because if your objects have links to other objects, then those also become copies, and it all just falls apart from there.
|
|
# ? Oct 16, 2014 17:08 |
|
Been messing around with Zenject in Unity for the last couple of days. It's an Inversion of Control/Dependency Injection framework. It's cool, and it has the ability to clear up a lot of Unity's inherent mess, but I was also inspired to make this diagram: I call it "Circular Dependencies."
|
# ? Oct 21, 2014 03:00 |
|
Nition posted:Been messing around with Zenject in Unity for the last couple of days. It's an Inversion of Control/Dependency Injection framework. It's cool, and it has the ability to clear up a lot of Unity's inherent mess, but I was also inspired to make this diagram: Basically you've realized that all the solutions for organizing our code are really poo poo and no one has been able to come up with something that doesn't want to make you vomit.
|
# ? Oct 21, 2014 03:21 |
|
Yes, I thought about inserting a branching ??? entry after IoC Framework for some future construct that breaks from the circle, but decided I didn't have that much hope.
|
# ? Oct 21, 2014 03:23 |
|
I think the lesson learned is to binge code until you finish and promptly purge everything you know about the routine from your head.
|
# ? Oct 21, 2014 03:23 |
|
DI can have bad effects on performance, too, so that's nice.
|
# ? Oct 21, 2014 03:25 |
|
Where in that graph is the time-honored method of everything being basically globals and goto? That's got all the advantages and none of the disadvantages!
|
# ? Oct 21, 2014 05:27 |
|
roomforthetuna posted:Where in that graph is the time-honored method of everything being basically globals and goto? That's got all the advantages and none of the disadvantages! I actually successfully used a GOTO for the first time this in 25 years this weekend (full support for GOTO in modern C# apparently). GOTO can be a surprisingly useful method to quickly modify behavior (it was a time limited programming competition).
|
# ? Oct 21, 2014 15:14 |
|
Stick100 posted:I actually successfully used a GOTO for the first time this in 25 years this weekend (full support for GOTO in modern C# apparently). GOTO can be a surprisingly useful method to quickly modify behavior (it was a time limited programming competition). At the very least you've got to use C# goto for full use of switch fall-through. code:
|
# ? Oct 21, 2014 15:23 |
|
I have exactly one GOTO in the maybe ~30,000 lines of C# code in Scraps. It's in a big method where I set up a bunch of stuff, and the method can either run right through or it can finish early, but still needs to do the same clean-up code at the end either way. At the very end it assigns the results of its calculations to the object that was originally passed in. Obviously I could call a separate "clean-up and assign" method, but it'd have to have a big list of variables passed into it that the first method created, so I made the executive decision to just "goto Cleanup" instead. Works great.
|
# ? Oct 21, 2014 19:36 |
|
goto always works great its like sticking your bumber on your car with duct tape. flawless for practicality reasons but ugly 2 look at
|
# ? Oct 21, 2014 19:46 |
|
Nition posted:I have exactly one GOTO in the maybe ~30,000 lines of C# code in Scraps. It's in a big method where I set up a bunch of stuff, and the method can either run right through or it can finish early, but still needs to do the same clean-up code at the end either way. At the very end it assigns the results of its calculations to the object that was originally passed in. I found some old code of mine that exits a loop early (almost as bad as goto!) that's similar to what you describe; I'm passing in like a dozen extrapolated values and just don't want to have to deal with them after a certain point. In the one case where further processing isn't necessary this was the comment: code:
|
# ? Oct 21, 2014 19:57 |
|
Should've used goto GetTheFuckOut.
|
# ? Oct 21, 2014 20:07 |
|
echinopsis posted:goto always works great I like the analogy. Both sound reasonable at the time and both can lead to disaster if it comes into contact with someone else.
|
# ? Oct 21, 2014 20:10 |
|
Nition posted:the method can either run right through or it can finish early, but still needs to do the same clean-up code at the end either way try-finally?
|
# ? Oct 21, 2014 20:37 |
|
Everyone is trying to get my man nition to weasel out of the GOTO I like to think every software worth a drat has a GOTO hidden in there somewhere. Like taking a jizz in the coleslaw at KFC, you just know that ONE of those pottles has it. It's like a signature.. "I was here" it says "I was alive. I EXISTED"
|
# ? Oct 21, 2014 21:18 |
Well that certainly was a post.
|
|
# ? Oct 21, 2014 21:59 |
|
There's only the one goto, I promise.
|
# ? Oct 21, 2014 22:10 |
|
Yeah and only "one" pottle of coleslaw at KFC has the special sauce I got your back don't you worry
|
# ? Oct 21, 2014 22:24 |
JGTheSpy posted:I've been having the same issue. Maybe it's because I'm so used to my workflow in Unity but I've found UE4 to be utterly miserable every time I fire it up. I'm going to make my third attempt to transition this weekend but I don't have my hopes up. It doesn't help that every time I try one of their official tutorials, it doesn't compile and I lose interest before I have a chance to figure out why. I'm probably just spoiled. Pardon me for adding to the circlejerk. I'm in complete agreement. The damndest thing is I can't seem to figure out exactly WHY Unity is easier to work in than Unreal. I would chalk it up to experience, but I really am not all that familiar with Unity. I'd chalk it up to the availability of online examples, but I rarely find myself going to those for most of my problems. I thought at first it was autocompletion, but Visual Studio should blow Monodevelop out of the water. Anyone's guess is as good as mine. Does component based vs. class based really contribute that much? Does C++ really provide that much more headache than C#. We already had the 'boilerplate' discussion, but I've not had any additional insights since then. I'm still hopeful for Unreal4. It's pretty and the level editor actually works exceptionally well.
|
|
# ? Oct 21, 2014 23:19 |
|
Jo posted:Pardon me for adding to the circlejerk. I'm in complete agreement. The damndest thing is I can't seem to figure out exactly WHY Unity is easier to work in than Unreal. I would chalk it up to experience, but I really am not all that familiar with Unity. I'd chalk it up to the availability of online examples, but I rarely find myself going to those for most of my problems. I thought at first it was autocompletion, but Visual Studio should blow Monodevelop out of the water. Anyone's guess is as good as mine. Does component based vs. class based really contribute that much? Does C++ really provide that much more headache than C#. We already had the 'boilerplate' discussion, but I've not had any additional insights since then. Component-based-engine superiority.
|
# ? Oct 21, 2014 23:33 |
I just want to say that no fall-through in switch statements is bullshit. Carry on.
|
|
# ? Oct 21, 2014 23:42 |
|
Unity is "easier" because you just create a component, drop it on any object, and it works. That component can be a HealthComponent that displays a healthbar and keeps track of health, also providing a small API to damage or whatever. The problem with Unity is that this is only useful to the smallest of indie games, when you're just starting out and don't know any better about proper code formatting. What happens when you want to add armor? Do you just lump it with the HealthComponent? What happens if you calculate the player's facing direction in a PlayerMovement component, and you want the direction in another script? You have to couple it with PlayerMovement just to get the direction, and by the end of a complex player, everything's coupled so tightly that you might as well just have one huge megacomponent, and by that point you'll probably just be wishing you could have coded the entity to begin with, rather than using components. The other problem with unity is how there's just so many missing tiny features all over the place. You want to zoom out on the animation preview? Sorry! You want to adjust the handle lengths on an animation curve? Sorry! You want to undo while editing an animation curve? Sorry! Not to mention crashing around every corner. And then you get into stuff like unity not even providing a way to make savegames without external plugins written by people who don't really know how to provide an intuitive interface. Or the GUI system being horrible and requiring you pay $100 for a better system (potentially fixed in newer versions but I wouldn't hold my breath). Or having no decal system whatsoever (and a huge flaw that I recently discovered is that in DirectX11 in deferred rendering mode there seems to be no way to have shadows on a transparent (alpha blended) surface, so any custom decals won't work because they'll be fullbright in shadows. The only advantage Unity has is C# is easier, and it was more accessible, but now Unreal is opening up (in both source code and ease of availability) and hopefully Unity will be wiped from existence in a few years. Edit: Also it's more than possible to make some pretty complex games with blueprints alone; no code at all, so that's a possibility if you really hate C++ that much; or can't code. Jewel fucked around with this message at 23:54 on Oct 21, 2014 |
# ? Oct 21, 2014 23:49 |
|
As someone who recently was forced to make the switch from Unity to UE4, I can relate to feeling a bit lost. But trust me, once it clicks and you get comfortable with the C++/Blueprint structure you'll never look back. Jewel posted:Also it's more than possible to make some pretty complex games with blueprints alone; no code at all, so that's a possibility if you really hate C++ that much; or can't code. People who make games entirely in Blueprint are in for some pain. While it's totally possible to make small games entirely in Blueprint, the entire system is built to be extended and manipulated in C++. Currently, my method is to make C++ classes that get extended into Blueprints in my project to handle hooking up assets and do minor adjustments / hook into UMG. It also makes for an excellent place to prototype and poke at the various APIs, but I always refractor any complex expensive stuff back into the C++ class. The engine handles that very smoothly, the Blueprint sub-classes are updated with the new functionality as soon as you compile without any hassle. Calipark fucked around with this message at 00:24 on Oct 22, 2014 |
# ? Oct 21, 2014 23:50 |
|
I'd never done development before starting UE4 so I have started fresh with blueprints. The problem with UE4 as such is that there are many ways to do a thing, but it's never really clear if you've done it the best way. And a lot of the examples show you how to achieve something but not necessarily in the best way. For example, the ball rolling demo works fine, and the player camera is attached to the rolling ball BluePrint. This works and I used that idea with my game for a bit, but it turns out, that while it's a quick and easy way to do it, it's not the best way at all. If you use a Camera Manager, and make it point at whatever you're controlling, you have a lot more flexibility. That's just an example but my entire journey for 3 months has been through doing something with no clear direction and only later realising I did it a poor way. Perhaps this issue is on all engines, but it just doesn't help the the examples don't help, and that the tutorials don't tend to cover anything past getting started. I can definitely see people getting lost and I've had to spend a lot of time learning a lot of things through trial and error and reading forum posts etc just how to do things. Welp
|
# ? Oct 22, 2014 00:29 |
|
|
# ? Apr 26, 2024 14:46 |
|
echinopsis posted:Welp Welcome to GameDev.
|
# ? Oct 22, 2014 00:31 |