[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
▼ Settings Mobile Home
/v/ - Video Games

Name
Spoiler?[]
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File[]
  • Please read the Rules and FAQ before posting.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: flicker.png (6 KB, 542x158)
6 KB PNG
> a lighting trick from John Carmack's Quake is still used in Half-Life: Alyx, over 25 years later
> a simple string of letters controls how lights flicker, with each character representing a brightness level
In the 90s programmers knew how to code. Nowadays, it's unoptimized AI slop written by jeets.
>>
File: ai_shills.jpg (197 KB, 860x1122)
197 KB JPG
White men know how to code. AI shills are indians
>>
>>751687761
What gay ass language is this?
>>
>>751688001
C++ though Quake was written in C
>>
>>751687761
>const char *flicker = https://www.youtube.com/watch?v=32Hp1LW08Yc
>>
File: 1776327207647900.jpg (55 KB, 1280x720)
55 KB JPG
MMAMAMMMMAMMAMAMAAAMAMMMA
>>
>>751688126
Quake 2 was written in C++
So is legacy quake 2 code
>>
File: 1774653329951488.png (35 KB, 303x692)
35 KB PNG
>>751688425
>Quake 2 was written in C++
No? I think it wasn't until DOOM 3 was when the engine started using C++.
Valve's Goldsource, Source, and Source 2 were all written in C++ though.
>>
>>751687761
>carmack wouldn't use % but power of 2 &
>carmack wouldn't use strlen but sizeof for constant length data
the code looks like dogshit i wonder if it's even from carmack at all
>>
>>751687761
why is it a string thou, this seems really unefficient
literally wasting bytes of ram there
>>
kinda funny that he was working on meta quest shit competing with alyx
>>
>>751688425
Up until Quake 3 was written in C

Doom 3 was the first use of C++
>>
>>751687761
>In the 90s programmers knew how to code.
I might be missing something, but isn't this about as basic as it gets pretty much? It's just iterating over an array/pointer/whatever and doing a basic if statement?
Like this is the stuff you learn 10 minutes into a youtube tutorial.
>>
>>751687761
post the original code and not an LLM's impression of it
>>
>>751687792
Proof that Americans aren't white.
>>
>>751688748
From what I understand, alot of people just randomly attribute stuff to Carmack. Like everyone says fast invert square root was Carmack, but it was something that he picked up from someone else. Basically if there was any code magic in an ID game, everyone just assumes Carmack did it.
>>
>>751689107
https://en.wikipedia.org/wiki/Elegance
>>
>>751689107
40 years ago a lot of things were new ground and fresh methods to solve an unsolved problem.

Besides, anyone talking about modern code and programmers as if its better or more correct is mentally retarded.
We have 800MB "apps" that take 100x the CPU requirements to do the same thing as a text messenger from 1998. And they run worse and slower despite having 100x the CPU and resources.
>>
>>751689471
someone post the meme and github page.
>>
>>751687761
If it ain't broke, don't fix it.
>>
>>751689349
Yup.
>everyone keeps talking about Carmack's light
what about Carmack's shadow? https://en.wikipedia.org/wiki/Shadow_volume
>>
>>751688001
do they really not even teach kids C++ anymore?
>>
>>751690114
there's nothing about it that makes it C++ it's just C
>"just" C muh muh muh what about C80 C89 C99 C11 C17 C23 MUH MUH DICK
>>
you retards are hopeless
>>
>>751690380
LOL code in OP is even wrong it doesn't shimmer at all
>>
>>751687792
India is number 1. Top American CEOs? All Indians. Wealthiest Americans? All Indians. Apologize.
>>
>>751688927
Maybe it was written with C in mind and the bit size was the same? Not a compsci guy.
>>
>>751688927
>literally wasting bytes of ram there
How many flicker patterns do you intend to have where that would even be an issue?
>>
>>751687761
Don't fix it if it ain't broken.
>>
>>751687761
>In the 90s programmers knew how to code. Nowadays, it's unoptimized AI slop written by jeets.
>null-terminated string
>strlen
>bytes when you mean bits
That code is already slop.
>>
>>751690843
>fell for it
good goy yes believe everything you see and are told
>>
>>751690380
I fell for fake a OP again
>>
Weird how carmack is an indian loving AI tranny now though.
But I guess you didn't know that one did you
>>
>>751687761
>using strlen to go over the entire string every time looking for a null terminator to find its length (no, MSVC doesn't optimize it)
>instead of saving its length or, God forbid, using std::string like a sane person
quality Valve code, no wonder their modern wokeslop barely runs
>>
ooh mamma
>>
File: image.png (48 KB, 699x935)
48 KB PNG
>>751690380
Also
https://github.com/id-Software/Quake/blob/bf4ac424ce754894ac8f1dae6a3981954bc9852d/QW/progs/world.qc#L337
>>
>>751690380
OP code does this with a single hardcoded lightstyle (mmmammamamamammaa)
>>
Let's post some webms/gifs from cool retro games then.
>>
>>751690583
>>751690673
You're both fucking retarded, learn to comprehend a joke when you see it.
>>
File: Unreal Gold Ruins.webm (2.76 MB, 1280x720)
2.76 MB
2.76 MB WEBM
>>
>>751688351
lolled
>>
>>751692047
Couldn't light strobe have just been "ma"?
>>
File: 20221130_020057.mp4 (70 KB, 640x360)
70 KB
70 KB MP4
>>751687761
>>
>>751693928
Maybe there's a noticeable delay when the loop ends before it restarts, so they extend the loop long enough that you should pass by before the reset.
>>
File: 1790475220835501.jpg (27 KB, 491x491)
27 KB JPG
>>751691840
>using the standard library for anything performant
>>
>>751693929

Carmac's code lives on.
>>
>>
>>751687761
c = m? But c isn't m. What is this woke insanity?
>>
>>751694362
retard
>>
>>
>>751687761
MAMA MAMA
MAMA PLEEEAASE
can't you flicker my lights
can't you flicker my lights
can't you flicker my
ah ah ah
>>
>>751694690
OpenGL had trouble with animated textures
>>
>>751693445
NTA lrn2joke first you abysmally unfunny clown
>>
>>751689256
obsessed
>>
>>751693929
neat
>>
>>751687761
Isn't this directly tied to the Hammer editor? IIRC you could manually type in your own flicker options.
>>
File: Hammer.png (79 KB, 913x596)
79 KB PNG
>>751695716
Yeah I thought it looked familiar. I'm not a coder, but would that have anything to do with it being stored as string as others are suggesting?
>>
>>751687792
>Japan devs are 80%+ into AI
>Japan that low
>chatGPT exclusive chart
buy an ad
>>
>>751688236
>>751688351
kek
>>
>>751688126
>>751690114
it would compile under C, so i say it's C

>>751688748
this, the strlen() is particularly egregious here
>>
>>751695878
>>751695716
Yes, Doom/Quake engine used string of letters instead of list of numbers for brightness as a small lifehack for level designers. Entering nmponmpo is easier than 130,129,132,131,130,129,132,131 etc
>>
File: 9.jpg (158 KB, 1170x1631)
158 KB JPG
>>751687761
this is just a cached comparison, except cached against something simple so it looks silly and high iq at the same time
heres another set of examples:
>I flip a coin, if its heads, flip again, if its tails return the number of heads flipped correctly. Technically doesn't even have to be 50/50, can be 99/1
simply rand a float between 0 and 1 with relevant degree of precision, then cache a raw integer array representing that random value but multiplied by 1000 that inside its value contains the resulting amount of heads results. can easily cache for any amount
>an A* pathfinding map that never changes
when you calculate a path from X to Y, remember it. Then absorb the result into any bigger path that contains it (eg X-1, Y+1) and simply count the steps from X-1 to Y, and when asked 'how to get from X to Y' again the answer is 'X-1 to Y+1 but 2 steps earlier'
>basic culling trick
instead of checking all the models for individual models to render, only check the ones the player is guaranteed to see (using their FoV) + 1 large tile extra, because theres always models that are big enough to appear on a tile next to them if placed on the edge as to avoid pop in
>>
File: halo-unreal-engine-5.png (1.61 MB, 1200x1200)
1.61 MB PNG
That's because you had to actually figure out how to do shit back then because this shit was an entirely new medium and technology. You read about the shit Miyamoto wanted to do in SMB1, on a fucking Famicom/NES, like Mario punching, kicking, using a gun, riding a dinosaur, etc. Even ignoring how many buttons are on a NES controller they had to tell him to chill out. Eventually he got his wish with Yoshi in SMW and Mario having a more expanded moveset in Super Mario 64.
Carmack being able to replicate Mario's scrolling levels on a PC was a feat of engineering in 1990 compared to how stiff PC platformers often was compared to arcades/consoles, and laid the groundwork for the FPS genre.

20-30 years ago I was making shit in RPG Maker and Half-Life 1/2 mods and that was pretty streamlined and straightforward for the day, enough to make simple stuff and rudimentary programming systems if you wanted to go really off the wall. These days there is so much that is pre-made for you. That's why Halo Studios' last hail mary involved a switch to Unreal engine, and now you got Xbox's boss soft launching an AI slop initiative. They were so dependent on contractors instead of attempting to build and retain a team with institutional and technical knowledge that they just went with the shit every amateur and design school teaches people on. The shareholder appeasing strategy of making shit and firing people after the game ships has finally caught up to a lot of devs leading to these bloated development times and paint-by-numbers programming entirely dependent on the Unreal cartel.
>>
>>751697167
completely clueless. sad to see.
>>
>>751698701
1 and 3 are real application, 1 especially if its not a 50/50 and the 3rd trick is used everywhere. instead of iterating over every object, calculating if its in the right tile then doing stuff if it is, instead you have a cache of units per tile and then iterate through the tiles. literally every culling and pathfinding algo relies on that
>>
>>751687792
Show per capita, micropenis Timmy
SHOW. PER. CAPITA.
>>
>>751698701
2 is only useful in a niche case where the
>map is big
>uses A*
>the map pathability is never modified
which isnt something that happens in games but is/was used by Google maps
>>
>>751698885
>>751699347
yeah you've heard of those algorithms and understood nothing about them. sad. and flickering lights have nothing to do whatsoever with anything you said. very very sad. my advice: stick to vibecoding
>>
>>751699859
>yeah you've heard of those algorithms and understood nothing about them
Not true, I wrote them in my own stuff before I found them online by googling later. Just be creative 4head
>>
THE MAMA THE MAMMA THE MMMAMA
>>
>>751687761
Uh... Why not an array of 0 or 100s? What is the point of the m a branch?
>>
>>751689107
if you tried to shove this into an "enterprise" code base today you'd be knocked down at the review step.
"Using a string for this is pretty hard to grok"
You'd be forced to make some kind of LightController class, and then some unique type to represent the flicker, and probably a few other random points of abstraction.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.