#archived-code-advanced

1 messages · Page 172 of 1

final steeple
#

Do you have a log file from your attempt to run it?

#

Game.exe -logFile log.txt

#

Should see any exceptions in there

cyan forum
#

How would I get another application to displaying in unity?

#

I remember I saw a tool that could do it, but I can not remember what it was called

hazy epoch
final steeple
#

Crashing as in you get the Unity crash handler popup?

hazy epoch
#

Yup.

final steeple
#

Just as a test it might be worth trying the manual CreateProcessW approach I outlined above

#

You might not be using IL2CPP, but there might be something else at play here with the implementation of the Process class Unity has

hazy epoch
#

Well no... Right now I mean I'm attempting to open the Game via a double-click. Not via code.

final steeple
#

My hunch is that RedirectStandardInput could be related, but we can get to that after knowing whether CreateProcessW crashes or not

hazy epoch
#

Opens fine on my system, but crashes on the remote server machine.

#

Via double-click.

final steeple
#

I'm confused, which is crashing? The program that was creating the process, or the process it's creating?

hazy epoch
#

The Unity Game.exe is crashing when I initiate it manually.

final steeple
#

Where Game.exe is the program being launched by the code above?

hazy epoch
#

Yes. However, I'm not even at the point yet where I'm trying to do it via the code. I was only trying to open it manually to get a log file going to see what happens inside Game.exe if its launched.

final steeple
#

I was under the impression that the program launching the process was crashing, not the process being launched

#

No way to know the cause without seeing code related to that game then, nothing in the code above should be the cause in that case

undone coral
#

have you tried to start with a log?

#

i know it doesn't work when you double click

#

focus on the question 🙂

#

"no"

hazy epoch
# undone coral that's not good

I was going to, but someone else on the team deleted that build and replaced it. Now it's starting without crashing, but we're back to the StartProcess issue. If you run the Game.exe manually (double-click) it runs fine and the console window for the headless game opens just fine. However, if its run from the code via the Process the application is launched (I know because I can see it in the Task Manager | Background Processes), but the console window doesn't open.

undone coral
#

did you try starting the process with -nographics ? what about -batchmode?

#

the console window won't open

#

i don't know why you'd expect that

#

if you can see it in background processes it's running

#

what command line are you using to start the application? these are the arguments you're passing to Process or whatever

#

i'm going to tell you a key detail

#

in just a moment

#

just try answering the questions first

undone coral
#

is that correct?

hazy epoch
#

The console opens regardless of how the .exe is started on my PC. Only on the remote server does the console not open, and only when started from Process. The application is started from this code snippet.

undone coral
#

just a simple yes or no

#

the console window will not open

#

if you start it with process

#

but the process was started

#

that's why you see it in taskmanager

#

does that make sense?

#

just a simple yes or no

#

otherwise it's too difficult to help you

hazy epoch
#

Yes...

Do you know why the console opens on my PC when it's started via Process?

undone coral
#

i'm sure i could figure out why, but does it matter?

#

just a simple yes or no

hazy epoch
#

No... At least not right now it doesn't. lol

undone coral
#

okay

#

so it doesn't matter

#

the process has been starting

#

what is your actual issue?

#

it's okay if the answer is you're not sure

hazy epoch
#

For debugging reasons, is there a way to have the console open (so if the application "hangs" I can see exactly where it happens)?

undone coral
#

no

#

you can output to the log

hazy epoch
#

Ok.

undone coral
#

you have to pass the logFile as an argument, and tail it

hazy epoch
#

I guess there's no issue then. I thought there was because it behaved one way on one PC, and a different way on another.

undone coral
#

if you just pass -logFile without an argument, it's supposed to write the logfile to standard out

#

but i think that'll be too much for you

#

just write to a log file

#

using the -logFile argument

#

is that helpful? @hazy epoch

#

it sounds like you guys have some bad processes. copying exes onto servers... it's bonkers

#

that you are remote desktopping into

#

i'm sure this is just for a prototype or whatever which is fine

#

if you're trying to write a C# application that starts the "right number" of unity servers

#

you're reinventing something that is really complex to do, and you're going to run into a colossal number of pitfalls

raw lily
#

How would one get X unique values within a random range?

hazy epoch
#

It's a plugin that hooks into Photon's server calls to ~~create ~~ launch a (Unity) game application instance on the server machine to host a match.

undone coral
#

server orchestration is hard

#

if you only want to deal with the problem of starting the right number of windows executables in the right places, you can use Hashicorp Nomad

#

that's what roblox does

versed gazelle
#

Do you need to pay the hundred dollars to begin the integration with steam and unity?

undone coral
#

if you want to start the right versions of the servers, if you want them to be accessible on the internet, etc., you'd have to use kubernetes

versed gazelle
#

oh man, so I can't begin testing beforehand?

#

yeesh

undone coral
#

or what it will eventually become

#

if you fixed lal the problems you're dealing with, you'd be writing Kubernetes

#

i've never used nomad and i wouldn't recommend it

#

but it solves problems

#

it's better than trying to do this yourself

ocean igloo
#

Hi!
I have a quick question:
I'm trying to make a system similar to have unity made for the game Kit project they made a few years ago. Something to allow for sending events from one place to an other.
For this i need some unique ID for the entities that can receive and send commands/events to each other. The game we are making is a large open world game so we are going to have many sub scenes that need to be able to reference each other.

Now my plan is/was to make a script that has a UUID and than in Awake register it to a global list (hash map). Now my problem is that we plan on having prefabs of regular setups like doors. (A prefab of a door with the trigger zone that opens it.). When the user would drag this prefab in it would mean that the UUIDs stay the same. This would result in all the doors opening from any of the triggers.

#

My question is if there is any way to detect in the editor if a prefab was dragged in?

#

So that i could automatically regen and map the IDs..

final steeple
#

Game.exe -logfile CONOUT$ might work to get it to do that though

tough tulip
versed gazelle
#

thanks so much!

tough tulip
#

In most cases, you should see message printed on screen for unhandled exception or some fatal error

alpine kindle
#

Hey guys, if you want to serialize a normal c# class for the purpose of saving a game and later run a function on deserialization, what is the best way to implement that function? Is ISerializable the way to go?

#

I originally tried ISerializationCallbackReceiver and OnAfterDeserialize but the function never seems to fire

tough tulip
alpine kindle
#

@tough tulip I could do json, I already wrote the implementation as a byte stream though

#

I had the impression that the later would be better because it would be more compressed

#

What's the advantage of json? Better utilities?

sage radish
tough tulip
alpine kindle
alpine kindle
#

Hadn't thought about that

#

Might be worth considering that fact

alpine kindle
sage radish
alpine kindle
#

That makes sense, thanks guys!

small torrent
#

Not sure if this is the right place to ask, but I have a method that accepts a delegate as a parameter, in this case an Action. If that method listens for a UnityEvent that I have set up in the editor, it won't let me send the Action as a parameter by the drop down. I need to send a call back to this method for...reasons. Basically, I need to know what object is invoking the method of the second object so that upon a certain condition being met within that method, the second object can call a method of the first object in the second objects method that was called by the first object in the first place. Wow I hope that made sense

#

Alternatively, if there is a super simple way to see what objectA called the objectB.MethodB() from within that method, that'd be dope

sage radish
small torrent
#

Hmm...

#

I'm trying to think of how to explain without over explaining and posting a wall of text lol

#

Basically, there's a class called GameChunk

#

It contains a collection of Events that are invoked when the corresponding index of DialogBox's collection of "inputs" (more broad than Inputs from Input class) is triggered. So like, the game chunk handles the data and what events come after it's out put, while the dialog box controls what constitutes an input and how output it handled. The chunk has an ID number for what dialog box it get loaded into which is the index of a DiaogBox object tracked by a collection in the game manager singleton. If the ID is -1 it's supposed to be loaded into the the samedialog box that invoked an event to have the first gam chunk call the second. So like, the chunk doesn't care where it goes, it just cares that it gets loaded by the same dialog box. FWIW dialog box is an abstract class and not neccesarily a box for text and an image. It just porcesses output and input in broad terms for this system I'm building

#

DialogBoxes are monobehaviours and GameChunks are scriptable objects

sage radish
small torrent
#

I thought maybe, but like... what about having multiple events and dialog boxes all working in tandem?

sage radish
#

Are the events invoked asynchronously?

small torrent
#

Yes

#

wait

#

I don't know

sage radish
#

Can an input be triggered before the events corresponding to another input have finished invoking?

small torrent
#

yes

#

Defintely

sage radish
#

Why are you using indices/IDs instead of referencing the DialogBox directly?

small torrent
#

Dialog boxes are held by a singleton in an array. That is how the references are held cause it's dynamic and the Chunks are scriptable objects

granite viper
small torrent
#

Thanks, but I don't think that really solves my problem? Maybe I'm over complicating things or too reluctant to go back and change the structure of my class relationships but....

granite viper
#

rather than passing a delegate through the unityevent

#

pass an interface that your calling classes implement

#

that interface can have a callback function on it

small torrent
#

Interesting

#

I will look into that

granite viper
#

👍

#

lmk how it goes

urban warren
#

I got a Spline question. Unity's Spline system has knots that have a tangent and a rotation which is used to get the position of the control point (knot.Position + math.rotate(knot.Rotation, knot.TangentOut)).
I am now trying to figure out how to set the tangent and rotation so the control point is at a specific position. I feel like I am close but I just can't quite figure it out.

sage radish
urban warren
noble pasture
#

So I'm loading everything in the world with a script that loads and unloads assets around the player based on location. I'm using a minimap package from the webstore that requires scans of the scene in editor mode. Can a scene be preloaded with assets via script?

granite viper
#

yes

noble pasture
#

do you have a basic description of how that would be done? i'm trying to find how to do it, but all the results im getting are explaining how to do the opposite of what i want

granite viper
#

how are the assets stored?

#

in multiple scenes, in SOs, etc?

noble pasture
#

it's all one scene and there's like 72 modular assets

#

but they arent in the scene

#

it's loaded at runtime

granite viper
#

how are they loaded

#

just do that, but in the editor

noble pasture
#

ok

#

ah editor scripting. ok that's what i was looking for, thanks

granite viper
#

👍

noble pasture
#

@granite viper sorry, i got the terminology wrong. i mean scene view, not editor

granite viper
#

same thing

noble pasture
#

ok

hollow scaffold
#

I created a script which loads satellite elevation data and loads it onto a quadsphere to replicate the Earth but i want to make it more performant. I get pretty significant frame drops and stuttering when higher resolution data is being loaded and I thought of doing a few things such as the jobs system or multithreading but im just not sure what the best approach is. I'm a hobby programmer so im not too familiar with best practices for this sort of thing.

The current system I made loads data from a 1 degree latitudexlongitude file which stores elevation data for 1arcsecond resolution as a 16bit integer, and stores it in a dictionary with a short[,] array and the coordinate of the current tile. I probably need to do some more debugging but I do know when I trigger the sequence which updates the quadtree and then updates the mesh I get pretty bad stuttering so i need to implement something that can do this better, just not sure where to go. Any ideas? Here is a video of my current setup:
https://youtu.be/szlpD2eeU5E

WIP SRTM (Shuttle Radar Topology Mission) data loading into my quadsphere implementation. Need to work on lag spikes when loading in new areas.

▶ Play video
undone coral
#

@small torrent if you expect the calls to be recursive, use a stack

#

if MethodB can throw errors, use try ... finally

#

a bajillion things in unity work this way under the hood

#

granted, i don't understand why MethodB doesnt' take the sender as an argument

small torrent
#

Oh, I wasn't able to pass a parameter because of how I was setting it up through the editor window to be invoked and wanted to work around

visual iris
#

Hello. I am building a multiplayer game with a dedicated server and I have built the server as a console application. Is there any way to input into it?

fresh salmon
#

Input, as in user input? Then Console.ReadLine

visual iris
#

What do I need to be using to do that because I can’t find it anywhere

#

I want some way to manually restart the server,stop it, end game or something

fresh salmon
#

You just have to put that line in the console app's Main method or anywhere else reachable.

#

Even other threads. That method returns a string you can do logic on.

visual iris
#

I did, it works in the editor player but when I build it it doesn’t work

#

I have just input.get key down s in update that calls server.stop

fresh salmon
#

There is no concept of editor/builds for .NET console applications

visual iris
#

I built it from unity as a dedicated server

fresh salmon
#

In fact, running the app from VS actually runs the executable file

visual iris
#

So it just doesn’t recognise any input

fresh salmon
#

Is the app actually a .NET Console Application you created in Visual Studio? I don't get it

tough tulip
fresh salmon
#

Ah, so it's not a console app

tough tulip
fresh salmon
#

I see

#

Didn't know these were a thing

bitter crane
#

Hi

low nymph
#

how do i assign values to gameObjects i'm instantiating in code BEFORE they execute their Start() function?

winter yacht
#

Do this immediately after instantiation.
This will have to be a component on the GameObject. So you need to do a GetComponent after instantiation.

low nymph
#

will that reliably execute before the start() function or should i just put everything from the start function somewhere else and manually execute afterwards?

winter yacht
low nymph
#

alright, thanks a lot 🙂

lavish plume
#

Someone I look up to has managed to save scripts inside an AssetBundle somehow without them being in the Assembly of the built game for a mod somehow. Does anybody have any idea where I can start with this? It'll make life so much easier for me and it'd be really useful

#

If they accomplished it I know it's possible at least

sage radish
lavish plume
sage radish
lavish plume
#

Ohhh

#

I'm guessing Assembly.Load is a function I can call to literally just load in the Assembly file from the build of my level

#

And I assume you'd have to do it before instantiating the AssetBundle's contents otherwise it may not loads the scripts or something

lavish plume
#

Ok sounds good. I'll look into it. Thanks!

remote pumice
lavish plume
# sage radish Yes and yes

Alright one more thing because I can't seem to find much on Assembly.Load. Sorry

I guess it'd work something like this?

using System;
using System.Reflection;
using UnityEngine;

public class SpawnStuffIdk : MonoBehaviour
{
  void Start()
  {
    Assembly.Load();
    //Load AssetBundle Here
  }
}

But how would I like reference the Assembly? If it was in StreamingAssets because I know you can reference stuff in there like this ```cs
Assetbundle assetbundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath,"test"));

raw schooner
#

surely Assembly.Load is just not necessary

sage radish
raw schooner
#

.bin is more common

#

for, you know, binary

lavish plume
#

Oh that's so useful

#

So let me get this straight just so I don't have to be annoying and reply again lol

sage radish
lavish plume
#

I build my level and take the Assembly-CSharp.dll out of it and bring it into the non-built project

#

Then put it on like a GameObject or something but change it from .dll to .bytes

#

And then I can build the AssetBundle and load it in like that

sage radish
#

Well it might be a bit problematic referencing the .dll in assets contained in the same asset bundle. Maybe fine if you load the assembly before attempting to load any specific scene or asset referencing scripts in the assembly.

#

The .dll/.bytes file would just be an asset somewhere in your Assets folder. You can't put it on a GameObject like a component. You could reference the TextAsset in a script on a GameObject, but there's no reason to if you just label the TextAsset to be included in the asset bundle.

lavish plume
#

So just load the Assembly in before loading the AssetBundle

lavish plume
sage radish
lavish plume
#

Ah

#

I guess I just kind of have to hope it works if I load in the AssetBundle and the Assembly is in it? I'm not sure if I missed something you said but Idk if there's anything else I can do to 100% make sure it works

sage radish
#

I'm only suggesting a way to embed a .dll inside an asset bundle so your mod isn't two separate files. You could also just put them in a .zip and unzip that in your bootstrap plugin.

lavish plume
#

Ah. I think putting them in a .zip would be the best idea for now. Thanks for your help

undone coral
#

i believe you can add assemblies to unity nowadays pretty easily by modifying one or two files inside the player

#

i'm not sure if on desktop platforms, an il2cpp player can load a mono-built dll... but probably

undone coral
#

you can create a new Mouse() and new Keyboard() and queue input events for them

#

InputSystem already has a way to take input events from one unity application and send them over the network to another application

undone coral
undone coral
#

seems like you're figuring it out

#

there are assets in the asset store for modding you could use

lavish plume
#

Kinda. It would be better if I could keep it all in one file but like MentallyStable said I can't exactly load the DLL in first

#

Or well

#

The TextAsset

undone coral
#

it really depends on what people are trying to do

#

normal people won't for the most part be writing C# with an editor like a programmer... they will just be copying and pasting scripts

#

it's better to use a pre-existing mod loader, especially one that has appeared in other popular games

sage radish
#

@undone coral Ethan is making their own mod for another game

undone coral
#

ah i see

lavish plume
#

Wait why can I not just load the DLL in first? I'm 101% certain that there's a method to load in something specific from the DLL and not just everything

undone coral
#

there is

#

you can add the DLL file to scriptingassemblies.json

#

and if it needs to load early, use runtimeinitializeonloads.json in the standalone player build

lavish plume
#

I'm not exactly sure if that's modding friendly. Also this isn't my own mod. Basically the mod I'm using has AssetBundles used as custom levels for the game so I'm trying to find a way I can make the scripts I put in the AssetBundle work

undone coral
undone coral
lavish plume
# undone coral what are you actually trying to do?

So I've built a level in a Unity Project ready to upload to a Discord for people to use with a mod. The level however has to be exported as an AssetBundle which means it won't save the scripts and I'm trying to find a way to save the scripts so I can do a lot more with my level instead of just teleporters and tag triggers

undone coral
#

create an assembly definition for your scripts

#

export a standalone build and the asset bundle

#

if you'd like your scripts to be available to the target application, add them to the application's scriptingassemblies.json file

#

does that make sense? just try it

#

see if it works

#

i think it will

lavish plume
#

It would work for me but it wouldn't automatically change for others would it?

lavish plume
wooden cedar
undone coral
#

yeah lots of ways to roll this

#

but you'll sitll have to export the assembly somehow

#

i am not 100% sure how to do that and the way i'd do it myself is really engineery

undone coral
#

there are a lot of pros of an approach that is just a C# function with an image as an argument and a Mesh as a return value

#

interactive loading of these images would require writing a shader

reef wren
#

i have a logical/mathematical question not exactly code
is it possible to get a 10 digit non uniform long number from an int?
i should also be able to get back the int number back from the long number

to shed some context ->
i have an unique user id which starts from 1 and so on. i keep incrementing it with user count.
now i want to show the user some unique ID to their account. i dont want to show them their ID directly so i planned to show them IntToHash(int userId) where IntToHash would return some data of some length
I should also be able to get back userId from another function HashToInt(var someHash);

hollow scaffold
undone coral
#

do you actually need that?

hollow scaffold
#

I want to be able to transition from surface to orbit seamlessly and the current stutters I am getting are pretty bad, its noticeable when moving my camera and it suddenly jumps because of the time between frames when the loading occured

sage radish
reef wren
#

it is fine if anyone can guess the number, but i dont want anyone and everyone to know the plain number directly

sage radish
# reef wren it is fine if anyone can guess the number, but i dont want anyone and everyone t...

If you need to be able to convert the 10-digit number back to the original number, users will be able to follow the same steps if they know what the steps are. To prevent those steps being reverse engineered, you will have to do this conversion outside the client app, on some server, but you can do it client side if you don't mind that possibility. You can use any encryption method you fancy. To ensure it's always 10 digits, you can add 1,000,000,000 to the int after you hash it. Since uint can't be larger than 4,294,967,295, it will ensure the hashed IDs are always in the range 1,000,000,000-5,294,967,295.

reef wren
regal olive
sage radish
#

But why do you need to reverse it? Surely if you are able to hash it in the first place, you must know what the ID is?

#

Are users meant to copy this hashed ID and submit it somewhere?

reef wren
#

i dont want this to be super tight encryption, but i just dont want people to be able too search a profile directly by their plain userid because then profiles with userid 1 and similar lower values will have high profile views, and get spammed with requests

craggy carbon
#

¨˝î˙´,

#

$<>?
P)M"^C–4.

manic flare
#
 void RaycastWorldUI()
    {
        if (Input.GetMouseButtonDown(0))
        {
            PointerEventData pointerData = new PointerEventData(EventSystem.current);

            pointerData.position = Input.mousePosition;

            List<RaycastResult> results = new List<RaycastResult>();
            EventSystem.current.RaycastAll(pointerData, results);

            if (results.Count > 0)
            {
                //WorldUI is my layer name
                if (results[0].gameObject.layer == LayerMask.NameToLayer("WorldUI"))
                {
                    string dbg = "Root Element: {0} \n GrandChild Element: {1}";
                    Debug.Log(string.Format(dbg, results[results.Count - 1].gameObject.name, results[0].gameObject.name));
                    Debug.Log("Root Element: "+results[results.Count-1].gameObject.name);
                    Debug.Log("GrandChild Element: "+results[0].gameObject.name);

                    
                    results.Clear();
                }
            }
        }
    }``` I got this code working to return the Button but now , how do i get it to call the standard events like Hover over, and OnClick function for button ?
undone coral
#

two packages have copies of System.Runtime.CompilerServices.Unsafe.dll

#

how can i tell my package of those two to correctly omit its copy when another already exists?

wooden cedar
#

But with what you have, the pointerData tells you the position (hover), press, drag etc as well

#

Iirc

mellow plinth
#

Are methods decorated with RuntimeInitializeOnLoadMethodAttribute(...) guaranteed to execute in the Unity main thread?

austere jewel
mellow plinth
#

Once ago, I heard something about that Unity loads scenes in the background, I was wondering if that would affect this methods also or not. Hence the question.

sly grove
#

Why are you spamming every single channel in the Discord with off topic stuff

ornate blade
#

Does anyone know off the top of there head if there is a way to disable certain characters from being inputted into an TMP_InputField? such as disabling Control-I (^i) or ASCII character 9.

unborn otter
#

anyone have any idea on what is untracked memory exactly in Memory Profiler ? I installed the same APK on 2 different phone, one is showing 36MB for untracked the other one is showing 1GB like the screenshot, i have no clue what is the cause of the difference in untracked memory

#

this is killing me 😦

devout hare
#

Don't crosspost

unborn otter
#

removed other post. I understand what does tracked memory contain but i have no idea why it is so different on different devices

#

by right the amount of untracked memory should be more or less the same on different android devices

terse rampart
#

how can I make a random sprite show up when something a bool is true

split sierra
#

what is the best function to set a bool isColliding to true while the gameobject with the script is touching another gameobject but set it to false after not touching anymore?
it should be working with multiple gameobject (when going from one to another it should stay isColliding should stay true)

sly grove
native plover
#

How can I open and view the default Character Controller script?

drifting galleon
#

component top right, triple points, edit script

drifting galleon
#

guess not then. reference the character controller type in a script temporarily and then click it, and press f12 if using visual studio this should open the script or give you a stub from decompilation

undone coral
drifting galleon
# native plover

yeah, no. after some search i guess CC is written in native c++. since unity is not open source you can't look at the code

undone coral
drifting galleon
#

does anyone have experience with the ScriptableRenderFeature api that uses the new RTHandles?

drifting galleon
#

i literally just want a simple blit in urp

undone coral
#

into the camera

#

i woudln't overthink it

#

it won't differ from a performance point of view

drifting galleon
undone coral
#

i see

#

i'm sorry i don't know enough abotu it

drifting galleon
#

but all online examples and docs use RenderTargetHandles which are obsolete

soft hawk
#

Is this the right channel to ask about ml-agents?

drifting galleon
#

why not.

soft hawk
#

Ok, im looking for some advice. I wanna train an agent to play my puzzle-fighter clone, and I'm wondering if it's feasible to to give the entire gameboard state as an observation, or is that practically too many observations

#

that's about 168 observations per step I believe

#

7x12 array with an int and a boolean per cell

undone coral
drifting galleon
#

if they are seperapable into distinct actions, it might be better to split them into multiple agents. otherwise training might take absolutely forever, but you can also try as one and then train the agent on some human play first to get it to an acceptable point

soft hawk
#

@drifting galleon so you're saying 2 agents working cooperatively could be better?

drifting galleon
#

could be. but i have no idea about your game so, there's only so much i can speculate

soft hawk
#

I've looked at a few implementations of Tetris AI and they were feeding columns and column heights, but I feel like that won't work for this because in tetris the colors don't actually matter

#

But in my game they do

drifting galleon
#

if you've already set up the agent, you could try learning on human input first and then check how far you can get

soft hawk
#

I haven't yet, I've got only a little experience with training AI so I wanted to seek some guidance before I started

#

But yea, I had considered that

drifting galleon
#

also, if they've observed the columns in tetris, it's kind of a big waste imo. why not just observe the pieces and have a property that describes the shape or identifier of the piece? anyway...

soft hawk
#

I think the idea behind observing the columns is to represent the state of the board without telling it about every row

drifting galleon
#

that's kinda contrary to how tetris works though. i just think there would've been a better way to do it

soft hawk
#

Yea I have no idea if it's a good implementation, I just know I haven't seen any examples where the agent observes the entire board state

drifting galleon
#

it really would not even be necessary to observe the whole board. absolutely not. at least not if you have access to the code. if you are standalone and visually observing the board, that's of course massively different

soft hawk
#

Knowing the colors of the things on the board seems important. I guess I'm just a little lost in how to get started on this lol

drifting galleon
#

just have the color, position and 'shape' / type of piece as a property of the piece and feed that into the agent

#

for example

soft hawk
undone coral
#

have you tried writing a conventional puzzle fighter bot?

soft hawk
#

I have not, no

#

This is a learning project at this point

undone coral
#

write a conventional puzzle fighter bot first

#

then do the next steps

drifting galleon
soft hawk
#

Yea I don't see why I would need a conventional bot at all...

#

If I can get an agent to learn it, that's all I'd need

drifting galleon
#

what gpu do you have anyway?

soft hawk
#

2070 supa

drifting galleon
#

ok, well that should be kinda ok i think. at least for an ai like this

#

but then you really don't want 168 observations

soft hawk
#

I'm having trouble thinking of alternatives

drifting galleon
#

wdym?

drifting galleon
pallid holly
#

Any experienced devs looking for a role in an nft project? 🙂

pallid holly
#

I'm asking the 30% who are

soft hawk
#

Oh so instead of observing the board space, give it block vectors and properties? leave out the blanks spaces? I guess that works

drifting galleon
#

they are absolutely pointless anyway. but especially in gaming

undone coral
pallid holly
#

Not here to justify anything

undone coral
#

you won't be able to write a deep learned agent if you haven't written a conventional one

drifting galleon
pallid holly
#

So I can hack a game, give myself infinite items, and that's okay?

undone coral
#

the conventional bot will fix bugs

pallid holly
#

But NFT backed game won't let that happen

undone coral
#

show you what board state matters, etc.

soft hawk
#

@undone coral Well thanks, I have considered a conventional bot but training an AI agent sounded like a fun project

#

It might not be a bad idea, but I don't think the bot is necessary to develop the agent, that's all

undone coral
drifting galleon
#

so you can't cheat

undone coral
#

if that doens't appeal to you writing a working agent will not happen

pallid holly
#

Or get's hacked?

drifting galleon
pallid holly
#

oof

drifting galleon
soft hawk
#

This server needs a no NFT policy

drifting galleon
soft hawk
#

You are not going to find anyone here that wants to implement your scam dude

drifting galleon
pallid holly
#

If that happens, we are all doomed

#

And this dev stuff is the least of our worries

drifting galleon
pallid holly
#

Amazon goes down all the time?

#

Do you have anything better to do

drifting galleon
drifting galleon
soft hawk
#

Can you please leave?

drifting galleon
undone coral
drifting galleon
#

there is nothing else backed on blockchain atm

#

it's not like the whole internet will be down when a blockchain goes down

pallid holly
#

Literally have 25k available for this

soft hawk
#

@undone coral Yea, I did the ml agents hummingbird project on the learn.unity site

drifting galleon
pallid holly
#

Obviously not the place for this type of business

pallid holly
soft hawk
drifting galleon
pallid holly
#

For a demo

soft hawk
#

Took me about 5 days to go from zero to training a perfectly competent agent 🙂

humble leaf
drifting galleon
pallid holly
#

Sorry

humble leaf
#

And take it to DMs if you all want to debate NFTs.

pallid holly
soft hawk
#

Probably better not to engage with NFT hucksters honestly

pallid holly
#

That's all I needed

drifting galleon
pallid holly
pallid holly
fresh salmon
#

lol

drifting galleon
pallid holly
#

You're not my target market

drifting galleon
#

you clearly have a vision

#

so what's the GAME?

pallid holly
#

And you are not part of it

humble leaf
drifting galleon
#

i'm still interested in the GAME aspect?

soft hawk
#

Ok so now I have another question. If I just observe the individual block locations and relevant properties, that means that the number of observations changes as the board gets full. Is that a problem?

drifting galleon
soft hawk
#

Just block him

drifting galleon
soft hawk
#

🤷‍♂️

drifting galleon
pallid holly
#

You said it's not relevant. Please stop asking me

humble leaf
#

Next one of you to continue this is getting muted.

pallid holly
#

Everyone having a good day?

drifting galleon
soft hawk
#

I think the venue is the problem

humble leaf
#

!mute 215504142947319808 1d Don't waste my time.

thorn flintBOT
#

dynoSuccess Mindstyler#7405 was muted

soft hawk
#

😦

pallid holly
#

Also, is this a good server to connect with 3D modelers?

humble leaf
soft hawk
#

In general, is there any issue with the number of agent observations being non-constant?

final steeple
#

Back-reading this channel was hilarious, I needed that

undone coral
#

somewhere you'll have to specify a number of observations. unity might have a way to "zero out" observations for you

#

you're at the start of a very long journey. how seriously do you want to have something that works? @soft hawk

soft hawk
#

I guess I'll give it a go passing the whole board state and see what happens

round quiver
#

Can anyone explain to me how a shader knows what to shade with a blob shadow projector?

#

I want to use ZTest Always but then multiple blob shadow appear on all objects it intercepts

undone coral
round quiver
#

i want a blob shadow projector always drawn behind objects but if I used ZTest Always in the shader, it draws multiple shadows

twilit basin
#

I have a drawing app that uses Vectrosity to draw lines. A camera then takes these lines and then converts them to a texture so that more operations can be done on it. It works fine with solid colors, but with semi transparent colors it behaves weirdly.

When I commit the line into a texture, the camera that is looking at the Vectrosity lines takes the image into a render texture and then this is applied onto a Raw Image component. Every time this happens, the alpha value of the texture reduces until the semi transparent part doesn't exist anymore. This doesn't happen with fully transparent colors(you can't see anything anyways), or fully opaque colors.

#

It goes from this

#

to this

#

and eventually this

#

the render texture is displayed using a raw image component with no material on it

undone coral
twilit basin
#

i have tried on linear and gamma space, with the same results

#

I have also tried different graphic format for the render texture too

#

it is usually kept at RGBA32

undone coral
#

are you clearing the render texture

#

before you draw to it again

#

looks like you're writing to it without clearing

twilit basin
#

hmm, that could be possible, let me try that out

twilit basin
#

no luck with that either

merry lodge
#

What would the equivalent of UnityObjectToClipPos(); be for light sources instead of the camera?

undone coral
sour bay
#

If I have a class X and an array or list of said X. How would I make X aware of the array or list it is in and what index it occupies?

undone coral
sour bay
#

Could you elaborate or point me where to look? I am not 100% familiar with some of this stuff

granite viper
#

@sour bay what are you trying to do?

sour bay
#

So, I have a game with a grid system

#

Two types of objects to rest on the grid

#

Fixed and loose

#

Loose objects are the focus here

#

Now, each cell has one spot for a loose object

#

a person may have a couple spots for a loose object

#

now, in code, that wold be an array/list of loose objcects

#

so, if an inventory has 0, 1, 2, 3 spaces

#

0 = wood
1 = empty
2 = empty
3 = sword

#

hold on

#

i think i figuredd it out

#

rubber duck philosophy?

vernal hazel
#

Just curious what methods do other devs use for implementing terminal velocity on a rigidbody? I am currently using AddForce to control my rigidbody and have tried adding terminal velocity through multiple methods but none have worked.

I have tried

  • Setting velocity directly
  • Applying an opposite force
  • Adjusting drag based on speed

Despite which method I use, I seem to get different current speeds (rb.velocity.magnitude) based on the acceleration I am using.

winter yacht
#

I'm encountering some problems after calling SceneManager.UnloadSceneAsync
Does some GameObjects in the scene still run Update() and should I add a check e.g. bool sceneUnloading to prevent code running while the scene unloads?

#

This happens intermittently.

#

I'm going to implement the boolean check and see if the problem goes away.

tough tulip
#

If you're looking to clamp velocity, the easiest way is to handle the force addition yourself by calculating the instantaneous velocity each fixed update based on acceleration and drag, and applying it

split sierra
#

Hey, is there a way to check if a Gameobjects whole underside (eg. of a cube) is touching the another gameobject (eg. a floor)?

austere jewel
sly grove
raw lily
#

Hey! How can I call a script in a scene, from another scene?

tough tulip
# raw lily Hey! How can I call a script in a scene, from another scene?

if you have reference to that script then why not?
You can get the reference by using static variable/functions to to store and retrieve the reference, or using Unity's methods like FindObjectOfType. I personally never use FindObjectOfType or similar methods which iterate over entire scene objects

upper mica
#

Hey, I need some help implementing a serializable dictionary and its methods to break them down into lists for serialization.

Here is the SerializableDictionary class I am using
https://pastebin.com/4NX1bvjn

and here is the constructor class for my SaveData (incomplete as I do not know how to use the OnBeforeSerialize properly)
https://pastebin.com/qExWu3iz

merry lodge
#

What would the equivalent of UnityObjectToClipPos(); be for light sources instead of the camera?

upper mica
#

OnBeforeSerialize simply breaks down the dictionary into generic lists of TKey and TValue.... but it stores them in private variables, and the methods dont return anything, so I have no idea how to access these lists... furthermore, without extending my class to Dictionary, I cant use the type TKey or TValue, and those cant be converted directly to a list with an explicit type

I can solve the latter issue by just doing a for loop on worldFlags.keys and adding them to my List<int>
but this only works if I change the List<TKey/TValue> in the serializeabledictionry class to public, and I dont think thats the intended way of using this

#

it seems this serializable dictionary uses the ISerializeCallback interface to implement the serialization functionality, but thats kind of over my head
I dont know how to implement that

#

could really use some assistance

sage radish
merry lodge
#

All directional ones at least

sage radish
merry lodge
clever pond
#

hey, I'm trying to add google play games services to our app, I configured both the Unity side of things and Google Cloud/Google Console. I'm getting a "UISignInRequired" as the status code when i try to authenticate the login.
what are the known problems that lead to this ?

#

I also added the emails to the testing section

merry lodge
# sage radish You're talking about for rendering shadow maps, right?

https://youtu.be/gtUQjJXICpI trying to recreate the reflection effect this has

Angel Aura Quartz is a beautiful type of crystal coated in precious metals, such as platinum, nickel, gold and titanium. It is then heated in a kiln to facilitate this alchemical process. The holographic tint is due to this alchemical manipulation of a regular quartz crystal.

Angel Aura Quartz works on all chakras due to the rainbow effect

Sh...

▶ Play video
merry lodge
merry lodge
upper mica
#

I'm still struggling with this serializable dictionary, can someone help?

#

it seems to seralize just fine, but on attempting to load the file, I get a huge error

sage radish
# merry lodge Do you know much about that topic then?

You'll find more people with knowledge of that topic in that channel, so I'd ask your question there. Include the video to show what you want, because I don't see how UnityObjectToClipPos is going to help you achieve it.

upper mica
#

SerializationException: The constructor to deserialize an object of type 'SerializableDictionary`2[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' was not found.

from this line

            SaveData data = formatter.Deserialize(stream) as SaveData;```
merry lodge
#

Trying to figure out how to make it so that it does work with light

raw lily
# tough tulip if you have reference to that script then why not? You can get the reference by ...

Yeah I was trying to avoid that... the thing is I want to have spawn points but everything stays the same except that, which is a different scene (with spawn points). So I don't see a way around this unless the spawn points remain the same across different maps/backgrounds.

Maybe big prefab instead of scene? Would that work? Any caveats?

EDIT: Seems like that wont be async so additive scene is probably the way... unless there's another option.

EDIT2: I think FindGameObjectsWithTag is the more perfomant way to do this.

upper mica
#

do I need to just serialize each serializableDictionary to its own file? am I running into this problem because I'm deserializing a SavaData instead of a SerializableDictionary?

maiden turtle
raw lily
#

What's faster: FindGameObjectsWithTag or FindComponentsInChildren?

sly grove
novel wing
raw lily
#

Alright, wont worry about it too much then. It's already much better than Find, thanks!

undone coral
#

use JSONUtility and reorganize the fields of the scriptable object into a [Serializable] class field

#

ToJSON and FromJSON<T> that field

undone coral
undone coral
#

before fixed update, it applies velocity = velocity * ( 1 - deltaTime * drag);

sand wraith
#

I was trying to do mesh manipulation. Is there any way we can get vertices of bottom face of a cube? (Just that 4 vertices)

frank peak
#

theres some bit in the middle thats relevant

royal burrow
#

Can someone please help I made a cutscene system that works in strange ways but I can't seem to fix it

#

My Weird Cutscene System

remote pumice
#

Hey, I'm looking for some architectural advice and/or personal opinions how you'd approach this thing! Let me make a thread before putting the question, it's a terribly long text

steady stirrup
#

Can anyone point me to some resources on how to best encode custom level editor data? Aside from normal game data, I want to have a bool check if the player has actually solved the level themselves. Now if I'm merely using the default JSON, players could of course go into the JSON and change the bool from false to true and therefore completely troll other players quite severely. Should I use a custom file? Encode the JSON using a cipher? Has anyone made some experiences here? :)

compact ingot
pine topaz
#

I got a question, i was thinking to slice meshes as cubes like Voxel models and gonna make a destructible environment from them but i wonder can i apply physics to those slices meshes ? im not talking about fractured models with multiple gameobjects (i mean ofc slicing them will create new gameobjects but its dynamicaly)

compact ingot
#

you can do whatever you want, the question is, will it run smoothly, and the answer is often: NO if the meshes/objects are generated on the fly and not pooled, especially if they have colliders; YES if you can somehow prewarm/pool the objects.

pine topaz
#

they must have colliders to collide other physic elements like bombs, bullets etc.

silent dagger
#

Hello there

#

I'm trying to extract a number from a string

true merlin
#

Guys do you think is it possible to make bot that plays flappy bird on its own?

silent dagger
#

and it drives me crazy 😕

#

if (text.All(char.IsDigit))

#

it won't work

fresh salmon
#

So you're checking whether all the chars of the string are digits

#

What does a sample string look like?

silent dagger
#

"PT_Medieval_Female_Armor_01_A_body"

#

this is the string

#

but the number could be also at the end of the string

#

I could parse each character... but it's boring 😂

fresh salmon
#

Could use some regex for that

silent dagger
#

I should learn it ... 😅

fresh salmon
#

It'll also handle the case where there are more or less than 1 number inside of it

#

Regex is the only solution if the string varies greatly

silent dagger
#

that was my fear

fresh salmon
#

Here you could split by _ if you're 100% sure the number will always be alone, between two _

#

Or before, or after _ if it's at the start/end of the string

#

If it's not though, example Some1234Number, you need regex

silent dagger
#

some assets have the number at the end some other in the middle... artists ¯_(ツ)_/¯

#

ok I'll go with RegEx

fresh salmon
#

The position isn't a problem, it's what's surrounding the number

silent dagger
#

you'll never know xD

fresh salmon
#

So regex it is

#

Something as simple as \d+ (yes, that simple) can extract numbers

silent dagger
#

cool 🙂
I'll google it 🙂

#

thanks 😉 🍻

fresh salmon
#

I personally recommend https://regex101.com to try out regex. It has integrated docs, live explanations and even code generators

regex101

Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET.

quiet bolt
#

oh god, regex ☠️

silent dagger
#
int number = -1;
            string tempStr = new string(text.Where(char.IsDigit).ToArray());

            int.TryParse(tempStr, out number);
            
            if(number > -1)
                return number;
            else
                return -1;
#

Linq FTW 😄

silent dagger
#

just now... 'cause I couldn't find a way, until now xD

fresh salmon
#

Note that your LINQ solution will concat all numbers, so if you feed in Test_12_string_34, you'll get 1234, which may not be what you want

silent dagger
#

💩

#

I could make a second check

#

... or use RegEx 🙄

undone coral
pine topaz
fresh salmon
# silent dagger ... or use RegEx 🙄
Regex regex = new(@"\d+");
foreach (Match m in regex.Matches("ac12_34aaa5"))
{
    int number = int.Parse(m.Value);
}

As simple as that. Add number to a list or something

silent dagger
#

Nice 🙂

languid sinew
#

I want to mirror all gameobjects within a trigger that are on a specific layer to another area

#

I am making a yugioh style board

#

So every object of layer "cards" inside here should scale and be placed on the larger board

#

I'm not sure the best way to go about it though

#

Should I instantiate gameobjects, or do something with the rendering

undone coral
#

there's great stuff in the asset store for destructible environments, you'll learn a lot from them

soft hawk
#

@undone coral I was thinking about what you said about creating a conventional AI before training an agent, I get what you meant now

#

A conventional AI could instruct the agent

#

But then if I'm going to do that there's barely a need for the agent at all, I might as well just do the pathfinding algorithm too

mighty cliff
#

guys how do you stop the VideoPlayer thing from instantly blinking on when you hit play Its like, as soon as I call Play, it just suddenly appears, not like you have an image you can fade in and out

novel wing
#

Kinda depends on what your needs are when it's visible on the other side. If you want to be able to also interact you need some more complex setup with duplicated game objects.

languid sinew
#

Hmm, thanks for the advice, I’ll look into that.

And I really only need it to be visible from the other side, nothing fancy

#

Although, I assume that would make it a flat 2D texture on the big board

novel wing
#

Yeah that would be an issue

#

If you can get away with duplicate objects I would probably suggest you doing that. This is kind of a hard problem to solve

native plover
#

I have a math question.

I have 2 Vector3's that have magnitudes 3 and 5. If I add these two vector3's, would the magnitude of the sum equal 8?

sly grove
native plover
#

Yeah makes sense

sly grove
#

otherwise you're forming a triangle and calculating the length of the third side

native plover
#

Thank you

undone coral
fallen magnet
#

Does anyone have a strategy for selecting assemblies at build time? I've split out the logic I use for Steamworks into separate components that each conform to an interface (Lobby, Player Info, event handlers, etc) so that I can do the same thing for Epic Online Services without having to change my core application - plugins, basically. What I'd like to do is 1) not include Steamworks code in the Epic build and visa-versa, and 2) select which assembly definition to include with a command line parameter so I can automate the builds. Does Unity have any tools that can make this easier for me? Does anyone have a better way of switching platform specific components?

sand wraith
#

How to update y component of a vertex? can we do something like this?

mesh.vertices[i].y = value;

#

I tried it and not working

sly grove
#

also you really don't want to be doing mesh.vertices in a loop

#

It creates an entirely new array copying all the vertices into it every time you call that

#

you should do:

Vector3[] vertices = mesh.vertices;
for (int i = 0; i < vertices.Length; i++) {
   Vector3 v = vertices[i];
   v.y = value;
   vertices[i] = v;
}
mesh.vertices = vertices;```
sand wraith
#

Thanks a lot

remote pumice
#

Hey, I've got some kind of riddle for you 🤔 🤣

I have following base classes

public abstract class CommandArgumentParser
{
    public abstract bool CanParse(string text);
}

public abstract class CommandArgumentParser<T> : CommandArgumentParser
{
    public abstract T Value { get; }
}

with concrete implementations like

public class StringCommandArgumentParser : CommandArgumentParser<string>
{
    public override string Value => m_value;
    private string m_value;

    public override bool CanParse(string text)
    {
        m_value = text;
        return true;
    }
}

I am calling CanParse, and if it returns true, I'm using Value in another spot. There's nothing that could possibly affect Value and it's backing field only ever gets set in that method

I've put a Debug.Log(Value) between m_value = text and return true and it properly logs the value of text as one would expect, however, when accessing Value from another place, after CanParse did run and log, it gives me the default value (in this case, null, but happens for int and other types as well)

Any ideas why that would happen? First guess could be that I'm not properly overwriting Value, will double-check on that, anything else..?

quartz stratus
remote pumice
#

I have a class

class CommandSignature
{
    public CommandArgumentParser[] Arguments { get; }
}

Arguments is being assigned in constructor.
I'm accessing like
((StringCommandArgumentParser)someSignature.Arguments[0]).Value.
Even when calling

someSignature.Arguments[0].CanParse(...);
Debug.Log(((StringCommandArgumentParser)Arguments[0]).Value);

I'm getting this problem

Anyways, it's 4:20am here, I'm going to sleep and continue bothering with this later, it's also kinda hard to pull this out of the complete context of my program, it's related to a thread I've made previously today, if you mind checking it out

quartz stratus
#

lol sounds good

#

I'm concerned that you're casting it to StringCommandArgumentParser. That could potentially allow for a situation where you end up with a reference to the base class, not the implementation.

#

Is there a way to get a hold of the subclass type without casting?

#

Might not have anything to do with your specific problem though

remote pumice
quartz stratus
#

Okay, good

#

Oh and I might be missing something obvious, but I'm confused as to how this compiles:

public override bool CanParse(string text)
{
    m_value = text;
    return true;
}

when the method signature it's overriding has a different return value:

public abstract void CanParse(string text);
remote pumice
#

Ah sorry, I misspelled! It's ofc not a void

#

Did edit 😀
Kinda terrible to write on a phone XD
Appreciate your interest, but will definitely sleep now, everyone feel free to DM me when having any ideas

unborn otter
#

i have a 4096x4096 altas in my android build however it only takes 0,5kb memory from memory profiler, the game behaves normally, anyone got any idea on why this is happening ?

austere jewel
#

is it actually that size or is it just named that

unborn otter
#

based on the compression format, it should be around 16MB

#

it is this size

austere jewel
#

There are per-platform settings that can change that, along with settings in the quality settings that can scale it too

#

but that is still an absurdly small size for a texture, so it may just be something else going on

unborn otter
#

we are not setting override for android platform, still it is very werid

#

the strange part is, if i use android override and make another build, the memory size returns to normal

#

no code change, just compression format change only

quartz stratus
# remote pumice Did edit 😀 Kinda terrible to write on a phone XD Appreciate your interest, but ...

hope you get some rest lol. For what it's worth, I tested the below classes and it performed as expected. So seems like your code is solid, just something unknown must be touching it. A riddle indeed.

using UnityEngine;

public class TestMono : MonoBehaviour
{
    private CommandArgumentParser[] Arguments { get; } = new CommandArgumentParser[] { new StringCommandArgumentParser() };

    private void Start()
    {
        Arguments[0].CanParse("test");
        Debug.Log(((StringCommandArgumentParser)Arguments[0]).Value);
    }
}
using UnityEngine;

public abstract class CommandArgumentParser
{
    public abstract bool CanParse(string text);
}
public abstract class CommandArgumentParser<T> : CommandArgumentParser
{
    public abstract T Value { get; }
}
public class StringCommandArgumentParser : CommandArgumentParser<string>
{
    public override string Value => m_value;
    private string m_value;

    public override bool CanParse(string text)
    {
        m_value = text;
        Debug.Log(m_value);
        return true;
    }
}
urban warren
#

How would I apply a rotation relative to another point? So if I rotate point A, point B would also rotate to stay in the same relative position? (Like how rotating a parent gameobject rotates the child GO)

untold moth
# unborn otter

If you're profiling in the editor, it would include everything the editor works with in the session, possibly including cached versions of texture with different compression settings.

#

Profile the build to get precise data.

unborn otter
untold moth
#

Okay then.🤷‍♂️

unborn otter
#

however if i alter graphic api to use openGL es3 by default and make a build to test (before it was vulkan default), all atlas size seems to changed back to normal (which is 16MB)

#

this is really werid

untold moth
#

Profiler/graphics API bug?🤔

unborn otter
#

i guess it might be vulkan has some compression optimization towards sprite atlases ?

#

coz i use developer option on my android device to check my app RAM usage, the default build (0.5kb atlas RAM) indeed spent less memory than the 2 other control group builds (4mb atlas RAM & 16mb atlas RAM)

#

hopefully Unity ppl's can jump in to help

undone coral
#

some library that does command line parsing well

#

and has no dependencies

undone coral
undone coral
unborn otter
undone coral
#

hard to say

#

maybe on android, on your device, it needs to be a specific format for performance reasons

#

it happens to be the 16MB one

#

then converts it

unborn otter
#

i checked memory profiler and it did get compressed actually

#

very strange though coz i used SystemInfo.SupportsTextureFormat() to check my deivces supports ASTC or not and it returned false, however memory profiler is telling me it's been compressed

undone coral
#

yeah

undone coral
#

is that the rigth query then?

#

your game is working and it's ASTC so it must be supported

#

why would it be wrong? not sure

#

maybe it returns a cached result and at the time that you call it, vulkan hasn't yet determined if it's supported or something

#

that would be weird

#

android can probably convert textures on demand

unborn otter
#

well Unity doc said it the compression format is not supported it will be decompressed to RGBA 16 or sth, so even thought the format might not be supported the game can still run and play

#

i kind of feel that memory profiler package is not showing the correct memory usage value, probably like you said it's been decompressed to other part

devout hare
#

Not the right channel, but the first step is to log the array lengths and values in Start and in the coroutine

limpid bear
wispy terrace
#

Is there a maximum depth as to how many coroutines are waiting for another coroutine? like "yield return StartCoroutine(Routine);"
I've got an Ienumerator that waits for another Ienumerator in a (unrelated) child class that waits for another Ienumerator in a singleton script but I get this error:
NullReferenceException

#

The line that it points to is the one inside the Ienumerator in the child class

#

Also, the child class derives from a class that derives from Monobehaviour but it is not instantiated in the scene

raw lily
#

Does anyone know what could be wrong here?
I'm trying to get something (with tag) from an additive scene.

#

Seems pretty straight forward yet..

devout hare
wispy terrace
#

Maybe the child class doesn't have access to the coroutine in the singleton script?

devout hare
#

Then it would say that

#

Null reference error means that the value of something is null

wispy terrace
#

So, could it be because the parent class is not instantiated?

devout hare
#

🤷

#

show code

wispy terrace
#

Just fixed it actually, I just made the parent class derive from monobehaviour because I couldn't start a coroutine from the child class. But I can reference the target monobehaviour and start the coroutine from it

#

Thanks for the help though!

shut citrus
#

I'm using Unity 2019.4. I want to open a second display and have multiple issues. main issue being the screens all open without border (no way to move or resize). I can resize and reposition the second display with d2.SetParams(width, height, 0, 0); but the main display remains in fullscreen and ignores my request to toggle to windowed (I have code that switches between fullscreen and windowed).
Is there a Unity way to get around this? I'm looking into microsoft windows code to change what I want

rotund dagger
#

Need some tips on optimizing a scene with lots of the same object. Separate suggestions are appreciated, although it'd be better if someone can find a full article on this topic.

compact ingot
glacial wedge
#

is it possible to add a public method to unity Button class? I need to assign to buttonA the invoke of onClick of buttonB

glacial wedge
#

I wont add the same method on different classes

#

exteding Button somehow, adding a method that make the button fire would help me a lot

rotund dagger
#

Could you be a bit more concrete about what you're trying to do?

glacial wedge
#

OnSelect event of Textmeshpro input field fire the event of the parent Button

rotund dagger
#

I see that you probably want to invoke whatever clicking Button would do by selecting the textmeshpro part of your UI

glacial wedge
#

yes

#

I can do it with custom component easily

#
using UnityEngine;
using UnityEngine.UI;

[RequireComponent(typeof(Button))]
public class ClickButton : MonoBehaviour
{
    private Button _button;

    private void Awake()
    {
        _button = gameObject.GetComponent<Button>();
    }

    public void _Fire()
    {
        _button.onClick.Invoke();
    }
}
rotund dagger
#

Why wouldn't you just copy the same behaviour of the button-clicking to the text-selecting?

glacial wedge
#

but I wont add the component, but having this method within the Unity Button

glacial wedge
rotund dagger
#

Because look, onClick is called onClick for a reason. If you call it when the button isn't being clicked, you might get yourself into trouble at some future point because that's a misuse of the abstraction

rotund dagger
glacial wedge
#

I already make it, but I miss the change of the button status (Selected)

rotund dagger
#

Okay. Again it's the same issue: if the button isn't really selected, don't try to make it show as selected. You might eventually find a way to do it, but by doing that you're creating a bug

glacial wedge
#

Ok, I get it

#

thanks for your feedback, I was underestimate the danger of changing standard behaviour

misty glade
#

I've upgraded to a later version of unity, and I'm having some issues with my project files. Apparently they're not being regenerated properly but I can't seem to figure it out.

I do have an external dependency (a shared .net class library that I'm copying to the /Assets/Plugins folder) which has worked for me in the past, but now it appears to be.. not. Compilation in unity works fine, but when I open any of the scripts (in visual studio), the csproj files appear corrupt. Visual Studio is complaining on these lines (in the project file):

  <PropertyGroup>
    <ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <UnityProjectGenerator>Package</UnityProjectGenerator>
    <UnityProjectGeneratorVersion>2.0.14</UnityProjectGeneratorVersion>
    <UnityProjectType>Game:1</UnityProjectType>
    <UnityBuildTarget>StandaloneWindows64:19</UnityBuildTarget>
    <UnityVersion>2021.2.14f1</UnityVersion>
  </PropertyGroup>

Saying that the project subtype (the one starting in E097...) is missing:

There is a missing project subtype.
Subtype: '{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1}' is unsupported by this installation.

Any ideas?

rotund dagger
misty glade
#

Uninstalling and then Resinstalling the workload "Game development with Unity" from the visual studio installer fixed it

shut citrus
desert pendant
#

Hey guys, i've currently got a dictionary set up with actions, and the action names as strings. is there a way for me to get TryGetValue to give me a reference to the action rather than the action by value?

#

for a little context

sly grove
#

You want to give an Action and get the string out?

#

oh I see what you're asking

#

It's not that you got a by-value

#

the problem is that action += actually creates an entirely new delegate

#

you need to do this:

action += obj.function;
BossEventsHandler.actionToString[obj.actionName] = action;```
desert pendant
#

Sorry i wasn't clear, yeah that's the issue i was trying to address

#

awesome thank you so much!

sly grove
#

shove it back in the dictionary

desert pendant
#

Will that overwrite all the previous functions that have subscribed to the action?

#

if so could i do

BossEventsHandler.actionToString[obj.actionName] += action;?

sly grove
#

No it won't overwrite all the previous ones

#

If you want to overwrite the previous ones just use = instead of +=

fresh basalt
#

how would i access a variable in another script that is in a seperate class?

sly grove
pastel tiger
#

Is this forum suitable for asking questions regarding to native C++ questions?

somber swift
hallow cove
#

so I have this Firebase authentication script

#

and I need it to also work in the editor

#

I want to be able to log into an account from the editor

#

since I'm making some custom editor windows and tools

pastel tiger
#

I wanted to understand how can we pass an std::vector of vertices from a native C++ plugin to C#?

I have been googling regarding the same, however much of the answers pertain to passing arrays from C# to C++, and it's quite unclear how to do the reverse.

The requirement is that I write a simple OBJ loader in C++, which extracts the following data - vertices, triangles, normals and uvs, from an obj model, and transfer that data in Unity, where it will be subsequently supplied to the mesh class.

tough tulip
hardy iris
#

Ayo I have a bit of a problem,
I am continuing someone elses work which was made on unity 2019.3.5
All of the work up until now is done in that version. Part of that was me saving an image of where a player looked at most in a heatmap for which I used a bitmap from System.Drawing (I uncluded the dll using csc.rsp with -r:System.Drawing.dll). Today I tried updating to Unity 2019.4.36 LTS and everything asides from the Bitmap class and Imageformat.bmp works, which I'm stuck on now. Anyone knows how to solve this? https://media.discordapp.net/attachments/811921872467001344/951203329453748284/unknown.png

hot mirage
#

i have a coding problem, where i cannot hit the a moving target with raycast, in my aim trainer anyone know how to solve this,it is too big to put on here

silent dagger
#

I'm trying to debug some code that run in EditMode, but VS gone crazy and crash when I set some condition on the breackpoint

#

Shouldn't be so messy 🤔

#

still crash even with targets[i].name == "PT_Medieval_Female_Armor_hair_01"

sly grove
#

maybe on line 134 it will

#

but it's just being declared on 133

silent dagger
#

ok let me test it

#

I try with just the line below

#

😂 ok today I learned a new things 🤓

#

the i didn't exist in the for declaration line

sly grove
#

that shouldn't crash VS though. Seems like a bug

sly grove
#

i isn't declared yet because that line hasn't run yet

silent dagger
#

🤔 yea that's makes sense.

sly grove
#

Regardless, VS shouldn't be crashing from that. Seems like a bug

#

It should just show you some kind of error

silent dagger
#

or maybe nothing, but it misbehave sometimes it get frozen

#

anyway thanks a lot 🙂
the condition are extremely useful when you have a loop with 250 items

rotund dagger
#

Which one is faster for updating a Vector3's value with a translation:

  1. Changing x, y, z of a Vector3 individually. i.e. v = new Vector3(v.x + 1, v.y + 2, v.z + 3)
  2. Create a new vector and do addition. i.e. v += new Vector3(1, 2, 3)
#

Or is there no significant difference in terms of performance between the two?

granite viper
#

the first

#

although ideally you actually want

v.x += 1;
v.y += 2;
v.z += 3;
#

though this isn't possible for transform.position and similar since they are properties

hollow garden
granite viper
#

It's not about allocations -- the second one is two function calls

#

both of them aren't allocating anything, they're on the stack

hollow garden
#

well it still does new twice is what i meant so that's not good

granite viper
#

first one is one function call

#

it actually does it three times, I think

#

three function calls

#

anyway, minutia

#

the important performance consideration here is to minimize the number of function calls you're making

#

however, with any perf advice -- dont worry about perf early in development unless it's immediately and obviously adversely affecting the experience

granite viper
#

I only worry about function calls in very hot path code, like if I'm inside a for loop 10k times

rotund dagger
#

Like why is it not possible to do transform.position.x += 1?

#

I knew it from the very beginning but never questioned the reason for it

granite viper
#

Because transform.position returns a copy of the real backing value

#

so setting transform.position.x += 1 would be useless and do nothing

rotund dagger
#

I see, thx

fresh salmon
#

Yeah properties are just disguised methods

granite viper
#

since this behavior is somewhat unintuitive C# helps you out by throwing a compiler error

fresh salmon
#

And when you return a value type, it makes a copy of it

rotund dagger
#

Okay.. another weird question: Is it possible to vectorize the operations that I want to perform on a bunch of vectors? ("vectorize" as in data science terms)

#

If you're familiar with numpy or torch you should know what I'm asking

granite viper
#

can you give an example

#

I'm not familiar with those

fresh salmon
#

Not familiar either, but is it, like chaining operations on a value and executing it all at once?

rotund dagger
#

Basically I have a bunch of Vector3 in Unity, and I want to apply some operation to all of them. For example, adding (1, 1, 1) to each of them.
In Python, we tend to put these values into 2d arrays and let numpy do an addition with broadcasting, avoiding the use of an explicit for loop, because using a loop is much slower

#

I'm wondering if the same concept can be applied to Vector3's in Unity

granite viper
#

in C#, using a for loop is the fastest way to handle this

fresh salmon
#

Yeah

granite viper
#

you could technically add this functionality via linq, or implementing it yourself with an extension method

#

but again, with all basic perf issues function calls are your enemy

rotund dagger
#

There seems to be an article on Unity docs about it

granite viper
#

I was about to say, unity burst has this kind of multiplexing for jobs

rotund dagger
#

I'll read it later and let you know if there's anything fun

granite viper
#

but you have to use their math library

#

and I think it may only apply inside jobs? Not sure

compact ingot
# rotund dagger Basically I have a bunch of Vector3 in Unity, and I want to apply some operation...

you are basically describing a map function. in C# the most direct equivalent would be .Select() (e.g. IEnumerable<int> map = someList.Select(x => x + 1);), multiplexing via vector commands (AVX etc.) and Parallel.ForEach() are advanced variations of the same principle, Burst/Jobs offer some further variations with unity specific optimizations. There is however no immediate reason to avoid C# loops for performance reasons.

pine topaz
#

There is a thing i dont understand, on OOP Encapsulation is hiding sensitive data from other classes which mean private fields, but Encapsulation also generates public getter/setter methods or properties right. So whats the point of making a variable private but can get or set by public ?

hollow garden
# pine topaz There is a thing i dont understand, on OOP Encapsulation is hiding sensitive dat...

Encapsulation, as i understand it is there just to hide state and internal stuff that is not necessary to see, so that you cannot accidentally go in and directly change it without going through a proper procedure, take something like, a Meter for example cs public class Meter { public int current; public int maximum; } here you can go in and directly change the values, so bugs like current > maximum can happen, this is where encapsulation comes in ```cs
public class Meter
{
private int current;
private int maximum;

public int Current
{
get => current;
set
{
if (value <= maximum) current = value;
}
}
}

#

so the point of making a variable private but having public get and set is to prevent you from using the data in an illegal way

#

or something like that

#

there's definitely more points to it but this is the one i remember

novel wing
#

Another nice little thing specifically for getter & setters is that you can plop a breakpoint on them, allowing you to debug whenever a value changes.

undone coral
#

nothing will stop you from writing buggy code either

#

if someone else is going to use or contribute code to your game you should document how your code is used via the visibility attributes

undone coral
undone coral
undone coral
#

you can also construct the Mesh in C++ directly

#

all Unity.Objects can be constructed in C++

rotund dagger
undone coral
rotund dagger
# undone coral what's your application?

We are creating a game that involves coins. Players will possess a lot of them and we are aware that if there are a lot of them there might be a performance issue - although none of us is experienced enough to tell where exactly the issue lies. Is too many rigid bodies going to be an issue? Or is it fine as long as they don't all have colliders? If the coins need to have different color / textures, will it be more efficient if they all use the same material but I make change to the shader at runtime, than having different materials for each of them, or does it not matter...?

#

So generally speaking I'm just pretty clueless about which are the most crucial factors when it comes to optimizing a great amount of the same object.

compact ingot
undone coral
#

1000x cube rigidbodies + gpu instance material + identical mesh + hdrp sample scene runs at >100fps on my 3090 + 5950

rotund dagger
#

How often do you run into people with exactly the same rig

undone coral
#

professionally you buy the steam hardware survey top items and test on that

undone coral
rotund dagger
undone coral
#

physx is cpu limited

rotund dagger
#

But yeah the point is it should work well on most pcs not mine

undone coral
undone coral
#

how many are moving at the same time is big

rotund dagger
compact ingot
#

do you even need physics for your coins? Do they even have to be gameobjects? Could they be particles?

upper mica
#

Hey, I have a save/load system I've been working on, and I finally got all the bugs worked out of it, tested thoroughly... but when I compile a web build and try to play it in Chrome, it just crashes (grey screens the unity window) in the browser when I try to load a save.... any idea whats going on here?

Heres the code for the save system
https://pastebin.com/sLN0XvYS

Is it just because chrome and other web browsers dont play nice with binary formatters?

fresh vortex
upper mica
#

hmm wait I looked up webgl debugging and uh... the first line
Unity WebGL does not have access to your file system

#

I dont intend for my game to be Web based, I have just been using web builds because its an easy way to let others test and give feedback without having to download anything

#

but I may just need to bite the bullet and go back to PC windows builds

quartz stratus
quartz stratus
upper mica
#

I just got my save/load system fully working, will I have to make any changes to it to make it work with that?

quartz stratus
upper mica
#

bleh, I think I've just start doing windows builds

#

its nearing that point anyways

#

I plan to have the prototype done by the end of this month, so I dont want to spend a bunch more time on a temporary saving system

hollow scaffold
#

Is there a faster way I could perform this operation?

Vector3[] vertices = new Vector3[currentJobData.Vertices.Length / 3];
            Vector3[] normals = new Vector3[currentJobData.Normals.Length / 3];
            Vector2[] uvs = new Vector2[currentJobData.UVs.Length / 2];
            int[] triangles = currentJobData.Triangles.ToArray();
     
            for (int vertex = 0; vertex < vertices.Length; vertex += 3) {
                vertices[vertex / 3] = new Vector3(currentJobData.Vertices[vertex], currentJobData.Vertices[vertex+1], currentJobData.Vertices[vertex+2]);

                normals[vertex / 3] = new Vector3(currentJobData.Normals[vertex], currentJobData.Normals[vertex+1], currentJobData.Normals[vertex+2]);
            }
            for (int uv = 0; uv < uvs.Length; uv += 2) {
                uvs[uv / 2] = new Vector2(currentJobData.UVs[uv], currentJobData.UVs[uv+1]);
            }```
I'm taking mesh data from a job in a nativearray and converting it to proper array. I've reduced it as much as I can but im not sure if it can be optimized more. Depending on the amount of data returned it gets up to ~20ms to execute which causes some noticeable lag spikes
long ivy
#

why are you copying element-by-element for verts, normals and uvs instead of ToArray? Your uv indexing looks wrong to me as well

hollow scaffold
#

to update the mesh.vertices it needs to be a vector3[] but jobs only support blittable types so i've done everything in float[]

#

same for uv and normal

long ivy
#

Vector3 is a blittable type

#

same with Vector2. Dump the float shenanigans, you'll save some time there

hollow scaffold
#

Really? I tried a few times and kept getting errors

#

I'll give it another go

#

Yeah that'd save a massive headache

hollow scaffold
long ivy
#

it makes more sense to me with your explanation with the floats

hollow scaffold
#

Ah okay

hollow scaffold
long ivy
#

also, make sure you're profiling in a build or with safety checks off. They'll harm performance a lot

hollow scaffold
#

Didnt even think of that, i'll do that in the future

glacial wedge
#
for (int i = 0; i < options.Length; i++)
        {
            
            options[i].button = options[i].item.GetComponent<Button>();
            options[i].image = options[i].item.GetComponent<Image>();
            options[i].button.onClick.AddListener(()=>_OnSelect(i));
            options[i].image.sprite = options[i].offSprite;
        }
#

When I click on button the integer value passed is options.Length

#

How to pass the correct value to each option?

#
for (int i = 0; i < options.Length; i++)
        {
            int index = i;
            options[i].button = options[i].item.GetComponent<Button>();
            options[i].image = options[i].item.GetComponent<Image>();
            options[i].button.onClick.AddListener(()=>_OnSelect(index));
            options[i].image.sprite = options[i].offSprite;
        }

it works using a copy variable

timber flame
#

There are two admob libs (unified and non unified). I would like to have one implementation for both.
The video ad implementations of both libs are similar. The only problem is OnAdFailedToLoad event. The event returns AdErrorEventArgs in one lib and AdFailedToLoadEventArgs in another event.
I do not want to use preprocessor.

What is your approach?
I have implemented my way below

   rewardedAd.OnAdFailedToLoad += (sender, e) => OnAdFailedToLoad(sender, e.To(), adUnitType);
public static class AdErrorEventArgsExtensions
{
    public static AdErrorEventArgs To(this AdErrorEventArgs adErrorEventArgs)
    {
        return adErrorEventArgs;
    }

    public static AdErrorEventArgs To(this AdFailedToLoadEventArgs adErrorEventArgs)
    {
        return new AdErrorEventArgs
        {
            AdError = adErrorEventArgs.LoadAdError,
            Message = adErrorEventArgs.LoadAdError.GetMessage()
        };
    }
}
ivory notch
#

how to switch between this sprite randomly, so it created illusion like its talking

#

i tried this

craggy spear
ivory notch
craggy spear
#

so you set the sprite to index 2 from the array in Start() and then you never change it again

#

Use a random number, between 0 and array length (google -> unity how to get random number)
Then change the sprite more often

ivory notch
#

i want it to change every 0.5 secs

austere jewel
#

There are so many ways to do that, and you should use the array length, not hard coding it

#

If you have issues with that, ask in a more appropriate code channel

ivory notch
#

im sorry

#

im new, this is really advanced for me

craggy spear
novel plinth
hardy iris
upper mica
#

Hey so I was having an issue yesterday with my load game crashing the app in the webGL build, and I thought this was a webGL exclusive problem, since webGL builds dont have access to your file system... but I just made a windows build to test, and it has the same issue... game just crashes on load, and I have no idea how to debug this, or find out why its crashing

drifting galleon
#

look at the logs

hallow cove
#

I have Firebase set up with my project and I want to be able to log into an account on it inside a custom editor window, out of play mode

#

how could I do that?

#

since, the script for that requires a Coroutine as well

upper mica
#

I've looked multiple places it could be

drifting galleon
upper mica
#

yup thats the page im on

#

I've looked where it says they should be

#

all I can find is a Player.log
at %USERPROFILE%\AppData\LocalLow\CompanyName\ProductName\Player.log

#

and there doesnt seem to be any useful info in there

#

interesting note: if I delete my save file, and then try to load a game, it executes these lines, then crashes

if (File.Exists(Application.persistentDataPath + "/kobolds.shiny"))
                {
                    GameMaster.i.spellList.spellList.Clear();
                    GameMaster.i.LoadSave();
                    e_ControlGuideFlags.Invoke();
                    GameMaster.i.spellList.PopulateSpellDict();
                    StartCoroutine(LoadGameAndPlacePlayer(GameMaster.i.playerStatsSO.sceneAtSaveLocation));
                }
                else
                    source.Play();```

it does the `else`
plays the sound, then crashes
hallow cove
upper mica
#

ah I'm dumb, I think see the problem... testing it out now

#

I have an Application.Quit() line that is being run unintentionally.... couldnt catch this in the editor because that method does nothing in editor play

#

yup, that fixed it.... woops

fathom flare
#

What do i want to accomplish?
I want to receive a HTTP POST request in unity, this will activate a GET request to the backend and return a list of objects

More information
So i have made a http listener in unity, this component is linked to an object.

When i receive a request, it looks like I am not able to call the function where I activate the Get Request

if (context.Request.HttpMethod == "POST") {    
            var param = new StreamReader (context.Request.InputStream, 
                                context.Request.ContentEncoding).ReadToEnd ();
            
            StartCoroutine(getRequest(param));
}
private IEnumerator getRequest(string name) {
  //Here is my request, but it never enters this function
}

I only added the code I think you might need to understand what is going on,

The variable "param" has a string which is used as body in the get request.

Is anyone able to help me here? I don 't understand why I can 't call the startcoroutine function

umbral trail
#

can you step over the streamreader in the debugger?

fathom flare
#

the value of the param is correct so I don 't think there is anything wrong with the streamreader, what would u think?

umbral trail
#

then you should be able to step into getRequest

drifting galleon
#

also be sure to use using on the streamreader

fathom flare
hardy iris
fathom flare
#
        Debug.Log(param);
            StartCoroutine(getRequest(param));
            Debug.Log("after");
#

it logs param, never reaches "after"

#

and never reaches first line in getrequest()

upper mica
#
  1. cannot tell anything from that little bit of a code
  2. is this really a question for advanced code channel?
tough tulip
# fathom flare **What do i want to accomplish?** I want to receive a HTTP POST request in unity...

why not use UnityWebRequest for it? you haven't provided enough code to help anyone else to understand whats wrong with your code.

Guessing from what I see, normally a StartCoroutine will not stop the code execution (even when an exception is thrown within the coroutine), but it does run the code instantly until the first yield.
Is there any code within the coroutine which freezes the main thread?
Is your editor responsive after calling StartCoroutine?

hallow cove
#

if I wanna upload and download a unity scene at runtime

#

do I have to use AssetBundles?

drifting galleon
#

not necessarily i think, but just use addressables. btw addressables supersede asset bundles

flint sage
#

Not really, Addressables uses assetbundles, it's not a replacement

drifting galleon
#

never said it's a replacement. it uses asset bundles but has much more features

flint sage
#

Supersede implies it's the replaces, I.e. Takes the place of something

drifting galleon
#

i know. and i'd always take addressables over asset bundles. only because it builds upon them doesn't mean it's not effectively a replacement

#

but i get what you're saying

flint sage
#

I definitely wouldn't, you can't control when things get loaded and unloaded very well due to the design (e.g. being able to call load everywhere without regard for actually loading the bundle)

hallow cove
#

ok so

#

what I actually want to do is

#

take the current scene in the editor

#

and convert it to an assetbundle or something

#

and upload it to a server

#

and then be able to load that asset back in play mode at runtime

#

so I need to like

#

click a button and have it trigger a function that gets the current active scene and converts it to an asset that can be shared

#

please ping me cause I'll forget to check here 💀

drifting galleon
undone coral
#

oh i see you figured it out

hardy iris
#

ye, sry for having your time wasted

timber flame
#

I have asked this question before but no answer.
Suppose a package used in your project has some utility scripts/classes (Linq, Singleton, JobQueue, TaskUtility, etc.). This package uses that utility classes. Do you prefer to use these utility classes in the entire project or not.
Think if you decide to delete that package (Suppose a package which can replace with another package, video ads, IAP, etc.). How do you handle the dependencies?

undone coral
#

create a unity package for utilities you author and use, and leave other packages / source code that you control but did not author alone

timber flame
undone coral
#

do not use utility classes declared in other packages

#

copy them into your own namespace if they're valuable to you

undone coral
undone coral
#

addressables are complicated. but so is the problem.

timber flame
undone coral
#

@fathom flare you can use Kestrel, the cross platform http server from aspnetcore, inside unity. then, you will do something of the form

var builder = WebApplication.CreateBuilder(null);
var app = builder.Build();

app.MapPost("/your-url", async () => {
  await UniTask.SwitchToMainThread();
  // you can now run code on the main thread.  
});

app.RunAsync().Forget();
#

unitask makes it easy to interoperate with unity's runtime model

#

kestrel is the best, fully featured, clearly documented web server

timber flame
#

Suppose I would like to create some packages about different IAP system or ads, etc.
I have decided to create one package for each IAP module and one Core module (generic interfaces, utilities, services and factories)
My questions
1- Factory classes in Core module need to create some instances of those modules but they do not exist in the core module. Should I use something like preprocessors?
2- How do you group these classes by namespaces? Is it OK to exist similar namespaces in different packages? For example in Admob and Adcolony packages, both they have "CompanyName.Advertisement.Platforms" namespace

CompanyName.Advertisement.Platforms  (AdColony, Admob, ... classes)

CompanyName.Advertisement.Core
CompanyName.Advertisement.Core.Factories
CompanyName.Advertisement.Core.Services
//  

or do you like to group them differently? namespace for each module separately

CompanyName.Advertisement.Core
CompanyName.Advertisement.Admob
CompanyName.Advertisement.AdColony
public class AdFactory{
   public Advertisement Create(AdType type){
   }
}

Inside Create method, I create an instance of that ad module.
If The factory class is inside Core package that I think it should be but in core package, there is no ad modules
In Unity3d, I can add preprocessors like below

#if Admob
  return new Admob();
#endif
public class AdFactory{
   public Advertisement Create(AdType type){
      switch type{
         case:
          //...
      }
   }
}

So, I won't have any compile time errors. I add desire modules and then define the corresponding preprocessors. Any better approach?
I would like to add/remove modules without any problem, having flexibility

undone coral
#

can i symbolic link files from an ignored (IgnoredFolderWithTilde~) folder into somewhere else in assets?

#

or will unity vomit on windows?

#

if symbolic links are enalbed with git?

granite viper
hollow scaffold
# undone coral why are you converting it?

Already fixed that problem. I thought I had to use float instead of Vector3, didn't know vector3 was supported by jobs so i converted everything back to vector3 and vector2

hallow cove
#

I need to upload A WHOLE map

undone coral
hallow cove
#

something like a unity package that contains all the assets in a scene

undone coral
hallow cove
#

wdym?

#

I want users to use Unity to create maps and stuff

undone coral
#

do you fully control the source of the game

hallow cove
#

I'm making a project where people can use Unity and an SDK I'm making, in order to make maps

#

like VRChat