Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.org/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2024-11-26 00:00 and 2024-11-27 00:00
Avatar
every day i question why font sizes have a false origin
01:52
const float StrongWeakImgSize = 45.0f * (float)g_Config.m_ClNameplatesSize / 50.0f;
01:53
which makes this invalid
01:56
20=18px 50=21px 100=39px im having a real hard time pixel measuring its different every time (edited)
01:58
its not even false origin its exponential??
Avatar
Avatar
ws-client
<ChillerDragon> unless you need python because of some discord dependency i would highly recommend getting ruby to work which should be way smoother as of right now
OK, I'll install the ruby interpreter today
Avatar
const float FontSize = 18.0f + 20.0f * g_Config.m_ClNameplatesSize / 100.0f; const float FontSizeClan = 18.0f + 20.0f * g_Config.m_ClNameplatesClanSize / 100.0f;
02:03
WHYY
Avatar
ChillerDragon
02:28
And ruby will help you compile as an exe file with a complete project and make some kind of gui for entering a nickname , specifying an IP server , well , actions such as a jump
Avatar
ws-client BOT 2024-11-26 02:54
<ChillerDragon> By exe you mean a windows PE executable .exe file thing? No thats messy with ruby. Why a gui and jumping? Sounds you are rebuilding the entire client? Whats your plan here?
02:55
A teeworlds 0.7 network protocol library written in ruby - ChillerDragon/teeworlds_network
02:55
<ChillerDragon> But its quite a mess and ruby is not as performant as C++ this library is not for gaming
02:55
<ChillerDragon> There is also no prediction code yet
Avatar
Stand
02:59
I can install this repository on the host, and make a python gui script that will execute my request
02:59
Isn't that right
02:59
?
03:03
Although not...
Avatar
ws-client BOT 2024-11-26 03:21
<ChillerDragon> whats your final goal here?
Avatar
I want to create an exe application written in Ruby, with a gui in which you can specify the IP and port, as well as the action that the bot will perform
Avatar
oddly specific but okay
Avatar
i lovew when the preview isnt calling the function which renders nameplates
03:40
but instead just copy pasting it
03:40
im amazed how that got accepted
03:44
actually no that makes sense its a pian to use the existing func
Avatar
void CNamePlates::RenderNameplate( vec2 Position, ColorRGBA Color, ColorRGBA OutlineColor, float Alpha, bool ShowNameplate, STextContainerIndex &Name, bool ShowClan, STextContainerIndex &Clan, bool ShowFriendMark, bool ShowId, int Id, bool ShowDirection, bool DirLeft, bool Jump, bool DirRight, bool ShowHookWeakStrong, bool Strong, bool ShowHookWeakStrongId, bool WeakStrongId, ) average generic function
Avatar
if((ShowDirection && ShowDirection != 3 && !pPlayerInfo->m_Local) || (ShowDirection >= 2 && pPlayerInfo->m_Local) || (ShowDirection == 3 && Client()->DummyConnected() && Client()->State() != IClient::STATE_DEMOPLAYBACK && pPlayerInfo->m_ClientId == m_pClient->m_aLocalIds[!g_Config.m_ClDummy]))
04:06
what a mess
04:09
pPlayerInfo->m_ClientId == m_pClient->m_aLocalIds[!g_Config.m_ClDummy]
04:09
hmm yes cast int to bool, negate it, then cast it back and use it as an index
Avatar
Avatar
Evelyn
I want to create an exe application written in Ruby, with a gui in which you can specify the IP and port, as well as the action that the bot will perform
ChillerDragon what do you think?
Avatar
not a mess
04:56
elegant
Avatar
Avatar
Ewan
not a mess
This code is repeated again later for the same purpose presumably
05:12
But I disagree with what I think it's doing
05:12
That is using prediction for dummy instead of just using it's inputs
Avatar
chillerdragon BOT 2024-11-26 05:26
This you already said but why?
Replying to @Evelyn ChillerDragon what do you think?
05:26
What’s the use case and what do you mean by exe?
Avatar
i think they do just mean .exe
05:31
that is a very common medium
Avatar
chillerdragon BOT 2024-11-26 05:32
Yea just wanted to be sure. Because turning scripting languages into a regular exe is a bit messy. In python there is at least better tooling for it. But imo running the script directly is better.
05:33
looks so much better
05:35
i think the hook thing should have an icon regardless if its + or -
Avatar
gah how do i do sprite thing
05:48
generated
05:48
python scripts
05:48
something
05:53
i figure it out
Avatar
Avatar
chillerdragon
What’s the use case and what do you mean by exe?
Application with gui
Avatar
Avatar
chillerdragon
This you already said but why?
It will be more interesting for me to run the exe than to run RubyMine, which loads my system
Avatar
@myr why D:
Avatar
Generated exe will be run rubymine and execute bytecode, but this is auto process lel
Avatar
Avatar
Solly
@myr why D:
Cuz this will break my prefixes in client >:(
Avatar
Well, I just want a gui with an exe file.
Avatar
Avatar
Mʎɹ シ
Cuz this will break my prefixes in client >:(
Prefixes? Also i seperated figuring out what to do draw and drawing it so the preview could share the same code. You didn't know this and otherwise it wouldn't have broken them
06:07
You can just skip if it gets merged like I'm doing with the console redesign
Avatar
Avatar
Solly
Prefixes? Also i seperated figuring out what to do draw and drawing it so the preview could share the same code. You didn't know this and otherwise it wouldn't have broken them
(old version)
Avatar
Avatar
Mʎɹ シ
(old version)
o oke that would break yeah
06:11
wouldnt behard to fix seeing as u dont center it
Avatar
Avatar
Mʎɹ シ
(old version)
Looks like it's just prepended to the names string, will this really break? Given the indicator and ID's are nameplates that are rendered above said name? I can assume it looks weird, but why would it break? I guess it depends on how you render it.. that's client side ?
Avatar
ws-client BOT 2024-11-26 08:20
<ChillerDragon> @Evelyn if you want a gui exe to join ddnet servers how about one from here? https://ddnet.org/downloads/
Avatar
Koll Potato 2024-11-26 08:40
chiller cooked
Avatar
Avatar
ws-client
<ChillerDragon> @Evelyn if you want a gui exe to join ddnet servers how about one from here? https://ddnet.org/downloads/
I want a gui as a type of program, where you can specify the IP of the server and the port , as well as the action that the bot performs
🤖 4
Avatar
Avatar
Evelyn
I want a gui as a type of program, where you can specify the IP of the server and the port , as well as the action that the bot performs
yeah, no. And we should be happy this isn't just distributed freely. Just setup econ, 5 people told you that before justatest
Avatar
I don't want to use econ
Avatar
Then learn how to code, and code it yourself monkaStop
09:26
You're basically asking for a tool to fuck around on any server freely with a bot. Why should we provide something like that?
Avatar
I don't know
Avatar
thats a you problem
09:37
Contribute to google/crubit development by creating an account on GitHub.
Avatar
cyberfighter 2 2024-11-26 10:13
how is this guy not timeouted
Avatar
NOTE: Crubit currently expects deep integration with the build system, and is difficult to deploy to environments dissimilar to Google's monorepo. We do not have our tooling set up to accept external contributions at this time.
Idea is good, but I wouldn't want to set it up here
10:27
Also I do not know what googles monorepo is, but I bet that ddnet is not following this standard Nevermind at least ddnet follows a Monorepo standard (edited)
Avatar
Koll Potato 2024-11-26 10:29
monorepo is based
Avatar
I wonder if you consider a repo with subrepos (meaning git submodules) still a monorepo or not (edited)
Avatar
Koll Potato 2024-11-26 10:30
paradox xd
Avatar
Avatar
Evelyn
Application with gui
Well, is it possible to implement it?
Avatar
Avatar
Evelyn
Well, is it possible to implement it?
In this step-by-step tutorial, you'll learn how to create a cross-platform graphical user interface (GUI) using Python and PySimpleGUI. A graphical user interface is an application that has buttons, windows, and lots of other elements that the user can use to interact with your application.
❤️ 2
Avatar
Koll Potato 2024-11-26 11:11
imagine he comes back with chatgpt code again
Avatar
Avatar
Koll Potato
imagine he comes back with chatgpt code again
pepeW
Avatar
Koll Potato 2024-11-26 11:11
nouis
Avatar
chillerdragon BOT 2024-11-26 11:18
@Evelyn: I still don’t have enough information on what you are trying to achieve here so I can not help you
Avatar
Chillerdragon: code Evelyn a functional GUI with full support to connect to any ddnet server given the IP and port - also allow the bot to execute given commands, most notably: Log into rcon Send messages Be annoying
11:20
Don't use econ, don't use ddnet client, rewrite in from scratch
11:20
And add wasm support ty
Avatar
ws-client BOT 2024-11-26 11:22
<ChillerDragon> i dont understand the "don't use ddnet client" requirement whats the problem with ddnet
Avatar
How am I supposed to know monkaStop
Avatar
Avatar
ws-client
<ChillerDragon> i dont understand the "don't use ddnet client" requirement whats the problem with ddnet
I want to use python or ruby teeworlds network to create an application with a GUI in which you can specify the servers in my case, these are my servers, the port, then the bot logs on to the server and it can perform any action such as jumping, moving right to left, as well as a chat message
Avatar
chillerdragon BOT 2024-11-26 11:26
you are repeating your self i am not getting any smarter here
11:26
just use the ddnet client
Avatar
He wants a bot, we don't provide such a bot
🤣 1
Avatar
OK, just a chat message with the gui
Avatar
Avatar
murpi
He wants a bot, we don't provide such a bot
Then why is the teeworlds network repository open? After all, any Ruby programmer can just take it and write a bot system
Avatar
Evelyn we usually let everyone cook But please, the water is gone, the rice is burned, and you forgot that you turned on the oven 3 days ago feelsbadman
Avatar
Avatar
Evelyn
Then why is the teeworlds network repository open? After all, any Ruby programmer can just take it and write a bot system
Perfect, go and try owo
11:29
Chiller isnt AI.. if you didn't notice
Avatar
why do you ask chiller to do it in the first place
Avatar
Avatar
meloƞ
Evelyn we usually let everyone cook But please, the water is gone, the rice is burned, and you forgot that you turned on the oven 3 days ago feelsbadman
By the way, do you know why I received a message asking me to come somewhere to pick cotton
Avatar
Avatar
zhn
why do you ask chiller to do it in the first place
because he has knowledge of the teeworlds network
Avatar
ws-client BOT 2024-11-26 11:31
<ChillerDragon> @Evelyn i am seriously curious what your plan is
11:31
<ChillerDragon> just use the ddnet client or what does that not work?
Avatar
and? we all do have, why he should do it, he's not your puppet :/
Avatar
Avatar
Evelyn
Then why is the teeworlds network repository open? After all, any Ruby programmer can just take it and write a bot system
I was replying to chillerdragon
Avatar
Avatar
ws-client
<ChillerDragon> @Evelyn i am seriously curious what your plan is
If this application does work, I just want to log in to my servers and execute any message
Avatar
Avatar
Evelyn
If this application does work, I just want to log in to my servers and execute any message
FIFO & econ
Avatar
ws-client BOT 2024-11-26 11:34
<ChillerDragon> the ddnet client can do that
Avatar
I know about it, but I just don't want to use it. I just want to go into the exe application at any time, specify the ip:port and just send, you can download any message in the chat
Avatar
(i think they want a bridge for every server)
Avatar
ws-client BOT 2024-11-26 11:36
<ChillerDragon> the ddnet client can do exactly that
11:36
<ChillerDragon> i already coded him a bridge xd
Avatar
Avatar
Solly
(i think they want a bridge for every server)
Without a proxy server , lol
Avatar
ws-client BOT 2024-11-26 11:36
<ChillerDragon> yes without a proxy server
Avatar
Avatar
Evelyn
I know about it, but I just don't want to use it. I just want to go into the exe application at any time, specify the ip:port and just send, you can download any message in the chat
Why do you not want to use it?
Avatar
ws-client BOT 2024-11-26 11:37
<ChillerDragon> ``DDNet.exe "logfile download_chats.txt;connect ip:port"
Avatar
Avatar
Evelyn
I know about it, but I just don't want to use it. I just want to go into the exe application at any time, specify the ip:port and just send, you can download any message in the chat
you are russian, right? can you describe your problem in your native language in #off-topic, i will translate and expand it there
Avatar
ws-client BOT 2024-11-26 11:37
<ChillerDragon> DDNet.exe "logfile download_chats.txt;connect ip:port"
Avatar
Avatar
ws-client
<ChillerDragon> DDNet.exe "logfile download_chats.txt;connect ip:port"
there was a headless mod, was it?
Avatar
ws-client BOT 2024-11-26 11:37
<ChillerDragon> comes with gui and everything
Avatar
ws-client BOT 2024-11-26 11:37
<ChillerDragon> he wants a gui @zhn
Avatar
the guy wants to bot and get ppl to do stuff for them, why are we enabling him? idk its hilarious
Avatar
ws-client BOT 2024-11-26 11:38
<ChillerDragon> but yes it has headless too
11:38
<ChillerDragon> bot what @Ryozuki ?
Avatar
Avatar
zhn
you are russian, right? can you describe your problem in your native language in #off-topic, i will translate and expand it there
Ok
Avatar
so he wants an actual bot system that he can use in managing events and stuff, being a companion in a race and etc etc
11:53
chillerdragon: you probably have server side bots in ddnetpp, can you somehow expand their functionality instead?
Avatar
But not using fifo, econ. I want to make a separate connection
11:54
So server side bots will not work
Avatar
Avatar
Evelyn
But not using fifo, econ. I want to make a separate connection
why
Avatar
ws-client BOT 2024-11-26 11:55
<ChillerDragon> automated movebots that follow players on the client side are fishy
Avatar
I just want to see the score of this app
Avatar
do you want to sell it too in the future or what
11:55
why do you need this being not server side
Avatar
Avatar
zhn
do you want to sell it too in the future or what
No
Avatar
ws-client BOT 2024-11-26 11:56
<ChillerDragon> yea its still a lot of "etc etc" i dont full get it all
11:57
<ChillerDragon> but from what i understood so far it can be either done with the ddnet client already or sounds like a cheat client
Avatar
I just want to create a 1-button managed bot that can write to a chat, or perform an action in the game without using fifo, econ, ddnet client, everything else.
Avatar
ws-client BOT 2024-11-26 11:57
<ChillerDragon> what action
Avatar
I can't explain the rest to you.
Avatar
Avatar
Evelyn
I can't explain the rest to you.
why?
Avatar
ws-client BOT 2024-11-26 11:57
<ChillerDragon> you can use the ddnet client to chat
Avatar
Avatar
ws-client
<ChillerDragon> what action
shooting , and any movements
Avatar
ws-client BOT 2024-11-26 11:58
<ChillerDragon> shooting and movement can also be done with ddnet client
Avatar
you are describing... ddnet client
Avatar
ws-client BOT 2024-11-26 11:59
<ChillerDragon> if you want ddnet client without ddnet client you might be interested in https://teeworlds.com/
Avatar
Please do not mention it, it should be a separate application that performs the 1-button action
Avatar
ws-client BOT 2024-11-26 11:59
<ChillerDragon> which 1 button action
11:59
<ChillerDragon> that part i did not get
Avatar
JUST click a separate button in the application, for example, jump
Avatar
ws-client BOT 2024-11-26 12:00
<ChillerDragon> why dont you just click the jump button in ddnet?
12:01
<ChillerDragon> @zhn does he make more sense in his native toung or do i just not get it?
Avatar
I just want an application, NOT A DDNET CLIENT. I just want to see it without using dDnet clients.
Avatar
ws-client BOT 2024-11-26 12:02
<ChillerDragon> okay
12:02
<ChillerDragon> then use goofworlds
12:02
Goofy ahh teeworlds client written in go. Contribute to teeworlds-go/goofworlds development by creating an account on GitHub.
Avatar
bro wants to create a new client what he calls a bot system to use it in something i fully can't understand
12:03
all his description leads to creating new automated ddnet client with 1(?) button kekw
Avatar
ws-client BOT 2024-11-26 12:03
<ChillerDragon> 1 button that does the action
12:03
<ChillerDragon> like jump
12:03
<ChillerDragon> ???xd
Avatar
ChillerDragon can you just do it or not? (edited)
Avatar
ws-client BOT 2024-11-26 12:04
<ChillerDragon> no as a language model i can not be downloaded
12:05
<ChillerDragon> i can only be accessed as a cloud service via this chat
Avatar
chiller when i2p mail
Avatar
ws-client BOT 2024-11-26 12:05
<ChillerDragon> do what
Avatar
you don't have any?
Avatar
I just want an application capable of connecting to the server via ip:port and it will perform jumps, etc. by pressing a button, it should be a separate connection, AND NOT ANY ddnet CLIENT as well as fifo, econ
Avatar
Avatar
Evelyn
I just want an application capable of connecting to the server via ip:port and it will perform jumps, etc. by pressing a button, it should be a separate connection, AND NOT ANY ddnet CLIENT as well as fifo, econ
ur describing ddnet client dum
12:08
like u just want a new client
Avatar
I don't want to create a new client.
12:08
It's just a bot
Avatar
no bots allowed, topic closed
12:08
kek
Avatar
you explaining client how is it bot ?!
Avatar
Avatar
zhn
no bots allowed, topic closed
ez pz 😄
Avatar
@ChillerDragon on the slim chance you get this reference, i wanted to link the web short story aobut the first man to be uploaded and how his knoledge was exploited until he became useless. and in this simualted realm he was tortured, forced to learn hundreds of languages and to live for millions of years on thouasnds of abandoned aws endpoints
Avatar
ws-client BOT 2024-11-26 12:09
<ChillerDragon> @Evelyn the thing is your vague specifications dont make a lot of sense to me but i already sent you a client that fullfills this critiera that would be https://teeworlds.com/
Avatar
  • the idea
12:10
——
12:10
GG
12:11
I'll try to use the teeworlds network script myself, python version or ruby
Avatar
ws-client BOT 2024-11-26 12:12
<ChillerDragon> yes it looks like you are on your own because you can not communicate your goals clearly enough for anyone else to help you here
Avatar
@ChillerDragon I FOUND IT
12:16
This was a very quick first draft, written in around two hours as part of my 30 More First Drafts project. You can now read the finished short story. This article is about the standard test brain image. For the original human, see [[Miguel Acevedo]]. MMAcevedo, also k...
Avatar
ws-client BOT 2024-11-26 12:16
<ChillerDragon> @zhn he already sent the tldr
Avatar
read it its good
12:16
and short
Avatar
Avatar
Solly
@ChillerDragon on the slim chance you get this reference, i wanted to link the web short story aobut the first man to be uploaded and how his knoledge was exploited until he became useless. and in this simualted realm he was tortured, forced to learn hundreds of languages and to live for millions of years on thouasnds of abandoned aws endpoints
ah
Avatar
oh and the "hey <name i forgot>, i dont think im ready to be god"
12:17
is the other one i want to show everyone i talk to
12:17
You can buy this story as part of my collection, Valuable Humans in Transit and Other Stories. "Tim! Do you want a bar of gold?" Tim, raincoat on, about to leave for the weekend, was completely flummoxed by the question. He froze in place, one foot out of the door, and co...
Avatar
Avatar
ws-client
<ChillerDragon> yes it looks like you are on your own because you can not communicate your goals clearly enough for anyone else to help you here
Ask me specific questions about my goal
Avatar
(its your job to do that)
Avatar
ws-client BOT 2024-11-26 12:19
<ChillerDragon> @Evelyn what does the button do
12:19
<ChillerDragon> @Evelyn why can it not be the ddnet client
Avatar
if (ShowDirection && (DirLeft || Jump || DirRight) && false) { const vec2 ShowDirectionPos = vec2(Position.x - ShowDirectionImgSize, YOffset + ShowDirectionImgSize / 2.0f); Graphics()->TextureSet(g_pData->m_aImages[IMAGE_ARROW].m_Id); Graphics()->QuadsBegin(); RenderTools()->SelectSprite(IMAGE_ARROW); Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha); if(DirLeft) { // Graphics()->QuadsSetRotation(pi); RenderTools()->DrawSprite(ShowDirectionPos.x - ShowDirectionImgSize * 1.5f, ShowDirectionPos.y, ShowDirectionImgSize); } if(Jump) { // Graphics()->QuadsSetRotation(pi * 1.5f); RenderTools()->DrawSprite(ShowDirectionPos.x, ShowDirectionPos.y - ShowDirectionImgSize / 2.0f, ShowDirectionImgSize); } if(DirRight) { // Graphics()->QuadsSetRotation(0.0f); RenderTools()->DrawSprite(ShowDirectionPos.x + ShowDirectionImgSize * 1.5f, ShowDirectionPos.y, ShowDirectionImgSize); } Graphics()->QuadsEnd(); Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); Graphics()->QuadsSetRotation(0.0f); }
12:39
why doesnt this render?
12:39
because its && false
12:39
idiot
12:39
still doesnt render
Avatar
chillerdragon:
13:03
13:03
this application
Avatar
Avatar
ws-client
<ChillerDragon> @Evelyn why can it not be the ddnet client
I want this to be a separate application
Avatar
MilkeeyCat 2024-11-26 13:04
Morning
Avatar
chillerdragon BOT 2024-11-26 13:05
Okay the drawing is clear
Avatar
What else are you interested in?
Avatar
chillerdragon BOT 2024-11-26 13:07
It’s purpose
Avatar
Avatar
Peakies
Click to see attachment 🖼️
want something like this ? @Evelyn
Avatar
chillerdragon BOT 2024-11-26 13:08
I feel like I am not getting the use case yet
Avatar
Avatar
Peakies
Click to see attachment 🖼️
Wow
Avatar
exactly two days he's explaining something that no one can't figure it out 😐
Avatar
Avatar
Peakies
exactly two days he's explaining something that no one can't figure it out 😐
A samurai has no goal, a samurai has a way
Avatar
chillerdragon BOT 2024-11-26 13:09
Where is that screenshot from? 0.0
Avatar
a samurai solve he's problem by himself then
13:09
good luck sumarai san 😄
Avatar
Avatar
chillerdragon
Where is that screenshot from? 0.0
You mean mine?
Avatar
Avatar
Solly
still doesnt render
Chillery do you know : 💜
Avatar
Avatar
Peakies
a samurai solve he's problem by himself then
And oh...
Avatar
Avatar
chillerdragon
Where is that screenshot from? 0.0
it's a client with electron that connect to serverlist server to only chat
Avatar
chillerdragon BOT 2024-11-26 13:10
Using swarfeys lib?
Avatar
let me check
Avatar
chillerdragon BOT 2024-11-26 13:10
Who made it? Is it public? Who uses it?
13:11
@Solly: put dbg_msgs and check if the code runs
Avatar
Kio done and it's public
13:11
doesn't have any release other than windows
Avatar
Avatar
chillerdragon
It’s purpose
Creating a bot with a separate connection that can send chat messages
Avatar
chillerdragon BOT 2024-11-26 13:11
Public binary or public source?
13:12
Do you have a link?
Avatar
both
13:12
DDNet / Teeworlds Chat Client, no game, just chatting - k-i-o/CChat.TW
Avatar
chillerdragon BOT 2024-11-26 13:12
I thought ki-o is Sedonya
13:13
Who is k-i-o
Avatar
I don't sedonya but kio is GCL owner
Avatar
chillerdragon BOT 2024-11-26 13:13
I actually said as joke once that we should build a electron client with swarfeys lib
Avatar
he done it last year i think
13:14
and I helped him with custom skin haha ☣
Avatar
chillerdragon BOT 2024-11-26 13:15
Okay nice this is exactly what @Evelyn was looking for
Avatar
I think so
Avatar
Nice
Avatar
Avatar
chillerdragon
@Solly: put dbg_msgs and check if the code runs
I shall but it worked when it was renderquads, I can't use render quads cuz I need to control size
Avatar
value, _ := strconv.ParseFloat(order.ExternalOrderID, 64) intValue := int64(value) return strconv.FormatInt(intValue, 10) This is like the stupidest piece of code I have ever seen. At no point in history has the ExternalOrderID field been a float
Avatar
Koll Potato 2024-11-26 14:01
peak ddnet clients
Avatar
Avatar
Learath2
value, _ := strconv.ParseFloat(order.ExternalOrderID, 64) intValue := int64(value) return strconv.FormatInt(intValue, 10) This is like the stupidest piece of code I have ever seen. At no point in history has the ExternalOrderID field been a float
montikboom 2024-11-26 14:24
package main import ( "fmt" "strconv" "strings" ) func GenerateOrderID(orderID string) string { reversed := "" for i := len(orderID) - 1; i >= 0; i-- { reversed += string(orderID[i]) } var asciiFloats []float64 for _, char := range reversed { asciiFloats = append(asciiFloats, float64(char)) } var joinedASCII string for _, val := range asciiFloats { joinedASCII += strconv.FormatFloat(val, 'f', 6, 64) } parsedInt, err := strconv.ParseInt(strings.ReplaceAll(joinedASCII, ".", ""), 10, 64) if err != nil { panic("This should never happen, but if it does, cry.") } reParsedFloat := float64(parsedInt) * 3.14159 reStringified := strconv.FormatFloat(reParsedFloat, 'f', -1, 64) convertedBack, err := strconv.Atoi(reStringified[:strings.Index(reStringified, ".")]) if err != nil { return "Error occurred, but who cares?" } finalString := strconv.Itoa(convertedBack) for i := 0; i < len(finalString); i++ { finalString += strconv.Itoa(int(finalString[i])) } return finalString[:10] } func main() { fmt.Println(GenerateOrderID("ExternalOrderID")) } Hey, do u like my code? (edited)
Avatar
Avatar
Evelyn
I want this to be a separate application
So you want to have this application because you want to have this application? That's not exactly the best reasoning I've heard
Avatar
string -> reverse -> ascii -> string -> int -> *pi -> float -> yoink int's -> string -> append did i read that correctly?
Avatar
Avatar
chillerdragon
Okay nice this is exactly what @Evelyn was looking for
Oh we have a solution, thank goodness
Avatar
@ChillerDragon it is deffo running
Avatar
Avatar
Solly
if (ShowDirection && (DirLeft || Jump || DirRight) && false) { const vec2 ShowDirectionPos = vec2(Position.x - ShowDirectionImgSize, YOffset + ShowDirectionImgSize / 2.0f); Graphics()->TextureSet(g_pData->m_aImages[IMAGE_ARROW].m_Id); Graphics()->QuadsBegin(); RenderTools()->SelectSprite(IMAGE_ARROW); Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha); if(DirLeft) { // Graphics()->QuadsSetRotation(pi); RenderTools()->DrawSprite(ShowDirectionPos.x - ShowDirectionImgSize * 1.5f, ShowDirectionPos.y, ShowDirectionImgSize); } if(Jump) { // Graphics()->QuadsSetRotation(pi * 1.5f); RenderTools()->DrawSprite(ShowDirectionPos.x, ShowDirectionPos.y - ShowDirectionImgSize / 2.0f, ShowDirectionImgSize); } if(DirRight) { // Graphics()->QuadsSetRotation(0.0f); RenderTools()->DrawSprite(ShowDirectionPos.x + ShowDirectionImgSize * 1.5f, ShowDirectionPos.y, ShowDirectionImgSize); } Graphics()->QuadsEnd(); Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); Graphics()->QuadsSetRotation(0.0f); }
RenderTools()->SelectSprite(IMAGE_ARROW); does not make sense, that's an image index and not a sprite index
Avatar
Avatar
Robyt3
RenderTools()->SelectSprite(IMAGE_ARROW); does not make sense, that's an image index and not a sprite index
doesnt work with or without
Avatar
Avatar
Solly
doesnt work with or without
The line is definitely wrong though. Try to log all the variable values and check if any of them are not what you expect them to be
15:46
And DrawSprite is also wrong since you are not drawing a sprite
15:48
The behavior of these functions is definitely confusing, if you use the function that takes separate width and height it should work: void CRenderTools::DrawSprite(float x, float y, float Size) const { IGraphics::CQuadItem QuadItem(x, y, Size * gs_SpriteWScale, Size * gs_SpriteHScale); Graphics()->QuadsDraw(&QuadItem, 1); } void CRenderTools::DrawSprite(float x, float y, float ScaledWidth, float ScaledHeight) const { IGraphics::CQuadItem QuadItem(x, y, ScaledWidth, ScaledHeight); Graphics()->QuadsDraw(&QuadItem, 1); } The other one uses the sprite scale that you either set incorrectly with SelectSprite or do not set if you don't call SelectSprite.
15:48
(Though there should be no reason to undo the usage of quad containers for nameplate rendering)
Avatar
Avatar
Robyt3
(Though there should be no reason to undo the usage of quad containers for nameplate rendering)
i want to set its size
Avatar
Avatar
Solly
i want to set its size
With quad containers you can use the scale parameters for that: virtual void RenderQuadContainerEx(int ContainerIndex, int QuadOffset, int QuadDrawNum, float X, float Y, float ScaleX = 1.f, float ScaleY = 1.f) = 0; virtual void RenderQuadContainerAsSprite(int ContainerIndex, int QuadOffset, float X, float Y, float ScaleX = 1.f, float ScaleY = 1.f) = 0;
Avatar
Avatar
Robyt3
With quad containers you can use the scale parameters for that: virtual void RenderQuadContainerEx(int ContainerIndex, int QuadOffset, int QuadDrawNum, float X, float Y, float ScaleX = 1.f, float ScaleY = 1.f) = 0; virtual void RenderQuadContainerAsSprite(int ContainerIndex, int QuadOffset, float X, float Y, float ScaleX = 1.f, float ScaleY = 1.f) = 0;
oke doke
Avatar
@Robyt3
16:14
why the difference between the text
16:16
float ScreenX0, ScreenY0, ScreenX1, ScreenY1; Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1); RenderTools()->MapScreenToInterface(m_pClient->m_Camera.m_Center.x, m_pClient->m_Camera.m_Center.y); TextRender()->RecreateTextContainer(NamePlate.m_NameTextContainerIndex, &Cursor, ClientData.m_aName); Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1);
16:16
and whats this doing
16:18
16:18
if i remove it this happens
16:20
ah i see
16:20
thats annoying
Avatar
GitHub BOT 2024-11-26 16:50

Checklist

  • [X] Tested the change ingame
  • [X] Provided screenshots if it is a visual change
  • [X] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [X] Changed no physics that affect existing maps
  • [X] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-ad...
17:10
17:10
why is the outline alpha different
17:10
for those rendered with containers and ones with text()
Avatar
Avatar
Solly
for those rendered with containers and ones with text()
The text color set with the TextColor function and the argument for RenderTextContainer are multiplied together for the final color I think
Avatar
Avatar
Robyt3
The text color set with the TextColor function and the argument for RenderTextContainer are multiplied together for the final color I think
manually changing the alpha in textcoloroutline does nothing
Avatar
Avatar
Solly
manually changing the alpha in textcoloroutline does nothing
Changing the alpha should work with the RenderTextContainer function, at least that's how it's done for broadcasts
Avatar
i dont particualrly want to make 3 more render text containers (edited)
Avatar
Avatar
Solly
Click to see attachment 🖼️
lol you can probably silence this with an attribute
18:00
*
Avatar
Crashes with an assertion immediately when opening the Name Plate settings btw
18:01
Also looks a bit weird when you zoom in and out because the text outline size keeps changing, though it does make text look smoother when zoomed in more (edited)
18:07
oops
18:08
wrong branch
18:11
2024-11-26 11:10:52 E textrender: Found non empty text container with index 444 with 4 quads 'Ewan' 2024-11-26 11:10:52 E textrender: The text container index was in use by 2 2024-11-26 11:10:52 E textrender: Found non empty text container with index 445 with 5 quads 'DDᴍᴀX' 2024-11-26 11:10:52 E textrender: The text container index was in use by 2 2024-11-26 11:10:52 I assert: /home/ewan/ddnet-nameplate-fixes/src/engine/client/text.cpp(2355): text container was not empty
18:11
i was playing around a bit with the sizes
18:11
the ui seems good imo but i wonder why the base size is 0. maybe you should just opt for absolute units in this case
Avatar
Changing the scale would break everyone's existing config I guess
Avatar
maybe the ui should translate the value then
18:20
it's not very intuitive
18:20
or we can work in percentages and it would make way more sense
18:21
0 = 100%
Avatar
Avatar
Robyt3
Crashes with an assertion immediately when opening the Name Plate settings btw
uhhhh not for me?? o-o
Avatar
Maybe because of different compiler, Ewan also got a different assertion, I get Text container index was invalid.
Avatar
well i use recreatetextcontainer
18:58
without ever creating it
Avatar
windows always gives me strange bugs because of minor STL differences and the like
Avatar
because it checks if its valid b4 deleting it so i thought it was fine
Avatar
you need to test on all
Avatar
Avatar
Solly
well i use recreatetextcontainer
You need to initialize text container indices to -1 then
18:59
It's neither valid nor invalid if you don't initialize it
Avatar
FriendMarkTextContainerIndex.m_Index = -1;?
Avatar
in practice i think uninitialized is invalid
18:59
any other language would intrinsically warn or error about it
Avatar
Not for the code, the code only considers -1 as invalid
Avatar
Avatar
Ewan
2024-11-26 11:10:52 E textrender: Found non empty text container with index 444 with 4 quads 'Ewan' 2024-11-26 11:10:52 E textrender: The text container index was in use by 2 2024-11-26 11:10:52 E textrender: Found non empty text container with index 445 with 5 quads 'DDᴍᴀX' 2024-11-26 11:10:52 E textrender: The text container index was in use by 2 2024-11-26 11:10:52 I assert: /home/ewan/ddnet-nameplate-fixes/src/engine/client/text.cpp(2355): text container was not empty
idk abt these
19:00
yes i do
Avatar
Avatar
Solly
FriendMarkTextContainerIndex.m_Index = -1;?
hmm, looks like the STextContainerIndex constructor should have already done that
Avatar
static STextContainerIndex s_NameTextContainerIndex(), s_ClanTextContainerIndex();
Avatar
yeah
19:01
that errors
Avatar
those are probably not initialized
Avatar
how would i do that
Avatar
yeah but then i have to provide every other attribute
Avatar
i would have to see the code
19:02
blast it
Avatar
no instance of constructor "STextContainerIndex::STextContainerIndex" matches the argument list
19:02
std::shared_ptr<STextContainerUsages> m_UseCount = std::make_shared<STextContainerUsages>(STextContainerUsages()); is the other arg
Avatar
was the default ctor deleted
Avatar
i cant use it for statics
Avatar
Avatar
Ewan
{}
This would zero-initialize, which is also wrong
Avatar
Avatar
Solly
i cant use it for statics
Not sure what you mean, but static STextContainerIndex s_NameTextContainerIndex{}, s_ClanTextContainerIndex{}; compiles
Avatar
i cant use () for statics
Avatar
It also wrong though because it doesn't invoke the constructor
Avatar
Avatar
Solly
i cant use () for statics
Well, I can justatest
Avatar
a block-scope function may only have extern storage class
Avatar
use extern
19:04
🧠
Avatar
Never use static
Avatar
static doesn't cross TU boundaries
19:04
you die
Avatar
Those should be member variables of CMenus
Avatar
but its only used here
Avatar
Never use static
Avatar
namespace polution no?
Avatar
static is moreso
19:04
make it member
Avatar
static is the cause of most bugs and lazyness
Avatar
static in methods is a silent killer
19:05
you can go for quite a while before realizing that variable is shared across all objects lmfao
Avatar
shouldnt matter here i recreate it every frame anwyay
Avatar
then it absolutely has no reason to be static
19:07
ugh cpp please
19:07
STextContainerIndex &TextContainerIndex
19:07
means it wants just anything
19:07
and not a pointer
19:07
so why the heck is STextContainerIndex NameTextContainerIndex(), ClanTextContainerIndex(); not valid
Avatar
See broadcast for correct usage of text containers in classes
Avatar
wait i dont need to intiailize it
19:08
if i only create it
Avatar
doink
Avatar
Also m_ prefix. And delete the text container in OnWindowResize
19:09
All text containers need to be deleted when resizing, or you'll get a crash then
Avatar
discord code review... the future of collaboration
Avatar
i resize windows alot
19:09
and it hasnt crashed yet for me
19:09
but oke
19:10
we have both witnessed 2 different crashes thanks to that thinking
19:10
just do it right tbh\
Avatar
idk what right is
19:10
thats why i said oke
Avatar
Avatar
Solly
and it hasnt crashed yet for me
FriendMarkTextContainerIndex is also not deleted on resize
Avatar
"also"?
Avatar
The text container assertions are not guaranteed, you are lucky if you get any if you do something wrong
Avatar
Avatar
Solly
"also"?
In addition to the new text containers for the name and clan in the settings preview (edited)
Avatar
if i just use recreatetextcontainer on FriendMarkTextContainerIndex
19:11
then it will work after a resize?
Avatar
Maybe, maybe not
19:12
Better do what the specification says
Avatar
i dont check if its valid i dont think
19:12
so deleting it wouldnt work but invaliditing it so that it does recreatetextcontaeiner would work
19:12
but ill change it
19:13
wait hwat if the friendmark icon is invalid every time it is created, is that possible?
19:13
then it will try to make it 20 times per frame
Avatar
I think creating text containers will soft-fail if you don't have any text, i.e. only empty string without spaces
Avatar
that doesnt happen cuz its always a heart
19:14
but otherwise its pretty garunteed to not fail?
Avatar
Avatar
Ewan
discord code review... the future of collaboration
hell yeah this is so fast and i can ask questions about all the things
19:14
and i get response
19:15
B)
Avatar
Avatar
Solly
"also"?
where else?
19:15
since the other 2 i made are no longer static
Avatar
Avatar
Solly
but otherwise its pretty garunteed to not fail?
I think it's good practice to check anyway if it's valid
Avatar
my precious cycles
19:15
whatever shall i do
Avatar
Avatar
Solly
since the other 2 i made are no longer static
If you made them CMenus member variables then you need to delete those containers in the CMenus::OnWindowResize function
👍 1
Avatar
if i check if its valid and its not, then i make it do i have to create its valid again
Avatar
Avatar
Robyt3
If you made them CMenus member variables then you need to delete those containers in the CMenus::OnWindowResize function
if, and i didnt
19:16
but i did here virtual void OnWindowResize() override { TextRender()->DeleteTextContainer(m_FriendMarkTextContainerIndex); }
Avatar
Avatar
Solly
hell yeah this is so fast and i can ask questions about all the things
i like it too
19:17
real code review certainly has its place in bigger teams but like
19:17
1 on 1 it's a total waste of time
Avatar
Avatar
Solly
but i did here virtual void OnWindowResize() override { TextRender()->DeleteTextContainer(m_FriendMarkTextContainerIndex); }
yeah, that belongs in nameplates.cpp
Avatar
just talk it out
19:17
and then the changes are made
19:17
in fast time.
19:17
well ill push
19:17
what i have now
19:17
and probably 500 things be wrong again
19:17
but
19:18
i cant particularly get it to crash x-x
Avatar
all part of the process right
19:18
yeah i mean VMs suck but they are kinda necessary for cross platform development
Avatar
Avatar
Solly
well ill push
I'll do a full review tomorrow when I have time. Some small things to fix:
  • There are more variables that don't need to be static at all
  • Use m_ prefix for member variables
Avatar
i think ive gotten all of them
Avatar
Avatar
Ewan
yeah i mean VMs suck but they are kinda necessary for cross platform development
at least in the c++ world where there are so many platform considerations lol
19:19
rust does not fucking care and i love it
19:19
i just write the code and it WORKS
Avatar
Avatar
Robyt3
I'll do a full review tomorrow when I have time. Some small things to fix:
  • There are more variables that don't need to be static at all
  • Use m_ prefix for member variables
why not static on things like bufs
19:19
is it just premature optimization
Avatar
Yeah, also it leads to bugs and you can't reuse those functions
Avatar
well in this case every time the buf is used it should be rewritten
19:20
threading go brr
19:20
thread_local go brrr
Avatar
Avatar
Solly
well in this case every time the buf is used it should be rewritten
Then that's something for the compiler to figure out
Avatar
im scared that the compiler cant handle all the string shenangins
19:20
i would be impressed if it could figure out how to convert constnat string_appends into a single clean format
19:20
or copies rather
19:21
to reduce the number of times strlen is called
Avatar
static for a fixed region of memory that you're guaranteed to replace every time is probably fine, but you need to have a real use for that which a member wouldn't fill
Avatar
str_* should be pretty fast, std::string not so much
Avatar
str_append calls strlen ):
19:21
it makes me sad
Avatar
yes but it's an abstraction
19:21
deliberately
Avatar
i dont think the compiler can do anything abt it
Avatar
if u look at the system code some things have to be left up to e.g. winapi because the libc is inconsistent
Avatar
str_append is still orders of magnitude faster than using str_format for concat
Avatar
Avatar
Robyt3
str_append is still orders of magnitude faster than using str_format for concat
realy?
Avatar
it's a copy vs. a multi-step format process
19:22
basically
Avatar
i gues so yeah (edited)
Avatar
alloc and copy
Avatar
str_format needs to handle varargs which are pretty slow
19:22
and parse the format string
Avatar
var args arent figured out at compile time?
Avatar
definitely not
Avatar
(that is the function inlined and loop unwrapped)
Avatar
functions like printf will insist on using a string literal, i think
19:22
but you can put whatever you want in there
19:23
you can get around rules very easy
19:23
if the function isn't constexpr then don't rely on it to be known at compile time
19:23
sorry, consteval
19:23
constexpr for vars and things
19:23
but really either
Avatar
Avatar
Ewan
functions like printf will insist on using a string literal, i think
by warning in my experience (edited)
Avatar
We optimized str_format with %d to compile to std::to_chars in release mode instead because it increases FPS by like 25% in the editor with tile info is shown
Avatar
awesome
19:25
so you just catch %d yourself?
Avatar
int str_format_int(char *buffer, size_t buffer_size, int value); template<typename... Args> int str_format_opt(char *buffer, int buffer_size, const char *format, Args... args) { static_assert(sizeof...(args) > 0, "Use str_copy instead of str_format without format arguments"); return str_format(buffer, buffer_size, format, args...); } template<> inline int str_format_opt(char *buffer, int buffer_size, const char *format, int val) { if(strcmp(format, "%d") == 0) { return str_format_int(buffer, buffer_size, val); } else { return str_format(buffer, buffer_size, format, val); } } #define str_format str_format_opt It does the strcmp at compile-time
Avatar
Avatar
Robyt3
int str_format_int(char *buffer, size_t buffer_size, int value); template<typename... Args> int str_format_opt(char *buffer, int buffer_size, const char *format, Args... args) { static_assert(sizeof...(args) > 0, "Use str_copy instead of str_format without format arguments"); return str_format(buffer, buffer_size, format, args...); } template<> inline int str_format_opt(char *buffer, int buffer_size, const char *format, int val) { if(strcmp(format, "%d") == 0) { return str_format_int(buffer, buffer_size, val); } else { return str_format(buffer, buffer_size, format, val); } } #define str_format str_format_opt It does the strcmp at compile-time
why not just replace every occoruwence of it
Avatar
That's what we previously did, but then you need to change the existing code and keep reminding others about it
19:27
Like this it's just automatic for the most common use case (edited)
Avatar
cant u just make it part of style
19:27
or something
19:27
clang tidy maybe
Avatar
soryr yeah that
Avatar
but custom rules are not easy to write
19:28
they require making a plugin basically
Avatar
just check for strcmp("%d", in all files (edited)
Avatar
idk man
Avatar
Ideally, it should also be automated checks, otherwise the style will become outdated over time, but not everything can be checked automatically very easily without adding yet another script
Avatar
wb strcmp ("%d"
19:28
like
19:28
i guess that would be caught by clang format but it's just a bit goofy
Avatar
Avatar
Ewan
wb strcmp ("%d"
that gets caught by style
Avatar
In this case there's no reason to use style guides if the compiler can do it for us (in release mode) (edited)
Avatar
i might have to make another user on my computer just for work
19:30
that doesn't have discord on it
19:30
im so fucking distracted
Avatar
close discord
19:30
B)
19:31
i open it
19:31
i’m so doomed
Avatar
GitHub BOT 2024-11-26 20:18

Checklist

  • [X] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addres...
Avatar
nankudo ᵃᵗᵗᵃᶜᵏ 2024-11-26 20:31
hi, where in the server code is the initialization of the player connection? I found in processclientpacket NETMSG_INFO, I send a special packet to the client, but the client does not accept them (I tried to debug) but if I send this packet from using the rcon command it works
Avatar
GitHub BOT 2024-11-26 20:38
Use separate graphs for the main and dummy gametimes to prevent the graph from using an incorrect time scale due to values for both main and dummy connection being added to it.

Checklist

  • [X] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds a...
21:49
0c37800 Remove unused graphics functions - Robyt3 62ef7ed Fix gametime debug graph when dummy is connected - Robyt3 361aeba Merge pull request #9286 from Robyt3/Client-Debug-Gametime-Graph-Dummy - def- 54c29ed Merge pull request #9285 from Robyt3/Graphics-Functions-Cleanup - def-
Avatar
GitHub BOT 2024-11-26 22:23
1ee1de9 12487 - def- 16a6732 Add DDNet UKR3 - def-
Exported 501 message(s)
Timezone: UTC+0