Jump to content

New To Programming


David_J_Rogers
 Share

Recommended Posts

Hello Guys,

I emailed the developers of this game a while ago. My name is David James Rogers. I am 19 years old and I am currently majoring in Game and Simulation Programming at DeVry University in Long Beach, California. I want to help out since I am going to be a programmer myself in the near future.

Concerning my knowledge of programming, I know little to nothing about writing code in C++ and Java. I just started going to College in September soon after I graduated High School and my first GSP class only used Game Maker Pro - which if other programmers know, is not exactly writing code, but takes away the writing of code to make a game.

I wanted to get ahead of my class and go ahead and try to help all of the other programmers here. Again, I do not know much, and I understand if you other programmers don't want to teach me on top of writing the code for this game. But, I am willing to learn and I will work hard once I do learn to do this while also keeping up with my school work.

I will be happy to help however I can. And getting some real experience with programming early on will help me out in the future.

Thanks for reading, and I hope you guys will accept my help. :)

Link to comment
Share on other sites

Anything you see fit to give me I will work my best. I just need to learn to write some code is all. Preferably, I would like to start with basics and move on up.

If there is anything you all can give me to get started as soon as possible, I will get to work on it so I can make some productive contributions soon. :)

Link to comment
Share on other sites

Anything you see fit to give me I will work my best. I just need to learn to write some code is all. Preferably, I would like to start with basics and move on up.

If there is anything you all can give me to get started as soon as possible, I will get to work on it so I can make some productive contributions soon. :)

You might want to consider joining our mod team.

Speak to Niektb or Hephasteon for assistance.

Link to comment
Share on other sites

Basically, learning to program just requires a lot of time. Writing code that doesn't work, and then trying to understand why it doesn't work. Because of that, you need to pick something that really interests you.

When you have chosen a task, you can always ask for help (and you should).

  • Like 1
Link to comment
Share on other sites

To summarize:

- Decide what you do like most, since it is going to cost a lot of effort and time with ups and downs.

You can either decide to come up with something of your own (Random Map Scripts, AI, Gameplay) or pick a task from the trac. http://trac.wildfiregames.com/query?status=assigned&status=new&status=reopened&keywords=~simple&col=id&col=summary&col=status&col=type&col=priority&col=milestone&col=component&report=16&order=priority

- Ask for help when you run into problems or do not fully understand it.

In doing so, you can either decide to place a topic here in which you explain what you are doing and your questions or ask someone directly by sending him a PM.

Some tips:

Make sure you get the source from SVN, since the alpha releases aren't very up-to-date.

For instructions: http://trac.wildfiregames.com/wiki/GettingStartedProgrammers

When writing out ideas think in terms of algorithms. What would be needed to achieve something? Which steps do you have to take? And so on.

Link to comment
Share on other sites

I support the points of my colleagues, especially it takes simply a lot of time and experience to a feel for how programming works just like Sander said.

Once one got used to that, it's really no longer difficult, nevertheless, it might quickly turn into tedious work.

Generally my feeling is that those guys and gals that take over university assistance jobs early and try to follow tutorials in different languages only to get magic projects done, are getting used to programming pretty quickly, especially if they are forced to program to not fail in university too (weekly exercise sheets... :omg:).

So as a quickstart:

  • Start up Linux. The earlier you get used to UNIX-like systems (GNU/Linux, Mac OS, FreeBSD, Android, ..) the better. Because though Windows is powerful too, it's tedious to keep up to a commercial firms plans and changes to improve their funding. A problem UNIX not suffers from. :)
  • STRG+ALT+T to show up the terminal/console (alternatively look for a search field and type term.. and there you go).
  • Then in the terminal type:

    sudo apt-get install git
    If that's not working, search the internet for "install git <you_operating_system>". (<> indicates a placeholder, so there your OS goes without those <> !!) Follow the instructions. Another common usecase for <> is for elements/tags in markup languages like HTML, XML, sure you will hear more about that soon.
  • Back with focus on the terminal, create a directory for 0ad in you home folder (shortcut: ~) and enter this directory using cd <path-to>/<directory>:

    mkdir ~/0ad/ && cd ~/0ad     #this sign begins a shell comment, it's ended automatically at EOL End Of Line, which is denoted as \r\n (\rewind\newline) commonly but you don't have to care for that.
  • Now try to download the git repository: (in the correct folder, . means the current folder we're in: ~/0ad/)

    git clone https://github.com/0ad/0ad
  • Wait for the download to finish, in the meantime search the internet for "JavaScript tutorial" and "javascript syntax reference". It's probably the best language to start with as Java is almost identical and more and more widespread in university teaching.
Once the download has finished successfully:
  • Go to http://trac.wildfiregames.com/wiki/BuildAndDeploymentEnvironment . Type STRG+F , then Linux. Follow the instructions for building on linux (it's only a few commands! it's easy!).
  • If successful, there you go:

    ~/0ad/binaries/system/pyrogenesis    #this will start your custom built 0ad
  • Tip: Whenever you try to figure out a path or command in he terminal use the TABulator key! Type twice to list all possibilities, then pick one by typing the first letters and type TAB again to auto-complete.
  • Once 0AD is started, first be surprised how much more advanced the up to date version is. Start any map, then type ALT+ENTER to switch to windowed mode (to allow to return to the terminal without closing 0ad).
  • In the terminal:

    vi ~/0ad/binaries/data/mods/public/  #type TAB now to see a list of all folders and files
  • Choose the file you wish to edit:

    vi ~/0ad/binaries/data/mods/public/simulation/ai/aegis/aegis.js
  • Look for Line 95. Then type i to enter INSERT mode.
  • Type ENTER once. Then type (not copy or you will never learn programming) in these brilliant lines of the famous Teiresias now:

    if (!this._counter){    this._counter = 1;}this._counter++;// Every 25 time we enter this onUpdate function/mthod we perform a special action:if ((this._counter % 25) == 0){    var myEntities = this.entities.filter(            function (ent/*<-An argument also called parameter.*/) { return ent.isOwn(PlayerID); }    ).toEntityArray();        if (myEntities.length > 0)    {       var sacrifice = API3.PickRandom(myEntities);       this.chat("This time we had to sacrifice " + sacrifice.templateName() + " to keep our gods from sending another famine!");       sacrifice.destroy(); //<-- has to be called after the chat message as we need its template name for the message.     }          /* extend here if you like, you could pick another unit and make it walk around ... read through the aegis files in the directory this file here is in to find out how to do that.  */}/*Or insert here some other code/commands. e.g. if you don't want to perfrom this action every 25th time like the above but each 100th time, then retype the above code and change 25 to 100 .*//* Here starts the original code of the AI.*/
  • Exit INSERT mode now using ESC. (if you have left INSERT MODE you can also undo changes by typing u)
  • To save the additions we inserted, let's save the file. (make sure you are no longer in INSERT mode via ESC).

    Then type the command for writing (colon w):

    :w
    To save and quit you would write:

    :wq
    To quit without saving and hence lose all changes:

    :q!
  • The cool thing with JavaScript is, that it can be changed while 0ad is running. So you see immediately if something breaks. :)

    => Switch to 0AD via ALT+TAB or similar. Look what you've done.

  • I think we can only gain if we really teach the new generation. Although many people forget that

    Never take more than you give.

    Happy learning. :D

Edited by Hephaestion
Link to comment
Share on other sites

I support the points of my colleagues, especially it takes simply a lot of time and experience to a feel for how programming works just like Sander said.

Once one got used to that, it's really no longer difficult, nevertheless, it might quickly turn into tedious work.

Generally my feeling is that those guys and gals that take over university assistance jobs early and try to follow tutorials in different languages only to get magic projects done, are getting used to programming pretty quickly, especially if they are forced to program to not fail in university too (weekly exercise sheets... :omg:).

So as a quickstart:

  • Start up Linux. The earlier you get used to UNIX-like systems (GNU/Linux, Mac OS, FreeBSD, Android, ..) the better. Because though Windows is powerful too, it's tedious to keep up to a commercial firms plans and changes to improve their funding. A problem UNIX not suffers from. :)
  • STRG+ALT+T to show up the terminal/console (alternatively look for a search field and type term.. and there you go).
  • Then in the terminal type:

    sudo apt-get install git
    If that's not working, search the internet for "install git <you_operating_system>". (<> indicates a placeholder, so there your OS goes without those <> !!) Follow the instructions. Another common usecase for <> is for elements/tags in markup languages like HTML, XML, sure you will hear more about that soon.
  • Back with focus on the terminal, create a directory for 0ad in you home folder (shortcut: ~) and enter this directory using cd <path-to>/<directory>:

    mkdir ~/0ad/ && cd ~/0ad     #this sign begins a shell comment, it's ended automatically at EOL End Of Line, which is denoted as \r\n (\rewind\newline) commonly but you don't have to care for that.
  • Now try to download the git repository: (in the correct folder, . means the current folder we're in: ~/0ad/)

    git clone https://github.com/0ad/0ad
  • Wait for the download to finish, in the meantime search the internet for "JavaScript tutorial" and "[url=http://google.com/?q=javascript+syntax+reference]javascript syntax reference". It's probably the best language to start with as Java is almost identical and more and more widespread in university teaching.
Once the download has finished successfully:
  • Go to http://trac.wildfiregames.com/wiki/BuildAndDeploymentEnvironment . Type STRG+F , then Linux. Follow the instructions for building on linux (it's only a few commands! it's easy!).
  • If successful, there you go:

    ~/0ad/binaries/system/pyrogenesis    #this will start your custom built 0ad
  • Tip: Whenever you try to figure out a path or command in he terminal use the TABulator key! Type twice to list all possibilities, then pick one by typing the first letters and type TAB again to auto-complete.
  • Once 0AD is started, first be surprised how much more advanced the up to date version is. Start any map, then type ALT+ENTER to switch to windowed mode (to allow to return to the terminal without closing 0ad).
  • In the terminal:

    vi ~/0ad/binaries/data/mods/public/

This looks good, but only applies to Linux users and for Git purposes, I don't know if the Git transfer is already good enough, better stick with TortoiseSVN for the time being. (And I thought Haskell was fancied in University? Not by students though)

Link to comment
Share on other sites

JavaScript will bite if you haven't learned about data types though. C++ is a good place to start. Unfortunately, I don't think any of the C++ here is suitable for beginners considering you'll most likely need some pointer knowledge.

My recommendation would be to start with C++ or Java or some other reasonably typed language. Begin with simple "hello world" programs. Don't try to just dig into complex code until you understand the basics or you'll just get frustrated. It'll be at least a year or so before you'll be able to really read C++ on a game and a bit longer than that before you will really understand anything. If you can get some basics down, you will probably be able to tackle some simple tasks in our JavaScript in 6 months or so. You are developing a skill; it takes work and time.

Link to comment
Share on other sites

Checkout some intro to programming tutorials. There are many available for free. The programming language used in the tutorials isn't too important - once you learn the basics, you can apply them to nearly all other programming languages that are in the same classification.

Java is a "strongly typed language" that is probably the easiest to start with and provides almost all of the features you would need to learn about in C++ (except for memory management). There should be a lot of introductory tutorials available using Java. There are several IDEs (integrated development environment) available for Java. The Netbeans IDE (it's free) will do a lot of hand-holding to get you through syntax / grammar errors in your code. After you get the basics, you can either start learning JavaScript or go closer to the hardware and learn C++.

By the way, Java and JavaScript are two completely different languages. The reason I don't really recommend JavaScript for new programmers (besides the weak data typing) is that it is such a freeform lanuage that inexperienced programmers can learn to write really badly formed code (ask me how I know, lol). Java will help instil some better design habits. C++ is alright also, but doesn't offer anything over Java for learning the basics and has many more pitfalls. You'll probably need to learn C++ eventually if you really want to do game development, but you won't have the skills to appreciate the advantage C++ has over Java until you are much more experienced anyway.

Link to comment
Share on other sites

Sweet. Will do. I am looking into them right now. I am so excited to learn and help you guys out. I appreciate all the pointers and I will see if I can write some basic code soon and soon hopefully some more advanced code. I don't own a Linux OS, I run Windows 8 on my phone and on my computer. I dont know of that limits me or not as to what I can do with writing code.

  • Like 1
Link to comment
Share on other sites

Windows doesn't limit you in your ability to code, but it does somehow limit you in what apps you can use to code. Like for compiling the game, we only support MS Visual Studio.

And since you need visual studio anyway, you can start with C# too. It's like Java (strongly typed with automated memory management), but this way you'll also get to know the development environment you can use for C++ (and getting to know all sorts of debug tools is important too).

In any case, all languages we mention: C++, C#, Java and JavaScript all have syntax that's based on C syntax. This means that their basic features all look very alike.

int fac = 1;for (int i = 1; i <= n; i++){  fac *= i;}
The example above is a (quite naive) method to calculate the factorial of 'n'. And it will work in all mentioned languages (except in JS, where you have to drop the 'int' types, as JS has no types).
Link to comment
Share on other sites

I agree with the C# recommendation. It's very similar to Java in style and would also be a good starting point. You'd have to use Microsoft Visual Studio for C# as Netbeans doesn't support it. MS Visual Studio is kind of expensive, but if you are a student in a technical program at a university, you can probably get it for free. There is also a limited feature MS Visual Studio Express Edition that is free for anyone. It should still have all the features you would need to get started learning programming.

Link to comment
Share on other sites

Ah, so with my solid foundation in C# and Java, I actually shouldn't have that difficult of a time transitioning into C++. I already knew this to a certain extent, but it is nice to see it reiterated. My main problem is I really need a job and to get my own computer with a proper programming set up in order to effectively contribute, because XP isn't going to cut it for anything other than older games for very much longer.

Link to comment
Share on other sites

The main difference is that C++ makes you clean up after yourself so to speak. If you allocate memory, you must manually free that memory in a destructor (opposite of a constructor). "finally" is the closest thing Java has to it, but that's not per class. Also you have really direct memory access with pointers that Java's reference variables don't allow. (Imagine adding an integer to an object variable and making it point to a different object.)

Link to comment
Share on other sites

And it's free just pick a flavour of your choice with the desk top environment you like yeah that's a choice as well lots of Linux experience here to help you over the first ridges in the learning curve ;) don't worry about all the chaff about spotty hardware support it's actually better than Windoze (you don't have to track down the manufacture's drivers).

Enjoy the Choice :)

Link to comment
Share on other sites

Don't worry about all the chaff about spotty hardware support it's actually better than Windoze (you don't have to track down the manufacture's drivers).

Windows: Intel IA-64, x86.

Linux: Intel IA-64, x86, ARM (mega-widespread, Open standard, almost every smartphone), Analog Devices, Alpha, C6X, ETRAX CRIS, Atmel AVR32, Hexagon, H8, M32R (Misubishi), Microblaze (Xilinx), MIPS, MN103, OpenRISC, Power, IBM, PowerPC, SPARC, SuperH , Synopsys DesignWare ARC cores, S+core, Tilera, Xtensa, UniCore32.

If you don't to lose all your work in the near future. Go with an open system.

Someday you might want to reuse your programs on your anti-gravity laser optical quatuum non-screen-required hologram device. Now look at the list above, take the decision to your liking.

Fear of Windows 9 losing compatibility? XP support was dropped (now university legally is REQUIRED to trash all XP systems)

On the other hand there is our Archlinux, a bleeding edge system. Belongs to noone other than this planet. No more updates, live update / incremental updates only (event the kernel).

To not get shocked at the beginning better start with Ubuntu, it's just like a smartphone platform and simply works. There binaries for everything. No compilation required. Simply ask

sudo apt-get install office

and it will ask if you meant LibreOffice. For editing DocX there is Docx4J upcoming.

For TeX us TeXLive which integrates with LuaTex (use Lua for creating your documents) which will some day replace all TeX-specific commands.

Okay, we've lost. :help:

Take Windows, because you have to use Windows for University anyway (as universities mostly have Windows installed, perhaps all those thousands of licenses are too cheap, noone really knows?).

Use Linux in your freetime to feel morally fine, Earth's citizens have created it and will always help you out - even in future (programs from 30 years ago still supported without changes, e.g. perl, ..).

If apt-get fails to install your program, don't worry, try again with:

aptitude install blender

and it will resolve dependency issues if you say you don't like the default solution. It looks for more solutions until all is fine again. :)

C# is a good choice indeed. So look for Visual Studio, get it, install it. Search for C# getting started. (it will probably even help with setting up C# environment)

We are not angry if anyone does not like UNIX systems. Our principle is: no hierarchies, not even for Operating systems. it's everyone's freedom to choose. Just never stop asking questions and the reasoning behind decisions. That's all philosophers wish.

Have fun. :medieval:

  • Like 2
Link to comment
Share on other sites

There are quite a few good tutorials out there. If one doesn't work out, there are always others. You should also consider purchasing an intro to programming book (in what ever language you choose to start out with) as it would be more complete and structured. Read the online reviews at your favorite online bookstore to find a good one.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...