Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/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 2022-06-04 00:00:00Z and 2022-06-05 00:00:00Z
Avatar
@Jupstar ✪ wanted to figure out how the camera width/height is calculated from the aspect ratio. is CRenderTools::CalcScreenParams the correct function, and WMax/32 and HMax32 are the amounts of tiles horizontally/vertically?
01:24
if so, what is Amount supposed to be and what is f with that weird calculation
Avatar
Avatar
Patiga
@Jupstar ✪ wanted to figure out how the camera width/height is calculated from the aspect ratio. is CRenderTools::CalcScreenParams the correct function, and WMax/32 and HMax32 are the amounts of tiles horizontally/vertically?
Amount is clear I guess. You want resolution independent scaling. The backend's screen mapping will scale down all variables so we have normalized values across all resolutions, so that you end up in a NDC. Basically how pretty much all projection matrices would also do it. Now sqrt(Amount) is the length of one side of the new resolution. I guess this is clear too? Pretty basic geometric math. Now lets do some math. Imagine we subsitute the Amount at the very last step, even if it breaks math. But we want to transform into a different resolution anyway.. in the resolution of Amount: x * y = x * y | / y (x * y) / y = x | * x (x * y) * (x / y) = x^2 | sqrt sqrt(x * y) * sqrt(x / y) = x At this point it's clear where our journey ends xd x / y is the Aspect ratio.. The function takes the Aspect ratio as parameter so our new x is: x = sqrt(Amount) * sqrt(AspectRatio) and y is y = sqrt(Amount) / sqrt(AspectRatio) now look at the original formular float f = sqrtf(Amount) / sqrtf(Aspect); *w = f * Aspect; *h = f; its the exact same. f is basically = y and we go from y to x by multipling AspectRatio And AspectRatio / sqrt(AspectRatio) = sqrt(AspectRatio) You can think about this geometrically too, but I cannot explain it. Draw it on your paper or watch some videos about geometrical mean of sqrt. About WMax and HMax. Basically disallow zooming. And yes / 32 is to get the tile count at normal zoom
Avatar
chillerdragon BOT 2022-06-04 06:26:10Z
There is Patigas twmap which can turn maps into json and back. Do you can track json files in git. (@cauldron)
git for map editor when
Avatar
Maybe a tip for imagination: You want make the new resolution (Amount) fit into our aspect ration So side_length * sqrt(Aspect) and sqrt bcs the AspectRatio is on the "full" old resolution. But you only do the ratio multiplikation on one side of the new resolution not on the full length. E.g. lets say you take 1920x1080 thats the full mass.. EVERYTHING XD if you only want the amount of everything that was created by the width u basicall do (1920×1080) × 16/9 now you have a new mass, the mass of the width do now get the side length of that new mass u simply put a sqrt around it sqrt((1920×1080) × 16/9) and tada. You are back to 1920 See hard to explain but kinda makes sense if u imagine it somehow
06:32
thus the name Aspect Ratio It is the Ratio between the two sides
06:32
xd
06:32
ok i stop now
Avatar
Avatar
chillerdragon
There is Patigas twmap which can turn maps into json and back. Do you can track json files in git. (@cauldron)
well you could even track binary files with git, couldn't you? i was thinking of managing soundpacks for ddnet with git, to just checkout another branch and have another soundpack
08:56
but json converter could make building a ddnet map history feature "natively" without git easy
Avatar
we had an undo manager before just saving the map, its simply very slow
08:57
calculating the diff is not much faster
08:58
would be cleaner to seperate all changes on a map from the editor and do undo events there
Avatar
what do you mean very slow
08:59
even if its super slow i would use it
Avatar
as said there was one it was made async bcs it was too slow probs
Avatar
just saving would be slow, right?
09:01
anyway, i am not into this. its too big for me. soundpack or color feature keep me busy xD
09:02
but is the web collabo editor built from scratch?
09:02
maybe it could have it
Avatar
i cannot say smth about the actual performance, but e.g. adding a layer somewhere on a 4kx4k map would require quite a lot of processing
09:02
be it diff or just saving
09:03
bcs it would shift all bytes after the layer at least
Avatar
why?? after all its just the tiles mapped to locations or not?
09:03
i mean does the res play a role?
09:04
ah you mean 4k tiles
09:04
still
Avatar
see you either have an undo manager that knows about the file format (then you can also just make it very efficient, bcs all actions you do in the editor can be cleanly seperated) or you have an undo manager doing smth like git: binary comparision... that can result in a full check in worst case
Avatar
for git its obviously not annoying, bcs it does that exactly when u expect it
09:05
but a weird lag everytime u add new tiles or stuiff like that can be really annoying
Avatar
yes it has to be seamless
09:05
off
Avatar
Avatar
Jupstar ✪
ok i stop now
thank you a lot, your explanation was very good :)
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
only retards uses -fr
Avatar
Avatar
Jupstar ✪
see you either have an undo manager that knows about the file format (then you can also just make it very efficient, bcs all actions you do in the editor can be cleanly seperated) or you have an undo manager doing smth like git: binary comparision... that can result in a full check in worst case
I have never build a good undo manager, but I would think if every possible action in the editor has a corresponding inverse action, you could just put the actions on a stack and revert them on a undo command one by one.
Avatar
yes
Avatar
btw colemak user
13:26
_ 😎
Avatar

Checklist

  • [ ] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly rel...
Avatar
I think i reached a new low with windows
14:38
a simple copy paste literally crashed all opened applications simulatenously
Avatar
Avatar
c0d3d3v
I have never build a good undo manager, but I would think if every possible action in the editor has a corresponding inverse action, you could just put the actions on a stack and revert them on a undo command one by one.
I think save full state is easier than create inverse action to recover state
Avatar
Avatar
Chairn
I think i reached a new low with windows
are you using windows as main os or just for gaming / compiling?
Avatar
Avatar
cauldron
are you using windows as main os or just for gaming / compiling?
windows on my pc, linux for work and dev
14:45
i sometimes dev on windows like right now
Avatar
Avatar
Wohoo
I think save full state is easier than create inverse action to recover state
requires mome memory if you have to save few MB every action
Avatar
Avatar
Chairn
windows on my pc, linux for work and dev
aha
Avatar
Avatar
c0d3d3v
I have never build a good undo manager, but I would think if every possible action in the editor has a corresponding inverse action, you could just put the actions on a stack and revert them on a undo command one by one.
I planned on doing that for the web editor although I'm not there yet
14:49
plus multi editor brings a lot of additional pain like concurrent edits
Avatar
Avatar
k2d222
I planned on doing that for the web editor although I'm not there yet
are you writing it from scratch? adding feature after feature
14:50
is it like etherpad if you know it?
Avatar
yea no choice really bc there is a lot of specifics with the way you handle multiple users
Avatar
Avatar
cauldron
is it like etherpad if you know it?
huh no
Avatar
etherpad is multiple user online text editor
Avatar
oh like google docs I went multiple times already to try and understand how they handle undo in case of conflicts
Avatar
Avatar
k2d222
oh like google docs I went multiple times already to try and understand how they handle undo in case of conflicts
yeah but open source i think
Avatar
I'll have a look then thx
Avatar
theres also ethercalc
14:53
and more ethers idk
Avatar
struct and class are identical except for the default visibility. Should we use structs specifically to identify POD types and classes for everything else? Or just use classes for everything? In any case, we agree that struct/class names will use the prefixes S/C. @Chairn in https://github.com/ddnet/ddnet/issues/5337#issuecomment-1146625826 @heinrich5991 in https://github.com/ddnet/ddnet/issues/5297#...
Avatar
Avatar
ReiTW
only retards uses -fr
true story
Avatar
Avatar
Nagi01 {LAN}
true story
Nagi best javascript developer sue
Avatar
js is for kiddos
15:43
real chads use rust
15:43
greenthing
Avatar
@heinrich5991 is there a difference between c++ std::atomic<uint64_t> *m_pTextureMemoryUsage; (edited)
15:44
and c++ std::atomic<uint64_t*> m_pTextureMemoryUsage; (edited)
Avatar
yes
Avatar
which is?
Avatar
one is a pointer of atomic
15:46
the other an atomic ptr
Avatar
thanks...
Avatar
np
15:46
u cannot just change it
Avatar
because i see both in the code, so i wonder if it's intentional
Avatar
where is the 2nd?
Avatar
there c++ std::atomic<ILogger *> m_pLogger;
Avatar
there its probs intendet
Avatar
mostly in the new log code
15:49
i was mostly wondering if i should init std::atomic variables
Avatar
Avatar
ReiTW
only retards uses -fr
only french use -fr
Avatar
Avatar
Swarfey
only french use -fr
I'm french I use -rf
Avatar
im french and i use -rf
Avatar
im german and i use -rf
16:57
ls -alh
Avatar
real pros use GUIs
Avatar
eaglemode nice fs "gui"
17:00
Homepage of Eagle Mode (eaglemode) - a zoomable user interface (ZUI) with file manager, file viewers, audio/video player, games, fractals, and C++ toolkit API.
Avatar
Avatar
Jupstar ✪
real pros use GUIs
heretic !!
Avatar
1505fbe Move/rename variable declarations in map_optimize tool - Robyt3 3003608 Move/rename variable declarations in map_resave tool - Robyt3 de3bb1c Move/rename variable declarations in map_replace_image tool - Robyt3 d984872 Move/rename variable declarations in map_diff tool, add checks - Robyt3 4bc1aee Move/rename variable declarations in map_convert_07 tool - Robyt3 fbfbc78 Move/rename variable declarations in map_extract tool - Robyt3 1f51e6e Fix variable name in dummy_map tool, add storage check - Robyt3 081881e Move variable declaration in dilate tool - Robyt3 e8bd268 Move/rename variable declarations in config_retrieve - Robyt3 8258eff Move/rename variable declarations in config_store - Robyt3 7fa3bb0 Rename variables and use class in config_common.h - Robyt3 fda98a3 Rename variables and use class in crapnet tool - Robyt3 5435932 Merge #5337 - bors[bot]
Avatar
@Ryozuki What about testing this tool with DDnet, to have full dump execution? https://rr-project.org/ It's on HN front page. I've never tested it, it should probably dump network packets too, since it is mainly used with Firefox. Reverse execution feels like magic to me
Avatar
Those are projects are very cool, but slow down execution by a lot
21:50
So it's something you can use in your central tests sometimes to try and catch hard to reproduce bugs
22:50
455b17e Update prediction to use new input handling - trml b554039 Merge #5320 - bors[bot]
Exported 102 message(s)