Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411279 Posts in 69323 Topics- by 58380 Members - Latest Member: bob1029

March 28, 2024, 04:16:02 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Writing your own code...
Pages: 1 [2] 3 4
Print
Author Topic: Writing your own code...  (Read 3625 times)
ubik
Level 0
***


View Profile
« Reply #20 on: October 22, 2014, 04:11:47 AM »

Quote
I think your view of games programming is too narrow.
My view is that it requires time and effort to do anything worthwhile.  I don't feel that throwaway endeavors have much value except in cases of extreme outliers.  Angry Birds was the product of many years of effort by the guy who made it in the form of fiftyish other games previously.  Flappy Bird was pure luck and very possibly chicanery of some sort.


Quote
I think the problem is that you're thinking like a programmer who is looking for inventive programming in games.
I'm thinking like someone who is interested in craftsmanship and the value of knowing one's tools and one's field of endeavor very well.

You obviously don't agree.  Something tells me armedpatriots is going to understand what I'm saying.

Quote
Again: small, simplistic or limited in scope doesn't have to be a bad thing, like, at all.

Small, simplistic or limited in scope just has to be small, simplistic or limited in scope.  QED.

And yes you can write a choose-your-own-adventure game with anime template art about the travails of bipolar feminists.  That's great, go do that.
Logged
Dacke
Level 10
*****



View Profile
« Reply #21 on: October 22, 2014, 04:21:12 AM »

And yes you can write a choose-your-own-adventure game with anime template art about the travails of bipolar feminists.  That's great, go do that.

Aah, now I get it. You're that guy. Well, I hope you leave or get banned asap.
Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
ubik
Level 0
***


View Profile
« Reply #22 on: October 22, 2014, 04:24:26 AM »

Quote
Aah, now I get it. You're that guy. Well, I hope you leave or get banned asap.

Which guy's that?  Did I step on an issue?

I'm "that guy" who values craftsmanship over throwaway pablum and apparently it's a sore spot for you.  You aren't the only one, it's a sore spot for a lot of people.  If you want to do something well, you study it.  If you don't do the hard work, you'll be competing with all the other coffeeshop baristas and that's just a sad fact of life.
« Last Edit: October 22, 2014, 04:38:34 AM by ubik » Logged
s0
o
Level 10
*****


eurovision winner 2014


View Profile
« Reply #23 on: October 22, 2014, 05:12:09 AM »

i have 0 interest in programming beyond game development and have always just picked up the skills i needed as i went along. ive been doing fine with that.

ive been using game maker for several years now (i also know a bit of c++). my current game is a roguelike and the inventory system is just a bunch of nested arrays, nothing i would call "advanced" or particularly complicated.
« Last Edit: October 22, 2014, 05:32:59 AM by C.A. Silbereisen » Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #24 on: October 22, 2014, 05:30:28 AM »

i don't think i ever copied code, even when first learning. programming is a language. copying large stretches of code is basically like trying to learn to read and write english by copying large sections of novels other people wrote rather than learning to speak your own sentences

that said you don't need to master programming to make good games. but you do need to know how to program, not just how to copy and paste code. if you try to create a game by copying and pasting code from tutorials and examples and modifying it, you won't be able to finish a game at all, it'll actually be *harder* that way than writing code yourself

i mean, try to imagine writing a novel by copying and pasting sentences and paragraphs from other novels and from how to write exercises. do you really think that'd work? it'd create a monstrosity, not a novel. it'd also be about 1000x harder to write a decent novel that way than the normal way, even though it may seem like it'd save you time

if you think of what you are doing as harder rather than easier, maybe it'd reduce some of the fear of just coding stuff yourself? i dunno, as i said i never had this problem, so i'm just guessing about how to fix it. but it's definitely a problem that will stand in your way, a habit worth getting rid of as soon as possible

note that i'm not against copying code for specialized functions of course -- e.g. if you want to copy someone's self-contained code to find out if two triangles intersect, that's fine, because maybe writing that yourself isn't easy for everyone, it's specialized knowledge. but trying to copy very major parts of code for your game, like 'how to code character movement' or 'how to code changing weapons' or 'how to code using items' and then copy some 'how to code jumping' code from somewhere else and then some 'how to code a title screen' code from somewhere else, rather than coding that stuff yourself, will lead to problems
« Last Edit: October 22, 2014, 05:40:00 AM by ஒழுக்கின்மை » Logged

Dacke
Level 10
*****



View Profile
« Reply #25 on: October 22, 2014, 05:33:58 AM »

Did I step on an issue?

Yes. I have an issue with people that think "travails of bipolar feminists" is somehow an insult. I have an issue with people who think that games that focus on story telling or art are somehow less worthy. I have an issue with people who start flinging insults when someone disagree with them. You're that guy.
Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
Dacke
Level 10
*****



View Profile
« Reply #26 on: October 22, 2014, 05:40:09 AM »

copying large stretches of code is basically like trying to learn to read and write english by copying large sections of novels other people wrote rather than learning to speak your own sentences

I don't think this is true. Copying and modifying code is a common way to learn how to code (I still use it when learning a new library/language!). It teaches you how to read the language, how good code is written (in that language) and how changes affects it.

Using your analogy: before you write your own stories, you learn how to read. When you're learning a new alphabet or language, you often copy and modify sentences others have written.

Obviously you need to move beyond that at some point. But it really isn't a bad staring point:
http://learnpythonthehardway.org/book/
http://en.wikipedia.org/wiki/Type-in_program
https://en.wikipedia.org/wiki/Modding
Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #27 on: October 22, 2014, 05:43:34 AM »

i'm unsure why you'd group modding with copying code? modding is nothing at all like copying code; i've modded tons of games and never had to copy code to mod

in any case i disagree that it teaches someone how to write "good" code, or even that such a thing as "good" code exists. the purpose of programming isn't to write "good" code, it's to code stuff that works. if code is bad, but works, that's more than sufficient (in fact it may be preferable to code that is good and works, even, because it's more individual and interesting). i think the obsession with good code is a major problem in programming
Logged

Netsu
Level 10
*****


proficient at just chillin'


View Profile WWW
« Reply #28 on: October 22, 2014, 05:48:28 AM »

Did I step on an issue?

Yes. I have an issue with people that think "travails of bipolar feminists" is somehow an insult. I have an issue with people who think that games that focus on story telling or art are somehow less worthy. I have an issue with people who start flinging insults when someone disagree with them. You're that guy.

The only person I see around here who thinks it's an insult is you.

But more on topic, you can do pretty complicated games without having specialised programming knowledge nowadays. I'm using Unity and the only time when I really need computer science knowledge is when I'm writing AI. It helps in other apsects too, but it's not really neccessary.

Programming good games (even the very mechanics-heavy ones) is more about the subjective things like good feedback than really technical stuff like asset management and shaders.
Logged

Layl
Level 3
***

professional jerkface


View Profile WWW
« Reply #29 on: October 22, 2014, 05:53:37 AM »

if code is bad, but works, that's more than sufficient

I highly disagree with this. Bad code will keep you from writing your code in the future. If it's not maintainable it will cost you time in the long run. That said, there's a certain point where code will be "good enough" though I personally find it enjoyable to look for "even better" even if I don't have time to implement it.

The only person I see around here who thinks it's an insult is you.

I respectfully agree with that dismissing depression quest like that was uncalled for and rude, no matter the actual quality of the game.
Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #30 on: October 22, 2014, 06:02:14 AM »

i think code should be maintainable. but that isn't the same as what people mean when they say "good code". when they say good code they tend to mean particular formatting, a particular style of indentation and brackets, a particular style of commenting, particular name conventions, and so on. that is the stuff that i feel is unnecessary. of course code should be maintainable. but code can be maintainable without being good

basically, as long as someone's code is consistent, and they can read it 10 years later and still understand it, it doesn't matter whether it's good code or not

(i should note however that maintainable code isn't as important to indie game developers as to other types of programmers, because the chance of going back and actually using code you wrote 10 years ago is much lower for someone who writes game jam games or small games than it is for someone in the AAA industry or someone who writes operating systems; especially because indie game devs tend to shift between languages and engines regularly. for indies and hobbyists, maintainability is nice, but not essential)
Logged

Dacke
Level 10
*****



View Profile
« Reply #31 on: October 22, 2014, 06:06:13 AM »

i'm unsure why you'd group modding with copying code? modding is nothing at all like copying code; i've modded tons of games and never had to copy code to mod

in any case i disagree that it teaches someone how to write "good" code, or even that such a thing as "good" code exists

Most of my modding experience has been with modifying existing games, either by copying the source and modifying it or messing with existing resources and config files Shrug

I'm not saying that "good code" is a necessity for games. But if you read/modify other's code you'll learn how to structure your code in a reasonable way (functions, classes, files, modules). When I started programming I wrote everything in a single file and stored everything as global variables. Obviously I ended up with an incomprehensible mess pretty quickly.


when they say good code they tend to mean particular formatting, a particular style of indentation and brackets, a particular style of commenting, particular name conventions, and so on.

Ah, no, that's not what I was talking about at all.
Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
Layl
Level 3
***

professional jerkface


View Profile WWW
« Reply #32 on: October 22, 2014, 06:08:52 AM »

Formatting, style, naming conventions, indentation and brackets are in my opinion the absolute basics a code base has to establish, but only because it's easy to do. It doesn't take much effort and gives you more consistent (and often more readable) code. I don't however see how this in any way can define how good code is.

How good code is, is in my opinion defined by how maintainable it is, how well it handles problems and how flexible it is where it's used. This is indeed more important than naming conventions and style, but it's also a lot harder to do.
Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #33 on: October 22, 2014, 06:12:32 AM »

Formatting, style, naming conventions, indentation and brackets are in my opinion the absolute basics a code base has to establish, but only because it's easy to do. It doesn't take much effort and gives you more consistent (and often more readable) code. I don't however see how this in any way can define how good code is.

How good code is, is in my opinion defined by how maintainable it is, how well it handles problems and how flexible it is where it's used. This is indeed more important than naming conventions and style, but it's also a lot harder to do.

i agree with the second of those, but strongly disagree with the first. conventions are exactly that: conventional. code that doesn't use common conventions is superior, not inferior, to code that does. i wish my code were less conventional than it is, i do some unconventional stuff but unfortunately i've been poisoned by convention over the years; i have the highest respect for code that is unconventionally written and still is good code
Logged

ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #34 on: October 22, 2014, 06:16:00 AM »

to illustrate what i mean, look at cactus's code sometime -- i'm not sure it's publicly available, but i've seen some of it in bits and pieces (mr. podunkian has worked with him and he sent me some snippets to look at) and it's amazingly good despite being totally unconventionally written

i'm sure there are more available examples too, though i can't think of any offhand; if i come across or recall some i'll try to link them in this thread

(as an aside it seems totally hypocritical to me that programmers are often like "coding is a form of art!" and then they tend to hate any deviance from coding standards and conventions, any type of individuality or idiosyncrasy in coding styles)
Logged

Netsu
Level 10
*****


proficient at just chillin'


View Profile WWW
« Reply #35 on: October 22, 2014, 06:20:02 AM »

I respectfully agree with that dismissing depression quest like that was uncalled for and rude, no matter the actual quality of the game.

I'm not gonna try to explain what he mean for him, cos I don't actually know, but this is not how I interpreted it.

I'm not saying that "good code" is a necessity for games. But if you read/modify other's code you'll learn how to structure your code in a reasonable way (functions, classes, files, modules). When I started programming I wrote everything in a single file and stored everything as global variables. Obviously I ended up with an incomprehensible mess pretty quickly.

That's definitely the case when you want to program in C++ or make your games from scratch. But with tools like Unity and Game Maker you could probably get away with writing whatever in those scripts, your code usually ends up being well divided into scripts by the very nature of the tool and even if individual scripts are a terrible mess, they aren't really that long.

This is where I see the difference between 'programmers' and people who just make games. You don't have to be a programmer, with a professional level of knowledge and skill, to make games. And you can make much, much more complicated stuff than interactive novels without deeper technical knowledge.

i agree with the second of those, but strongly disagree with the first. conventions are exactly that: conventional. code that doesn't use common conventions is superior, not inferior, to code that does. i wish my code were less conventional than it is, i do some unconventional stuff but unfortunately i've been poisoned by convention over the years; i have the highest respect for code that is unconventionally written and still is good code

The purpose of convention is collaboration. If you work alone and only alone you can write however you see fit. But when you are a member of a bigger team, and worse yet, that team can change at any time, you have to use certain conventions or you (and others) will lose a lot of time reading code that is written differently than you are used to.
Logged

Layl
Level 3
***

professional jerkface


View Profile WWW
« Reply #36 on: October 22, 2014, 06:21:00 AM »

If the conventions that are set make your code worse, they're bad conventions. Conventions are set to improve the overall quality of code. Things such as using "_name" for a member variable instead of "name" so you can clearly see the difference.

Of course, there are situations where you need to break conventions for good reasons. As an example of this, C# has the "unsafe" keyword, which you can use to break a bunch of conventions C# enforces in the compiler. To me it just generally feels like it makes your code better to use that as a last resort rather than business as usual. If you feel like consistently you can get better results out of your code if you break conventions, change the conventions.

As for the "coding is a form of art!" argument, painters use brushes for a reason, but know when to get better results out of their paint without one.
Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #37 on: October 22, 2014, 06:27:28 AM »

i think the above post is an example of how convention poisons minds; it just repeats what is taught in programming classes without any kind of argument or even any type of rationalization. statements like "If the conventions that are set make your code worse, they're bad conventions. Conventions are set to improve the overall quality of code." just remind me of 1984's type of thinking, it's very orwellian. it's basically the equivalent of saying "conventions are good because they make code good. good code is code that uses conventions". recursive code can be elegant but circular logic usually isn't
Logged

Netsu
Level 10
*****


proficient at just chillin'


View Profile WWW
« Reply #38 on: October 22, 2014, 06:28:55 AM »

to illustrate what i mean, look at cactus's code sometime -- i'm not sure it's publicly available, but i've seen some of it in bits and pieces (mr. podunkian has worked with him and he sent me some snippets to look at) and it's amazingly good despite being totally unconventionally written

I'd love to see it if it's available anywhere. I'm not even sure what 'totally unconventionally' looks like.
Logged

s0
o
Level 10
*****


eurovision winner 2014


View Profile
« Reply #39 on: October 22, 2014, 06:32:03 AM »

i never copied and modified any code and as a result have huge problems reading other people's code. i literally made up my own level generation algorithm for my roguelike because i didnt understand any of the tutorials i found. so there's that.
« Last Edit: October 22, 2014, 06:42:06 AM by C.A. Silbereisen » Logged
Pages: 1 [2] 3 4
Print
Jump to:  

Theme orange-lt created by panic