« first day (3978 days earlier)      last day (1339 days later) » 

nwp
nwp
08:33
I'm trying to get intellisense to work in VSC for Unity. Apparently I need to install the Visual Studio Code Editor from Unity's package manager. Unfortunately it's perpetually stuck fetching packages :(
nwp
nwp
08:53
Apparently you're supposed to go to Help->Report a bug. Unfortunately it's a modal dialog so I can't.
nwp
nwp
09:04
It also didn't recover the project correctly after I killed the editor.
And on second try it just works.
 
2 hours later…
nwp
nwp
11:36
I made a circle that can move around a square in a 2D plane. I feel accomplished.
2
user92578
Nice!
nwp
nwp
12:01
Still don't have intellisense though :(
 
1 hour later…
nwp
nwp
13:09
Omg I finally got intellisense.
Someone should really package this so not every developer has to go through this pain, but that won't happen.
 
2 hours later…
nwp
nwp
14:47
> Operator '*' cannot be applied to operands of type 'Vector2' and 'double'
But why?
user92578
Would have to promote to Vector2<double> but I don't think that's a thing in Unity?
nwp
nwp
Casting the double to a float is easier, but still.
I guess they really hate implicit conversions.
user92578
Ugh I don't like the hidden cast
user92578
Much rather see vec * (float)d than have it cast without seeing the cast
nwp
nwp
Well, it's an explicit cast.
user92578
14:51
I thought you wanted Unity to cast inside the operator*(Vector2, double) overload?
nwp
nwp
I'd want Vector2 * double to just work because it makes sense to me. I guess that does require a cast at some point.
Actually the root cause is that Math.Sqrt doesn't work on float. I should check if there is MathF.Sqrt or something.
By "doesn't work on float" I mean "implicitly promotes the float to a double".
 
1 hour later…
nwp
nwp
16:11
I managed to make the camera orbit the player. Not what I wanted, but kinda cool.
 
2 hours later…
18:35
Well, got some great news! My retro arcade game is essentially done. Now, I'm off to make the artwork and animations.
3
19:19
@nwp Yeah, in C# the convention is that you can cast implicitly from float to double, but you need to be explicit when you want to go from double to float - as a kind of insurance against accidental loss of information. Similarly for casting from a narrower to wider integer type or vice versa.
(A convention that Unity violates by letting Vector3 implicitly cast to Vector2, which I think was a terrible decision, but meh...)
They also let layermask implicitly cast to int which opens up other problems. So that's made me wary of implicit casting. 😉
@nwp And yeah, UnityEngine.Mathf has single-precision float versions of all the main math functions that use doubles in System.Math, including Mathf.Sqrt, though I imagine you found that already.
I usually don't touch System.Math in a Unity game. Single precision has been enough for what I need. I've only resorted to doubles when writing StackExchange answers about precision limits, or one time when trying to simulate player populations where I expected very small variations.
I thought narrowing conversions were relatively eschewed all around. Not just in C#. I know the Core Guidelines do
user92578
I think C++ loses any implicit conversion discussions by default just because foo("asd") will choose a boolean overload over std::string
It does WHAT?
But C++ will convert anything. The whole point is that isn't a good thing.
I hate implicit conversions. What is the purpose of static typing then?
user92578
Yeah
user92578
Sometimes they are nice though, I like being able to just return T{}; even if my function output type is std::optional<T>, or being able to create wrapper types the behave like the underlying types when necessary
19:44
I also like when 1 * .5 works. But better to be explicit imo.
user92578
I use strongly typed value-type wrappers pretty much everywhere, so not a lot of raw ints/floats around, but the issue with my current implementation is that the unit is tied to the representation, so all pixel quantities are currently always integers, while it would be sometimes nicer math-wise to perhaps also allow floating-point pixel quantities
20:19
@OKprogrammer Nice work!
 
3 hours later…
23:08
@Vaillancourt Hey! New color on your star!
I like
So, I have a general game design question. It might be a fit for the site but I will need to think exactly how to ask it first. But, as a general rule in RPGs, you want the work/reward ratio to be relatively balanced. Imbalance leads to people not pursuing the other options. Nobody grinds in the cave for gold or experience unless it is a good place to grind. So much so that many people spend a lot of time finding optimum grinding locations.

So what if it was imbalanced on purpose. What if the puzzle was to work out the optimal places. Could this be a good puzzle dynamic? I'm trying to thin
23:55
"you want the work/reward ratio to be relatively balanced" are you certain of this for all cases?
does risk figure into this at all? I think it does

« first day (3978 days earlier)      last day (1339 days later) »