Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Nude posted:

It seems like Godot wants to be a serious contender for both 2D and 3D game development. With C# (7!) support does anyone know how it compares to Unity? Right now I see it as something that's growing and to keep an eye out for. Would love to hear anyone else's thoughts.

my thoughts mirror yours; i've been waiting for 3.0 to really check it out. based on the 20 minutes i've spent with it, the editor seemed a bit less fleshed out and it seems like you'll spend more time in code.

having the source without dumping loads of money into it seems nice.

Adbot
ADBOT LOVES YOU

Boron_the_Moron
Apr 28, 2013
I've got this idea for a system-building game like Factorio, where instead of building factories and assembly lines, the player has to organise large groups of dumb, predictable labourers. The idea is that the player will have to make systems where different divisions of labour play off each other to achieve various goals, resulting in huge, Rube Goldbergian bureaucracies.

Would Unity be a good fit for a game like that? I've heard some things about Unity not being capable of consistent floating-point maths, and that being important for a complex simulation game like I have in mind. But I don't know for sure. Any thoughts?

munce
Oct 23, 2010


sweet. 2.x worked pretty well, hopefully 3 just makes it better

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Boron_the_Moron posted:

I've got this idea for a system-building game like Factorio, where instead of building factories and assembly lines, the player has to organise large groups of dumb, predictable labourers. The idea is that the player will have to make systems where different divisions of labour play off each other to achieve various goals, resulting in huge, Rube Goldbergian bureaucracies.

Would Unity be a good fit for a game like that? I've heard some things about Unity not being capable of consistent floating-point maths, and that being important for a complex simulation game like I have in mind. But I don't know for sure. Any thoughts?

Unity’s current implementation of .net can be weird at the edges, but it handles floats just fine..?

Nude
Nov 16, 2014

I have no idea what I'm doing.

Boron_the_Moron posted:

I've got this idea for a system-building game like Factorio, where instead of building factories and assembly lines, the player has to organise large groups of dumb, predictable labourers. The idea is that the player will have to make systems where different divisions of labour play off each other to achieve various goals, resulting in huge, Rube Goldbergian bureaucracies.

Would Unity be a good fit for a game like that? I've heard some things about Unity not being capable of consistent floating-point maths, and that being important for a complex simulation game like I have in mind. But I don't know for sure. Any thoughts?

I don't think Unity has any problem with calculating floats.

That said, if you are talking about Unity's coordinate system you would be somewhat correct. The short version is Unity gives you 7 digits of accuracy when you have something in game world. So something that's 700000.01, 0, 0 will be in the same spot as 700000.02, 0, 0. It will still calculate those floats correctly but game wise they will be placed in the same spot. This article goes into greater detail about the limitations of the game coordinate system. For your game I think Unity could handle it just fine. It really depends on how big you want to make this and how much you want to zoom in/out. Kerbal Space Program (which simulates the solar system) was made in Unity for reference. Although admittedly they did use various tricks to get what they wanted.

xzzy
Mar 5, 2009

The concerns with floats has nothing to do with Unity, it's a fundamental limitation of the processors we use.

I think you're putting the cart before the horse, just because there is a limit to floating point precision doesn't mean a Factorio clone in Unity is going to melt down.. you're gonna have to push the envelope pretty hard before you run into issues.


If it still worries you, just do everything with integers and never ever divide or use percentages. :v:

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

roomforthetuna posted:

Is it going to ruin everything if I try to transition my existing project?
The answer is it is a mild pain, but not as bad as the transition from Polymer 1 to Polymer 2 for web things. So far I've found:
You can "export to Godot 3" from a 2.14 project, it doesn't do very much automatically but it does create the project file.
Some of your global settings will be forgotten and have to be replaced (plugins are deactivated for example).
x.get_global_pos() and x.set_global_pos() must be replaced with x.global_position
x.get_pos() and x.set_pos() must be replaced with x.position
x.rotation_deg must be replaced with x.rotation_degrees (which breaks most of my AnimationPlayer links, easiest fixed with opening the tscn files in a text editor and search and replacing things)
residual_motion = move(v) is replaced with collision = move_and_collide(v) and collision.residual, and all the transient collision_normal() functions are now values on that collision object, which is much better but requires a manual translation.
ReferenceFrame nodes will prevent your scenes from loading, and must be replaced with ReferenceRect
animation.set_speed(n) must be replaced with animation.set_animation_speed(n)

Zerf
Dec 17, 2004

I miss you, sandman

Boron_the_Moron posted:

Would Unity be a good fit for a game like that? I've heard some things about Unity not being capable of consistent floating-point maths, and that being important for a complex simulation game like I have in mind. But I don't know for sure. Any thoughts?

Floating point math is inaccurate always, if you want perfect accuracy use fixed point math instead.

josh04
Oct 19, 2008


"THE FLASH IS THE REASON
TO RACE TO THE THEATRES"

This title contains sponsored content.

Consistent is not the same as accurate; if you want to keep two complex simulations in sync over a network or replay the same simulation on more than one platform the consistency is going to be important even if you're correctly managing the accuracy.

Doc Block
Apr 15, 2003
Fun Shoe
Aww, the grid map node is buggy in Godot 3.0 :argh:

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

xzzy posted:

The concerns with floats has nothing to do with Unity, it's a fundamental limitation of the processors we use.

I think you're putting the cart before the horse, just because there is a limit to floating point precision doesn't mean a Factorio clone in Unity is going to melt down.. you're gonna have to push the envelope pretty hard before you run into issues.


If it still worries you, just do everything with integers and never ever divide or use percentages. :v:

I’m unaware of any FPU bugs in any modern processor you’d need to worry about.

There was notably a bug in the original Pentium, but later intel processors do not have that issue.

Concerns on floats over variable precision or non-canonical but valid representations are an issue with the specification, not the processor. A ‘better’ processor won’t redefine what floats /are/.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!
Any hints as to what's happened to the ability to inspect the state of the world while paused has gone in Godot 3? I can see local variables and stuff, but I can't find the scene hierarchy anywhere now.

Also in upgrade fun, my "move the camera to encompass focal objects" code no longer works as before, it seems to work only on one axis now, and my character's legs have become reversed but the head has not even though they're moved and animated from within the same hierarchy.

Edit: Turns out the reason for that is, as well as rotation_deg being renamed to rotation_degrees, the direction of rotation has been reversed, so I had to flip all negative numbers to positive and vice-versa in the animation to get it back to the expected behavior. The head was immune because it doesn't animate by rotation. The feet were upside-down too, but that wasn't noticeable at the scale.

roomforthetuna fucked around with this message at 06:59 on Feb 1, 2018

Obsurveyor
Jan 10, 2003

roomforthetuna posted:

Edit: Turns out the reason for that is, as well as rotation_deg being renamed to rotation_degrees

Have all these name changes been deprecated for awhile or do they not believe in that or some other reason they couldn't? Heard about a lot of these so far and it seems kinda weird to just pull the rug out from under people like this.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Obsurveyor posted:

Have all these name changes been deprecated for awhile or do they not believe in that or some other reason they couldn't? Heard about a lot of these so far and it seems kinda weird to just pull the rug out from under people like this.
Most of the new way is objectively better, so it has that going for it. It looks like they consciously made a decision to say "gently caress backwards compatibility, we're redoing it right".

Unfortunately, a major unintended consequence of this is that thousands of webpages of Q&A that they don't control now have outdated advice that won't work, which is a pretty horrifying prospect. Documentation that you still find when you google for it but is now actively unhelpful is a fine way to make a language unappealing.

Fano
Oct 20, 2010
I spent a few hours messing with godot for the first time and reading up on stuff yesterday since I was excited to be able to use c# with it.

Unfortunately it seems the documentation is not quite there yet for the API and I was having trouble understanding how to get a simple tween to work.

I understand what node paths are but I could not get them to work in the context of the tween, I was fairly certain I was translating all gdscript examples properly too, I saw no errors in the debugger when trying to run my project and I wasn't really sure how to debug further.

I really like the way the design philosophy is implemented though, and I look forward to playing around with it some more later, I hope all the mono stuff gets a proper write up, I guess that will take time.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I think I have an irrational obsession with pulling code out of Unity MonoBehaviour Update() calls so I can possibly just make them ScriptableObjects or something more primitive. I just replaced my damage indicator scrolling up for a time with a tween:

code:
        DOTween.To(
            () => textComp.rectTransform.anchoredPosition.y,
            (x) =>
                {
                    var displayPosition = mainCamera.WorldToScreenPoint(target.transform.position);
                    displayPosition.y += x;
                    textComp.rectTransform.anchoredPosition = displayPosition;
                },
            50.0f,
            DisplayTime
        ).OnComplete(() =>
        {
            Destroy(gameObject);
        });
I mean, I did it. I guess. This is fine. Right?

... I guess next is the code in Update() that makes it flash. I guess that can be a shader!

(actually I think in that case I really should probably be using a shader...)

Boron_the_Moron
Apr 28, 2013

josh04 posted:

Consistent is not the same as accurate; if you want to keep two complex simulations in sync over a network or replay the same simulation on more than one platform the consistency is going to be important even if you're correctly managing the accuracy.

Yeah, this was what I meant by consistency. I don't actually have any desire to make my game networked right now, but I couldn't help looking to the future. I was also wondering if there were any other areas where a lack of simulation consistency could be a problem, that I might not have thought of.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Boron_the_Moron posted:

Yeah, this was what I meant by consistency. I don't actually have any desire to make my game networked right now, but I couldn't help looking to the future. I was also wondering if there were any other areas where a lack of simulation consistency could be a problem, that I might not have thought of.

How much is the simulation managing? If you're just planning to use Unity as just a rendering engine to reflect the simulation, then I wouldn't worry so much. I guess you'd just want to make sure the simulation logic isn't goofing up in Mono.

The one obvious thing to look after when using base floating-point types is performing math on a huge number with a smaller number repeatedly.

You probably know this already, but just to be thorough:
code:
HUGE NUMBER += BIG ENOUGH NUMBER;
Is not the same as:
code:
for(i = 0; i < BIG ENOUGH NUMBER TIMES; ++i)
{
   HUGE NUMBER += 1;
}
The loop will not be so obvious, but it will come out from ticks in the simulation. If you rely on a tick to do little microadjustments and then feed it a whale of a number to perform them, then you'll find the whale isn't changing. You'd get screwed by that without Unity even being on the computer.

Ranzear
Jul 25, 2013

Going to fixed point is good for both consistency and sometimes network (depending on serialization, can save many bytes per number). Figure out how many decimals you actually need first. I'd be surprised if it was more than three. Caliber uses two (positionally, 1% of a pixel). If with fixed point you're still exceeding your upper bound too, you need to reconsider how your game scales itself.

Even in Unity units, three decimals is millimeter accuracy. You have to be doing something like KSP where you're more than seven digits worth of units away from the scene origin to see issues, but then they just pulled a Futurama and made the universe move around the ship instead.

If everything rounds consistently, floating point errors are no issue. Hell, Javascript's notorious ...00004s is why I do this in the first place.

rarbatrol
Apr 17, 2011

Hurt//maim//kill.
Speaking of C#, I've been meaning to mess around with Xenko... anybody try it out already?

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Does anybody know if TextMeshPro has some ability for me to supply a shader? It seems counterproductive to what it's trying to do so I don't think I can. I was hoping to get rid of some logic in a MonoBehaviour that to flicker some text by changing the color of the text on small, regular intervals.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Rocko Bonaparte posted:

Does anybody know if TextMeshPro has some ability for me to supply a shader? It seems counterproductive to what it's trying to do so I don't think I can. I was hoping to get rid of some logic in a MonoBehaviour that to flicker some text by changing the color of the text on small, regular intervals.

Yes, there’s a demo for it somewhere in the demo scenes. They stencil out waves or something iirc.

Tiler Kiwi
Feb 26, 2011
code:
public void AssignDelegate<T>(System.Action<List<ITargetable>, T> function, T data)
    {
        EffectDelegate genericthing = delegate (List<ITargetable> targets)
        {
            function.Invoke(targets, data);
        };
        this.EffectFunction = genericthing;
    }
i can't tell sometimes if the poo poo i end up writing is clever or very stupid. its probably both.

this is an attempt to more or less have my cake and eat it too. an effect is a SO class meant to map a list of targets to whatever function and yet still being able to pass parameters (as part of a larger Interaction SO that has Targets mapped to Effects). my preference would be to just have a way to say "insert literally anything at all as long as the first parameters is a target list and you give data for the rest", but even then im not sure itd really help my goal of being able to write some effect like ChangeColor in lieu of ChangeToRed, ChangeToBlue, ChangeToGreen, etc.

e: Further elaboration: this is more or less a way to quickly script new abilities for characters and such in a turn based game via giving an SO a list of targets and having it call functions / fire events / return commands (I haven't figured out a best fit at all, yet). It works but its just too inflexible for me to be happy with it, since effects can only be given a list of targets and not any additional data. The above thing lets me stash some data with the Effect via loading up some parameters with data, so that at least allows reuse of functions and more flexability from where effects can draw from, but it still doesn't solve the basic issue of saying like, "I'd like this effect to apply a modifier, which is specified via the user / interaction", which would permit me to have more generic style Effects. I might just be looking at this whole thing the wrong way: the obvious idea I've been chasing after is allowing more flexibility in the parameter signatures for Effect's EffectFunction delegate and then using reflection or something to communicate to the Interaction about what the effect needs, then communicating that to whatever is wanting to invoke the Interaction, but maybe that's just not possible due to it being kind of inherently not type safe to do? I tried making Effects themselves a generic type but Unity didn't like that and it probably wasn't a good idea anyways. Its probably just going to end up not nearly as simple as I was hoping.

e2: followup: I have learned about Delegate.DynamicInvoke and ahahahaha I am going to create a loving frankenstein monster.

Tiler Kiwi fucked around with this message at 13:44 on Feb 5, 2018

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

leper khan posted:

Yes, there’s a demo for it somewhere in the demo scenes. They stencil out waves or something iirc.

There's a 50/50 chance I missed it or the demo you're talking about didn't actually use a custom shader. I looked at demo scene #23 ("Animating Vertex Attributes") in a video while folding laundry and he did all the effects in MonoBehaviours. That one had the wave in it. I also looked at demo scene #24 ("Surface Shader Example") and it's just going over the different SDF materials. I didn't see anything to sneak in my own shader.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Rocko Bonaparte posted:

There's a 50/50 chance I missed it or the demo you're talking about didn't actually use a custom shader. I looked at demo scene #23 ("Animating Vertex Attributes") in a video while folding laundry and he did all the effects in MonoBehaviours. That one had the wave in it. I also looked at demo scene #24 ("Surface Shader Example") and it's just going over the different SDF materials. I didn't see anything to sneak in my own shader.

If you want to do something very custom, you can use a render texture as the face texture or duplicate one of the existing shaders.

I’d probably recommend the former. Just do whatever weird nonsense you want, shove it in a render texture, and drop that on the face or outline or wherever you want it.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

leper khan posted:

If you want to do something very custom, you can use a render texture as the face texture or duplicate one of the existing shaders.

I’d probably recommend the former. Just do whatever weird nonsense you want, shove it in a render texture, and drop that on the face or outline or wherever you want it.

A render texture doesn't need a camera at all?

It sounds like it's becoming overkill for just trying to make some damage indicators flash without polling on some timings in an Update() call.

deadly_pudding
May 13, 2009

who the fuck is scraeming
"LOG OFF" at my house.
show yourself, coward.
i will never log off
In a sort of belated New Years resolution, I'm gonna finally start buckling down on game dev. I've flirted with it a bit, and made some (bad) games as a teenager. My goal for now is to just start cranking out a ton of dumb tech demos in GameMaker and see if one of them sticks. I realize Unity and UE4 are both things, but it's way easier for me to make my own assets for a 2D game :v:

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

deadly_pudding posted:

In a sort of belated New Years resolution, I'm gonna finally start buckling down on game dev. I've flirted with it a bit, and made some (bad) games as a teenager. My goal for now is to just start cranking out a ton of dumb tech demos in GameMaker and see if one of them sticks. I realize Unity and UE4 are both things, but it's way easier for me to make my own assets for a 2D game :v:

Awesome, check out the awful jams dischord, lots of friendly helpful game makers there.

KillHour
Oct 28, 2007


Rocko Bonaparte posted:

A render texture doesn't need a camera at all?

It sounds like it's becoming overkill for just trying to make some damage indicators flash without polling on some timings in an Update() call.

Why don't you use a coroutine? Isn't that what they're for?

Ranzear
Jul 25, 2013

Tiler Kiwi posted:

e2: followup: I have learned about Delegate.DynamicInvoke and ahahahaha I am going to create a loving frankenstein monster.

Dynamic invocation of effect tags is something I suggested to you earlier in this thread, wasn't it?

Just don't forget to have a whitelist corresponding to functions that actually exist, or some other kind of fallback, then you can tag things before you even have a function for it.

Remember: Frankenstein is the monster.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

KillHour posted:

Why don't you use a coroutine? Isn't that what they're for?

My real goal was to try to just make the material for the text just be flashing epilepsy wonder. It seemed like having some text flash would be a shader thing.

This isn't really blocking me from doing other stuff; the greater bulk of my stupidity is simultaneously getting me stuck in completely different areas. I was just trying to do this as "right" as possible.

I'm generally just trying to not have a MonoBehaviour ticking on Update() for something like this. In this case, I believe Update()'s still running even if I have the good stuff in a coroutine. This is a certain amount of pig-headedness but it's helping me get into things like making subsystems, using ScriptableObjects, and writing shaders for visual effects.

Doc Block
Apr 15, 2003
Fun Shoe

deadly_pudding posted:

In a sort of belated New Years resolution, I'm gonna finally start buckling down on game dev. I've flirted with it a bit, and made some (bad) games as a teenager. My goal for now is to just start cranking out a ton of dumb tech demos in GameMaker and see if one of them sticks. I realize Unity and UE4 are both things, but it's way easier for me to make my own assets for a 2D game :v:

Cool. Also maybe check out Godot, which can do both 2D and 3D, and lets you write your game logic visually, in a friendly scripting language, or in C++ or C# if you prefer. And it’s free, unlike GameMaker.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Rocko Bonaparte posted:

My real goal was to try to just make the material for the text just be flashing epilepsy wonder. It seemed like having some text flash would be a shader thing.

This isn't really blocking me from doing other stuff; the greater bulk of my stupidity is simultaneously getting me stuck in completely different areas. I was just trying to do this as "right" as possible.

I'm generally just trying to not have a MonoBehaviour ticking on Update() for something like this. In this case, I believe Update()'s still running even if I have the good stuff in a coroutine. This is a certain amount of pig-headedness but it's helping me get into things like making subsystems, using ScriptableObjects, and writing shaders for visual effects.

Update will tick every frame unless the behaviour does not have an Update function. Update functions are not a prerequisite to run a coroutine.

Something will need to at minimum update a timer in the shader (unless you have access to an RNG in the shader I guess?). That will be triggered /somewhere/.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

leper khan posted:

Something will need to at minimum update a timer in the shader (unless you have access to an RNG in the shader I guess?). That will be triggered /somewhere/.
Disclaimer: I kind of stopped nibbling on the shader when I couldn't figure out how I might even plug it into the text. That being said, I found a _Time property with X-Z components that give the a floating-point time in various scalings. It did compile the shader so I assume I did that much correct.

I'm not so much fixated on not having an Update() as much as I am being able to completely chicken out of having a MonoBehaviour at all. I also am conceding this is kind of unreasonable, but I learn new things every once in awhile when I shoot myself in the foot like this on purpose. So I'm trying to go for it.

KillHour
Oct 28, 2007


Rocko Bonaparte posted:

Disclaimer: I kind of stopped nibbling on the shader when I couldn't figure out how I might even plug it into the text. That being said, I found a _Time property with X-Z components that give the a floating-point time in various scalings. It did compile the shader so I assume I did that much correct.

I'm not so much fixated on not having an Update() as much as I am being able to completely chicken out of having a MonoBehaviour at all. I also am conceding this is kind of unreasonable, but I learn new things every once in awhile when I shoot myself in the foot like this on purpose. So I'm trying to go for it.

Don't you need a monobehaviour to trigger the health bar to go down when you take damage anyways? Just start the coroutine there.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

KillHour posted:

Don't you need a monobehaviour to trigger the health bar to go down when you take damage anyways? Just start the coroutine there.

<whiney voice> :cry: But I wanted to use a shader!!! :cry: </whiney voice>

Mr Shiny Pants
Nov 12, 2012

Rocko Bonaparte posted:

<whiney voice> :cry: But I wanted to use a shader!!! :cry: </whiney voice>

Kill your darlings :)

baby puzzle
Jun 3, 2011

I'll Sequence your Storm.
Can I do this in my shader, and set this entire uniform array with one call to glUniformXX()? I can't figure out how to do it.

code:
		struct ShaderData
		{
			mat4 thing;
			float whatever;
		};
		uniform ShaderData shaderData[16];
e: I think I should be using a layout instead probably

baby puzzle fucked around with this message at 17:47 on Feb 6, 2018

KillHour
Oct 28, 2007


Rocko Bonaparte posted:

<whiney voice> :cry: But I wanted to use a shader!!! :cry: </whiney voice>

I mean you could but the monobehaviour would still need to call the shader, probably by changing a variable on it and then changing it back when it's done. Which... would require a coroutine.

Adbot
ADBOT LOVES YOU

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

KillHour posted:

I mean you could but the monobehaviour would still need to call the shader, probably by changing a variable on it and then changing it back when it's done. Which... would require a coroutine.

Isn't there a _Time property I can use for that? Maybe I'll try that on some random mesh tonight just to see if I can make it work at all before even looking into trying to cram it into TextMesh Pro's thing.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply