#archived-code-advanced

1 messages ยท Page 198 of 1

undone coral
#

it would help inform what positive ROI automation there is

dark cypress
#

If I invoke the tests from the command line, it'd probably kick back a bad return code if there's a compilation error, right?

undone coral
#

what's the bigger picture app / game?

dark cypress
#

Natural language -> code streaming into a running Unity instance

#

for a hackathon

undone coral
#

cool

#

well it sounds like you should try to do no automation

#

on the local editor, you can grab the generated code via a REST API, then write it to a .cs file in your assets folder, then import that file

#

if you see build errors, delete the file (or whatever it is you want to do)

dark cypress
#

Yeah thats the thing, I want to bypass the "if you see build errors" part

undone coral
#

you're not going to succeed in getting this working on a server in the time span of a hackathon. stick to what you can test and run in your local editor

dark cypress
#

Oh, well thats true

undone coral
#

you can try duplicating out the filesystem of your project, then running it from the command line

#

but that is going to be extremely slow

#

why do you want to bypass the build errors part? have you tried this?

#

what's the worst that could happen? it can be quite fast if you write the file to an asmdef'd folder

#

but certainly not fast enough to interactively find 1/1,000 complex snippets that interact with the uniyt api

#

if you're finding that doing this by hand is giving you stuff that doesn't compile on average

#

well... i have bad news, RNNs really blow

#

there's a reason none of this is a real product yet

dark cypress
#

Yeah, that is probably the harsh truth

jovial totem
#

you're using a constructor in a UnityEngine object What do you mean by this? Doesn't that mean im just using a constructor?

undone coral
#

if you can find an existing natural language to AST transformer

#

you can do something interesting with that

#

for example there's probably a limited structured programming language with limited API

#

that someone has already trained, or does something more bespoke

#

and then you can use that to text/voice code a specific subset of in-editor behavior

#

if you want to brute-force 1,000 code snippets, you can, you will need to do a realistic scope of IT

#

use AWS lambda with a game-ci container. you'd have to ask for a quota limit increase to have a much longer runtime of a lambda function

#

then your backend would dispatch 1,000 requests, each with a different snippet, and they will run concurrently

#

this is as close to interactive as i can expect you to get. it couldn't be the user's project though, which would be pretty limited - or you'd have to somehow retrieve the user's project and update cloud storage with it

#

@dark cypress does that make sense?

dark cypress
#

Yeah, thank you

#

It sounds like my current approach isn't really feasible so I'm going to climb back up to 40,000 ft and reasses

undone coral
#

you would just have to turn into a pro backend engineer in like 48 hours or however long this hackathon lasts

dark cypress
#

lol

undone coral
#

you'd also need $100-10,000 to run the thing

#

but hey, for a cool demo

#

i guess fake twitter followers are cheaper ๐Ÿ™‚

dark cypress
#

Yeah, its 50% as a proof of concept, 50% to maybe get noticed and maybe intern somewhere

undone coral
#

natural language to code generation is an interesting topic.

#

the hearthstone paper from google is the most promising

#

firestone (python) isn't structured

#

i had an undergraduate research assistant who was doing something similar with my card game, which has a structured programming language

#

he got way way better results than google did, but then ran out of time and didn't want to do a masters

#

so that's that

#

this would be card text -> code that implements card text for a hearthstone like game

#

since my game was the hearthstone ruleset, and people had already authored 4,000 cards with code in the structured form, it was working for many, many card texts

#

card game text is already pretty algorithmic

#

structured meaning it looks like data / it is almost completely context free

dark cypress
#

Oh that is pretty sick

undone coral
#

you can certainly try. spellsource is open source with a nice unity client and active player base. here's the card editor demo (does not contain the dynamic generation feature, that is obsolete essentially) - https://www.playspellsource.com/card-editor/

#

there are probably 30k hearthcards cards you can rip. if you theoretically coded all of them, plus the 4,000 already coded cards, you would have a dataset large enough to hit 90% (i think we got 95% for simple card texts and 60%, comparable to google, for complex ones, whereas they got 40-60%)

#

there's also a professor in australia trying to do something similar

#

and a guy who took a sabbatical from zoox to do this

#

but i think he transitoned to trying to build a bot

#

@dark cypress suffice it to say, it's an exciting research topic and it is definitely possible to make something that works

#

for real

#

with technology today

#

otherwise the people who have had the most luck historical for this problem domain are in biotech

#

exhibit A the protein folding challenges from deepmind

dark cypress
#

Yeah I was just checking it out. So you trained on hearthstone cards, with the intent of going from a creative text description, to the code chunks that comprise the mechanics? Am I understanding that right?

undone coral
#

and people who try to generate a chemical signature from a functional description

undone coral
dark cypress
#

Sorry, what is AST?

undone coral
#

at the time 100% of hearthstone's card catalogue was implemented

#

an abstract syntax tree

#

in the card editor, if you figure out how to load a card, you'll see that it has a tree-like structure

#

as with any blockly / scratch document

#

but it is context free. it's not like you're writing code.

#

@dark cypress so why did our approach work with so little data? well one, the google people already demoed it. they didn't go into detail why it was working comparaitively very well in python, i'm not sure they knew, they used an RNN. at the end of the day card dtext and the code that represents it is quite regular

#

our approach worked better because the code that implements our cards is context free. you can permute the JSON in that link, and it will still be valid "code"

#

there's a paper that mapped text to a tree and vice versa, in a biotech domain, which we used

#

and it worked well because, unlike proteins, this is context free

dark cypress
#

So like, the logic that parses "rarity" for example, was that hand crafted to give it meaning?

undone coral
#

that insight became a key reason why there's a company that is succeeding to do this with small chain peptides

undone coral
# dark cypress So like, the logic that parses "rarity" for example, was that hand crafted to gi...

well let's work through the linked example. we trained a function

public static CardDesc generate(String fromCardDescription, int baseManaCost, int baseAttack, int baseHp, Rarity rarity, ...) {
  var tokens = tokenize(fromCardDescription);
  CardDesc cardDescription = transformer.transform(tokens);
  return cardDescription;
}

var dygraGemOfMadness = generate("While your hand is full, allies are Immune on your turn.", 5, 4, 5 ...);
dygraGemOfMadness.aura.class == AttributeAura.class;
dygraGemOfMadness.aura.condition.conditions[0].value == 10;
#

the transformer doesn't return text.

#

it returns an object

#

in a "CardDesc" there are only 11 distinct types

#

something like that

#

if you permute the fields of the type it's always valid

#

look at the JSON. it's a tree. look at the blockly document. it's a tree.

#

do you see what i am saying?

#

there happens to be a HandIsFullCondition

#

stuff like that made this work a lot better

#

@dark cypress so i guess my point is this is all possible, very possible. if you're wondering why no one has done this, (1) card games are really hard to engineer, (2) the tender eyes of sauron in this field, from groups like openai or deepmind, focus on different things

#

would it be really cool? yes

dark cypress
#

oooh I think I understand, you're going from fromCardDescription, into the transformer, and populating the "aura" field with appropriate values?

undone coral
#

well

#

the transformer creates something

#

that is like

#

it's a dictionary

#

it's making a dictionary of dictionaries

#

does that make sense?

dark cypress
#

Yeah I mean its nested, I get that

undone coral
#

the transformer does not create characters

#

and it happens that the keys of the dictionaries are all regular

dark cypress
#

But thats where the ML is happening? In the Aura generation?

undone coral
#

there are only 11 sets of keys

#

no in the transformer

#

the transformer has figured out how to read word by word from the description

#

and start filling out the dictionary with values

dark cypress
#

Right but in the card object you receive, the aura field is the result of the transformation? Thats the magic? lol

undone coral
#

because it happens that as you read a card text, it already "fills in" this stuff

#

yes

#

the aura field is the result of the transformation

#

like "Deal 5 damage" -> the transformer reads "Deal" and knows it's making a DamageSpell

digital sphinx
#

how i can start by the 00:00 second (Discord API)

undone coral
#

then it reads 5 and knows that it always puts numbers into values

dark cypress
#

Got it, thats super cool

undone coral
#

and it HAPPENS that in the natural language, it's of course not context free

#

but regardless of "where you are" if you shoved 5 into a dictionary you JUSTcreated

swift quail
undone coral
#

into a "value" field, which makes sense for spells and conditions and auras and... etc.

dark cypress
#

I didn't read far enough down the json, I thought you were just generating randomish values for baseAttack, for example ๐Ÿ™ˆ

undone coral
#

it will be the right thing to do 90% of the time

#

so i say context free, i really mean a very finite context

#

the RNN worked well too

#

it picked up on these things, character to json characters

#

that's why we went ahead and did something more sophisticated

dark cypress
#

Yeah thats really cool man, to go from language to something that is conforms with formal game rules/terms

undone coral
#

the game rules are really constrained and that's why it works

#

you can't freehand code in the card JSON

dark cypress
#

right

undone coral
#

it's 99% of the time context free - it looks like a cheap lisp

#

anyway that's the most realistic demo

#

it would blow anyone's mind seeing that

#

because then it would run on a phone

#

you know, something people actually use

#

something normals can use

#

hand a normal a unity editor, you might as well just make a design fiction

#

it might as well be a movie

dark cypress
#

Yeah, thats the goal... become the new Printing Press

undone coral
#

anyway, i doubt you need my thesis research advising

#

$1b of azure compute, and OpenAI has very sophisticated AI Design Fiction

#

you could also just make a movie, it would be just as impactful for normals

dark cypress
#

OpenAI is what I'm currently using, they keep giving out free credit like candy

undone coral
#

well as you discovered

#

most of the time it doesn't really work

#

because there isn't much open source Unity code for them to steal

#

if it was stupid questions, stupid Q&A, it works great

#

there are thousands of people writing dumb questions into reddit right this very second

#

odds are some normal person's dumb question, that sounds unique and not possibly in a dataset to them, is being written right now

dark cypress
#

Yeah I noticed their responses have a very reddit feel sometimes. Lots of fluff surrounding the actual point or argument, when there is one

undone coral
#

well there's no shortage of creative writing. you could also punch random keywords into google books, grab a copy of it from libgen like they did

#

and copy paragraphs of creative writing if you desire

dark cypress
#

Thats a good point about Unity-specific code being relatively uncommon, I have been wondering if I"m degrading its ability by putting it in a Unity-specific context, like ECS, when really its just the fields and code I want to generate

undone coral
#

for example, you might THINK there was never a character named "Hockerbocker"... but

#

so if you asked me, "tell me a story about a guy named Hockerbocker"

#

I am Admiral Winston Hockerblocker.โ€ LaserSword's head jerked as if he hadn't heard the man corโ€” rectly. โ€œExcuse me? Sir, what did you say your name was?โ€ โ€œAdmiral Winston Hockerblocker.โ€ That was when the hysterical laughter hit ...

dark cypress
#

Yeah, generating an environment, or maybe a cutscene, from a lore dump is pretty much my end to end goal

#

The more interactive the better of course

#

I'll ping you if I can get the whole process functioning

undone coral
#

okay, let's see what gpt3 generates for that prompt

#

compared to what i got by copying and pasting from google:

Hockerbocker was a man known for his love of pranks. He was always playing jokes on his friends, and they never knew when he was going to do something next. One day, Hockerbocker decided to play a prank on his best friend. He waited until his friend was asleep, and then he snuck into his room and put a whoopee cushion on his chair. When his friend sat down, he let out a huge fart. Hockerbocker laughed so hard that he fell out of hiding and was caught. His friend was not amused.

arctic tendon
#

Hey guys, I have a question about collision detection in unity...
I have 2 rigidbodies, which are supposed to collide during an animation. However it seems the animation has a very fast movement between 2 neighboring frames which sometimes result in a missed collision enter.
(See images below for an illustration).

How can I fix this issue without editing the animation?

(To clarify, the collision in the illustration is missed when the sword enters the NPC's back -- which is the behavior I'm trying to fix)

  • The NPC's rigidbody's detectionMode is set to continuous dynamic
dark cypress
#

@undone coral do you think its possible with current technology to formalize that story into something Unity can portray?

#

I guess I should read up on abstract syntax trees. But I'll be happy if I can just get a spinning cube

wooden cedar
#

Imho, most anything is possible with time and effort.

#

But using AI to pull context, and using it to generate environments, is already being done in plenty of 3D tools. No reason you couldn't extend it to Unity if you wanted to.

#

If I understand the question correctly anyways.

dark cypress
#

Yeah, originally I was asking about retrieving compilation errors lol but the discussion expanded

wooden cedar
#

Personally, I would probably run the AI outside of Unity for a myriad of reasons though, and make it purely visual on the Unity end.

dark cypress
#

Its funny that I ran into someone here who has basically done exactly what I'm trying to, it doesn't seem like people are talking about it in my gamedev social circle

#

I'm thinking we might be behind the curve a bit

wooden cedar
#

That would give you a more plug and play friendly AI driven API that can work with other engines, and let you access funding from things like the epic mega grants ;)

#

If that's an area of interest mind you

dark cypress
#

I'm using Unity to spawn the OpenAI requests because Unity has an ezpz python interpreter, lol

#

Eventually I'll pull it up to be more of a github actions/CI kind of thing

#

but I don't know how to into Continuous Integration yet. So i'm trying to prioritize my learning so I can get a vertical slice, THEN upgrade individual aspects

#

What kind of projects do you work on?

wooden cedar
#

We work on about 20 projects a month, lots of XR, lots of custom experimental things. OpenCV, AI integration stuff. We have a lot of government work, health care, games, entertainment that kind of thing

#

But I feel we are greatly under utilizing AI

dark cypress
#

Is it like you're doing work for 20 different clients? Or you have 20 different projects?

wooden cedar
#

Mostly because we just can't keep up with the work, and so always short staffed and no time for research

dark cypress
#

A good problem to have, ha

undone coral
#

many, many fun games look like card games in disguise though

#

every blizzard game is prototyped as a card game - then again they mostly make strategy (or strategy adjacent) games

#

i wouldn't try to generate the numeric parameters of overwatch guns, but i could generate spells for those guns

dark cypress
#

I suppose the numeric parameters would be the humans job anyway, the game "design" aspect

undone coral
#

well nobody would notice really either way

dark cypress
#

Wrangling the spell descriptions into functioning code is the way more skilled part, yeah? Not that designers aren't skilled, but programmers are rarer

undone coral
#

the differences between all the cs:go guns are very small, in the whole space of numbers

undone coral
#

that would be interesting to expressively and succinctly program

#

however no real point for game designers - the spellsource card editor is easy to use... on PC

#

the purpose is really to support people trying to do stuff on phones

#

in my view

#

nobody develops games on phones yet

#

it's not realistic to ever make something like a roblox game on a phone, so it can't be this unconstrained thing

#

Dreams is close, but still that uses a playstation controller

#

and kids that have infinite time

wooden cedar
undone coral
#

that isn't going to be a successful format for phones

dark cypress
#

Well, I dont know, I mean if the world uses in-engine controls to edit the world, all you have to do is make the game playable on mobile

#

Not that in-game content creation is what we've been talking about

#

But normal people will suffer through pretty atrocious controls to implement their creativity, I think

undone coral
#

not on phones

#

very hard to compete with tiktok

wooden cedar
#

I don't agree with that at all, sorry.

undone coral
#

how many adults play minecraft PE?

#

have you tried its virtual joysticks?

#

after that i can't think of a big mainstream game on phones that expects you to build something

wooden cedar
#

It always stands out to me when someone makes bold absolute statements based on personal assumptions.

undone coral
#

i think they'll use a PC

dark cypress
#

Its mainly for the sake of conversation ๐Ÿ˜…

undone coral
#

yeah i'm just trying to really refine a good audience here

#

spellsource is a card game where the players author the cards, and targets portrait mode mobile

#

it's tough. you wanna be able to do that on phones

dark cypress
#

I guess I'm trying to highlight the difference between a PC-specific level editor, and ingame editing you can do, like Fortnight. Do people not build forts in the mobile version?

undone coral
#

epic has delisted fornite from the apple and google stores for a while now

#

they also experimented with getting rid of the building in that game

#

you could read their reasoning online

#

obviously the truth is that playing fortnite on an iphone / android sucked, and so they'd rather those audiences do it on a switch or even better a PC

#

or maybe it's because "app store fees"

#

๐Ÿ™„

#

i'm not saying anything controversial by pointing out that FPS controls are absolutely horrendous on mobile devices

#

i undersatnd people play them, but that doesn't make the controls good

#

supernauts was designed by the best people in the world, at its time

#

for making mobile games

#

they couldn't figure it out

#

it was just too cantankerous

#

it's 2022 and facebook is repeating the same mistakes, with a cloud rendered supernauts like experience

#

nobody learns

#

if you want an audience for natural language to code

#

yeah, card games

#

it makes sense

#

because people want to play those on phones

#

exhibit A: Marvel Snap

#

ben brode basically did everything rigth in terms of making a better mobile card game

dark cypress
#

Yeah my original point was how people will suffer through bad controls, so I'd wondering what kind of decline there was in basebuilding on mobile fortnite vs PC. 50% drop? Who knows

undone coral
#

completely original approach, borrowing from all ther ight things (like texas hold'em), portrait mode, 1 value cards, etc.

dark cypress
#

Well maybe not "gamers" but normal people as in, the ones that maybe don't even have a PC

#

and don't know how bad of an experience they're having

undone coral
#

certainly kids will suffer through bad controls, for a while

#

if you have a brave idea on how to make good controls for older kids, get a roblox dev grant for $1m

#

clone a game, they want you to, desperately

dark cypress
#

Well Im going to see if I can fire up this pipeline, thanks for the AST primer

supple crescent
#

is it possible to get the contact points between two static colliders? trying to build a spline between the terrain and the ocean. Any ideas is appreciated thanks!

compact ingot
supple crescent
#

Would love to hear more, trying to think of as many approaches as I can.

compact ingot
#

well, one would be rendering a top-down-view utility texture that captures a depth map of the terrain and extracting the iso-line at sealevel (contour of the land at the elevation of the water), then convert that into a spline

#

i don't know any other method that doesn't rely on a depth map in some form or other

#

if the colliders/meshes are static you can also just analyse the mesh by a slow CPU process and "bake" the contour, but it would essentially too be a depth map calcuation

supple crescent
#

it would be a process that would only need to happen once during the initial generation of the world.

compact ingot
#

i'd go with a depth sampling approach

#

generating that spline is an interesting problem, probably requires reading some papers

buoyant nacelle
austere jewel
#

Not sure what is advanced about this

fresh salmon
#

NREs aren't advanced issues I'm afraid
1st error happens on line 43 of HealthBar (so L70 in your link), matBlock was null

#

2nd and 3rd errors happen on L19 of GameHandler, which point to a closing brace in the link - not slovable as is

#

Next time, post one link per class, don't shave off lines

austere jewel
scenic forge
#

I'm looking to write my own Android native plugin to use in Unity, is there any material regarding project setup?
I looked around and several articles I could find were years ago, and presented completely different project setups (some uses Android Studio, some uses CLI only; some creates a no activity project, some creates an empty activity project and changes post build; etc)
Also I'm wondering how to speed up the iteration, these articles didn't touch on that and all just assume code works, build and integrate into Unity, which is obviously not the case. The plugin I'm making is not really tightly coupled with my Unity project or Unity in general, I'd like to be able to test the plugin in isolation, and only build/integrate into Unity once it's done.

#

That's not really what I'm asking, and yeah I'm aware how to integrate into Unity.

#

The whole iteration question.

#

If every little change you make in the plugin, you have to build it, update it into Unity, run the Unity project in the actual device to test it, that's obviously ridiculously painful.

#

Yes that's what I was thinking, and I'm asking if there are materials that walk through all the steps.

#

Yeah and I'd like to avoid learning everything about Android just to do that because I obviously don't know what I need to know.

#

Sure, I would appreciate if you can give me the things I need to look for

#

Like which template, etc.

#

Hey man, I've done the searches and the articles all went with different setups and they configured the projects in vastly different ways

#

I wouldn't be asking here if those articles gave any explanation on why they chose what they chose or the difference between them, I'd basically have to go read Android dev from scratch.

scenic forge
#

Well, thanks regardless.

regal olive
#

for some reason the player still rotates to the direction he is moving to even tho I turned off all the rotation??? I'm so confused rn. My goal is to make the player only rotate to the direction he is aiming at and be able to still walk around while doing it. https://paste.ofcode.org/ZydnHEGj2mJzdZj4EdBGYN

fresh salmon
#

This is unreadable, even on PC

regal olive
gentle topaz
#

well that's not how you calculate a direction

#

close, but you are only normalizing the transform.position

#

you need to normalize the result of the subtraction

#

not one of the operands

regal olive
gentle topaz
#

putting parenthesis around the subtraction part

#

or you could just do the subtraction and then use aimDirection.Normalize()

regal olive
gentle topaz
#

if you did that, what would you be subtracting?

#

the subtraction is correct, the normalization is not

#

those are two separate concepts, and im saying to do the subtraction first, then normalize the result

regal olive
#

oohh

#

wow you actually did it

#

thank you so much

regal olive
uncut seal
#

Hi guys.
I need some advice about WebP.
I'm working in an android project with unity, and I would like to know if WebP is useful to decrease size build.

#

Is it correct?

stiff sigil
#

To my knowledge, Unity already compresses textures internally when doing a build

uncut seal
#

Yes, I know.
But webp compress more than png/jpge, I don't know if is more effective than png/jpge using crunch.

flint sage
#

Textures are compressed to a platform specific format, you can change these however you want in the import settings

flint sage
#

Afaik unity doesn't support webp and webp is a very different format from what it is being compressed to on device

#

Texture format in your unity project (i.e. not built project) don't really matter except as a maximum level of quality available

uncut seal
#

So, probably don't work in android project?

flint sage
#

Probably doesn't work in any project

stiff sigil
#

In your Unity project, always use the highest quality version of the textures you have.
Let Unity compress the textures for each target platform, you can change the settings if you need more granular control.

flint sage
#

Not really, your source files should be the highest quality version you have, you shouldn't be putting your source files in Untiy

uncut seal
#

I would like to use high quality, but my boss doesnt. ahhaha

flint sage
#

That's just stupid, it'll inflate your build times by a lot

novel plinth
uncut seal
#

Ok, I appreciate yours helps.
Thanks.

hot dock
#

Does anyone know what is the programmatic way to reset the position of a GraphView to (0,0)?

#

(or the hotkey, so maybe I can dig through the code)

#

I think there is a "placematContainer" that is related, but not sure how

next shard
#

having a problem with a compute shader where i am using an appendstructured buffer, but when i try to append to it, the editor will instantly crash with a d3d11 error. Anyone tackled this problem before, or know how to solve it?

uncut seal
next shard
#

ok, will do

plucky hound
#

I have a dog-like shape made of character joints (constrained). I'd like to "activate muscles". I think the right way is by applying torque to the rigid body of each character joint. am I in the right ball park?

#

i found several walking demos on yt but no code yet, and some that only use articulated joints (eg industrial robots)

silent dagger
#

any Math eater here around can help me with Player's level and Health guided by Animation Curve? ๐Ÿ˜…

#

I've made a Stats system that use AnimationCurve to define the value on level up, but the value have too many decimals and the game design should be based on stats with value like 8 16 20 24 32 ... and so on.... but I'm lost

#

'cause actually the player starts with a value of 4 at lvl.1 and 4.0085 at lvl2 ๐Ÿคฆโ€โ™‚๏ธ

#

Example:

#

I mean, I could set the curve at 100.000 but I really dislike the idea

#

or.. I could make the AnimationCurve with 100,000 as last point and divide the keys by the game levels ๐Ÿค”

#

Or ... I could throw myself out of the window ๐Ÿคฏ

#

I'm kidding ๐Ÿ˜

stiff sigil
#

Could you send any code and maybe a screenshot of the animation curve?

silent dagger
#

sure

#

Discord isn't happy... gimme a sec.

real talon
#

Post it in a code dump, the bot is removing weird code

silent dagger
dusky remnant
#

Hi, i have a problem with my 2d triggers, they seem to detect collision even though they are far appart, they are set to look for collisions with a tag, and only those gameobject have that tag. and they think they collide, even though the collider(green box) is far appart... any idea why this is happening?

silent dagger
#

in inspector looks like that

#

while for NPC's looks like that

#

***bad discord! ***

#

I see an If statement ๐Ÿ™‚

#

is it so bastard also in private?

real talon
#

Weird bot, I could post it one time ๐Ÿค”

stiff sigil
gray pulsar
silent dagger
calm ocean
#

Anyone has a good way of refactoring this abomination? https://paste-bin.xyz/65476

The goal is to see if object the script is on can see the player. First use box cast, but if that hits the corner of a wall and fails to hit the player, use a ray cast just to check. If that doesn't work, return false.

Untitled - pastebin Paste can store text, source code or sensitive data for a set period of time.

wooden cedar
maiden turtle
novel meteor
buoyant vine
#

you need for 2 d x and y

#

not x and z

novel meteor
#

Yesm

buoyant vine
#

new Vector3(i * offset.x, 0, -j * offset.y)

#

thats x and z

#

as example

#

you just need to change these

#

probably

novel meteor
#

Thanks! i shall give it a shot!

#

Awesome worked like a charm! thank you so much \m/

random dust
#

Anybody with Steamworks.NET experience? How do I find out when a lobby was invalid when calling SteamMatchmaking.JoinLobby? LobbyEnter_t is being called like the lobby existed.

#

These are the parts of the code that make up joining the lobby

#

OnLobbyEnter is called and returns a callback with the same lobby id, yet the lobby should not exist

#

I suppose I should supply custom lobby data and see if I can retrieve that? I do try to get a host address, but I was wondering if there was another way

dreamy spruce
#

how would you achieve transform.RotateAround without using RotateAround

dreamy spruce
#

@fast pagoda oops, meant without*

fast pagoda
#

i have no idea then lol

fresh finch
fresh finch
# urban warren Ray/sphere casts?

Sorry, I should clarify. This post isn't 100% relevant, I'm not trying to get jumping working -- I have multiple objects moving at high speeds that collide with eachother

urban warren
fresh finch
#

OnEnter is being called, but on occasion I encounter a Unity limitation, where if there is a lag spike then OnExit WON'T be called. I need to know when the collision starts and stops

urban warren
fresh finch
urban warren
cobalt marsh
#

i am using the code from this page https://forum.unity.com/threads/windows-api-calls.127719/ ..
..to make my window transparent and click Thru (the transparent parts). What do i need to pass into these to either Turn off the Click Thru, or disable both.

SetWindowLong(handle, -20, 524288);
SetLayeredWindowAttributes(handle, 0, 0, 1);
maiden turtle
sage radish
maiden turtle
#

yeah that applies it immediately I guess

sage radish
#

Oh transform.RotateAround also modifies rotation. In that case, add a fourth step:
transform.rotation *= rotation;

dreamy spruce
#

hmmm yes, math that I don't yet understand

pale zinc
#

rotation around a point can be

mighty delta
#

im trying to make a vr game but nobody is responding in the virtual-reality section so can anybody help me in here because i have a problem

fresh salmon
#

Don't cross-post

mighty delta
#

alr i just need help tho

fresh salmon
#

That's not a reason to post your thing everywhere

mighty delta
fresh salmon
#

"I need help" is not a question

#

You posted in 4 different sections now

tame valve
#

Guys is there a way of casting a float/int to bytes without unsafe code?

#

In Jobs (so no byte[] array)

tame valve
sly grove
#

without byte arrays... no I don't think so

#

well

#

I mean you can do it yourself

#

it's tedious

#

but through bitwise operators you could

tame valve
#

Yeah I know, it's not terrible really, just need a stackalloc array and pointers, but it's a bit annoying

sly grove
#

something like:

public void ToBytes(int input, out byte b0, out byte, b1, out byte b2, out byte b3) {
  int tail = 0xFF;
  b0 = (input >> 24) & tail;
  b1 = (input >> 16) & tail;
  b2 = (input >> 8) & tail;
  b3 = (input) & tail;
}```
tame valve
#

so I thought maybe there's a hidden c# method that could give you the byte at a given offset of the type directly

#

Yeah alright, I'll probably do that to avoid having to have unsafe compilation turned on for this assembly, thanks.

next grotto
#

I'm working on a script that spawns random enemies as the player runs around, but this seems to have issues with navmeshagent. Previously, when I was just using simple positioning of the enemies, I had them using non-kinematic rigidbody so I could pick a place to spawn them, and then iteratively move the model up by small amounts until a raycast down hit the ground, then spawn the enemy there and let it fall to the ground the .1 or so it was above it. This doesn't work though with navmeshagent though, as it's kinematic and apparently being just a tiny bit above the ground makes the it not able to control the navmesh agent.
Is there a logical way to tell it to basically apply gravity so the agent can fall but stay otherwise kinematic?

tame valve
#

I'd have thought having a navmeshagent enabled would immediately stick it to the ground. Has that changed, and if you have a kinematic component and move it above ground manually, the navmesh agent turns off or something?

compact vault
#

i've been working on a wave spawner for a tower defence game for a while now but i just cant seem to get it right, i was really close until i noticed the enemies dont always spawn properly, the issue seems to have something to do with the amount of enemies getting spawned. (sorry for the spaghetti code haha)

#

the problem seems to be right here

stiff sigil
#

You really should avoid the use of InvokeRepeating

#

It's terrible for performance and debugging

tame valve
#

It looks a bit weird, does EnemyInfo correspond to a single enemy entity? Or is it an enemy type? Because using InvokeRepeating like this, it looks like that each EnemyInfo is spawned multiple times.

If that's the case, then enemiesAlive++ should be inside SpawnEnemy, for a start, no?

#

You only check for enemiesAlive == 0 once, if it's not true, the coroutine ends, is that really what you want? I'd expect you'd want something like while (enemiesAlive > 0) { yield return null; }

compact vault
#

oh yeah my bad, theres a few other scripts

compact vault
compact vault
tame valve
#

Why are you setting CurrentPoint = Points[0] repeatedly in update? It's pretty much always the 0th point this way.

compact vault
#

at first it was for debugging purposes, im probably going to remove it as soon i have a few of the maps stuck in place

#

it mostly works but there should be 3 of the red ones but it only spawns 2

inner juniper
#

Hello? IS there a way to get the real width & height from a stretched RectTransform?

tame valve
#

@sly grove Apparently bit shifting isn't possible with floats... oh well.

sly grove
#

or BitConverter

tame valve
#

yeah but at that point I might just use pointers ๐Ÿ˜ฆ oh man, annoying stuff

flint flint
#

Hi, I noticed that my unity game for the iOS App Store has a section in the UnityFramework.framework/UnityFramework binary called il2cpp. I was curious what this was and if there was some way to remove it, as it takes up 16mb.

next grotto
#

Not sure what the cutoff between code-general and advanced is, but this feels advanced-ish? I've got a script that generates random enemies. To find a new position, I pick a random (x, charPos.y ,z) position near the player, and use NavMesh.SamplePosition to find the nearest spot that hits the navmesh. Then I Instantiate(prefab, hit_from_sample_position, Quat.identity, enemyParentsGameObject) but it still complains that I can't use setDestination because it doesn't think it's on the navmesh, even if I use Warp() to place it?

regal olive
#

I am making a third person shooter character, but for some reason the character doesn't walk to the direction the camera is facing even tho I did put it in the code. When I use WASD it only walks to a specific XYZ direction and doesn't get impacted(rotated) by the camera look position. Like it thinks that the camera is facing one Z axis all the time even tho the player is looking at a completely different direction. Anyone know what I did wrong? https://paste.ofcode.org/Pz2KXwCEpyDkGFXwKpcZup

#

I'm also not even sure if it's a script problem

#

so confused rn

#

This is inside the characters inspector

split light
#

Hello guys!
Can anyone tell me why when I play a particle inside my unity device, it breaks the textmesh for the UI? Has anyone had a similar bug?

fast pagoda
#

use pastebin, discord is a bit bugged

buoyant vine
woven kettle
#

I tried this, and it didnt work !
if(rot1 != Quaternion.Inverse(Quaternion.Euler(bag.targetRotation))) doesn't work

fast pagoda
#

well if I understood the context, async tasks are better, performance wise, than coroutines or unity delays or w/e

woven kettle
#

it didnt stop, the update function kept running

#

i added a debug to learn if its still working, and it was

fast pagoda
woven kettle
#

what is the right way to do it then ?

fast pagoda
#

whats your logic here? whats the feature you're doing?

#

there is always a better, more logical way to do it

woven kettle
#

well, the 2 handed gun is suppose to rotate in a specific rotation to the backpack of the player , became a child to the bag and that is it
I dont need to keep lerbing it's position on update

fast pagoda
#

so that's an animation right?

buoyant vine
# fast pagoda whats the context?

it was said that i can launch a task with unity engine unrelated code but instantiating an gameobject looks to me like unity engine related code

woven kettle
fast pagoda
# woven kettle yeah , kinda

Animations have duration, if I was coding that feature, I would just put a delay before stopping the update or whatever you're trying to do.

#

I don't care about the animation itself, the main thing is the duration.
There is no point having to create a condition for a rotation (in that situation)

#

you could get the angle, between the rotation and the "target" rotation, and see if it's like very close, but comparing Quaternions, that's not good

fast pagoda
#

i never calculated an angle between 2 quaternions but i'm pretty sure it's straightforward
For Vector3, you can use Vector3.Angle(euler1, euler2);

#

from google (for quaternions)

#

it's definitely not straightforward, ๐Ÿคฃ

#

just use the Quaternion.eulerAngles

woven kettle
#

yeah, looks pretty odd

#

is there is a way to run a delay for like (3 sec) after that i could just stop it ?

#

it only takes 1 -2sec to lerb

fast pagoda
#

Yea, using a Coroutine or an Invoke

woven kettle
#

what about update?

fast pagoda
#

using Update you'll need a timer variable

#

but yea that's possible

woven kettle
#

could you give me an example of the timer variable ?

fast pagoda
#

something like this

#
public float duration = 5f; // 5 seconds target duration

private float _timer = 0f;

private void Update()
{
    _timer += Time.deltaTime;

    if (_timer > duration)
    {
        DoSomething();

        // assuming you just want to destroy the object
        // at the end of the duration
        Destroy(gameObject);
    }
}
spring sable
#

Algum brasileiro?

humble leaf
#

@brazen hamlet I literally just told you that this isn't Unity related. Go find a C# discord, there are a few.

brittle charm
#

Hey, is it possible to implement such thing:

When my custom behaviour is assigned to an object one of its public attributes should be randomly generated and be kept forever, although be editable. I couldn't think of a way to implement that yet

brittle charm
#

Sure

fast pagoda
#

why would you want that specific thing

brittle charm
#

So basically I want some items to get disabled / destroyed if they were collected by the player before. For that I decided to make some kind of unique identifier for objects and store them in a list. If the identifier is found in that list, the object should get removed and be uncollectible

buoyant vine
#

just use an ID generator

brittle charm
#

Kinda new to data storage in unity, if there are better practices than using json serializeable for everything tell me about them please ๐Ÿ˜

buoyant vine
#

for the items

#

is it for online

#

or for singleplayer

fast pagoda
buoyant vine
#

but a simple enumeration like hardcore 1 2 3 4 5 6 7 would do it

#

if 7 was picked up.. dont do it

fast pagoda
#

i mean, the keywords from its initial question were:

Behaviour assigned Object public attributes randomly generated although editable

brittle charm
buoyant vine
brittle charm
brittle charm
buoyant vine
#

allright so data security is unimportant

brittle charm
#

Yeah

#

I just store that in json serializeable as I mentioned

buoyant vine
#

why do you not give your item an identifier

#

you got pickaxe id = 1 ... i cant pick something up if i allready picked up the one with id = 1

#

is the storage the problem?

brittle charm
#

I do, I just want them to be generated and inserted into the field based on my ID generation algorithm instead of typing a new id into the field manually

buoyant vine
#

make a static private int counter

#

in your scriptable object or mono

#

and onreset counter + 1

#

or onvalidate

brittle charm
#

The goal is to automate the process of me making an id and putting it into the field

buoyant vine
#

should the ID be random ?

brittle charm
brittle charm
buoyant vine
#

well onValidate gets triggered when something in the editor changes

#

or

#

when the script gets added

#

you can call the generator once in onvalidate

brittle charm
#

Hm, I will look into that method

buoyant vine
#

or onreset or on enable

#

but onenbale is in both editor and runtime once

#

onvalidate is only editor

brittle charm
#

I am not going to edit id at runtime so I think OnValidate is what I am looking for

fast pagoda
#

yes you could assign the ID inside OnValidate

brittle charm
#

Thanks for help

fast pagoda
#

if you wanna have a random unique ID, i would recommend using GUID

brittle charm
brittle charm
#

Thanks

gilded trench
#

Hey I have this idea for my game and I was wondering how I could get it to work. Im using Unity 2019.4.31f1

#

Basically I want the player to be able to type to the NPCs and using some kind of AI text recognition they could respond in unique ways based on parameters like their personality and mood

#

But I'm a big noob and have no idea if that's even possible ;-;

livid kraken
#

Possible yes, but you will have to learn a ton of things

gilded trench
#

I was thinking of starting off simply and just checking to see if some key words are in the string and then responding with some premade responses

frosty violet
#

Hi guys.
I would like some advice on simplifying mehs collider. My problem is this: I have a complex 3d model and I want to create, starting from its mesh, a simplified but quite accurate collider that encloses it and use it instead of the mesh collider to improve performace. How to achive this?

I hypothesized that I could work on the normals of each vertex, creating a new mesh with only the neighboring vertices having different normals. But I'm not sure it will work.
Thank you!

livid kraken
#

Cant you just hit convex in the mesh collider ?

frosty violet
frosty violet
carmine ermine
# gilded trench I was thinking of starting off simply and just checking to see if some key words...

that can work but its a different concept than ai text recognition. if you were to do it that way, i would see if there exists a library that maybe has those connections between words and knows what sort of conetation words have. then use them to decide which premade sentence to choose from. using the mood/personality, you can also use these connections and conatations and sqew them to a specific direction more.
if you were to do it without a library of some sort it would be super hard coded, but you can still do it. just kinda depends how complex you want this system to be.

#

(also take this with a grain of salt im not that experienced with this stuff)

gilded trench
#

And this conversation feature is gonna be like the main focus of the game so I'm willing to spend as much time as possible on it

river sand
#

instead of writing 100 useless word try to teach people dude! if this is not advance then help me resolve it.

remote oar
#

can anybody tell me how these rendering layer masks work

#

i have a outline effect that should show up on specific rendering layer masks, but it doesnt work..

#

if i choose "Unused 8" it wont work

#

am i missing something?

barren nacelle
#

i wanna know if someone can explain how quaterions work in unity

#

and i dont mean rotations but their multiplication

#

this should hold

#

i end up with a different result

#

any explanations?

regal olive
#

Does anyone know how hard on performance 2D boids are?
Both for CPU (C#) and on GPU (Compute Shader)
If I only have 10-15 on screen at once that shouldnt hurt the CPU too much right?

tough ore
#

Does anybody have experience with webviews inside their mobile games?

novel wing
regal olive
mint burrow
#

looking at the raw numbers wont really help you much

#

with euler angles, there can be multiple different sets of values that equal the same orientation

#

with quaternions, each set of values only corresponds to a single orientation

orchid marsh
#

Those are quaternion values from a matrices

mint burrow
#

you can use a quaternion to transform a vector much like you could with a matrix

#

if you have a certain orientation, let's say transform.rotation

#

you can multiply it by a vector to get that vector rotated by that orientation

novel wing
#

Quaternion isn't an orientation, it's a rotation. So going from Quaternion A to B doesn't really make sense, but you can construct a third Quaternion, C that represents a rotation to go from A to B

mint burrow
#

a rotation is an action that results in an orientation

novel wing
mint burrow
#

by multiplying vectors with quaternions it acts like rotating it by that amount

#

also they avoid gimbal lock

barren nacelle
mint burrow
#

there's a 3blue1brown video that describes the math

#

omg please just let me send the link dyno bot

#

How to think about this 4d number system in our 3d space.
Part 2: https://youtu.be/zjMuIxRvygQ
Interactive version of these visuals: https://eater.net/quaternions
Help fund future projects: https://www.patreon.com/3blue1brown
An equally valuable form of support is to simply share some of the videos.
Special thanks to these supporters: http://3b1...

โ–ถ Play video
barren nacelle
#

ik

#

probably gonna use that

#

wanted to use build ins

barren nacelle
#

thx

#

for those who want answer unity treats quaterian components in different order

#

heres what it normally looks like

#

and this is what unity does

gray pulsar
dreamy spruce
#

How would I go about generating a triangle pattern, for eg. See image. Where all of the dots will have their respective vector2 positions, the amount of dots will vary

#

Im think I should make an algorithm for x and y, but I have no idea how I'll calculate it

wooden cedar
#

You'll do a lot of this with procedural meshes :)

dreamy spruce
wooden cedar
#

Same with the Y.

#

That gives you the staggered dots you see in your image sample.

#

Where that gap depends on how you want the triangles and spaces to go.

#

But each row is one less than the row above. And each row is offset by 0.5. so now you can loop through and draw the points row by row, and just move ahead 0.5.

I'm basing this on your diagram though mind you.

dreamy spruce
#

Ignore coffee spil

wooden cedar
#

Take T4. You know the 4 is the number on the bottom row, 10 is total but doesn't matter.

So row one, draw 4 dots 1 space apart.
Row two offset 0.5. draw 3 dots 1 space apart.
Row three is now offset by 1. Draw 2 dots 1 space apart.
Row four, now offset 1.5, draw 1 dot.

#

I'd start at #5 and work my way up.

dreamy spruce
#

But if it like doesn't have enough to fill the row

wooden cedar
dreamy spruce
#

It does

wooden cedar
#

Well, you can't resolve ever number to a base square root.

#

So the option you may want is starting at #1. Which is just a for loop.

In this example:
Row one is always a max of 1 dot.
Row two is always a max of 3 dots.
Row three is always a max of 5 dots.

In your other examples I believe each row was only increasing by 1 dot.

But you know the row size you want. So as you go through your if statement, increment a max row size, and that determines if you should start another row. In this case though it is incrementing x and y by 1 for each row.

dreamy spruce
#

Hmmm, thanks

woeful shale
#

I need to render 4 billion objects on the screen at once. They're little 3D objects that will be stacked next to eachother in several 3d cubes of 1000x1000x1000 objects each. It's ok if they don't render in realtime (my client uses Unity to create videos).

I won't be starting work on it for a day or two here, but I've been mulling it over in my head for a bit and I'm certainly intimidated ๐Ÿ˜…. I've got a plan that I think might work, but I'd appreciate any thoughts if someone thinks they've got a better idea.

I'm planning on creating a component that captures an image of the object from the angle the camera's currently at and then repeats that image onto a simple 3D plane. I'll be able to get a decent approximation of perspective this way, though the parallax will be fixed within each plane. But... even if each plane handles 100x100 objects, that'll still be 100,000 planes ๐Ÿ˜…, which is probably way too many. So I think each plane would have to be pretty big but that'll make the fakery more obvious.

buoyant vine
#

its only theoretical thoughts

#

not useful at all

stiff sigil
woeful shale
stiff sigil
#

well, yeah lol

woeful shale
#

Though maybe I'll be able to support 100,000 planes outright using instancing ๐Ÿค”. Is that what you meant? How were you imagining applying instancing?

stiff sigil
#

all im saying is

#

if you're rendering lots of objects that have the same geometry, then you definitely need to be using instancing

#

but if your client doesn't care about it being realtime, why use unity?

#

4 billion is a crazy number of objects. 1920 * 1080 = ~2 million pixels

woeful shale
#

Gotcha. Yeah I'm sure instancing will be involved here... definitely an extreme thing. I need more than just instancing to pull this off though.

#

And he's got pretty good reasons for using Unity honestly ๐Ÿคทโ€โ™€๏ธ. Though we'll see if we're able to make this particular dream (the 4 billion objects) a reality.

stiff sigil
#

I'm not super familiar with this, but look at this:

#

that effect is almost definitely done using some magic on the GPU

#

i don't exactly know what it's called, but i think that's similar to what you're potentially gunning for

#

some GPU accelerated particle system, just the particles are cubes and not squares

stiff sigil
#

Stop posting the same question in multiple channels.

echo wigeon
#

can anyone help me with this?

#

Begin MonoManager ReloadAssembly

  • Completed reload, in 0.124 seconds
    Microsoft Media Foundation video decoding to texture disabled: graphics device is Null, only Direct3D 11 and Direct3D 12 (only on desktop) are supported for hardware-accelerated video decoding.
    Shader 'Nature/Terrain/Standard' uses 17 texture parameters, more than the 16 supported by the current graphics device.
    (Filename: Line: 0)

Shader 'Nature/Terrain/Standard' uses 18 texture parameters, more than the 16 supported by the current graphics device.
(Filename: Line: 0)

Shader 'Hidden/TerrainEngine/Splatmap/Standard-AddPass' uses 17 texture parameters, more than the 16 supported by the current graphics device.
(Filename: Line: 0)

Shader 'Hidden/TerrainEngine/Splatmap/Standard-AddPass' uses 18 texture parameters, more than the 16 supported by the current graphics device.
(Filename: Line: 0)

WARNING: Shader Unsupported: 'Hidden/Nature/Terrain/Utilities' - All passes removed
WARNING: Shader Did you use #pragma only_renderers and omit this platform?
UnloadTime: 42.950600 ms

supple crescent
#

Hello, I have a question that is heavily related to math & am trying to find a solution and then implement it in code, maybe unity has something built in but most likely not, if you have any ideas please @supple crescent Thanks!

So I am working on a spline system, that uses what I believe are Bezier curves, this is an asset where you can apply points to the spline and it will build out the curve, currently I am trying to find a way to get a close approximate to a perpendicular line running through one of these points that make up the spline. I have access to the current point and last point in the spline. but im not sure how to get a tangent line for this.

buoyant vine
#

you can use geogebra to get the maths right

#

it can print you the curves

#

then you can implement it in unity

supple crescent
#

this is a procedural based system, but I will look into this as it might be a great testing environment, thanks!

buoyant vine
#

its free and simple

rocky mica
supple crescent
#

3d, and I was just reading about vectors

#

I have a vector built from the two points but now I am looking into getting the perpendicular vector

rocky mica
#

perpendicular to what

#

๐Ÿ˜„

#

in 2d its easy, you can just calculate it directly from 2 points

#

in 3d, you need an extra vector to define perpendicularity

supple crescent
#

well the point of the perpendicular line is to create those points, I need to find a way to make it perpendicular off of the vector created from the two points

#

I suppose it could be in 2d space since I dont care about the y axis

honest hull
#

its 4 float3's on both cpu and gpu

rocky mica
#

and if you need a 3d variant, from your 2 points, use Vector2.Perpendicular to get the perpendeciular vector in the plane its lying, then use Vector3.Cross between that original vector and your new vector and that will get you a vector coming out of the plane

stiff sigil
#

In the 2d case:

  • You have a bezier curve b
  • You have a point on that curve p
  • Find the tangent t on curve b at point p. (There's a formula for this if you look it up)
  • Follow what @rocky mica just said
rocky mica
#

^^ Yeah this will get you the actual value, if you use points a and b directly you will get a rough aproximation depending how far away points b and a are

gilded trench
#

K I typed this somewhere else but didn't feel like doing it all again so I'll just send the screenshot. Can someone give some advice

#

Hold on I'll send the original message so you get the full idea

#

Hi, I'm working on a game and I'm trying to program a way for the player to type to communicate with the NPCs. And I want the NPCs to recognize the connotations in the worlds and respond with either a rude of friendly response. Any ideas??? I'm stuck ๐Ÿ˜“

minor scaffold
#

Hey guys I've been trying to fix a problem for 2 days, I hope someone can help me here.

I'm trying to make a game using planet gravity physics. I'm stuck in rotating player.

Lets say I pressed "Left Arrow" and wanted to player to go left and turn left at the same time. The problem is "transform.TransformDirection(moveDir)". When I make the player turn to the left, player starts the move its left side instead of the world position. If I only use moveDir for positioning, it goes out of the world. How can I make this work?

gilded trench
somber swift
#

Maybe you are using bilinear filtering for the texture?

random dust
#

Yes, sounds like texture filtering

#

Dunno, I never changed it

#

Look up how filtering works

#

I believe there is a pixel-perfect camera package

#

Maybe that helps

somber swift
#

Via code or in editor?

hazy hearth
regal olive
#

Is anyone here familiar with 2D Boids? I basically have it working except for one problem, their turning is too fast which makes them sort of freak out

Anyone know how to reduce their turning speed?

https://paste.ofcode.org/hR7FkUPHFPvWBjzQFNexLe

obsidian glade
hazy hearth
#

How do I check if a Query is empty?

stiff sigil
hazy hearth
# stiff sigil What do you mean by query?

Query userQuery = databaseReference.Child("users").OrderByChild("username").EqualTo(_username);
I want to check if the _username already exists in the firebase database

stiff sigil
#

That's a firebase api question, so I'm not personally sure.

hazy hearth
#

Alright :/

#

Anyone?

stiff sigil
#

You probably should ask in a firebase forum, or go through some of the provided Unity firebase examples.

hazy hearth
#

aight

clever cargo
#

Hi, I have a short video with audio on loop using Unity's Video Player. Webm file (Video: VP8, Audio: Vorbis). I change the speed of the video dynamically. The video processing is find, but the audio gets out of sync and if the video slow down by 0.5f the audio stutters and throws warnings like

AudioSampleProvider buffer overflow. 1028 sample frames discarded

I had a look at google and found a few threads / bug reports but there were either no solutions or blamed low device specs (this is definitely not the case for my pc build)
Does someone has experience with this behavior?

echo wigeon
#

is anyone available to help me out?

humble leaf
#

Just ask your question and find out?

echo wigeon
# humble leaf Just ask your question and find out?

[Subsystems] Discovering subsystems at path D:/RoForce/RoForce_Data/UnitySubsystems
Forcing GfxDevice: Null
GfxDevice: creating device client; threaded=0
NullGfxDevice:
Version: NULL 1.0 [1.0]
Renderer: Null Device
Vendor: Unity Technologies
Begin MonoManager ReloadAssembly

  • Completed reload, in 0.149 seconds
    Microsoft Media Foundation video decoding to texture disabled: graphics device is Null, only Direct3D 11 and Direct3D 12 (only on desktop) are supported for hardware-accelerated video decoding.
    WARNING: Shader Unsupported: 'Hidden/Nature/Terrain/Utilities' - All passes removed
    WARNING: Shader Did you use #pragma only_renderers and omit this platform?
    UnloadTime: 0.930400 ms *FIXED Turned of server build
#

anyone know what this is i have direct x 12

echo wigeon
#

another question how could i fix the detail distancing ?

misty walrus
#

I have a camera that I adjust on-the-fly to enforce aspect ratio. I just moved the rect x position lef and right on the picture before setting it back in the middle in order to demonstrate my issue. The parts of the screen not being rendered are no being cleared. I've tried running GL.Clear() with color black but it didn't do the trick :L.

buoyant vine
#

its copy pasta from wikipedia

gray pulsar
buoyant vine
#

but isnt that just pooling with extras?

gray pulsar
#

its more like using scriptable objects in unity

buoyant vine
#

ahhh

hot dock
#

I am not sure if I have asked already before in the past but... can Unity serialize a HashSet?

gray pulsar
hot dock
#

Thanks

buoyant vine
#

you just need asset store packages

#

that allready made it

#

as unity just doesnt want to do so

hot dock
#

Can you recommend one?

#

@buoyant vine

gray pulsar
buoyant vine
hot dock
#

even though I must have 2 data structures for the same data... one for runtime, and one for serialization

#

But I guess it is not the worst

finite pond
#

Does anybody have an idea if NetworkObject instantiation parenting works as expected? I'm instantiating GOs on the server and parent them to another NetworkObject inside that scene, but clients that sync up with the host don't parent the child GOs to the correct parent. Instead, they are placed at root and I get the exception that "parenting is only allowed on server", even tho I'm not even parenting them on the client. What's going on here?

queen mortar
#

Anyone know why I'm getting A Native Collection has not been disposed, resulting in a memory leak even though I'm disposing all the NativeArrays I'm using?

buoyant vine
#

or during non editor time

#

they dont get called from anywhere else

fast pagoda
buoyant vine
#

what is that exactly doin?

fast pagoda
#

its tell the compiler that if the directive "UNITY_EDITOR" is defined, it won't read the code inside the block

#

when unity is building, it removes the UNITY_EDITOR definition, and thus its not in the build

buoyant vine
#

ahh interesting

#

then i will go with that one

fast pagoda
buoyant vine
#

gotcha

fast pagoda
#

don't forget to also remove the using UnityEditor; if you have it, else it can't be build

#

personally for this kind of stuff i don't put the using, i just do something like
[UnityEditor.ContextMenu]
so it's already in the block that will be removed

inland delta
regal olive
fast pagoda
#

that's not an extension btw, let me check your problem

regal olive
#

Oh yeah your right, forgot that not everything in my Extensions class is an extension

fast pagoda
#

what is it supposed to do ? i'm not sure I understand, don't you need to use only generic type "T" and V is too much?

regal olive
#

Say you have a struct containing a float and a string
You could go through a list of that struct and find the struct where the 'Name' variable is 'John' or whatever

#

Not at all useful, just trying to push my limits

fast pagoda
#

I guess the issue is that V doesnt implement the operator '=='
you need to add a constraint on V to say "it should require a '==' operator" i'm not sure how you could do it though ๐Ÿค”

#

try V : IComparable

regal olive
#

Unfortunately not

fast pagoda
#

V should be a struct as well then no?

regal olive
#

V is any variable in the struct

fast pagoda
#

so it's an object

#

you can try V : object

regal olive
#

'Constaint cannot be special class object'

fast pagoda
#

ah ye thats stupid

#

well, i'm not sure how to help sorry ๐Ÿคฃ

regal olive
#

Maybe its not possible lol, thanks anyway

fast pagoda
#

but you definitely missing a constraint on V thats for sure

regal olive
viscid iris
#

Hello there folks... I was wondering if anyone could point me in the right direction for something I'm trying to do. I'm trying to draw a box polygon on screen with the mouse using two endpoints. I can get the endpoints from the mouse clicks properly with ScreenToWorldPoint(), but when I try to create the 4 vertices, the scaling seems to be really far off. Is there some other scaling system I'm missing or something?

regal olive
fossil lava
flint flint
#

Hi, any ideas why the Unity framework on iOS is dynamically linked and not statically linked? It's about 80mb, so statically linking it would significantly improve startup time and app size.

queen mortar
queen mortar
#

hold on, 1 sec

#

I'll condense it a bit to show the relevant parts

real talon
queen mortar
#

there's other stuff between there, but I don't think it's relevant, just getting data from the job

real talon
#

I don't know how many soldiers you have

#

If this is a really long job, you could probably go over the 4 frames and get the error.

#

Or your fps is really high

regal olive
#
//declaration, so you know
List<string> x.recipe
public Dictionary<char, Item> x.keys = new Dictionary<char, Item>();

foreach (var item in x.recipe)
{
    Item curr;
    x.keys.TryGetValue(char.Parse(item), out curr); //error here

    items.Add(curr);
}

i get an error herewhen the x.recipe is for exmple "XXX", that says: FormatException: String must be exactly one character long. that shouldnt happen, because i am iterating throught each one character in the string. However if the string contains only one letter, "X" for example, it works. can you guys help me here?

devout hare
#

x.recipe can't be a string, because it would give a different error message (can't char.Parse a char)

#

don't use var just because of things like this

regal olive
#

still same after changing var to string

devout hare
#

well yes of course, that's what I was saying

#

x.recipe is not a string

regal olive
#

char item doesnt work, cannot convert string to char

#

it is

devout hare
#

100% is not

regal olive
#

oh wait

#

true

#

its List<string> sorry

#

so another foreach

real talon
#

Also, I'm highly sceptical of it working in an IEnumerator. I don't know where you read that that is allowed.
But I usually just use the NativeArrays in DOTS, so I might be wrong about that.

queen mortar
real talon
#

You can just profile it

queen mortar
#

but that seems the most likely answer

#

yeah I will

#

ok so it looks like on average the job takes around 1ms

#

should I change from tempjob to persistent?

real talon
queen mortar
#

I didn't read it anywhere

#

that's just how it was after restructuring my project

#

idk what the better option is

#

oh wait

#

let me try something

real talon
queen mortar
#

so should I just run it in Update() or something, and just have a flag in an IEnumerator?

real talon
queen mortar
#

yes

real talon
#

So yeah, my guess would be do it in Start

#

Or update on a key or whatever

#

It needs to be on the main thread

queen mortar
#

alright

#

thanks

real talon
queen mortar
#

yes! it worked, finally!

#

wait...

#

no it didn't...

real talon
#

Rip ๐Ÿ˜›

queen mortar
#

I've been deceived

#

now I'm at a complete loss, I have no idea what could be causing it

real talon
#

Show the error and the code again ๐Ÿ™‚

queen mortar
#

ah, I was just trying something from the manual as a last-ditch effort

#

it didn't seem to make any difference

real talon
#

Not in an IEnumerator but maybe on the main thread it does

queen mortar
#

I removed it and still getting the same error

#

now it seems to be mainly coming from a particular array... let me try to figure out what's wrong with it

#

is there an issue using NativeArrays with length 0?

real talon
#

No clue

queen mortar
#

or maybe it's too big? idk

real talon
#

Whats the error you have now?

queen mortar
#

same error, just for this line
NativeArray<SoldierData> _closeSoldiers = new NativeArray<SoldierData>(len, Allocator.Persistent);

real talon
#

It's persistent, you are not allowed to Dispose those

#

Only when you exit play mode

queen mortar
#

well, I had it as tempjob before but I think it was the same thing

#

I'll try to switch it back and see

#

same thing

real talon
#

Well I don't know then ๐Ÿคทโ€โ™‚๏ธ
Not cleaning NativeArrays correctly could mess you up in between runs, so you can try to restart Unity.
Other then that if you use it on the main thread, it looks fine.

queen mortar
#

no luck :/

real talon
#

RIP

#

Can you show the code again?

queen mortar
#

yeah, hold on

queen mortar
real talon
# queen mortar https://pastebin.com/np3PmSjd
NativeArray<SoldierData> _closeSoldiers = new NativeArray<SoldierData>(len, Allocator.TempJob);
if (len > 0)
    _closeSoldiers = unit.closeSoldiers.ToNativeArray(Allocator.TempJob);

That seems janky, otherwise it looks good to me.

queen mortar
#

yeah, I agree...

real talon
#

Anyhow, gotta go, good luck with it ๐Ÿ‘

queen mortar
#

alright, thanks

queen mortar
#

I had it the other way bc at one point I was getting errors since I had forgotten to create a new list on startup, so I thought I had to do it like that, and when I fixed the list I forgot to change it...

gray pulsar
queen mortar
#

yeah, that seems about right

#

man, it was so simple... I've wasted so much time

#

anyhow, now I can get back to optimizing

golden lagoon
#

oke guys im trying to do onclick function
if photon is connected to master and joined lobby it just activates and disactivates gameobjects
if not it connects and do somethings
here is the script to better undestand

but it just says like this in the console log

uncut seal
#

Hi guys.
I have a problem using asset bundles loaded from PAD in Android.

#

the meshs dont load completely.

#

It seems something related to dependencies, but I dont know how to debug

#

asset bundles was generated using AssetBundle Manager from Package Manager.

#

Someone?

buoyant vine
#

post it properly

lavish sail
#

ah yes .txt malware

use a pasting site or a screenshot

buoyant vine
#

you dont know much about OS when you think that the file extension has any meaning

lavish sail
#

I doubt you can get malware through embedded txt files but still, paste site would be a better idea

buoyant vine
#

as soon as its on your pc everything is possible

lavish sail
buoyant vine
#

ofc

#

its just a name of the file

#

it has no meaning about whats inside

#

just when you name it .txt you say programs "when you read .txt then this file will work probably"

lavish sail
#

yes but it won't change its own extension

#

it would require the user to manually change it to an exe

#

wouldn't it?

buoyant vine
#

text.txt.exe

lavish sail
#

double extensions are a different story

buoyant vine
#

will be shown in windows as text.txt

#

example

lavish sail
buoyant vine
fast pagoda
buoyant vine
#

its per default hided

#

and i dont change my settings for someone who is too lazy to read the read me

golden lagoon
#

@buoyant vine bro no comment

buoyant vine
golden lagoon
#

@lavish sail dont loseur time talkng to him

#

and if ur not answeringmy quest or someone else's quest stu

buoyant vine
#

<@&502884371011731486> @golden lagoon wont follow read me and post properly and uses "stfu"

golden lagoon
#

nah

buoyant vine
#

yes they can see edited messages

#

np

golden lagoon
#

ye

#

and they can see how much u stupid too

fast pagoda
#

why so much agressivity

golden lagoon
#

and seeingedited messages is illegal in discord

fast pagoda
frozen imp
thorn flintBOT
#

dynoSuccess ! Harvy.#7247 has been warned.

golden lagoon
#

yes it is

frozen imp
#

@golden lagoon There's no off-topic here either

buoyant vine
#
:page_with_curl:  Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastepaste.com/, http://pastie.org/
#

no downloads

golden lagoon
#

its not large

#

with what do u think bro

#

u can just expand it

#

and read

#

it

#

dumm

#

y

buoyant vine
#
:page_facing_up:   Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.
```
golden lagoon
#

nah ur not gonna show me how tro do dat

frozen imp
golden lagoon
#

nah

fast pagoda
golden lagoon
#

im done

fast pagoda
#

wrong channel

buoyant vine
#

i posted it 3 times now

golden lagoon
#

i read it

#

but

#

this guy

#

is

frozen imp
#

@golden lagoon And stop spamming

golden lagoon
#

nah im done

golden lagoon
#

he looks like he has alot of free time doing nothing wasting my expensive time
its my fault to even answer him
My Bad...

#

i just gotta go search somewhere with real programmers abouta solution idk why im even here

fast pagoda
gentle topaz
#

well they need to fix their attitude, really

woeful shale
#

How can I define an AssemblyInfo.cs file for the predefined assembly? I'd like to make its internals visible to the also-predefined Editor assembly.

alpine sinew
#

Hey guys. #854851968446365696 says to use the pastebin for "long snippets". I hope this isn't a "long" snippet but here goes:

I have some class which I have thousands and thousands of at runtime:

class WorldObject : MonoBehaviour {
  private int MyValue;
}

Now, I also want just a few of them to be networked. Not all of them, because that would be a lot of networked objects :

class NetworkBehaviour : MonoBehaviour {}

class NetworkedWorldObject : NetworkBehaviour{
  private int MyValue;
}

To preserve the functions and properties between the two, I would ideally have NetworkedWorldObject inherit WorldObject. However, it's already busy inheriting NetworkBehaviour.

Is there any way I can get NetworkedWorldObject to inherit both of these classes? I've looked into the idea of interfaces but I don't think that I can use that here, since both NetworkBehaviour and WorldObject need to inherit MonoBehaviour -- which is just kicking the can down the road.

interfaces: https://www.geeksforgeeks.org/c-sharp-multiple-inheritance-using-interfaces/

long ivy
#

maybe composition instead. Extract the shared properties and methods into a separate object that NetworkBehaviour and NetworkedWorldObject have as a field

delicate jacinth
#

I'm trying to load and use the opencv library in Unity via a custom plugin dll and opencv_world460.dll (which I also compiled myself from source). However, when attempting to load opencv_world460.dll Unity throws an error stating: "Plugins: Failed to load 'Assets/Plugins/opencv_world460.dll' because one or more of its dependencies could not be loaded."

To track down the problem I ran the dependency tracing tool "Dependency" on opencv_world460.dll. As far as I can tell, the tool is able to resolve all of the dependencies required the run this dll on my machine. Obviously Unity is still unable to find or load one of them for whatever reason. The attached image is the dependency list for opencv_world460.dll.

Does anyone have any suggestions about how to track down specifically which dependency is failing to load? My best guess is there's a problem with all of the api-ms-win-crt dll's being forwarded to ucrtbase.dll. In the meantime, to test this theory, I'm going to go download the redistributable containing those actual dlls and install it to see if that has any impact on the problem.

grave bear
# alpine sinew Hey guys. <#854851968446365696> says to use the pastebin for "long snippets". I ...

Have WorldObject not inherit from either, and rename it to BaseWorldObject. This class will have properties, fields, etc that the new WorldObject and NetworkedWorldObject will inherit from. In all instances, they will all inherit from a MonoBehaviour but depending on the context, will be networked or local. So you can have: MonoBehaviour > BaseWorldObject > WorldObject and NetworkBehaviour > BaseWorldObject > NetworkedWorldObject and still retain the fields and properties BaseWorldObject implements.
Wait no that wont work lmao

grave bear
# alpine sinew Hey guys. <#854851968446365696> says to use the pastebin for "long snippets". I ...

I forgot that C# doesn't support multiple inheritance so that wouldn't work lmao. Ideally, all objects that pertain to the same design scope should be under the same type. For example: networking bullets (which is actually a bad idea, but this is just an example) will spawn on the server as a networked entity. They wont actually have any visuals, other than information about collisions, direction, damage, etc. On the client(s), you will extract the information needed from the networked bullet and generate visuals when needed. I really don't know why you want to selectively network objects or not through inheritance. This should be done contextually based off of certain conditions in the scene (is it visible? behind something? Not spawned yet? etc) for if an object should be synced with clients or not.

novel plinth
#

that's what interfaces are for

umbral trail
umbral trail
umbral trail
#

by predefined I assume you mean without an asmdef?

runic girder
#

How to hide public variable in inherited class? If u use new you can still see hided one in Inspector

runic girder
#

I need to hide it only in inherited class

austere jewel
#

Make a custom inspector for the subclass

#

That's the only way

runic girder
#

Ok, thx

buoyant vine
#

or make the property in the base class abstract

#

so the inherited class is responsble for the hiding

runic girder
#

But I can't create an abstract property

runic girder
#
public class BuildingStuff : MonoBehaviour
{
    [SerializeField] private BuildingSO _buildingParams;

    public virtual BuildingSO BuildingParams
    {
        get => _buildingParams;
        set => _buildingParams = value;
    }
}
public class AttackBuilding : BuildingStuff
{
    public new AttackBuildingSO BuildingParams
    {
        get => (AttackBuildingSO)base.BuildingParams;
        set => base.BuildingParams = (AttackBuildingSO)value;
    }
}

SOLUTION

#

I was too close

fickle inlet
#

Hey guys, how can I call classes with tags, like for an example with Mirror where you type [Command] [Client] etc. My idea is to create a tag like this (Command("method name", object, object 1)} and when this tag sits above a method, I can then go to my command console and type the method name and it will call it from the console. I cannot wrap around my head how this works, what is this called and where do I find resources to learn more about it?

kindred tusk
#

You can definitely set something like that up, basically your console can just scan for all the methods with that attribute at startup

fickle inlet
kindred tusk
lean nest
#

hey, anyone has experience with firebase here?

#

When reading values from the reatime DB from a different device than the one this value was uptaded, i recieve different values than what i can see on the DB, any clues or tips as for what could be causing ths? Im using this in unity so might aswell ask here ๐Ÿ˜›

woven kettle
#

hey, is there is a way to optimize temporary unity on play time ?
i'm trying to test a multiplayer game on the same laptop, and it doesn't take long before the laptop gets over heated and everything starts to lag, is there is anyway i could minimize the loads on the graphics temporarily?

broken socket
#

Is the value changing like, A LOT ?

lean nest
#

Not a lot, but it is behaving weirdly, basically sometimes, the value i saved in the DB and i can see in the firebase console, when i go and grab it, i get something different

broken socket
#

Uhm closest thing I can think of is viewing the value from the browser sometimes hanged up when trying to display collections too big. Still seeing the value updating in orange from the console ?

lean nest
#

yeah i see the value being updated into orange. then i disconnect, connect back to it, get the same value, but i recieve something different

#

is there a way i can directly debug the Realtime db, something that lets me see what calls are made and to what end? or similar

broken socket
#

Something wrong with the code probably then

broken socket
#

it was just another type of log

#

nothing special

#

I remember they have a CLI lib to watch access and performance though, but didnt use that much

#

worked only when you deployed locally IIRC, so just to test and debug yeah I'd say

#

there's a database:profile command there, might be worth a try, can't remember what feedback it generates

#

and double check from the web console, might have some journaling page (pretty sure there was one for Cloud Firebase but not sure for RTDB)

lean nest
#

that feedback is only bandwidth and speed data i think

broken socket
#

Yeah you might be right, we used it to check during stress-tests, nothing more

lean nest
#

here is the code just in case its something obvious i cant see this is the one that reads the value

#

this is the one that writes to it

broken socket
#

I'm more used to JS syntax but LGTM

lean nest
#

after writing the data. i just disconnect, see that the change in the db. then connect back, and print that first value i get from it (where you see the print("Direct ..."))

#

Somehow its different lol and theres nothing else calling it to change before that runs

broken socket
#

I got only obvious questions like "you sure user ID is the one you're expecting?", "Code only called once?", "Logs look what you're expecting ?" ๐Ÿ˜

#

but yeah looks like you covered that

lean nest
#

no problem i can answer, in my db there is only one userID which is the one im running tests on.

#

the code is indeed only being called once, and as for the logs well thats how i know i got an issue ๐Ÿ˜›

broken socket
#

Man I got no clue

lean nest
#

Thats fine, ill let you kow if i find a solution and what my issue was, thank you very much for the help!!

broken socket
#

yeah you got me curious, good luck !

fossil bloom
#

Hello, on my system when I create a compute shader with a product of numthreads higher than 1024. E.G [numthreads(2, 1, 1024)]. I get a shader compile error that it can't exceed 1024. Is the limit of 1024 true for all GPUs? Or can some have that limit as : 64,128, 512, etc.?

broken socket
lean nest
#

gonna check that now

lean nest
#

this is the currrent value on the DB lol

#

how are they different lol, kill me

broken socket
#

Not using a staging and prod DB, and forgot to switch config from one to another ?

lean nest
#

Hum, i dont understand that, can you elaborate?

broken socket
#

you have only 1 db, not using another one for test and somehow forgot to change which one you're talking to ?

lean nest
#

I dont quite get that, from my understanding i only have one DB, the one i see in my FB Console

broken socket
#

alright all good, just making sure

lean nest
#

right now i still have the code paused there, if i refresh my FB console page the value is still 40 not 80, where is it geetting that from?ยฟ so confused lol

broken socket
#

(I only read first message)

#

Looks like subscribing to ValueChanged method instead gives correct value for him, you could try that

lean nest
#

man you absolutly nailed it

broken socket
#

looks like there's some caching on mobile device ? (I worked on backend team and I can't remember any caching for us)

lean nest
#

Kinda seems like it, explains why this issue only happens when moving from one device to another

alpine sinew
tribal helm
#

Anyone experinece with setting up unity CI/CD pipeline in azure devops? Trying to do build a project from a docker container there but it complains about not being able to output to /dev/stdout. I can get this working with gitlab ci stuff so I guess there are some differences to azure runs containers when it comes to permission and such.

+ xvfb-run --auto-servernum '--server-args=-screen 0 640x480x24' unity-editor -projectPath /__w/1/s -quit -batchmode -nographics -buildTarget -customBuildTarget -customBuildName car-collision-comparsion -customBuildPath /__w/1/s/Builds// -executeMethod BuildCommand.PerformBuild -logFile log.txt
/usr/bin/xvfb-run: 159: /usr/bin/xvfb-run: cannot create /dev/stdout: No such device or address
/usr/bin/xvfb-run: 83: /usr/bin/xvfb-run: cannot create /dev/stdout: No such device or address
old agate
#

I am trying to change solid color of camera in unity via script. basically i want to do rgb computation from 0 to 255 basically 0 being all black and 255 being white. basically i want to be able to click a button that each time i click one it adds 1 grayscale level each time. this is what i have so far: https://youtu.be/Ka5XXGG0aPU

#

what someone be able to help with adjusting rgb values that every time ihit the button it increments rgb value by 1

sonic vessel
#

Because white is 1 so if you wanna increment from 0-255 you just gotta divide it by 256

old agate
#

oh ok. are there any docs or tutorials you can also refer me to this as well?

#

i think i get what you are saying

#

but just in case

sonic vessel