[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Why do games always have code like this? Pictured: Terraria

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 36
Thread images: 9

File: unknown.png (90KB, 607x945px) Image search: [Google]
unknown.png
90KB, 607x945px
Why do games always have code like this?

Pictured: Terraria

Related: Yandere Sim
>>
>>60647352
Because indie game dev is 90% design and 10% software dev
>>
>>60647352
What? No comments?
>>
>>60647368
This is wrong.
>>
>>60647352
Because games have a lot of menus and selection?
>>
>>60647380
There are no comments because it's decompiled code
https://github.com/csnxs/Terraria
>>
>>60647352
>why is decompiled code repetitive and have little high-level structure?
>>
File: gyubzyq87xmx.png (149KB, 828x801px) Image search: [Google]
gyubzyq87xmx.png
149KB, 828x801px
>>60647352
>Yandere Sim

This is not decompiled code, by the way
>>
>>60647463
Show me any decompiled code that looks good.

Oh wait, you can't, because that's asking for the impossible. Decompiled code is the pile of shit that is left after a steak.
>>
>>60647463
>stringly typed code
>>
>>60647463
how would you do better? make a switch statement?
>>
>>60647637
>This is not decompiled code
>>
>>60647697
Use enum classes.
>>
>>60647697
Enumerated types would be a start.
>>
>>60647884

In fact an enumerated type and a matching string value for the .gameovercause would reduce it to a single expression
>>
File: file.png (200KB, 1019x591px) Image search: [Google]
file.png
200KB, 1019x591px
even firefox code is cryptic as fuck. no wonder mozilla can't make anything except chrome clones
>>
File: 1462999472236.png (66KB, 597x255px) Image search: [Google]
1462999472236.png
66KB, 597x255px
>>60647352
> not using } else if {

That is shitty-ass code. Pic related is how proper programmers handle braces
>>
>>60647697
Not just enums as other anons have said, but also putting this shit in text files that get parsed. Then all you have to do is change the text file not refactor that ugly beast. Would also improve the test suite.
>>
File: lowquality.jpg (1KB, 100x100px) Image search: [Google]
lowquality.jpg
1KB, 100x100px
>>60648065
>>
>>60648065
The absolute state of Wintards.
>>
>>60647637
They literally just said that isn't decompiled code.
>>
>>60647697
Enums and switches. Don't listen to that other dumb fuck who thinks that reading in shit from a fucking text file that should be hardcoded is a good idea.
>>
>>60648076
love this
>>
>>60648309
>game data should be hardcoded
WEW LAD
>>
>>60647352
its generated code. You know things like "generate getters and setters/ extract interface/...." exists in modern ide's?
This code is most likely generated by a tool for game development.
>>
File: 1495500122895.png (178KB, 800x800px) Image search: [Google]
1495500122895.png
178KB, 800x800px
>>60647637
>>
>>60647463
Jesus fuck, it tests weapon, blood and weapon and blood. What a piece of shit.
>>
>>60648309
>switches
>>
>>60647463
Kidding aside, that (float)6 is also disturbing.
>>
>>60647368
More like a lot of indie devs have no idea how to code, they get into it because they want to make games and learn enough to scrape

t. indie dev
>>
File: file.png (16KB, 913x160px) Image search: [Google]
file.png
16KB, 913x160px
>>60647847
>>
>>60648555

It still doesn't justify a massive pile of string comparisons.
>>
>>60648555
They posted code from Yandere Sim, not Terraria.
>>
>>60648555
How dense are you?
>>
>>60647368

l m a o

I bet you draw anime and want to be a gayme designer
>>
>>60647352

that could be an unrolled loop

>>60648555

yeah that's probably an unrolled loop

fix it and make a pull request
Thread posts: 36
Thread images: 9


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.