#⌨coders-cave
1 messages · Page 47 of 1
Right I learned that when I tried to get a random int the normal way
Not System.Random
I didn't use unity and j couldn't do anything
Np
Is there something like nav mesh in 2d because if that's the case then I don't think I would use it
I'm pretty sure there is
But nav meshes always confused me
And litteorly never worked out for me
Sounds complicated
Xd
What is a nav mesh
The script check if he can win, if he can, he does, if he can't, he pick a random place to choose
so
The thing that let you path find for a character?
it's basically chance
but the bot will always win if he has the possibility
Path finding
That's what i did
Then why do you need a nav mesh
Nav meshes are difficult to set up correctly
my unity just crashed
Read about minimaxing
And if you screw them up guess you have to delete litteorly everything
To make it play better
i don't want a bot that is too strong
Try to implement minimaxing in C#
fun practice
I never use unity shit in 2D tbh
Its all too glitchy
Mainly because I don't want to put colliders everywhere
I just write my own stuff
Just read about minimaxing
And try to implement it
Theres sudo code on Wikipedia
Or whatever its called
I forgot
Its like a general fake programming language
Thats made for everyone to understand
Minimaxing reminds me of my worst nightmare, room generating algorithms in unity
For some reason
Minimax (sometimes MinMax, MM or saddle point) is a decision rule used in artificial intelligence, decision theory, game theory, statistics, and philosophy for minimizing the possible loss for a worst case (maximum loss) scenario. When dealing with gains, it is referred to as "maximin"—to maximize the minimum gain. Originally formulated for n-...
What
Room generation
So ez
Just need a bit of math
Tell that to my keyboard that no longer exists
And enums which I completely don't understand what they are
Why would u need enums
I understand how to make them but I have no idea what they ar meant to be
Makes sense
Wanna face your right
+1
Wanna face your left -1
Simple
If its 4 make it 0
If its -1 make it 3
Seems like it
Want a brain fuck
Do something like this
Something that simplifies room generation is being able to load scenes inside a scene
Yea
An infine while loop
Ofcourse it is
Ans it's very simple to make one
Ok
Its an infinite loop
Yea
it's something random
If the board is full
What is supposed to be true
It would go o. Infinitly
while true is to make a loop that last until the bot have a solution
but
Make sure when the board is full it breaks
Can't you just use for statement for that
the board wasn't full
that's the issue
my list stop at 8
It might be exclusive
Yes
But i think its exclusive
So 0,9 gives you numbers between 0 and 8
If it gives an error
Its not
And btw
The else statement
Its not needed at all
It literally does nothing
Hmmm
Did it work ?
i just want to check in google if it's exclusive or not
so
i can try to not make my unity crash again
Just try it

Unity when infine while loop be like
🧊
It litteorly freezes itself and a bit part of your computer
The first time I got it I couldn't access anything
lmfao
I told u
F
Are you sure you saved ?
yes
Xd
Lmao
Show me code again
and it's when i clicked
CPU must hate you rn
Hmmmmmm
Oh wait
I swear this chat has become my favourite lol
it's "long"
Only the loop
i mean
i clicked
you can see the
the
hoover
i clicked and it crashed
but i guess it's because it calculated already the bot move
Did you play
Send loop
i send the loop ?
Again
Ye
while (true)
{
int rand = Random.Range(0, 9);
if (buttonList[rand].interactable)
{
buttonTextList[rand].text = playerSide;
buttonList[rand].interactable = false;
ChangeSides();
break;
}
}
wait
So
while (true)
{
int rand = Random.Range(0, 9);
if (buttonList[rand].interactable)
{
buttonTextList[rand].text = playerSide;
buttonList[rand].interactable = false;
ChangeSides();
break;
}
}
wdym
Like an array that tells u if a square is empty or x or o
i can verify if the text of the button is O or X
and if it isn't
it means it's available
the
Lets try this
Write a function that returns true if the board is full
To do that
Just make a loop over the button list
If one of the buttons text is empty return false
And after the loop is done return true
WAIT
ok
let me
jsut
just
basically
i have a counter
that count the turns
and if it reaches 9
it stops the game
but
i forgot to add the ++ to the bot turn
Because that doesnt have to do anything with the loop
The way your doing it is not the best way
Indeed
thanks

basically
i did it so
when moveCount reach 9
it propose to play again
but i did it before i introduced the bot
so
even if the movecount reach 9
it change side anyway
cuz it considere the game is over
and there
the bot try to find a case
where
he can play
and he can't find one
And the board is full
cuz they're all used
Yea
What else
Oh ok
Rip
Remake the game
think
Woooooo
no
REMAKE REMAKE REMAKE REMAJE
it's just the bot making it crash
u nub
no
The way i approach a board game
Is i have a 2d array represent the board
I have an action struct to represent actions
Every turn i check if the game is done
🤫
shush
Remake
shush
NOW

Delete project
forever
Delete OS and write it from zero or ur bad
Noo
lol
You wont leave
Wasted too much time getting to crabzilla
Remake you mean
I haven't seen uni approach so idk what you guys are talking about but sure
i need to save this
Don't flood pls
If i make tic tac toe on phone faster than you make it on pc
How much gold u gib me ?
Bruh just minimize discord when you want to think
ok
i will jsut
just
build my project
and see when i crash

@barren shale
i think i know
it's because the code is going too fast

i just need to
slow it down
with a
sleep tim e
It now wait 3 seconds before the bot play
lol
i crashed on turn one
i crash everytime on round 1

Is there a way to not use a while loop
wait i'm
i'm lost
the game crash when i win against the bot

he doesn't like to loose
He just burns ur pc when he lose
Explain how you would go about doing this.
I suggest a remaje
Use the C# Shell android app
@fierce epoch ~show us your mod folder~ show us your win script
Abd destroy this nub
Uh-huh.
And you wouldn't want to use something faster than C# like C++?
Its tic tac toe
If you're writing for speed.
You're trying to get working faster on Phone than PC, right?
No
Source: 835575169862860801
Oh ok.
Faster than he can make the game
Makes sense.
Use the pygame python library if you're trying to write it faster
Since games are highly dependent on gpus now
No time to get that on android
Oof.
I hate any way of making a game that doesn't let you visualise the game while making it I just don't understand how it's possible to make a good game this way
Lots of testing?
hi
I mean it takes longer without a visual side, but it still gives the results you may want.
Yea no I would rather test 1 time a month but be able to see the game then having to constantly run the game
Go make this

Uhhhhh
Will split in half
Oof.
Wait a second
Are you sure it's freezing or are you just getting an error and the game pauses
You have an extra space between the content of the sentence and the punctuation.
It's painful.
in french you never put ! and a letter next to each others

Yes!
Yes !
Stop, let me live in an echo chamber.
i prefer the second option
Makes sense
Nice
Oh?
Fix it
As if it were that easy ever.
Life is pain.
I have been attempting to generate random rooms for a month now life is more then just painful
Oof.
Damn.
Don't know what to say to that actually.
I'm not very good with math ok
What language is it in?
C# unity
I have tried C# but haven't gotten too far into it.
Have not touched Unity.
Ite pretty easy
Compared to other things
Not sure I understand
Hello there what are you guys doing
Damn
Speaking in the tongue of gods.
Could have never guessed
We are coding 😎
Thank you guys I'm lost without you 
Like coders 😎 😎 😎
Anyone heard of Malbolge?
Google "Malbolge hello world"
Look in images.
Die.
Brain fuck is better
Yeah ywah
This looks so painful in so many different ways
Brainfuck is logical.
@hoary hound Hello fellow coder 😎
Brainfuck is wierd.
We codin' less goo
We codin tho
I've seen too many cursed programming languages
Brainfuck has logic behind it.
Befunge has confusing logic.
But Malbolge is just slamming on your keyboard.
And hoping that maybe something will happen
Hmm yes that sounds good for my mental sanity
I unironically want to learn Assembly.
Ehh
I got an "How to learn hacking" book once, it started off with assembly, I dropped it after the first pages
Maybe in the future
lessssssgoooooooooooo
But not now, no I'm not going to learn assembly
bro
@orchid frigate i don't understand
when i play without bot, the game over is working very well
but when bot is activated
it doens't work at all
Are you still making tic tac toe
Any error?
is assembly the same as IL?
and i only have 1 loop
whats up
This assembly
Pain
Enjoy manipulating memory and registers by hand
everytime bot win
oh god its worse

just dont lose
It's the closest language to machine language
count that as the bot celebrating its victory
I think
when i win it crashes too
uh
and it shouldn't
so something in your gameover is fucked
no
let's explain my script
ok

Weird
Rework is the best way
how can you crash without having an error
What compiler are you using
possibly because of an infinite loop
but
this loop
shouldn't be infinite
Oh
ah okay
Put print
It is because of an infinite loop
Or whatever you can to print output
The only reasob
show us the loop
while (true)
{
int rand = Random.Range(0, 9);
if (buttonList[rand].interactable)
{
buttonTextList[rand].text = playerSide;
buttonList[rand].interactable = false;
ChangeSides();
break;
}
}
Show us the loops 
Brruuh
I dont trust that if statement
when there is no button interactable
while true is 100% running forever
He has a break
But i dont trust that if statement
My suggestion
Write a function that gives you all the empty squares
And choose a random one
Instead of the if statement
if you consider the break ending the loop, it does this for one variable and stops
Thats Continue
if you consider the break not stopping it because "true" is ALWAYS true, so this loop should repeat indefinitely
wait
Continue skips to the next iteration
so he only changes one variable with this loop
It means that the break is never reached
is what im saying
i just need to do something and i brb
So the if condition is never met
Maybe try what i said
Instead of the untrustworthy if statement
Get all empty squares
oh youre right
And choose a random one
lol i see now
And remove while loop
if (buttonList[rand].interactable)
{
buttonTextList[rand].text = playerSide;
buttonList[rand].interactable = false;
oh my fucking lord
Idk why ur using a while loop tbh
i brb
No need to check if a square is empty if you know its empty
well i try to help but this gets confusing quick with 3 people giving input
Ye
if its still not working later i try again
Yea
lol
I'm just trying to figure out what the code is doing
i
While loops are geyh

i just changed a bit of code

Woah
Oh nice
Never use w while loop in unity
Bot do be cheating
Super geyh
ive only used it once, and knew i didnt have to
so id agree
Oh yeah
Unless you're 100% sure it finishes
It should
Knowing how Unity works indeed helped me a lot
Bye gonna go Continue making my superior tic tac toe
4d time travel tic tac toe
With time travel and shit
Lol yeah not even try to understand how it works
and no one has ever seen Cody again
It's the first ever chess variant with spatial, temporal, and parallel dimensions.
off to another dimension
They have been selling a time machine this whole time and no one noticed 
im considering hiring someone to do a couple specific things for my mod
fiverr has some big brains
i go log in into fiverr and propose a worldbox mod help
cuz
i'm bad
but
fucking poor
i could put off some of online mod and other projects onto someone else with more experience
but then i dont learn as much

cody i have a question
if you start a game on worldbox
put some villager
and save the world
if you don't touch anything
everytime you load the world
will it be the same "future" ?
that's sad cuz iit would have been easier for an online mod
Wasn't Cody already working on multiplayer mod
No
It will be the same
Unless they cahnge the seed
Everytime you load the game
Cuz computer random isnt really random
It makes you feel like its random
But its just math
you can override the seeds determining some of the randomness like hamza said
and is exactly what im trying for online already
uni was on to the same idea
when clients connect to host, host sends them the current seed so they can update and hopefully have some of the same interactions pre-determined
it works decently for map generation, but theres like a 20% chance its mildly different

With random AI
But the game doesnt freeze
Ez nub
Get rekt
Jk
I wrote it
To give you the sauce
So you can learn from it
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Main.cs where the program execute from
Game.cs which is game logic code
Not the best way to write code since coding on phone isnt my thing
But it was fun
My top recommendation is REMAKE
my second top recommendation is
Instead of while loop
Make a function that gives you a list of all empty squares
Pick one at random
or just
a
foreach
loop
But you want it to be random
Thats why you first make a list of all empty squares
So you can pick a random from the list
Sure
i have a list of all the TextObject in button object
Yea
but
to get all
like
i need to declare a variable
so
can i do <UnityEngine.UI.Text> ListName = new List<UnityEngine.UI.Text>();
Yea
ok
Then foreach loop
If a text is empty
Add to list
Then return list
Ping me when u need me
Sometimes i dont notice the chat
ok
hi?
hi?
Ay what can I do if all I know is python lol
Learn another language
C#?
Really depends
What do you wanna develop in?
like games, websites, machine learning, ect?
@dry bolt
Games
coughs coughs c++ is prob the best for game development but c# is good af too
What about automatons and machine learning
For machine learning id honestly go for java/python
You can go with r, julia, lisp too
basically any good langauge
for automation
Ight thx
after exam, gonna add these vehicles into my unit pack >:3c
What are you making a mod for?
making mod on 112 operator
https://steamcommunity.com/sharedfiles/filedetails/?id=2455724735
:3
sorry for late reply XD
I was white boarding the vehicle pics
like this
But most of them looks fammiliar
yea it's because They using mostly same vehicles.
but you can see difference.
this two looks same but they are used by other way
one is for transporting 4 officers, 2 criminals
the other is for transporting 2 officers, 4 criminals
Again. This is not 2015 all languages are equal
Or it should be even 2010

offended
where do i learn lua
don't use gay as an insult/joke

Have anyone here have access to GPT-3? (Im not begging just curious)
Probably the devs. Have access
It can generate some decent workable code to
Probably no one here its really rare to find someone with access
And yes it can generate decent code
But first you have to teach it
Which will take longer than writing the code urself
Just wwit until its public
Not really actually
Different languages have different speed
c++ is faster than most
Yes, but it doesnt matter in game development
It does
Or else youd see games coded in assembly
assembly is fast lol
Binary games be like
AM SANIC
It really doesnt matter
U might gain like 3 fps
Cuz most of the load is on the gpu
It is the bottleneck
Not that 100 ms difference between languages
If ur doing somethings like calculating prime numbers then i would use c++
Cuz it would benefit from the speed
So true, Fine-tuning or Training a model like GPT-3 to make probably Decently working code is patient and effort
ClosedAI
No
U cant train it
Its too huge
You can give it instructions tho
And examples
Im interested if GPT-neo can generate code better
Because there final goal is like 200B parameters then GPT-3 175B parameters
Who Em I kidding it's like 25Billion more that's incredible
But just think of it, When people suggest new features they can probably use a AI software to make it and refined the code
Still not ready for this
In all the demos youve seen
Its specific pieces of code
Not everything works
It makes mistakes too
Of course none will brag about gpt 3 being wrong
Thats ehy you only see the working stuff
I know someone that has access
His friend got it and theyre both using it
Its fun
You can write stories and tell it to complete them
Or questions with meh accuracy in answers
Its like 70% accurate
I have GPT-3 access, messed a lot with it (I'm actually running out of free tokens). What I can say is that code generation is not really a strength of gpt. Yeah it can generate decent code, but you first need to give examples, and code examples take a lot of tokens (considering the biggest prompt you can send is around 2000 tokens).
There might be better ways to do it than I did, but yeah I wouldn't rely too much on gpt-3 for code generation, at least for now
It's a common thing in coding...Most piece of codes won't work even the one you Borrow Ask someone
That's why, Fine-tunning it is probably the best case scenario (Also This new type of AI Is probably much faster then other Algorithms or Software in generating codes, that is Decently usable code)
But im not surprised if there's an AI that can generate code much better in this decade
lol nice
@north dune are you using the Unity MLAPI to do your multiplayer thing ?
seems sus
show us your mod folder 
so today i have been thinking the entire day about how to make my room generation script work and it was all good until i actually opened vs code
i have no idea what im doing once more
What mod folder
I can help you with that
If you want
no its like the dream joke where after he cheated everyone asked him for his mod folder
Oh
hmm but now that we are here can you help me with room generation
hack.(this);
print = (
“hack” ;
)
What language is this
so i have generated my first room and i have made a roomStats class where i store my x and y axis floats for my coordinate system (to the right will be (1,0) so on) but how do i put there coordinates to this room, how do i assign them more like
i use to be a modded for that game
Hack.this;
that doesnt make any sense actually
Xd
right
ok so i make a room script, inside the room class i put the stats including the cooridnates
and then just use a list
similar to binding of isaac room generation

