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
KillHour
Oct 28, 2007


Passive Aggreeable posted:

Thanks for the responses! I think I am going to settle somewhere in between and write something that still uses the .net CompileAssemblyFromSource() or .Compile().DynamicInvoke now that 4.0+ is supported.

So instead of running through expression trees, I was thinking that new user defined functions in script strings will just be replaced by their c# equivalent e.g. in a script the function 'bind 'a' 'b'' will be rewritten to call myConsole("bind a b")

Something that I have been thinking about lately is simplifying and reducing the amount of code you have to write to manage classes that are a bunch of delegates and events as in particle systems with swappable functions.

I wrote something for this with DOTS a long time ago. I'm out but I'll look it up later and post something.

Adbot
ADBOT LOVES YOU

Xerophyte
Mar 17, 2008

This space intentionally left blank

KillHour posted:

Now I just have to figure out how to turn an image into a vector map that points to the nearest white pixel. Is there a word for that? It's not a normal map, but it's similar.

What you need is the gradient of the SDF, so the corresponding map is a gradient map. That's a very overloaded term, though, since they appear for a lot of things. You can define a gradient for any scalar field; the most common use-case in graphics is probably bump maps/heightfields.

I'd be a little worried about discontinuities, the gradient will in general have a lot of them even if the SDF is perfectly smooth. Inigo Quilez has a bunch of analytic gradients for various SDFs if you have a simple case. For arbitrary shapes or SDF images you'd need to use discrete differences to generate a gradient map, but bear in mind that you might run into filtering issues if you use mipmaps, bilinear filtering, etc. There's no guarantee that the averaged gradient for some group of texels even points at the shape defined by the SDF, nevermind the nearest point on it.

KillHour
Oct 28, 2007


Xerophyte posted:

What you need is the gradient of the SDF, so the corresponding map is a gradient map. That's a very overloaded term, though, since they appear for a lot of things. You can define a gradient for any scalar field; the most common use-case in graphics is probably bump maps/heightfields.

I'd be a little worried about discontinuities, the gradient will in general have a lot of them even if the SDF is perfectly smooth. Inigo Quilez has a bunch of analytic gradients for various SDFs if you have a simple case. For arbitrary shapes or SDF images you'd need to use discrete differences to generate a gradient map, but bear in mind that you might run into filtering issues if you use mipmaps, bilinear filtering, etc. There's no guarantee that the averaged gradient for some group of texels even points at the shape defined by the SDF, nevermind the nearest point on it.

I've been using this website so much that I'm shocked I didn't find this page. The idea is to turn a logo or 2 tone image into one, though, so I'll have to find a way of generating arbitrary ones from an input image. The good news is that it really doesn't need to be perfect for what I'm doing.

That page will be great for other stuff though so thanks.

Edit: I don't actually want a gradient - a gradient is always a unit vector. I actually want something more like a LUT that has both direction and distance.

Double Edit: Here's an example where someone encoded both a unit direction and a distance. I think it would be easier if I just encoded the absolute vector, but it's a helpful start.

https://shaderfun.com/2018/07/23/signed-distance-fields-part-8-gradients-bevels-and-noise/

KillHour fucked around with this message at 01:49 on Aug 9, 2023

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Edit: gently caress me for thinking about this after I shut down and get away from it, but I wonder if the cube below is just a little in the air, hits the floor under it, and refuses to tween further. I would figure moving py position would suppress this.

How do parent and child objects work with colliders in Unity? I currently have this:

1. Root game object. Has the trigger box collider that is my "outer" collision box. The collider is a thin box on top with the depth and width of the box.
2. Child game object that just has the trigger box collider for the "inner" collision box. I have a Monobehaviour that ferries the trigger enter/exit callbacks as events to a logic Monobehaviour in the parent. The collider has the same position on top as the outer collider, and the same height, but it has a smaller width and depth.
3. Child game object that has a physical (non-trigger) collider so the player would stand on the floor plate. The collider is the full dimensions of the box in the same position as the box.

It's a box right now so it's easier for me to see it working and not working.

I had gotten something mostly working with #1 and #2 but without #3, but the player would clip through it since it was just the triggers. At that time, #2 also had a RigidBody. I read nesting stuff with RigidBody doesn't work "as expected" so I had deleted them. Having them didn't make it work any better.

The logic listening for the triggers causes a tween to run on the parent object's transform (position) to move it down and up based on entrance/exit. With child #3 (with the real collider), this jams up. It looks like it moves down only the height of the trigger box height even though the tween wants to move much more. The transform for the child has the Y position 0.1 up from 0.0 (where it starts). I don't tell the children to move; I was kind of assuming they'd just travel with it. It looks like #2 does travel with the parent, but #3 doesn't?

It's a lot of words but you could probably just ignore all that if you just have some advice on how to get parent-child game objects to move together--including any colliders.

I also kind of wish I could subclass colliders so I could just tie this all to one game object.

Rocko Bonaparte fucked around with this message at 08:28 on Aug 9, 2023

Xerophyte
Mar 17, 2008

This space intentionally left blank

KillHour posted:

Edit: I don't actually want a gradient - a gradient is always a unit vector. I actually want something more like a LUT that has both direction and distance.

Double Edit: Here's an example where someone encoded both a unit direction and a distance. I think it would be easier if I just encoded the absolute vector, but it's a helpful start.

https://shaderfun.com/2018/07/23/signed-distance-fields-part-8-gradients-bevels-and-noise/

Well, the gradient of specifically a distance field is a unit vector almost everywhere. The gradient of an arbitrary scalar field can be whatever. In general I'd say that having a unit vector is nice, encoding unit vectors in textures is easier than encoding arbitrary vectors. In any case, you can trivially change between distance + gradient and vector-to-surface representations so I don't think it'll matter much which you use for storage as long as it covers your required range and the precision is sufficient.

To generate the representation you'd use some finite difference to compute the partials. I'm not sure that doing what that link does and picking either forward or backward difference locally instead of doing a normal central difference is really a good idea. I see how it can let you compute a gradient value closer to a discontinuity, but it can also cause an entirely different set of errors where the computed gradient points in some entirely spurious direction because the X and Y partials were computed using different closest surface points. I suspect I'd rather deal with the more predictable effects of using central difference, but I guess it depends on the application.

FWIW my personal experience with this stuff is mainly from generating surface normals for procedural textures and for 3D SDF fractals, which probably colors some of my views.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Red Mike posted:

If you want to do it as a fun little project, have at it, but be prepared for constant confusion and roadblocks that have no apparent workaround, as well as for finding a solution that seems to work then discovering a week later that it completely breaks something else that's important. It's fun to bang your head on a wall like that for a while (hello from the well that is "surely it's possible to turn IL into LLVM IR properly"), but be aware that that's what it will likely be.
You can output to C++ instead of LLVM IR but the real problem is debugging it. There is definitely a need for a better games-oriented DSL right now but if it isn't debuggable, then it's going to be a net loss of productivity vs. anything with a debugger, even C++.

C# is actually reasonably good as a game DSL by itself but interpreting .NET is a huge pain in the rear end because a.) the standard library is huge, and b.) from .NET 4 onward you have to deal with covariance/contravariance, and there is an edge case where the way .NET handles it is completely insane.

OneEightHundred fucked around with this message at 20:55 on Aug 9, 2023

Red Mike
Jul 11, 2011

OneEightHundred posted:

You can output to C++ instead of LLVM IR but the real problem is debugging it.

You can in the sense of the same thing IL2CPP (or wasm workloads in dotnet) does, which is just take specific IL constructs and turn them into the same specific C++ constructs (that you can then compile to LLVM IR and therefore get multi-platform easily). But that's literally relying on you to write C++-like C# (or like Unity's IL2CPP does, tie all your C# scripts to specific existing C++ structures so that generally your code will be used that way anyway).

You want to use any of the useful IL constructs that most idiomatic C# uses? Tough, at most someone might have written very specific checks for particular types of structures and converts them to actual usable C++ so that one particular feature works. And they've only done that for the absolutely most important parts that everyone uses.

Debugging absolutely is the first thing you'd also need to work properly though, for sure. I've done a few WASM-based projects in dotnet now (with the experimental WASM workloads) and debugging is pretty much impossible.

e: Also that contra/covariance thing is hilarious but also such an edge case that I can believe they haven't actually tackled it. Especially since the spec is arguably more confusing than the behaviour.

Passive Aggreeable
May 23, 2009

"Either way, it's going to hurt like crazy."
So I'm sort of going ahead with the interpreter anyway, I find it as a good reintroduction into c# and it requires a semi intimate understanding of the language... so its a REPL that parses input strings character by character by entering and exiting contexts, I am now aware that these are more typically written with lexers and parsers, any problems I might experience going my way besides not having as in-depth errors?

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Passive Aggreeable posted:

I am now aware that these are more typically written with lexers and parsers, any problems I might experience going my way besides not having as in-depth errors?

I think the general ranking for best quality of output--not necessarily best return-on-investment--is something like:

1 (Best). A good custom lexer/parser. General-purpose ones just don't produce the level of error messages you get from controlling the whole process yourself.
2. A good implementation from a general-purpose lexer and parser framework.
3. A bad implementation from a general-purpose lexer and parser framework.
4. Go directly to #5. There isn't anything above #5 here. Whatever you start here you think is easier than #5 becomes #5.
5. (Worst) if-if-if-else-if-else-ifelse-if-if-context subsubsubsubsubcontext stack-if-if-if-if-if-if-if . . . you will die!

The massive fist to the face I got from grammar is how amazingly recursive languages are. A program is a statement followed by zero or more statements. A conditional is a statement. It starts with 'if', a block, zero or more statements (remember that a conditional is a statement), etc. Even writing a simple calculator rapidly goes to hell as soon as you try to add parenthesis to nest stuff if you aren't following a grammar. Granted, some asshats will make assignments or interview questions around that, and they want to see you counting the nesting, but it's about the limit for that without trying to introduce more structure to the whole thing.

There are many corner cases and comedy options around this. Like, there's the old "You can write a Scheme interpreter in Scheme" trick but the answer to that is to punch the nerd and steal their lunch money.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I think I've consolidated one of my collision problems in a way I can express now, although it still takes a lot of words:

The main problem is that the frame after I get an onTriggerExit the frame after an onTriggerEnter. If I look at the objects in the editor at that moment of the exit, the player's capsule collider is still well within the trigger boundaries!

The player is meant to collide with a huge floor tile that will lower when they stand on it and raise when they leave it. I have made it a large cube to help analyze this:
1. Parent is a cube with a RigidBody. No colliders. It is not kinematic. It has a MonoBehaviour controlling logic to lower the cube with a tween with an inner collider is entered, and reverse the tween if the outer collider is exited.
1.1 Child #1 is nothing but a box collider with the outer collision boundary and a MonoBehaviour that carries the trigger callbacks as events so the parent can get them.
1.2 Child #2 is as Child #1 except the collision boundary is smaller and inside that outer collision boundary.
1.3 Child #3 just has a regular box collider not set as a trigger so the player doesn't just fly through the object.

The hierarchy could be done different ways but I decided to make all the colliders peers and have a parent then control them. I figure that relationship should squelch any ideas of OnTriggerEnter/Exit calls firing off from other colliders. I don't know exactly how that works but I think I've isolated it completely.

The idea of inner/outer is to make sure that player truly committed to toggling this cube. The trigger bounds are above the cube and are meant to trigger when the player steps "through" them. Triggering should continue until the player exits out of the larger bounds, which is commitment to exit. Triggering the inner boundary starts a tween that lowers the object. Lowering the object is a major factor in this. If I don't lower it, no problem.

Without the inner/counter tests, I had noticed a lot of bounciness when I initially enter because of corner cases (literally the box corners!).

Currently, I have the player drop right down on the box. It triggers the inner collider enter, and then one frame later, triggers the outer collider exit. I set a Debug.Break() to pause it here because that's bonkers. I look at everything and the player's capsule collider is absolutely still within bounds. What could cause the outer collider to trigger?

I attached a picture:



The staircase is level with the blue box at first, but the tween starts to lower it. The red object is the player and it seems to still be level with the original box height. To me, everything still looks fine.

Some considerations:
1. Yes, I test that I'm specifically colliding with the player and only react with the player.
2. The player's collider is only one capsule collider. The player has a RigidBody. It is kinematic.
3. The MonoBehaviour for the triggers exposes OnTriggerEnter and OnTriggerExit as events. The parent logic attaches to them and is able to distinguish them this way. I use the outer trigger box's exit and the inner trigger box's enter.
4. For debug, I started listening to all triggers events. What I see is: outer enter, inner enter (triggers lowering tween), outer enter, outer exit (triggers raising tween). That second outer enter is very suspicious! It have already entered from the outside and had not exited it. So somehow, the outer trigger gets to onTriggerEnter events.
5. Slowing down the speed of the tween reduces the occurrence rate. It made my think that the player was being subject to a gravity effect every frame and trying to free-fall down to the cube. So I added that debug break to see it, and found instead that it was well within the trigger boundaries.

Edit: A hack that seems to work is to count how many outer enters I get and decrement them when I get a matching outer exit. Then I only activate my logic when it goes back to zero. This feels like something I shouldn't have to do.

Rocko Bonaparte fucked around with this message at 08:38 on Aug 12, 2023

Spatial
Nov 15, 2007

Rocko Bonaparte posted:

I think the general ranking for best quality of output--not necessarily best return-on-investment--is something like:

1 (Best). A good custom lexer/parser. General-purpose ones just don't produce the level of error messages you get from controlling the whole process yourself.
2. A good implementation from a general-purpose lexer and parser framework.
3. A bad implementation from a general-purpose lexer and parser framework.
4. Go directly to #5. There isn't anything above #5 here. Whatever you start here you think is easier than #5 becomes #5.
5. (Worst) if-if-if-else-if-else-ifelse-if-if-context subsubsubsubsubcontext stack-if-if-if-if-if-if-if . . . you will die!
lol this is a great summary

(as someone who's written multiple DSL toolchains at work)

SebAndSeb
Apr 23, 2007

hello

Rocko Bonaparte posted:

I think I've consolidated one of my collision problems in a way I can express now, although it still takes a lot of words:
[words]

I haven't used Unity but as a general comment, do you need to move the trigger colliders, or can you just make them tall enough and only move the collider for the physical/visible box (I'm assuming you're tweening the position of the parent object based on your previous post)? Although from your debug image it doesn't look like the player collider being at the edge of a moving trigger collider is the problem, there could be weird stuff going on in between frames with the collision checking and trigger events, and in any case it would make reasoning about the hysteresis region of your triggers simpler.

KillHour
Oct 28, 2007


Rocko Bonaparte posted:

The massive fist to the face I got from grammar is how amazingly recursive languages are.

I solved this for my last project by saying "you don't get control structures more complex than conditional jumps gently caress off" and wrote my language as a simplified version of assembly.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

SebAndSeb posted:

I haven't used Unity but as a general comment, do you need to move the trigger colliders, or can you just make them tall enough and only move the collider for the physical/visible box (I'm assuming you're tweening the position of the parent object based on your previous post)? Although from your debug image it doesn't look like the player collider being at the edge of a moving trigger collider is the problem, there could be weird stuff going on in between frames with the collision checking and trigger events, and in any case it would make reasoning about the hysteresis region of your triggers simpler.

I can try to screw around with large, static colliders, but I suspect it'll just be the same problem in a slightly different way. If I still drop into that large trigger, it'll probably still have a spurious exit as I fall through it. If I enter from the side, now I get it from the side. It was happening there too, but I thought the situation was too volatile because I had to control the player to move into that position. Just dropping them in gives me a consistent scenario every time.

I have the triggers digging into the cube halfways. It doesn't really show up in the picture, but I think you can vaguely see their silhouettes inside the blue cube. Not doing this did not have an effect but I was paranoid about that in-between frame stuff you mentioned too. Not seeing a change doesn't mean that isn't actually the problem though. I just don't know.

Since I can pause it, something I am considering is some gizmos to draw in the editor diagnostics about the nature of the collision entrance/exit and see exactly what spots are involved in the events.

Something I am curious about is how Unity's character controller manages triggers. Like, I could expect something goofy like it sending an enter every frame (I saw a post that made it sound like somebody else had that). When I added the integer the count entrances and exits, the whole thing does work, but I still have all the instrumentation to tell me what events are firing. I just get a huge sea of trigger enter and then exit alternating. Sometimes, they double up.

Another thing I see is that capsule colliders and other ones with multiple points can trigger the events for different points:
https://discussions.unity.com/t/ontriggerenter-being-called-multiple-times-in-succession/109418/2

I may try to draw something where the event happened and see if it suddenly looks like Christmas with all this places lighting up as the events roll in.

KillHour
Oct 28, 2007


I took a break for a few days but went back to the logo thing after some time away thinking about it and managed to get something basic working


(I'm embedding because this is a pretty simple image and I really don't think it will cause any problems but let me know if I'm wrong)

It looks low-res because it is - my code is VERY unoptimized as a naïve first pass and scales terribly, so 256x256 is the biggest I can reasonably do until I go back and implement something smarter. Also, there are artifacts at the top and bottom of the image that I have to figure out. But holy poo poo you guys, it works! It even handles uniform transformations like rotation and translation cleanly without any weird artifacts.

Right now, I'm using point filtering to avoid the issue with interpolation at places where the field isn't continuous, but I have a plan for solving that (store a mask for where the field is discontinuous and blend between point and bilinear filtering based on the mask).

There's still a lot to do, but I'm incredibly chuffed that this works.

Edit:

Improved the shader and fixed the issue where it was dilating the edges a bit.

KillHour fucked around with this message at 05:20 on Aug 13, 2023

KillHour
Oct 28, 2007


Fixed the artifacts above and below the logo. It was because Unity indexes textures top to bottom, but HLSL does UVs bottom to top

Have a fractal made of Unity logos.

sailormoon
Jun 28, 2014

fighting evil by moonlight
winning love by daylight


I'm familiar with what I need to do for game networking and have programmed a few games in Ebiten / SDL2 using rollback netcode, but I was curious how hard this was in modern engines. I see Unreal doesn't really guarantee deterministic frames -- is "good" networking pre-built in? Not looking to make anything more than a 4-8 player sidescroller, so nothing overly complex. I'm okay diving into the C++ weeds, which is why I was looking more into Unreal but what would be open to other engines to delve into.

blastron
Dec 11, 2007

Don't doodle on it!


sailormoon posted:

I'm familiar with what I need to do for game networking and have programmed a few games in Ebiten / SDL2 using rollback netcode, but I was curious how hard this was in modern engines. I see Unreal doesn't really guarantee deterministic frames -- is "good" networking pre-built in? Not looking to make anything more than a 4-8 player sidescroller, so nothing overly complex. I'm okay diving into the C++ weeds, which is why I was looking more into Unreal but what would be open to other engines to delve into.

I'm not sure what you call "good", but Unreal uses a model where there is an authoritative server that handles the bulk of gameplay logic and broadcasts the state of the world to players. There is some amount of rollback in Unreal's native systems, such as character movement, where clients can send their inputs to the server, which will apply corrections and broadcast that back out to the player. If you're using Unreal systems out of the box, this is generally pretty good. However, if you're making new systems, Unreal's built-in networking tools don't inherently have rollback, so if you're making a feature that requires snappy player input response, you'll be rolling your own.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I got it confirmed in the Awful Jams Discord that Unity triggers will fire multiple enter/exit events for one object, so counting the entrances vs exits is a pretty normal mitigation. Well, at least know that's what is all going on and it's something to work around gives me a lot of clarity.

KillHour
Oct 28, 2007


Redid the texture processing algorithm, so now a 2048^2 texture processes in a few seconds instead of a 256^2 texture taking 15 minutes. Still need to work on filtering to get rid of the aliasing, but it's a lot better. I also fixed a scaling issue that was causing everything to be squared off. I'm pretty happy with this now.

I know I did this song lately, but it worked the best to show off the effect. Epilepsy/photosensitivity warning, as always.

https://youtu.be/JYlnQL1p4Ns

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Red Mike posted:

Especially since the spec is arguably more confusing than the behaviour.
What the .NET runtime does doesn't match the spec anyway, it's great.

Rocko Bonaparte posted:

I think the general ranking for best quality of output--not necessarily best return-on-investment--is something like:

1 (Best). A good custom lexer/parser. General-purpose ones just don't produce the level of error messages you get from controlling the whole process yourself.
2. A good implementation from a general-purpose lexer and parser framework.
3. A bad implementation from a general-purpose lexer and parser framework.
4. Go directly to #5. There isn't anything above #5 here. Whatever you start here you think is easier than #5 becomes #5.
5. (Worst) if-if-if-else-if-else-ifelse-if-if-context subsubsubsubsubcontext stack-if-if-if-if-if-if-if . . . you will die!
6. (Even worse) Emit ops while parsing and train-wreck when some subexpression doesn't make sense as a value on the stack.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I never did that yet somehow got triggered because it reminded me of all the goofs I made emitting the bytecode. Then I would let my poor little guy go running off on it and all kinds of goofy-rear end things would happen.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Collisions and triggers represent a whole lot of the interactiveness in a game, yet it is such a huge pain in the rear end in Unity. I have had to switch off discrete collisions because it would miss the player exiting the trigger area if I moved just right.

Edit: gently caress this rule of thumb that you should only use a continuous mode if something moves faster than it's dimensions in a frame. What if you have a slowdown, hmmm?

Raenir Salazar
Nov 5, 2010

College Slice
Gotta say its a really nice feeling when someone replies to an 10 year old reddit thread about a problem I had for an old gamedev project asking if I had any new insight and for the answer to be yes, and then to have a conversation with this person to help them with their problem, like the circle of life is now complete and I collapse into dust.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
More collision chat: It turns out among my old project stuff, I had mixed a character controller with a rigid body and its own capsule collider. So I've been a bad, bad boy. Everything I've seen today is that you don't mix those. The character controller is supposed to work w/o a rigid body and has its own built-in capsule collider. So I guess if I want to work against triggers and such that I should write a "rigid body character controller." Fun times.

Passive Aggreeable
May 23, 2009

"Either way, it's going to hurt like crazy."

OneEightHundred posted:

6. (Even worse) Emit ops while parsing and train-wreck when some subexpression doesn't make sense as a value on the stack.

Since I just (re)started my project I just changed the entirety of the incomplete parser code to be a lexer, following https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure which has proven useful

One thing that doesn't make sense is that Unity still doesn't have a box collider character controller like the games you know instead of a capsule collider. B-but neato- it climbs edges automatically! It should have a client-server model with interpolaton and rewinding built in as well.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Passive Aggreeable posted:

Since I just (re)started my project I just changed the entirety of the incomplete parser code to be a lexer, following https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure which has proven useful

Are you using ANTLR like their examples then?

Passive Aggreeable
May 23, 2009

"Either way, it's going to hurt like crazy."

Rocko Bonaparte posted:

Are you using ANTLR like their examples then?

no, not even close, its still a class with a context stack that gets characters sent to it one-by-one; I saw that ANTLR was in JAVA so I just assumed that it would take too long to learn and implement or that it would be slow (considering the gaming use case).

Its really been some time since I have touched code, but I would like to add some code generation/macro support, I have been having trouble thinking of use cases besides like psuedoserialization into source code, maybe nesting switches, or generating respective delegates, methods, Actions/Funcs, from a single identifier name. I also had some trouble thinking of reasons for new keywords/operators, sounds like a great idea but what can you do with a something new that a method can't? The best I could come up with was "delegate!!(expr/del/event) +/-/= behavior" which is like saying On X also do/don't do/ replace with behavior. But this requires some sort of manager class.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Passive Aggreeable posted:

no, not even close, its still a class with a context stack that gets characters sent to it one-by-one; I saw that ANTLR was in JAVA so I just assumed that it would take too long to learn and implement or that it would be slow (considering the gaming use case).

There are versions in various languages. I used the c# one and I have word of a Python one. I don't remember if I ran some Java to generate stuff originally though.

The Visitor Pattern in ANTLR4 is nice. You can annotate lines in the grammar and it will generate statements you can override to specify whatever you want done there.

Passive Aggreeable
May 23, 2009

"Either way, it's going to hurt like crazy."
apparently, some things that I had no idea existed such as the #nullable preprocessing directive, raw string literals, and interpolated strings are not included in the draft specification link, making it pretty much useless.

Rocko Bonaparte posted:

There are versions in various languages. I used the c# one and I have word of a Python one. I don't remember if I ran some Java to generate stuff originally though.

The Visitor Pattern in ANTLR4 is nice. You can annotate lines in the grammar and it will generate statements you can override to specify whatever you want done there.
I will take a look, maybe it will help me in the future

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I'm cleared the hump on my collision/trigger problem, although I have some hardening still to do. I am pretty sure this would be useful to somebody.

My main mistake was trying to use enter/exit as single-shot events because I didn't want to poll on the stay callback instead. In Unity, you have these trigger callbacks:
1. onTriggerEnter: when a part of some collider reaches inside the trigger.
2. onTriggerExit: when a part of some collider reaches outside the trigger.
3. onTriggerStay: when a part of some collider enters/remains inside a trigger.

The enter and exit methods don't really explain themselves well. I had assumed originally they would only be called when the object first enters or exits. This isn't how it works and it's actually best it didn't work that way. Those triggers should be treated something like:

1. enter: you have some trigger and you want to be told when something is starting to get inside of it.
2. exit: you have some trigger and you want to be told when something is trying to get outside of it.

So having multiple events as the object kind flutters around between inside and outside is quite normal.

Both of these are useful for triggering certain kinds of events, but not for the floor plate thing. What I had to do instead was listen for onTriggerStay for my entrance event, and its absence for my exit event. To detect absence, I had to poll FixedUpdate() and see if I had just previously had an onTriggerStay() but don't any more. It's a bit of boolean shenanigans. Switching to that solved a lot of my problems. I still have some bounciness that is also not completely covered by having an inner and outer trigger, but I think it's because the real speed of a tile dropping causes the player to fall outside of it as it lowers away from them. I think the solution there is to "glue" the character to the falling tile, and I think I have to work on this for moving platforms anyways.

As a side note, I didn't have kinematic set for my tiles/boxes so they'd somehow catch a stray velocity and float into the sky.

SurgicalOntologist
Jun 17, 2004

Hey thread, a friend of mine is an artist / publisher starting a project combining art with VR, and is looking to meet unity/unreal developers. He is eventually looking to build a team but at first I think he just wants to chat with anyone with relevant experience, get some feedback on the ideas and start building a network.

I asked him to share a blurb:

quote:

[Project name] seeks to showcase art and photography in 3D and VR environments allowing artists to embrace bleeding edge media delivery systems to share multimedia work in an enveloping context. Designed for both VR headsets and desktop screens, the short-form, episodic presentations are perfect for art lovers, students and professionals who seek a deeper understanding of the art-making process and the inspirations behind the work.

We are building the team and seeking artists and engineers familiar with art direction in immersive environments as well as content creation in Unity and/or Unreal to begin experimenting with this emerging field of storytelling.

Anyways, I'm just looking to do a favor for a friend, he came to me since I used to do VR work but it was too long ago, I don't know anyone still doing that. For what it's worth he's not some rear end in a top hat new to tech/development, he previously co-founded a startup at the intersection of art and tech and took it to a modest exit. PM me if you're interested.

Also let me know if there's a better thread for this, you game devs were my first thought.

jizzy sillage
Aug 13, 2006

PMed you.

caleb
Jul 17, 2004
...rough day at the orifice.

Passive Aggreeable posted:

Since I just (re)started my project I just changed the entirety of the incomplete parser code to be a lexer, following https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure which has proven useful

One thing that doesn't make sense is that Unity still doesn't have a box collider character controller like the games you know instead of a capsule collider. B-but neato- it climbs edges automatically! It should have a client-server model with interpolaton and rewinding built in as well.

The box character controller thing is super lame. It's in the PhysX code, but not in Unity. I have been looking for a solution for a while that isn't "use ramps." I'm about half way through modifying the Kinematic Character Controller asset to use an AABB (a la idTech2, Goldsrc) but I'm not certain it will work out.

xgalaxy
Jan 27, 2004
i write code
I guess Unity really wants to commit corporate suicide:
https://blog.unity.com/news/plan-pricing-and-packaging-updates

Unity will charge a one-time fee per player based on them installing (and initializing) the game.

pseudorandom name
May 6, 2007

How’s that compare to their current pricing?

xgalaxy
Jan 27, 2004
i write code

pseudorandom name posted:

How’s that compare to their current pricing?


it’s in addition to their current pricing. With some minor changes to their DevOps stuff.

xzzy
Mar 5, 2009

It's an rear end in a top hat move but it's really only going to affect people that are making successful games. 200k installs is a pretty high bar.

But I'm not defending them in the slightest, company seems dead set on transitioning from being a community favorite underdog into an evil corporate empire. It also bugs me that it means every binary ships with telemetry code in it that's phoning home. I assume that's been there for many years now but I've never played a unity game that asked if I consented to this collection and now they're trying to monetize it? Big evil.

pseudorandom name
May 6, 2007

Oh this is a recurring fee lmao.

RIP Vampire Survivors I guess.

Adbot
ADBOT LOVES YOU

xzzy
Mar 5, 2009

Godot gonna get a lot more popular though, which is never a bad thing.

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