Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3

Author Topic: Planning to code my own game, looking for advice/help  (Read 3005 times)

BoboJack

  • Bay Watcher
    • View Profile
Re: Planning to code my own game, looking for advice/help
« Reply #15 on: February 05, 2013, 08:11:08 am »

Doublepost, sry.
« Last Edit: February 05, 2013, 08:48:43 am by BoboJack »
Logged

Urist_McArathos

  • Bay Watcher
  • Nobody enjoys a good laugh more than I do.
    • View Profile
Re: Planning to code my own game, looking for advice/help
« Reply #16 on: February 06, 2013, 08:43:43 pm »

Thanks for the tip about the Invent With Python books; I have to say, it really is surprisingly easy to pick up.

I still think I want to learn C#, if nothing else to familiarize myself with a more traditional code and for versatility (I know there are things that C#, as a C language, can do that Python can't, or at least in some cases a workaround).  Plus, the link to Unity earlier looked promising, and very interesting.
Logged
Current Community/Story Projects:
On the Nature of Dwarves

Anvilfolk

  • Bay Watcher
  • Love! <3
    • View Profile
    • Portuguese blacksmithing forum!
Re: Planning to code my own game, looking for advice/help
« Reply #17 on: February 08, 2013, 06:12:26 am »

Urist, all of these languages are Turing-complete, which is to say that you can write an algorithm for every thing that is "computable". In other words - anything you can write in one you can write in another. It will look different, and often might be organised differently, but there's nothing you can do in one you can't do in another. I'm still going to claim learning and programming is going to be faster in a higher-level language :)

Moreover, they're both imperative programming languages, which makes them even more similar. I'm all for learning C# or Java or whatever, but if you are learning to program I'd highly suggest sticking with Python for now, and go for another language when and if if you hit performance issues. Like someone else said though, performance issues are most often due to lack of programmer knowledge, rather than what language he is using.

Good luck!

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Planning to code my own game, looking for advice/help
« Reply #18 on: February 08, 2013, 08:00:59 am »

Learning is both easier and faster in a high level language.

And what one language can do, any other language can do. Of course, it's a matter of how fast, how easily, and how much you even need it to do one particular thing. :D

* Skyrunner seconds Anvilfolk
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Anvilfolk

  • Bay Watcher
  • Love! <3
    • View Profile
    • Portuguese blacksmithing forum!
Re: Planning to code my own game, looking for advice/help
« Reply #19 on: February 08, 2013, 08:38:09 am »

* Skyrunner seconds Anvilfolk

* Anvilfolk gasps!
:o

Well, I guess it's only right for me to say that if further down the line you find you really like programming; that you want to understand what is happening, how a computer works, and how to get the very best performance out of computation heavy applications, you should go for C++!

 ;)

Urist_McArathos

  • Bay Watcher
  • Nobody enjoys a good laugh more than I do.
    • View Profile
Re: Planning to code my own game, looking for advice/help
« Reply #20 on: February 09, 2013, 12:41:05 pm »

So, I've decided to go with Python 3.2 for now, and it's going really well.

I'll rename and edit the first post soon, once I've figured out more of the basics and can start a solid plan for my game's development, then this thread can be used for updates and discussion.  Thanks again to everyone for their advice and replies!

EDIT: So far, the hardest part is getting my fingers used to an entirely different kind of typing.  I've been writing long enough that I can write sentences and such without glancing away from the screen, but all the brackets, quotes, and different times to shift is completely screwing up my rhythm.  It feels like this is going to take forever to get fast at.
« Last Edit: February 11, 2013, 01:35:37 am by Urist_McArathos »
Logged
Current Community/Story Projects:
On the Nature of Dwarves

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: Planning to code my own game, looking for advice/help
« Reply #21 on: February 11, 2013, 12:10:56 pm »

Yeah, it's a very different type of writing.

A good suggestion for helping with that is to be lazy, which when done properly makes for better code.

By which I mean:

1) REUSE STUFF! If you can write a function or class that does something basic and can be used in many places, do so. Referencing an existing bit of code is not only faster and easier than writing the same bit of code many times, it also cuts down on the bugs you can introduce.

2) Copy and paste: The more you actually type the more little bugs you'll introduce. It's pretty good practice to copy and paste things rather than retype them too often. A good IDE can limit the errors you can make typing, but even there a pasted variable name is more reliable than typing it out every time.

And two non-lazy tidbits that help a lot:

1) Use long, descriptive variable names. CityName is infinitely easier to figure out later on than cn when you go back to debug your code.

2) Comment your code! This should be pretty quick, since you're already good at writing sentences, and code is rather hard to figure out later on. Even a few weeks away from looking at a particular bit of code can leave you wondering why you made various decisions, so it's a good idea to comment everything you are doing so it's easy for you to go back and fix, edit, upgrade, whatever a bit of code some time down the line.

Good luck!
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

inEQUALITY

  • Bay Watcher
  • Living On the Mirror's Edge
    • View Profile
Re: Planning to code my own game, looking for advice/help
« Reply #22 on: February 11, 2013, 02:11:25 pm »

I second/third/whatever python; I went into it knowing nothing but HTML, followed a tutorial, re-followed the tutorial picking up on things and even doing things my own way along the way, and am now about to do my own - if small - coding project for a lightweight game.

It just takes time and effort to learn a language. Read tutorials, don't be afraid to use some libraries to make your life easier (for instance, for roguelikes, libtcod is an amazingly potent little library) once you have your basics down, and most of all; don't expect too much out of your first forays into programming.
Logged
Quote from: Carl Sagan
It does no harm to the romance of the sunset to know a little bit about it.
If the magma cannon doesn't count, they aren't proper scientists.

Urist_McArathos

  • Bay Watcher
  • Nobody enjoys a good laugh more than I do.
    • View Profile
Re: Planning to code my own game, looking for advice/help
« Reply #23 on: February 11, 2013, 03:30:04 pm »

I'm curious about that, actually.  I haven't looked yet into libraries, but I've heard of them for programming languages.  What do libraries do, and where can I learn more about ones meant for different kinds of games?
Logged
Current Community/Story Projects:
On the Nature of Dwarves

inEQUALITY

  • Bay Watcher
  • Living On the Mirror's Edge
    • View Profile
Re: Planning to code my own game, looking for advice/help
« Reply #24 on: February 12, 2013, 11:44:00 am »

Someone more knowledgeable than me could probably explain better - I'm relatively new to 'real' programming myself - but from what I understand through use, libraries essentially give you access to methods/functions/etc. that just plain make things easier to code. In some cases not just easier, but in far, far less time.

For instance, libtcod is a specialized library for roguelikes available for both python and C/C++. It makes it easy to check for keypresses and mouse input, it has a built in pseudo-random number generator, and so on. It's not going to do all your work for you, however. You still have to utilize the features properly, and you still have to know how to code in your language of choice. And even though it was made for roguelikes in particular, a lot of its features could be used in other projects as well.

Libraries aren't always specifically tailored for any specific type of game, or even games in general, but just have features that are useful for coding. I'm really not sure where to find any, but I do know to be mindful as to what sort of licensing the library is available under. I personally found libtcod through a tutorial that used it.

Sorry if I'm not too much help.  :P
Logged
Quote from: Carl Sagan
It does no harm to the romance of the sunset to know a little bit about it.
If the magma cannon doesn't count, they aren't proper scientists.

Anvilfolk

  • Bay Watcher
  • Love! <3
    • View Profile
    • Portuguese blacksmithing forum!
Re: Planning to code my own game, looking for advice/help
« Reply #25 on: February 12, 2013, 04:00:16 pm »

Yeah, libraries are just functions/classes/whatevers useful for a certain purpose that are put in a single package. You've got libraries for game programming, for just graphics/visuals, for scientific computation, for ordering algorithms, database access, GUIs, and tons of other things. It's all done by someone else, so you don't actually see the code. Just a nice interface to use. This makes things a lot more modular!

Vanilla python (with no libraries/addons), for instance does not allow you to do graphics applications. If you want to make a game, you can, for instance, download the PyGame library, imort it, and start making games :)

Urist_McArathos

  • Bay Watcher
  • Nobody enjoys a good laugh more than I do.
    • View Profile
Re: Planning to code my own game, looking for advice/help
« Reply #26 on: February 12, 2013, 04:07:55 pm »

Just finished a nice tutorial on PyGame, actually.  I'm finishing up a features list for now, then I'll move on to a basic outline of what the code will need to be, then I'll get to it.  After I get the features list finished I should have enough of an outline to change my first post and thread title over to one for a game development thread instead of a advice one.
Logged
Current Community/Story Projects:
On the Nature of Dwarves

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: Planning to code my own game, looking for advice/help
« Reply #27 on: February 12, 2013, 04:14:40 pm »

Since this is your first foray into programming, I strongly suggest that you make your first game nice and simple. Keep your set of required features pretty minimal. You can always go back in and add stuff later if you want, but going for a large feature set is probably just going to get you bogged down.

The normal rule for programming is that your first few programs are garbage (mine certainly were), and you'll usually find after you finish it that there are much better ways of doing a lot of it. So you grab the good stuff out, take what you've learned, and move over to a Version 2 that can then be a good bit bigger.

The Toady One method of getting things 'good enough for now' and moving on to the next set of things that makes the game more fun to play is also pretty good. You get better at programming before you tackle anything too hard, and by the time you circle back around to an area you've got a better idea of what you want to do and how to do it.
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

Urist_McArathos

  • Bay Watcher
  • Nobody enjoys a good laugh more than I do.
    • View Profile
Re: Planning to code my own game, looking for advice/help
« Reply #28 on: February 12, 2013, 04:31:55 pm »

Right now the Toady method is how I'm planning to go, but I'm currently playing with functions and code from tutorials to get a better idea of how to make what I have in mind happen.  I figure I'll aim high and build in pieces, but I'll end up doing a number of small throwaway programs and such to figure out each concept as I come to it before using what I've learned to make a "final" piece for the game itself.
Logged
Current Community/Story Projects:
On the Nature of Dwarves

lemmily

  • Bay Watcher
    • View Profile
    • BatFinchBears
Re: Planning to code my own game, looking for advice/help
« Reply #29 on: February 12, 2013, 07:10:55 pm »

I'll end up doing a number of small throwaway programs and such to figure out each concept

This.

And also once you're past "complete noob" stage it's still fairly useful (I'm probably now at "beginner" ha.) - I have my main project and then (at the moment) two side projects that are testing grounds. One for the map stuff and the other is going to be my economy stuff. I work out most of the main functionality issues separately without having to try and incorporate it into the big project. Helps a lot for me :)
Logged
I make furry things - BatFinch Bears
Pages: 1 [2] 3