PDA

View Full Version : The programming/scripting thread!



Redcoat Kezz
04-26-2010, 09:26 AM
Hey guys! So there seems to be enough interest in programming and scripting here to have a thread on it! I wanted to continue the discussion from the creativity thread here and also provide a place for people to post any code samples or problems they have and ask for help with all things on the subject! The artists have had their thread after all!

I think we have all levels of people here, from people who are just slightly curious to people who are professional programmers in various different fields. Everyone is welcome to post away http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

l337pino
04-26-2010, 09:33 AM
Sweet. I'll post some code when I get a chance. I'm actually currently trying to debug a program due in about 4 hours http://forums.ubi.com/images/smilies/compsmash.gif .

ch0me
04-26-2010, 10:03 AM
Pino, in the other thread you brought up some good points about Java. That was the first language they taught us as freshmen in college, and I agree that it's the best language for new programmers. If you use Eclipse (do they use this in the real world? or just in school?), I'm pretty sure you can code things without actually knowing Java, haha.

l337pino
04-26-2010, 10:19 AM
Originally posted by ch0me:
Pino, in the other thread you brought up some good points about Java. That was the first language they taught us as freshmen in college, and I agree that it's the best language for new programmers. If you use Eclipse (do they use this in the real world? or just in school?), I'm pretty sure you can code things without actually knowing Java, haha.
Eclipse and Netbeans are two really powerful IDEs that you can use for Java development. They have a bit of a learning curve compared to the primitive stuff that they often teach people with (like BlueJ). If you were able to pick up coding really fast in those, that's a good sign. Sure, they are really helpful in helping the coder, but that's their purpose. Coding via command line sucks the balls. Hell, even using Notepad sucks (then again, I use Programmer's Notepad and Notepad++, which don't suck).

So what year are you in? I'm trying to finish my senior year.

Mookel
04-26-2010, 10:59 AM
I was stuck with having to use BlueJ when I was in comp. sci. in college, and they had just converted to teaching Java instead of C++. Looking back, I wish I had went to a different school which taught the C languages.

ch0me
04-26-2010, 11:06 AM
Originally posted by Pino_GruntFest:
<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">Originally posted by ch0me:
Pino, in the other thread you brought up some good points about Java. That was the first language they taught us as freshmen in college, and I agree that it's the best language for new programmers. If you use Eclipse (do they use this in the real world? or just in school?), I'm pretty sure you can code things without actually knowing Java, haha.
Eclipse and Netbeans are two really powerful IDEs that you can use for Java development. They have a bit of a learning curve compared to the primitive stuff that they often teach people with (like BlueJ). If you were able to pick up coding really fast in those, that's a good sign. Sure, they are really helpful in helping the coder, but that's their purpose. Coding via command line sucks the balls. Hell, even using Notepad sucks (then again, I use Programmer's Notepad and Notepad++, which don't suck).

So what year are you in? I'm trying to finish my senior year. </div></BLOCKQUOTE>

Also finishing my senior year - graduating in December.

I haaaate compiling things from the command line. gcc, javac, ./, -o, what is this moonspeak? Also, the computer labs here have Solaris installed on all the PCs and we're specifically instructed to go to the lab and compile everything at the command line before we turn it in, especially if we're writing it in C. What? No. I don't live on campus, I shouldn't have to do that. Portable Ubuntu comes with gcc, I'll use that from my home PC instead.


Originally posted by Mookel:
I was stuck with having to use BlueJ when I was in comp. sci. in college, and they had just converted to teaching Java instead of C++. Looking back, I wish I had went to a different school which taught the C languages.

Ohio State teaches both http://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gifhttp://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gifhttp://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gif WE'RE NOT JUST A COW TOWN, I SWEAR

GTZ_
04-26-2010, 11:23 AM
Originally posted by ch0me:
If you use Eclipse (do they use this in the real world? or just in school?), I'm pretty sure you can code things without actually knowing Java, haha.

Eclipse is being used in my real world RIGHT MEOW. (php webdev)

A bunch of the devs here are using Eclipse for their IDE, and I'm kind of getting used to it. To be honest, I really like just programming in a text editor, like vim. :V But I cannot deny that there are some superior benefits to using an IDE on a large codebase.

"wtf is this method I do not understand omg what class is it even in"
*Ctrl+click on class name, class file opens up to the appropriate method*
"oh okay"
*gets on with life*

One of the guys here uses Komodo. I like some of what he's shown me in that IDE, and once I can get a better handle on using xdebug, I'll be able to make a better distinction between IDEs.

Warholism
04-26-2010, 11:23 AM
Originally posted by ch0me:
Ohio State teaches both http://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gifhttp://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gifhttp://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gif WE'RE NOT JUST A COW TOWN, I SWEAR

that's a pretty vehement defense, boo.

Mookel
04-26-2010, 11:26 AM
Originally posted by ch0me:
Ohio State teaches both http://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gifhttp://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gifhttp://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gif WE'RE NOT JUST A COW TOWN, I SWEAR

That's cool, but real nerds code in assembly... http://forums.ubi.com/images/smilies/shady.gif

Ninja Kn1ght
04-26-2010, 11:39 AM
We learnt Java and C in college and yeah we had to do everything from teh command line too, it sucked. I've since gotten familiar with IDEs. I've mostly been using Objective-C and Xcode lately.

Over the summer, I plan to spend some time working on making a simple game targeting either the iPhone or Xbox live Indoe games.

Actually, now that I think about it. We have so many talented people here between artists programmers, musicians etc, I bet if we got together to work on a game project we could make something pretty cool and learn a lot in the process.


If people are interested post in the thread and let's see.

Redcoat Kezz
04-26-2010, 11:49 AM
Originally posted by Mookel:
<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">Originally posted by ch0me:
Ohio State teaches both http://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gifhttp://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gifhttp://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gif WE'RE NOT JUST A COW TOWN, I SWEAR

That's cool, but real nerds code in assembly... http://forums.ubi.com/images/smilies/shady.gif </div></BLOCKQUOTE>

Had a few classes in college that were in assembly. For my optimization programming final we had eight hours to debug a really big assembly file! If you knew what the errors were in it you could fix it in < 10 keystrokes, but the fact that it was assembly and you were debugging it manually took most people 6-8 hours!

In the real world I've only ever had to use assembly once. It was to correct a compiler glitch. Debug code ran fine but the optimized version had a soft freeze. After hours of looking at the C++ source and checking for things that would normally cause stuff like that to happen I compared the assembly generated by both builds and saw the problem almost immediately. The release version was not incrementing a loop counter properly for whatever reason. I just rewrote the loop and it worked fine after that. Compilers are generally extremely reliable. They have to be. This the one and only time I can say I was right and the compiler was wrong http://forums.ubi.com/groupee_common/emoticons/icon_wink.gif

ch0me
04-26-2010, 12:11 PM
Originally posted by Mookel:
<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">Originally posted by ch0me:
Ohio State teaches both http://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gifhttp://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gifhttp://forums.ubi.com/groupee_common/emoticons/icon_biggrin.gif WE'RE NOT JUST A COW TOWN, I SWEAR

That's cool, but real nerds code in assembly... http://forums.ubi.com/images/smilies/shady.gif </div></BLOCKQUOTE>

gtfo I'm done with assembly. Had too many courses in it, not gonna do it again. Can't hurt me anymore...

l337pino
04-26-2010, 02:14 PM
Originally posted by Ninja_Kn1ght:
We learnt Java and C in college and yeah we had to do everything from teh command line too, it sucked. I've since gotten familiar with IDEs. I've mostly been using Objective-C and Xcode lately.

Over the summer, I plan to spend some time working on making a simple game targeting either the iPhone or Xbox live Indoe games.

Actually, now that I think about it. We have so many talented people here between artists programmers, musicians etc, I bet if we got together to work on a game project we could make something pretty cool and learn a lot in the process.


If people are interested post in the thread and let's see.
Sounds cool. I'm interested, so long as I'm not too busy with the game I'm currently working on. It's pretty much just the senior design project that my team made this year, and we want to continue development and hopefully release it by mid-Fall.

I don't think Kezz can participate since it might be a conflict of interest with his current employer.

weaselboy
04-26-2010, 03:05 PM
I'll make my responses to people in the other thread... in this one.


Originally posted by GTZ_:
The answer to "should I learn X language?" is always the answer to two other questions: What languages do you already know? What are your programming goals?

1. None. Although depending on how nitpicky you want to get over "know" and "languages" and etc., I could say "Visual Basic" and "TorqueScript." Neither of which I care about, and neither of which I remember much of anything about. I guess if we are speaking currently, I know enough JavaScript and know enough of the Unity API to write some stuff from scratch w/o the need of any sort of resources.

2. This answer correlates to something else you bring up, so I'll answer it there.


If you don't know any other languages, and you are learning programming SOLELY to work in this game engine, you're probably fine with just the one (Javascript). If you just need to get Unity3D working, you only need one (from the looks of their features page, anyway).

If you want to know more about programming, you have to get a few different TYPES of languages under your belt to become a better programmer and start understanding the theoretical background/need for different languages. Some languages were not built for certain tasks, and this can be an important distinction when trying to solve a problem. It's like if you need a car and the only driving you EVER do is going to the grocery store -- do you need a tank, do you need a minivan, do you need a compact, do you need a s******, or could you take the bus? http://forums.ubi.com/groupee_common/emoticons/icon_smile.gif

As far as my own programming experience, I never really intended to do my own projects. I just was going to teach myself enough to throw together some prototype to get a trained programmer on board. When I quickly realized the pool of programs I personally know is very thin, I decided to do it all myself, but stay inside Unity since it's pretty flexible.

But this raises the point of deployment. To my knowledge, I still need to run a game through XNA if I want to deploy to an Xbox, correct? If so, will not knowing C# hamper me so much that I won't even want to do it (as was my experience with TorqueScript. It sucks. Well, scratch that, it's documentation sucks.)

So, in the end, my goals are simply to take a pre-built game engine (Unity, unless something better comes along,) and script the gameplay mechanics, then know enough to deploy to the major platforms (PC, PS3, 360, mobile--Unity has mobile covered, though, with a separate iPhone development package.)


Originally posted by ch0me:

I've always thought C++ was supposed to be the big one to know. And once you know that, C# would be easy to learn if you still think it'd be useful, because C++ and C# are both designed to be "better" versions of C. Last summer at my internship my boss made me write code in both C and C# even though I only knew C++, and I still got along fine.

So, in my amateur opinion, learn C++ first if you're going to learn anything.

I have no intention of programming my own engine. So while the thought of learning C++ crossed my mind (and believe me, you're not the first to bring it up,) it seems unnecessary given my time constraints. If I had the time, sure. But unfortunately, I do not.

Kezz, I think my responses pretty much also address the points you bring up. In summation: the only Microsoft thing I care for is potentially putting games I make on the 360. Otherwise, as I previously mentioned, the Unity API seems flexible enough that I should be able to do everything for the actual game within the confines of Unity.

Also: you guys rock.

Edit: I would be interested in helping out on a game with the community.

Brimtown
04-26-2010, 03:25 PM
Assembly fried my brain in college. That and "Introduction to Discrete Structures" which I swear is some form of alien math.


How difficult is it to learn C? My first year of programming at UCF, they had us programming with Modula-2.

dkkiller21
04-26-2010, 03:34 PM
i think i'll like this thread since i'm starting to learn c++.

GTZ_
04-26-2010, 04:14 PM
I'm gonna basically pretend this thread is a blog for a moment and make a very livejournal-esque post -- but it has a point I swear!

So at my new-ish job (as of March), there is another company who has been hired to help out the dev team on a long-term ongoing basis. This outside company has been here for months and is going to be here for months more.

There are a couple of guys from this other company who are extremely knowledgeable and have high expectations of everyone. It's not that they think you are stupid, per se, they just expect that there are certain principles you should know and put into practice every day. Sometimes when I ask them questions and they trace me through something, I feel like I'm back in school again. I joked with one of them once, "Haha, I feel like I should be studying every night." His response, completely dead-serious: "I do." http://forums.ubi.com/images/smilies/16x16_smiley-indifferent.gif

what

Yes, every day on the bus, he's reading something to improve his knowledge/understanding of development and Best Practices. He goes to local tech meetups for javascript, webdev, etc. He embodies the often-said but not-always-practiced notion that "Programmers need to constantly update their skills." It's an ongoing process, and it's something I haven't seen so blatantly before.

It's kicked my *** enough that I've asked them for references to start changing my own habits. I don't know if I can keep up as hardcore as these guys want to, I like my other hobbies and I like the idea of "keep your work at work". But they've given me a lot to think about, as the subtle implication in all this is that the more you know, the more you are worth.

l337pino
04-26-2010, 05:46 PM
I've always wanted to "Live to Work" rather than "Work to Live." I hope that programming is something that I will be able to enjoy enough to at least slightly keep my attention outside of work. However, if my academic life has taught me anything (lol?), it's that I will probably be in the same boat. I, too, have been told that it is very important to keep your skills sharp in this field as things so rapidly change (unless you work for NASA and use Fortran).

I ultimately hope that I will interact with enough of my peers to constantly absorb new skills. Then again, the internet is a a beautiful resource for help. http://forums.ubi.com/images/smilies/16x16_smiley-tongue.gif

wedgewu
04-27-2010, 01:50 PM
I'm one of those rare breeds, I guess, who acutally likes assembly. >__>

Then again, I am a hardware person at heart and I just like low level stuff more than anything else - when I was in school I used C more than any other language - I barely used any java/c#, and I only used C++ in my computer science classes.

If you all decide to make a game I'll help by digging into the assembly to find ways to optimize it. http://forums.ubi.com/groupee_common/emoticons/icon_wink.gif

Of course, these days I project manage more than I use my technical background, but I'm sure it's like riding a bicycle... right? ... right?

... at least I still keep up with new cpu instructions. That's gotta count for something...

TheOriginalDawg
04-30-2010, 02:19 AM
Wow, I feel like I'm behind the times. When I started to learn code in college we started with PASCAL then graduated to C++. Then through out my schooling we learned a few other languages which I felt we'd never use in the real world (like Scheme).

I hated Assembly and MIPS programming. I just wanted to code games.

We mainly did code that would be used for science, physics or business.

I really like this thread, btw.

Redcoat Kezz
05-03-2010, 09:24 AM
All good things in here!

Programming is definitely something you lose if you don't use. Pretty much everyone I know is always doing things outside of work to better themselves at programming. I do very much the same, though I don't restrict myself to programming as such. I try to better myself outside of work at game development. I practice game design and production about as much as I practice programming. I don't see myself as a programmer for my entire career, but I do see myself in the gaming industry in different capacities. Those who write code and are happy to do it forever spend the time focusing purely on programming and they love it. More power to them. Me, I spend that time doing some programming, some design and some production.

Which brings me to the proposed community project. I am interested in this. As Pino said it could be a conflict of interest for me depending on the ins and outs of it, but I'd have to know what it was before the call was made. What sort of thing interests people here? I imagine interest will be big at first but then fizzle out quick, so we'd need something simple. It would need to be very scalable. Completed early on, and then just tweaked and played with until people get bored, but at all times it's something working and fun. Any thoughts?

weaselboy
05-03-2010, 12:22 PM
I agree. I tried to start up a couple projects with people I know, and even that fizzled out because interest dropped as soon as it became clear this would require, you know, actual work. Even if it would have been only 10hrs a week.

As far as keeping it small, I have a few ideas that I've wanted to do, but don't know enough programming. I'd prefer to NOT start openly writing the design doc, you know, protecting ideas and all. If one of the programmers wants to contact me, I'd be happy to discuss it via private message or IM. If it's something that is easy from a programming perspective (I know it's easy from an art perspective,) I'll go ahead and propose it here. And, to help give some perspective, think like a simplified Chess or Go/Othello game. Relatively simple rules, but with great potential for emergent gameplay.

Otherwise, I'm up for pretty much anything that can be realistically completed in a short time-frame. I'd naturally want to lend my skills as an artist, but would help out with some limited scripting depending on the language used.

l337pino
05-03-2010, 03:12 PM
Originally posted by weaselboy:
I agree. I tried to start up a couple projects with people I know, and even that fizzled out because interest dropped as soon as it became clear this would require, you know, actual work. Even if it would have been only 10hrs a week.

As far as keeping it small, I have a few ideas that I've wanted to do, but don't know enough programming. I'd prefer to NOT start openly writing the design doc, you know, protecting ideas and all. If one of the programmers wants to contact me, I'd be happy to discuss it via private message or IM. If it's something that is easy from a programming perspective (I know it's easy from an art perspective,) I'll go ahead and propose it here. And, to help give some perspective, think like a simplified Chess or Go/Othello game. Relatively simple rules, but with great potential for emergent gameplay.

Otherwise, I'm up for pretty much anything that can be realistically completed in a short time-frame. I'd naturally want to lend my skills as an artist, but would help out with some limited scripting depending on the language used.
The problem with board games like Chess is that a lot of work is required for a decent A.I. You essentially hard code in X amount of begin and end game states and then rely on something like Alpha-beta pruning to allow the computer to make decisions in the middle of the game (since there are far too many possible arrangements for one to hard code. The end game and begin game states are more less varied and thus are recognized in a lot of Chess books.

As for an idea for the project, I'm up for anything. My current project is a top-down shooter. I'm having fun because the enemies that I have been making remind me a lot of the gameplay from the Robotron franchise. Good times http://forums.ubi.com/images/smilies/metal.gif

As a community project, are you guys more for making something from scratch or using source code or pre-made engines of some sort?

weaselboy
05-03-2010, 03:21 PM
Ah, yeah, that's what I was afraid of. I've read about some of the theory behind programming a chess engine, but have never actually looked into how much actual work that that translates into.

GTZ_
05-03-2010, 03:45 PM
I think there should be a game where the player is Andy running around the street insulting people

I would play the **** outta that

GTZ_
05-03-2010, 03:47 PM
and if you die

he goes

FFFFFFFFFFFFFFFFFFFFFFFFFFFUUUUUUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUUUUUUU

weaselboy
05-03-2010, 04:32 PM
It has potential. Also:
http://up-ship.com/blog/wp-content/uploads/2009/04/ffffuuuuu.jpg

l337pino
05-03-2010, 11:23 PM
Haha, that would be pretty epic. We could do it in flash, maybe with ActionScript (I've never used it, but I know the art department of Full Sail learns it, so some of the less experienced programmers in here like weasleboy might be able to pick it up faster...especially with it being a scripting language).

Man, we could totally take the game in the direction of an Adult Swim game.

TheOriginalDawg
05-04-2010, 07:19 PM
Originally posted by Pino_GruntFest:
<BLOCKQUOTE class="ip-ubbcode-quote"><div class="ip-ubbcode-quote-title">quote:</div><div class="ip-ubbcode-quote-content">Originally posted by weaselboy:
I agree. I tried to start up a couple projects with people I know, and even that fizzled out because interest dropped as soon as it became clear this would require, you know, actual work. Even if it would have been only 10hrs a week.

As far as keeping it small, I have a few ideas that I've wanted to do, but don't know enough programming. I'd prefer to NOT start openly writing the design doc, you know, protecting ideas and all. If one of the programmers wants to contact me, I'd be happy to discuss it via private message or IM. If it's something that is easy from a programming perspective (I know it's easy from an art perspective,) I'll go ahead and propose it here. And, to help give some perspective, think like a simplified Chess or Go/Othello game. Relatively simple rules, but with great potential for emergent gameplay.

Otherwise, I'm up for pretty much anything that can be realistically completed in a short time-frame. I'd naturally want to lend my skills as an artist, but would help out with some limited scripting depending on the language used.
The problem with board games like Chess is that a lot of work is required for a decent A.I. You essentially hard code in X amount of begin and end game states and then rely on something like Alpha-beta pruning to allow the computer to make decisions in the middle of the game (since there are far too many possible arrangements for one to hard code. The end game and begin game states are more less varied and thus are recognized in a lot of Chess books.

As for an idea for the project, I'm up for anything. My current project is a top-down shooter. I'm having fun because the enemies that I have been making remind me a lot of the gameplay from the Robotron franchise. Good times http://forums.ubi.com/images/smilies/metal.gif </div></BLOCKQUOTE>


Wow I'd love to be included in this project.


As a community project, are you guys more for making something from scratch or using source code or pre-made engines of some sort?

As far as this goes I'd love to say let's use both but then I guess that would mean we'd probably want to do two projects.

At the community college near me one of the assignments is to recreate "Breakout" in Java.

We could start with something along that scale.