PDA

View Full Version : The Programming/Scripting MASTER THREAD


Ben Apuna
08-27-2011, 08:05 PM
As the title suggests this thread is a place for the consolidation of programming and scripting knowledge on Polycount.

It isn't meant to compete with the Tech Artist - What are you working on thread (http://www.polycount.com/forum/showthread.php?t=68788), but rather compliment it in the same way that Technical Talk relates to Pimping and Previews.

Nor is it meant to compete with or dilute information from sites like Stack Overflow (http://stackoverflow.com/), Gamedev.net (http://www.gamedev.net/index), TechArtists.org (http://tech-artists.org/forum/), and TigSource (http://forums.tigsource.com/).

I see a lot of budding tech artists and indie developers on Polycount lately and I hope this thread can provide a comfortable place for anyone to ask for and get help on programming/scripting.

Most of us probably aren't formally trained software engineers, but maybe we can at least learn together and point each other in the right direction even if we don't have all the answers (because we don't!).

So feel free to post any questions, tutorials, links, on the subject of programming/scripting in this thread and I'll try to keep all that juicy info nicely organized in the next few posts.

Ben Apuna
08-27-2011, 08:05 PM
General Learning Resources:

Where to start!?

I personally recommend the following free online Stanford University course. Having gone through most of it I've learned quite a bit about programming.

Programming Methodology (http://www.stanford.edu/class/cs106a/), video lectures here (http://www.youtube.com/user/StanfordUniversity#g/c/84A56BC7F4A1F852), course materials here (http://see.stanford.edu/see/courseinfo.aspx?coll=824a47e1-135f-4508-a5aa-866adcae1111), free pre-press version of the textbook here (http://people.reed.edu/%7Ejerry/121/materials/artsciencejava.pdf), and the other textbook here (http://www.stanford.edu/class/cs106a/book/karel-the-robot-learns-java.pdf).

However if you'd rather learn Python for whatever reason then, there's also a similar course Introduction to Computer Science and Programming (http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/index.htm) from MIT OpenCoursWare (http://ocw.mit.edu/index.htm). The video lectures are here (http://www.youtube.com/user/MIT#g/c/4C4720A6F225E074), and a digital copy of the book is available here (http://www.openbookproject.net/thinkcs/).

After either of those two courses you should be ready to rock and roll.

Math

You'll probably need to know some math once you get deeper into coding for graphics related things.

Khan Academy (http://www.khanacademy.org/) - One stop shop for math. There are playlists for Trigonometry (http://www.youtube.com/user/khanacademy#g/c/D6DA74C1DBF770E7) and Linear Algebra (http://www.youtube.com/user/khanacademy#g/c/FD0EB975BA0CC1E0) which are probably two of the more important types of math you'll need for the kinds of programming you might want to get into.

Graphics Programming

http://kesen.realtimerendering.com/
http://advances.realtimerendering.com/
http://renderwonk.com/publications/s...hading-course/ (http://renderwonk.com/publications/s2010-shading-course/)
http://www.crytek.com/cryengine/presentations
http://publications.dice.se/
http://www.bungie.net/inside/publications.aspx
http://www.valvesoftware.com/publications.html
http://developer.nvidia.com (http://developer.nvidia.com/)

Game Programming

Game Programming Patterns
http://gameprogrammingpatterns.com/index.html (http://www.polycount.com/forum/Game%20Programming%20Patterns:%20http://gameprogrammingpatterns.com/index.html)

General Development Topics

http://altdevblogaday.com/

Ben Apuna
08-27-2011, 08:06 PM
Languages and Useful Libraries:

A library for those wondering is just a fancy name for some code other people have written that you can use along with your own code to accomplish a specific task, such as making games.

ActionScript 3 - link (http://www.adobe.com/devnet/actionscript.html)
The language of Flash, great for web based indie games and as renderhjs (http://www.polycount.com/forum/member.php?u=21020) has shown, cool tech art tools as well.

Away3D (http://away3d.com/) - ActionScript 3 library for making 3D games.
Flashpunk (http://flashpunk.net/) - ActionScript 3 library for making 2D games.
Flixel (http://flixel.org/) - ActionScript 3 library for making 2D games.

C# - link (http://msdn.microsoft.com/en-us/vcsharp/aa336706)
Used in Unity and XNA, also great for making tech art tools and programs.

XNA (http://www.microsoft.com/download/en/details.aspx?id=23714) - C# library for making games on Windows, Windows Phone 7, and XBox 360.
SlimDX (http://slimdx.org/) - SlimDX is a free open source framework that enables developers to easily build DirectX applications using .NET technologies such as C#, VB.NET, and IronPython.
SharpDX (http://code.google.com/p/sharpdx/) - SharpDX is intended to be used as an alternative managed DirectX framework.

C++
Great for lots of things, really bad for beginners (http://www.gamefromscratch.com/post/2011/08/04/I-want-to-be-a-game-developer.aspx).

Ogre (http://www.ogre3d.org/) - A 3D graphics engine using OpenGL. Can also be used with Python, Java, and .Net languages.
SDL (http://www.libsdl.org/) - A cross-platform multimedia library, Can also be used with .Net languages.
SFML (http://www.sfml-dev.org/) - Similar to SDL can also be used with Python and .Net languages.

IronPython - link (http://ironpython.net/)
A version of Python that runs on .Net, useful for tech art tools/programs. Sadly you cannot use it with XNA to make games on the XBox 360.

Java - link (http://www.oracle.com/us/technologies/java/index.html?ssSourceSiteId=otnen)
Not too popular as a indie game programming language, but you'll learn it if you went though that Stanford course I linked to in the above post.

AndEngine (http://www.andengine.org/blog/) - 2D game engine for Android.
jMonkeyEngine (http://jmonkeyengine.com/) - Java library for making 3D games.
libgdx (http://code.google.com/p/libgdx/) - Cross platform Android development library.
Slick2D (http://slick.cokeandcode.com/) - Java library for making 2D games.

Lua - link (http://www.lua.org/)
The scripting language of Cryengine 3 and many other game engines also used in Modo.

Love (http://love2d.org/) - Lua library for making 2D games.
LuaJIT 2 (http://luajit.org/) - Adds powerful functionality to call native C-functions (so that writing bindings often can be avoided) and to make use of native data structures.

MaxScript - No official website!?
The native scripting language of 3D Studio Max.

Mel - link (http://download.autodesk.com/global/docs/maya2012/en_us/index.html) - (User Guide -> Scripting also under Technical Documentation -> PyMEL reference)
The native scripting language of Maya.

Python - link (http://www.python.org/)
The most widespread scripting language for 3D apps, Max, Maya, Blender, Modo and Cinema4D.

Cocos2D (http://cocos2d.org/) - Python library for making 2D games.
Panda3D (http://www.panda3d.org/) - Python library for making 3D games.
Py3dsMax (http://code.google.com/p/blur-dev/wiki/Py3dsMax) - Python for Max.
PyGame (http://pygame.org/news.html) - Python library for making 2D games.
PyMel (http://code.google.com/p/pymel/) - Python library for Maya.

UnrealScript - link (http://udn.epicgames.com/Three/UnrealScriptHome.html)
The scripting language of UDK.

Shader Languages

Cg - link (http://developer.nvidia.com/node/76) - Language Reference (ftp://download.nvidia.com/developer/cg/Cg_Specification.pdf)
A free book by Nvidia "The Cg Tutorial" on the Cg shader language.

HLSL - link (http://msdn.microsoft.com/en-us/library/bb509561%28v=vs.85%29.aspx) - Programming Guide (http://msdn.microsoft.com/en-us/library/bb509635%28v=VS.85%29.aspx) - Language Reference (http://msdn.microsoft.com/en-us/library/bb509638%28v=VS.85%29.aspx) -
Shader language for Direct3D.

GLSL - link (http://www.opengl.org/documentation/glsl/) - Language Reference (http://www.opengl.org/registry/doc/glspec41.core.20100725.pdf) -
Shader Language for OpenGL.

Nvidia Shader Library - link (http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html) -
Many HLSL and CgFX shader samples.

Ben Apuna
08-27-2011, 08:07 PM
Applications, Tools, and Utilities:

An IDE short for Integrated Development Environment for those wondering is just a fancy text editor that makes common programming tasks easier. They look pretty intimidating when you first open them up (I still get scared sometimes...). But with a few tutorials, blind experimentation, or RTFMing they become much easier to grok.

Aptana Studio 3 - link (http://www.aptana.com/) - Python and others.
Similar to Eclipse, comes with PyDev already installed.

Code::Blocks - link (http://www.codeblocks.org/) - C++, (and others?)
An open source alternative to Visual Studio C++ Express Edition.

Eclipse - link (http://www.eclipse.org/downloads/) - Java, C++, Python with PyDev (http://pydev.org/).
A very versatile IDE with can be used with many different languages.

Estrela Editor - link (http://www.luxinia.de/index.php/Estrela/Estrela) - Lua, Cg, GLSL, HLSL, OpenCL.
A mufti-purpose IDE for Lua, CG, GLSL, HLSL, OpenCL, and the Luxinia (http://www.luxinia.de/index.php/Main/HomePage) engine.

FlashDevelop - link (http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page) - ActionScript 3, and haXe.
A great free ActionScript 3 IDE.

IntelliJ IDEA - link (http://www.jetbrains.com/idea/free_java_ide.html) - Java and related JVM languages.
Free version, has nice code completion.

MonoDevelop - link (http://monodevelop.com/) - C# (and others?)
If for some reason you don't like Microsoft apps then this is the C# IDE for you. Ships standard with Unity.

NetBeans - link (http://netbeans.org/) - Java and others.
Another popular Java IDE. Used with jMonkey Engine.

Notepad++ - link (http://notepad-plus-plus.org/) - Many (All?) languages.
More features than simple text editor and less complex than a full IDE. Perhaps a good app to start off with.

Spyder - link (http://code.google.com/p/spyderlib/) - Python
An IDE for Python, quite a bit more responsive than Eclipse/Aptana.

TextWrangler (Mac) - link (http://www.barebones.com/products/textwrangler/) - Many languages.
Looks like a notepad++ for Mac.

Visual Studio Express Editions - link (http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express) - C#, C++, and others.
Free versions of Visual Studio, Microsoft's programming IDE.

Visual Studio Integrated Shell - link (http://www.microsoft.com/download/en/details.aspx?id=115) - IronPython, IronRuby,and F#.
Install this to get a nice Visual Studio IDE for IronPython (http://ironpython.net/), IronRuby (http://ironruby.net/), and F# (http://msdn.microsoft.com/en-us/fsharp/cc742182).

Wing - link (http://www.wingware.com/) - Python
Non-free IDE for Python.

FX Composer - link (http://developer.nvidia.com/fx-composer) - Cg, HLSL
IDE for Cg and HLSL shaders.

Render Monkey - link (http://developer.amd.com/archive/gpu/rendermonkey/pages/default.aspx) - GLSL, HLSL
IDE for GLSL and HLSL shaders.

Shader Designer - link (http://www.opengl.org/sdk/tools/ShaderDesigner/) - GLSL
IDE for GLSL shaders.

ShaderFX - link (http://lumonix.net/shaderfx.html) - HLSL, Cg, CgFX
Visual shader editor for 3dsMax.

Mental Mill - link (http://www.mentalimages.com/products/mental-mill.html) - GLSL, HLSL, CgFX
Visual shader editor.

ShaderFusion - link (http://www.shaderfusionblog.com/) (Download though the Unity Asset Store) -
Visual shader editor for Unity by commander_keen (http://www.polycount.com/forum/member.php?u=14513).

Strumpy Shader Editor - link (http://forum.unity3d.com/threads/56180) -
Visual shader editor for Unity.

Ben Apuna
08-27-2011, 08:07 PM
Tutorials, Online Courses, and Books:

General Topics

Google Developer Channel - link (http://www.youtube.com/user/GoogleDevelopers#g/u) -
Lots of neat subjects covered here, code, business, and more.

General Programming/Scripting

MIT - 6.00 Introduction to Computer Science and Programming - link (http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/index.htm) - video lectures (http://www.youtube.com/user/MIT#g/c/4C4720A6F225E074) - textbook (http://www.openbookproject.net/thinkcs/) -
A great course to learn the basics. Language used Python.

Stanford - CS106A - Programming Methodology - link (http://www.stanford.edu/class/cs106a/) - video lectures (http://www.youtube.com/user/StanfordUniversity#g/c/84A56BC7F4A1F852) - course materials (http://see.stanford.edu/see/courseinfo.aspx?coll=824a47e1-135f-4508-a5aa-866adcae1111) - textbook01 (http://people.reed.edu/%7Ejerry/121/materials/artsciencejava.pdf) - textbook02 (http://www.stanford.edu/class/cs106a/book/karel-the-robot-learns-java.pdf) -
A great course to learn the basics. Language used Java.

Stanford - CS106B - Programming Abstractions - link (http://www.stanford.edu/class/cs106b/) - video lectures (http://www.youtube.com/user/StanfordUniversity#g/c/FE6E58F856038C69) -
This one is the course you'd take after CS106A which I linked to above. Language used C++.

Khan Academy - Introduction to Programming and Computer Science - video lectures (http://www.youtube.com/user/khanacademy#g/c/36E7A2B75028A3D6) -
Language used Python.

MIT - Intro to Algorithms - link (http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-046j-introduction-to-algorithms-sma-5503-fall-2005/) - video lectures (http://www.youtube.com/user/MIT#g/c/8B24C31197EC371C) -
This one is fairly advanced.

Game Development

How do I make games? A Path to Game Development - link (http://www.gamedev.net/page/resources/_/reference/110/135/already-a-programmer/how-do-i-make-games-a-path-to-game-development-r892) -
One of the best "Where do I start" articles I've read.

GameDev.net Articles - link (http://www.gamedev.net/page/resources?view=categories) -
Tons of info on various subjects.

TigSource Forums Tutorials - link (http://forums.tigsource.com/index.php?board=16.0) -
Many tutorials are here as well. One of my favorites is Vector Arithmetic For The Complete Novice (http://forums.tigsource.com/index.php?topic=14154.0).

Flipcode Archive - link (http://www.flipcode.com/archives/articles.shtml) -
Lot's of graphics programming articles.

Sacred Software Tutorials - link (http://sacredsoftware.net/tutorials/Tutorials.xhtml) -
Vectors, Time-based animation, Quaternions, Matrices, Collisions

GPU Gems 1 - link (http://developer.nvidia.com/content/gpu-gems-part-i-natural-effects) -

GPU Gems 2 - link (http://developer.nvidia.com/node/17) -

GPU Gems 3 - link (http://developer.nvidia.com/content/gpu-gems-3) -

SIGGRAPH 2010 Course: Physically-Based Shading Models in Film and Game Production - link (http://renderwonk.com/publications/s2010-shading-course/) -

Mobile Development

Stanford - iPhone Application Development - video lectures (http://www.youtube.com/user/StanfordUniversity#g/c/CCE29F69A864766F) -

Stanford - Developing Mobile Apps with Web Technologies - video lectures (http://www.youtube.com/user/StanfordUniversity#g/c/DD1386C4D784B56B) -

Web Development

Google I/O 2011: Building Game Development Tools with App Engine, GWT, and WebGL - link (http://www.youtube.com/watch?v=NNmoEOpGJdk) -

Google I/O 2011: Kick-Ass Game Programming with Google Web Toolkit - link (http://www.youtube.com/watch?v=F_sbusEUz5w) -

GoogleTechTalks - Building a JavaScript-Based Game Engine for the Web - link (http://www.youtube.com/watch?v=_RRnyChxijA) -

Application Specific Scripting

MAXScript 101 - video lectures (http://vimeo.com/album/1514565/page:1) -
A video-based introductory course for MAXScript

UnrealScript Tutorials by Mougli - link (http://www.moug-portfolio.info/index.php?page=tutorials) -

Math

Khan Academy - link (http://www.khanacademy.org/) -
Video lectures and problem exercises on beginner to advanced math topics.

Vector Math for 3D Computer Graphics - link (http://chortle.ccsu.edu/vectorlessons/vectorIndex.html) -

Various Math Formulas for Games - link (http://www.gpwiki.org/forums/viewtopic.php?f=3&t=10005) - link (http://forums.tigsource.com/index.php?topic=21514.0) (updated ? re-post) -

OpenGL - GLSL Tutorials

Learning Modern 3D Graphics Programming - link (http://www.arcsynthesis.org/gltut/) -

An intro to modern OpenGL - link (http://duriansoftware.com/joe/An-intro-to-modern-OpenGL.-Table-of-Contents.html) -

HLSL Tutorials

HLSL Introduction - link (http://www.neatware.com/lbstudio/web/hlsl.html) -

Crash Course in HLSL - link (http://www.catalinzima.com/tutorials/crash-course-in-hlsl/) -

Effects and HLSL Tutorials - link (http://rbwhitaker.wikidot.com/hlsl-tutorials) -

SilverShader Introduction to Silverlight and WPF Pixel Shaders - link (http://channel9.msdn.com/coding4fun/articles/SilverShader--Introduction-to-Silverlight-and-WPF-Pixel-Shaders) -

Still much more to come as soon as I have time...

Vailias
08-27-2011, 09:51 PM
Heya Ben, thanks for the links. The python one could be super useful for pyMel and more advanced rigging and Maya tools.

Ben Apuna
08-27-2011, 11:23 PM
Some alternatives to programming for those adverse to writing code that still want to make games:

Antares Universe - link (http://antares-universe.com/) - Visual scripting for Unity.
Blender Game Engine - link (http://www.blender.org/) - Visual scripting with logic bricks.
GameMaker - link (http://www.yoyogames.com/) - Create games for PC, Mac, iOS, and HTML5.
Kismet - link (http://udn.epicgames.com/Three/KismetHome.html) - Visual scripting for UDK
Kodu - link (http://research.microsoft.com/en-us/projects/kodu/) - A Microsoft project aimed at creating games through visual scripting. Non-commercial use only I think.
Quest3D - link (http://www.quest3d.com/) - 3D engine with visual scripting.
Scratch - link (http://scratch.mit.edu/) - Similar to Kodu I think, by MIT.
[/URL]Scirra Construct - [URL="http://www.scirra.com/"]link (http://www.scirra.com/) - Create executables with v1, HTML5 with v2.
Stencyl - link (http://www.stencyl.com/) - Create Flash games for the web and iOS.
uScript - link (http://www.uscript.net/home/) - Visual scripting for Unity.

Lamont
08-28-2011, 01:10 AM
I'll start with what I posted in the indie thread. This is a Case statement (Sytax is C#). Comments in line. In this version I DID NOT use myNumber to get my initial random number. Instead, I put the random number generator inside the MathF function. I'll post more code for the PolyCount Pac Man as I go along. First task and the hardest for this is to get ghost moving through a maze towards the player. This bit of code will be the base for all of that.

using UnityEngine;
using System.Collections;

// the class ghostMovement HAS TO BE THE SAME NAME AS THE FILE. So you name your file buttKiss, then this class
//NEEDS TO BE buttKiss.

public class ghostMovement : MonoBehaviour {

int myNumber;
int Rounded;


// Use this for initialization, like setting variables and ints. I set my numbers here, so when the "game"
//starts, I have the result of Rounded.
void Start () {
//This pics a random FLOAT between 0 and 4. Floats are numbers with fractions
//things like 1.2 or 35.0000234, where as things like
// 1, 2, 3 and 3000404 are int or WHOLE NUMBERS.
myNumber = Random.Range(0,4);
//Now take this and make it an int by rounding to the nearest whole.
Rounded = Mathf.RoundToInt(Random.Range(0,4));
}

// Update is called once per frame. You really don't want to use this for many things, it eats CPU cycles
//But for this demo, we will allow it.
void Update ()
{


//This little beauty is a CASE STATEMENT. It will be the "brains" of our ghosts. If it's this, do this, if it's that do this
//The options are finite so we will have total control. All this will do is handle being chased, and chasing.
//
//You see this switch(Rounded)? That Rounded is what will control the case options. switch is looking for a number
//and will only take the result of Rounded. Rounded was decided when the script first ran in the void Start().
switch(Rounded)
{
//Did the result of Rounded equal to 0?
case (0):Debug.Log("The number is zero!");
break;
//Did the result of Rounded equal to 1?
case (1):Debug.Log("The number is one!");
break;
//Did the result of Rounded equal to 2?
case (2):Debug.Log("The number is two!");
break;
//Did the result of Rounded equal to 3?
case (3):Debug.Log("The number is three!");
break;
//Did the result of Rounded equal to 4?
case (4):Debug.Log("The number is four!");
//These BREAKS stop the process of the case WITHIN this switch. Just know you need this, or it will toss an error.
break;

}

}



}

Ben Apuna
08-28-2011, 01:18 AM
Stanford University is going to be offering three free online courses this Fall in which you can actually participate and get a "statement of accomplishment" for completing them.

The courses start on October 10th and last until early/mid December. Check out the following links for more info or to sign up.

Introduction to Artificial Intelligence (http://www.ai-class.com/) - Could be useful for the indie developers looking to code better AI.

Machine Learning (http://www.ml-class.com/) - Looks to go hand in hand with that AI course.

Introduction to Databases (http://www.db-class.com/) - Could be useful for those that want to be on the asset management side of tech art.

Ben Apuna
08-28-2011, 01:21 AM
Cool stuff Lamont!

I'm looking forward to seeing how Polycount Pac Man turns out. Sorry I can't offer much support atm as C# isn't a language I know (yet).

rooster
08-28-2011, 02:09 AM
more visual editing:

for unity:
uScript - http://www.uscript.net/home/ -this is based on kismet's style
antares universe - http://antares-universe.com/

quest3d:
www.quest3d.com

PS- great thread idea!

Lamont
08-28-2011, 02:10 AM
Cool stuff Lamont!

I'm looking forward to seeing how Polycount Pac Man turns out. Sorry I can't offer much support atm as C# isn't a language I know (yet).Good thing you brought that up. What I want to do is show is that people CAN do psudo code and still be a BIG HELP. Code and ideas in any format can help.

For instance, you want the ghost to turn around 180 when it hits a wall:

If(You hit a wall in front of you)
Turn around 180 deg.

Also, I will toss in bad code and ask it to be fixed. The problem will be in the form of what was learned from the previous post/code snippet. This is to get people to see more than just what is there and pay attention to the compiler codes and research. When it's fixed, it will be posted. Code with a bad portion will be apparent as I'll do something like:

FIX THIS CODE!! Something in here is keeping it from running!!
void Update{
Debug.Log(Why isn't this working?");
}

The answer would be that it's missing a quote bracket.

Lamont
08-28-2011, 02:21 AM
For IDE's -

MS Visual C Express Free (http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express)

NotePad++ (http://notepad-plus-plus.org/)

TextWrangler(Mac) (http://www.barebones.com/products/textwrangler/)

CrazyButcher
08-28-2011, 02:26 AM
graphics related links
http://kesen.realtimerendering.com/

http://advances.realtimerendering.com/
http://renderwonk.com/publications/s2010-shading-course/

http://www.crytek.com/cryengine/presentations
http://publications.dice.se/
http://www.bungie.net/inside/publications.aspx
http://www.valvesoftware.com/publications.html

http://developer.nvidia.com

must have blog
http://altdevblogaday.com/

Lua
http://lua-users.org/lists/lua-l/
http://lua-users.org/wiki/
http://luajit.org/ LuaJIT 2 has a very powerful functionality to call native C-functions (so that writing bindings often can be avoided) and to make use of native data structures.

Editor Lua/Shaders
Estrela is an open-source editor written in Lua using wxLua which I maintain for both Lua and shader-related projects.
http://www.luxinia.de/index.php/Estrela/Estrela

SpeCter
08-28-2011, 02:42 AM
Game Programming Patterns:
http://gameprogrammingpatterns.com/index.html

gilesruscoe
08-28-2011, 03:10 AM
Another one to add to the list of engines for those adverse to writing code is the Blender game engine, although very rough around the edges, it has a "logic block" based scripting system which is pretty handy for setting up the basic stuff.
it's capable of doing some ok looking stuff, but i wouldn't suggest it for any serious projects :p
http://www.youtube.com/watch?v=SjFGDcGcEjE

r_fletch_r
08-28-2011, 03:38 AM
Android Game Programming
libgdx (http://code.google.com/p/libgdx/)- really nice cross platform game library for android development. runs natively under windows, linux, mac OS, and Android. No more emulator needed :)

http://www.youtube.com/watch?v=vLx_72qxK_0&feature=player_embedded



AndEngine (http://www.andengine.org/blog/)- 2D OpenGl engine for android.


might want to add Wing (http://www.wingware.com/)to python IDEs

Ben Apuna
08-28-2011, 04:34 AM
Cheers guys, that's quite an onslaught of info! :)

I've integrated most of it into the first few posts.

I'm immediately wondering if most of this info would be better served on the wiki in a programming/scripting sub-section. That way the info can be maintained and updated by multiple people and I don't have to do all the work by myself. I'm worn out after just a few hours, lol! :poly136:

Then the thread can stay a little more focused on discussions rather than random engine, library, IDE listings.

Or maybe things will settle down for the most part once all the initial links are up.

Or I could just update the various lists once and a while.

What do you guys think?

Surfa
08-28-2011, 07:02 AM
Am I missing something or is there a lack of c++ is the useful Libraries and languages post, this is like listing software companies and leaving out Microsoft. I hear by demand you update this asap :).

Ben Apuna
08-28-2011, 07:09 AM
Nah I just haven't added C++ or various other languages yet.

Personally I'm not too sure how useful C++ will be for most of us either (potentially cool app plugins aside). It takes whole lot of effort to get halfway decent with C++ and for most of us just starting out with programming it's generally regarded as a poor language choice.

CrazyButcher
08-28-2011, 07:09 AM
Surfa, I think the idea is not to turn this too much into full programming forum. As for wiki, Ben I am not sure that this wouldn't go too far. Imo tech-artists and alike are better place. A little "link" collection thread like this here should do for polycount.

Surfa
08-28-2011, 07:21 AM
I suppose so but when working with images on a per pixel basis I found the built in garbage collection of c# can throw some hissy fits and just using c++ can provide a quicker result with less headaches. I guess this isn't really a problem it just takes a little more time to calculate some stuff.

Anyway for the libraries:
For someone who want to make the leap to something a little bit more low level (then xna) in c# there is slimdx http://slimdx.org/

Also Ogre comes in with wrapper for .net python and java and can be found in the ogre wiki: http://www.ogre3d.org/tikiwiki/Alternative+Languages&structure=Libraries

For 2d stuff I tend to use sfml but I have checked out there .net wrapper yet but I have heard good thing about it and sfml is really ease to use anyway.
http://www.sfml-dev.org/download.php

Also sdl has a .net wrapper which is great if you want to get into opengl and not have to worry about the set-up.
http://cs-sdl.sourceforge.net/

haiddasalami
08-28-2011, 07:32 AM
MEL and Python reference - http://download.autodesk.com/global/docs/maya2012/en_us/index.html (Under Technical Documentation. Commands is MEL)

Dev C++ was a nice IDE for C++ - http://www.bloodshed.net/devcpp.html

Thanks for this thread Ben.

How many of you guys are enrolled for the Stanford courses?

Maph
08-28-2011, 07:50 AM
Anyway for the libraries:
For someone who want to make the leap to something a little bit more low level (then xna) in c# there is slimdx http://slimdx.org/


This! Big fan of SlimDX myself, and SharpDX (http://code.google.com/p/sharpdx/)is quite promising as well. Although no support for D3D9 on the latter.

Ben Apuna
08-28-2011, 08:31 AM
@CrazyButcher (http://www.polycount.com/forum/member.php?u=13945):

I think you're right about wiki. Let's just keep this a nice list to get started with for now then. Definitely don't want to even think of taking the place of Tech-Artists.org or any of the other sites.

@Surfa (http://www.polycount.com/forum/member.php?u=27435):

Nice set of libraries. I had heard of SlimDX but never looked into it, looks nice.

@haiddasalami (http://www.polycount.com/forum/member.php?u=30443):
Thanks so much for the Maya documentation link. I've been a Modo user for so long I've completely lost touch with Maya and Max.

You might want to be careful with DevC++ I've read that it's pretty outdated now. I've heard better choices are Visual C++ Express Edition and Code::Blocks (http://www.codeblocks.org/).

I've submitted my email to those Stanford courses. I'm just waiting to hear back from them. I hope I can somehow come up with the time to do all three.

@Maph (http://www.polycount.com/forum/member.php?u=41908):
Cool!, I've never heard of SharpDX before.

Sandro
08-28-2011, 09:50 AM
This is a sweet thread, lots of useful stuff.

It would be cool to see more learning resources about general programming, common practices, algorithms and math/trigonometry/physics related stuff, not necessarily particular engine/library or even programming language-specific. Seems like there are tons of libraries that deal with low-level mumbo-jumbo of putting sprites/images on screen, but you still need to code how they behave, which can vary from sorting swords in inventory to caclulating complex trajectories or buildig save/load system e.t.c

PeterK
08-28-2011, 11:40 AM
Can we make this a sticky ?

Maph
08-28-2011, 01:21 PM
@Sandro: Indeed! And I couldn't agree more!

I personally would love to talk about how you guys would handle GameStates, Data driven gameplay, and of course; vector math!
The latter is very important for any dev working in games! And this is by far one of the best -and most well explained- lessons when dealing with vectors.
http://chortle.ccsu.edu/vectorlessons/vectorIndex.html

UNCCheezy
08-28-2011, 02:07 PM
www.tech-artists.org

that is all.

Ben Apuna
08-28-2011, 06:52 PM
@Sandro (http://www.polycount.com/forum/member.php?u=29243):

That's the plan. I just haven't had enough time to put up everything I've got yet.

@UNCCheezy (http://www.polycount.com/forum/member.php?u=34776):

I completely agree, www.tech-artists.org (http://www.tech-artists.org/) is definitely the place to go for purely hard core tech art information.

I see this thread as more like a casual mix of indie game dev and tech art stuff mostly aimed at artists who might feel out of place on a programming board. More like a starting point of interest rather than authoritative source of information.

cw
08-29-2011, 02:29 AM
maxscript questions I can try to help. I think it's good for people to not be afraid of maxscript, it can speed things up so much it is crazy, and make everyone's life easier. :D

SimonT
08-29-2011, 04:10 AM
Currently i work on an HTML5 Prototype within Aptana. Nice Tool but it annoys me that the function list a) can't simply show ONLY functions and b) the function list always collapses during writing some code.

Has anyone a tip for me how to handle with that?

Lamont
08-29-2011, 04:08 PM
Update to PolyCount man will be tonight my time. Next will go into MOVING the ghost object. Till then, think about and post what a typical Pac Man ghost does/can do and try to make psudo code.

r_fletch_r
08-29-2011, 06:49 PM
maxscript questions I can try to help. I think it's good for people to not be afraid of maxscript, it can speed things up so much it is crazy, and make everyone's life easier. :D

Likewise, allways like to see folks asking about MXS here.

Techwise for myself I've been learning JAVA/Android. I'm loving explicitly typed data. (what a nerd)

Ben Apuna
08-29-2011, 08:52 PM
@cw & r_fletch_r:

It's great to see some MaxScript people popping in here to help. Are there any good links for the language reference or beginner tutorials? I don't have much to add to the list on MaxScript. There's a bunch of stuff on Tech-Artists wiki but nothing easily accessible for beginners.

@SimonT:

Sorry I can't help with Aptana. I only used if for a short time while learning Python. I did like the dark themes though. You might want to look up help for that issue under Eclipse since Aptana is a rebuild of Eclipse there's probably more info out there for Eclipse.

@Lamont:

How closely did you want to follow the actual AI of the original Pac Man? There is a pretty cool article about it on Gamasutra - The Pac-Man Dossier (http://www.gamasutra.com/view/feature/3938/the_pacman_dossier.php).

SpeCter
08-30-2011, 03:31 AM
The best thing you can do about maxscript is going through the tutorials and stuff inside max.Furthermore reading some other maxscripts(unencrypted ones of course).

Wasnīt it our very own MoP who made a little tutorial for the beginners?
I canīt forget what he said there... This is the listener, this can be fun.Pink is for watching , white makes things run!

Eric Chadwick
08-30-2011, 03:50 AM
These are a couple nice intros to Maxscript

Koen Samyn's Learn MAXScript from start to finish (http://knol.google.com/k/maxscript#)

Dub's Intro to Maxscript tutorials (http://www.maxforums.org/threads/dub_maxscript_tutorial_index/0001.aspx)

haiddasalami
08-30-2011, 05:40 AM
Heres another Intro to Maxscript

MAXScript 101 by John Wainwright (http://vimeo.com/19276145)

EDIT: Whoops see this was already added.

r_fletch_r
08-30-2011, 05:49 AM
The best thing you can do about maxscript is going through the tutorials and stuff inside max.Furthermore reading some other maxscripts(unencrypted ones of course).

Wasnīt it our very own MoP who made a little tutorial for the beginners?
I canīt forget what he said there... This is the listener, this can be fun.Pink is for watching , white makes things run!

that was Vig :)

cptSwing
08-30-2011, 06:19 AM
<- will be watching this thread

Lamont
08-30-2011, 06:39 AM
I'm using this:

http://gameinternals.com/post/2072558330/understanding-pac-man-ghost-behavior

SpeCter
08-30-2011, 06:57 AM
that was Vig :)

Ah right it was Vig , my bad!:poly136:

r_fletch_r
08-30-2011, 07:01 AM
<- will be watching this thread

*ask Questions*

Lamont
08-30-2011, 07:53 AM
So after some reading and discovering that they DO in fact use a beacon system for Pac Man this is what my code will look like for the ghost:

Stored value for turning left
Stored value for turning right
//These will only lock rotations to 90 deg intervals
// Following the doc on the listed page create 3 states for the ghost AI

Following the beacon system will use mono to make a manager for the world. The manger will know where the ghosts, player and beacons are. When the ghost reaches a beacon, it will ask where is the player, then decide which way to turn.

The Beacons.

The beacons will send a message and have a debug mode to show which directions it can send the ghost in (using Debug.DrawRay). The beacon is activated y a proximity to make sure the ghosts don't miss a turn.

First stage is to get the beacon system planned out. Second stage is to get the ghost moving through the world using the beacons.

igi
08-30-2011, 07:58 AM
For me the timing couldn't be better.I've searched for Ben Apuna's informative posts for the programming info and I've found that thread,just great.I'll be contibute to the thread whenever I'm able to do something higher level then just write a word on a screen..
Great thread for sure.

cptSwing
08-30-2011, 07:38 PM
*ask Questions*


unfortunately i have way too much other art-related stuff to get the hang of before i seriously dive into programming.. goddamn these 24 hour days..

i will however take this opportunity to paste a couple of my hackjob maxscripts here, i'm sure you guys have some pointers on how to make them more efficient.

this script i pieced together when i discovered that the panel-toggle script i had been using (http://www.scriptspot.com/3ds-max/scripts/toggle-time-command-panels) refused to work in max 2012

macroScript toggleLowerPanels
category:"MyScripts"
toolTip:"Toggle Time-, Status-, and Trackbar"
buttonText:"Toggle Lower Panels"
(
local allToggled

if (trackbar.visible == true or StatusPanel.visible == true or timeSlider.isVisible()) then
(
allToggled = false
)


if (allToggled == false) then
(
local val = timeSlider.isVisible()
timeSlider.setVisible(false)
StatusPanel.visible = false
trackbar.visible = false
allToggled = true
)
else
(
timeSlider.setVisible(true)
StatusPanel.visible = true
trackbar.visible = true
allToggled = false
)
)



and this one is a similarl hackjob to enable the element mode toggle in the UV editor, another function i could not get to work in 2012

macroScript toggleelementmode category:"Unwrap_UVW"
(
-- register status of subobjectmode and element mode
sub_obj_mode = $.modifiers[#unwrap_uvw].unwrap2.getTVSubObjectMode()
element_mode = $.modifiers[#unwrap_uvw].unwrap2.getTVElementMode()
-- set to subobjectmode to 0 in order for element toggle to go through (bug?)
$.modifiers[#unwrap_uvw].unwrap2.setTVSubObjectMode 0
$.modifiers[#unwrap_uvw].unwrap2.setTVElementMode(not element_mode)
-- set subobjectmode back to original
$.modifiers[#unwrap_uvw].unwrap2.setTVSubObjectMode sub_obj_mode
)


i have quite a few ideas for simple (?) maxscripts that i'd like to try my hands at somewhere down the line, but seeing as it usually takes me quite a while to get results, and it can be quite frustrating to just guess around until i get to where i want to be, i usually find better ways to spend my time ;-/

Lamont
08-30-2011, 10:15 PM
Learning how to do path-finding in 2D.(Grid-based).

DEElekgolo
08-30-2011, 10:26 PM
I have a 2d Tile system setup and I am not sure if I did it correctly since I am unable to have an entity traverse the grid properly.

C++
I have 2d array of tile objects.
The tile object has a vector full of entities to draw at that tile.
due to this, the entities contained in a tile are unaware of their own XY position.
How would I have my player object go from the tile that it is in to the tile that is next to it and allow have room for an animation to play? The state pattern works well but what "flow" would I give it?
Change player state to moving, play an animation and shift the drawing of the player to the tile it is going to move over, and then once the animation is complete should I copy the entity to the new tile and delete the old one?

Its the designing of things like this that throw me off in the not-so-long run. Any information will do.

Lamont
08-30-2011, 10:51 PM
Grid-based movement system?
I'd do:
Find path from A to B
Move (normalize the time)
When B is reached, do animation.

I'm thinking like a chess system.

SpeCter
08-31-2011, 02:03 AM
You could do a simple A* which is pretty easy to do.

r_fletch_r
08-31-2011, 05:44 AM
i have quite a few ideas for simple (?) maxscripts that i'd like to try my hands at somewhere down the line, but seeing as it usually takes me quite a while to get results, and it can be quite frustrating to just guess around until i get to where i want to be, i usually find better ways to spend my time ;-/

its just a matter of practice. my best advice would be to work as neatly and modularly as possible. break code into functions as much as you can, and print out to the console alot. When you break your scripts down into functions it becomes much easier to locate errors and also becomes alot more readable.
When you are using variables type the first 3 letters then press CTRL+enter this will give you an auto complete list, if you use that you will misspell things far less :).

do this tutorial and enable autocomplete for the full mxs api (very very cool)
http://apps.jhaywood.com/Blog/?c=3dsMax&p=1

Lamont
08-31-2011, 07:05 AM
You could do a simple A* which is pretty easy to do.It's what I am doing now for the ghosts.

r_fletch_r
08-31-2011, 07:07 AM
It's what I am doing now for the ghosts.
you got any decent info on that, allways fancied working out how it worked.

SpeCter
08-31-2011, 08:51 AM
I think i have my Java A* Code on my computer somewhere if you want fletch, just say a word and iīll look for it ;)

Lamont
08-31-2011, 09:11 AM
I just got it working a few seconds ago, adding some other things, will post a demo soon.

r_fletch_r
08-31-2011, 10:03 AM
I think i have my Java A* Code on my computer somewhere if you want fletch, just say a word and iīll look for it ;)

that would be very interesting! thanks.

cptSwing
08-31-2011, 10:05 AM
its just a matter of practice. my best advice would be to work as neatly and modularly as possible. break code into functions as much as you can, and print out to the console alot. When you break your scripts down into functions it becomes much easier to locate errors and also becomes alot more readable.
When you are using variables type the first 3 letters then press CTRL+enter this will give you an auto complete list, if you use that you will misspell things far less :).

do this tutorial and enable autocomplete for the full mxs api (very very cool)
http://apps.jhaywood.com/Blog/?c=3dsMax&p=1


cheers, will give that try!

Lamont
08-31-2011, 10:12 AM
Here is what I have so far, needs optimizations. Going to narrow the search better.

Click the button to make the path advance, then when goal is reached, it will reset and move the player. There is a bug on the border parts sometimes, it can't find it for some reason.

http://dl.dropbox.com/u/2851501/PolyCountMan.rar

SpeCter
08-31-2011, 10:23 AM
that would be very interesting! thanks.

http://dl.dropbox.com/u/1114083/aStar.zip

Itīs one piece of shit code, but i wrote that 2 years ago :D
Here is my little java implementation and contains some little bugs but feel free to play around with it.

r_fletch_r
08-31-2011, 10:24 AM
thanks!to the Eclipse cave!

SpeCter
08-31-2011, 10:31 AM
It could be , that i uploaded an older version(or so it seems -.-)
Need to take a look at it again!

Edit:

Ok thatīs the version when i just started with my implementation.
Iīll update the most recent version when i find it, sorry for the inconvinience:(

If i canīt find it , iīll do it again just for you fletch ;)

r_fletch_r
08-31-2011, 10:50 AM
jeez mate, i appreciate the free code, no need to be apologising. take your time :)

SpeCter
08-31-2011, 11:00 AM
The code posted will work if the program doesnīt try to check for tiles which are outside of the map(non-existant).
And this version just gives the shortest path in coords.
The one iīm looking for right now had a little gui where you could define your map, start/end points, add water and stuff(different ground with different costs).
Most probably iīll have to do that again, itīs a nice practice and now the code will most likely be better :D

The Flying Monk
08-31-2011, 11:38 PM
When you are using variables type the first 3 letters then press CTRL+enter this will give you an auto complete list, if you use that you will misspell things far less :).

do this tutorial and enable autocomplete for the full mxs api (very very cool)
http://apps.jhaywood.com/Blog/?c=3dsMax&p=1

Neat, I didn't realise that the MaxScript editor had this.
For the guys who use Max Script, are there any other settings like this that you would recommend to make things easier?

DEElekgolo
09-01-2011, 06:59 AM
http://i.imgur.com/Vf0JW.png
Perlin noise saves the day.
(http://www.flipcode.com/archives/Perlin_Noise_Class.shtml)

SpeCter
09-01-2011, 07:29 AM
Started to program it again, GUI is mostly working now onto the fun part!

SpeCter
09-02-2011, 03:19 PM
Ok here it is , just for you fletch(everyone else interested can have it too of course)

It has some little flaws, but it should find one of the shortest ways.
The size for the maze is hardcoded atm(sorry!) if you want to make it smaller or bigger you have to change xSize and ySize inside of GameWindow.java.

You can choose what to paint on the maze with the little icons in the blue square.
The last square indicates which type of ground is currently selected.
The little flags are start and finish.

Feel free to do whatever you want with it and keep in mind, itīs a very simple implementation of the A* algorithm ;).

A picture of it:
http://dl.dropbox.com/u/1114083/astar.png

And here is the project file:
http://dl.dropbox.com/u/1114083/Pathfinding.zip

The images folder has to be in the application folder, otherwise all tiles will be white!
If you run the program it will print the right path to the console.

Itīs a netbeans project file, but you should have no problems getting it to run in another ide.

The most important part is the Pathfinder class, this is where the magic happens, so please be gentle before argueing about documentation.

If you got questions, feel free to ask.

r_fletch_r
09-03-2011, 06:22 AM
awesome! your a gent

Lamont
09-05-2011, 12:06 AM
Here we are. Getting closer. Now that it works, time to do game rules and ghost personalities. Have a lot of work going on, but still daydream about this. When it's done it will be released code-wise with lots of comments.

When all is done, let's do some art :)

Link to the latest PC build.
http://dl.dropbox.com/u/2851501/PolyCountMan.rar

Lamont
09-05-2011, 12:15 AM
Unity Webplayer version: http://dl.dropbox.com/u/2851501/PCMan/WebPlayer.html

Lamont
09-05-2011, 06:10 AM
Here is a solution to a common problem with touch on iOS. Say you are trying to ALWAYS have your left stick as aim and the other as movement. Well you could go by touch ID, but the ID changes. This makes a zone that you can use to be your invisible button that's not a button. You very well could make a touch state for this.

Possible uses outside of buttons are:

Draw this on screen using the objects bounds to get a box touch area.
Gesture recognition.


So what the code does is take the zone height and width values and draws a rectangle where you tell it. Then that function at the end checks to see if THAT instance of the rectangle has a touch inside it, if it does, it registers, else, it won't (if you set it up that way).

JavaScript (Unity)

var myZoneWidth : int = 200;
var myZoneHeight : int = 200;
private var customBounds : Rect;

myBounds(touch.position, customBounds);

function InsideBounds (touchPosition : Vector2, myBounds : Rect)
{
return (myBounds.Contains (touchPosition));
}


C#

int myZoneWidth = 200;
int myZoneHeight = 200;
Rect customBounds;

myBounds(touch.position, customBounds);

void InsideBounds (Vector2 touchPosition, Rect myBounds)
{
return (myBounds.Contains (touchPosition));
}

Maph
09-05-2011, 06:25 AM
Something for the Unity/.NET peeps. I was looking at some delegates/events stuff with generics, and came across this great article on CodeProject!
http://www.codeproject.com/KB/cs/event_fundamentals.aspx

Definitely worth the read, as events are pretty freaking important in a component driven environment such as Unity imho.

mLichy
09-05-2011, 06:33 AM
Awesome awesome stuff, thanks for sharing this :D The Slimdx stuff is very cool.

haiddasalami
09-05-2011, 07:35 AM
Article on matrices by MacaroniKazoo. Also does a lot of python stuff.

http://www.macaronikazoo.com/?page_id=413

Calabi
09-05-2011, 08:36 AM
I have a really basic question.

What do you do about unnasigned object variables? I mean like a variable that will only be assigned at run time. But it seems the in C# it has to be assigned before, so do you create an empty object or just assign it to a random object.

Surfa
09-05-2011, 11:14 AM
I am not quite sure I get what you mean. You can have a varible with nothing assigned to it in c# just define it as
int a;
bool b;
float c;
etc..
Or is this not what you meant.

Also it would be cool if you could add some hlsl or glsl stuff to the list as this would be useful for people getting into tech art.

Maph
09-05-2011, 01:32 PM
I have a really basic question.

What do you do about unnasigned object variables? I mean like a variable that will only be assigned at run time. But it seems the in C# it has to be assigned before, so do you create an empty object or just assign it to a random object.

Depends on the scope where the variables are used, and the compiler used. Generally speaking, uninitialized variables that are used with no value will yield compiler errors but it's pretty possible that VC# auto-assigns default values to uninitialized variables. I know the Mono compiler from Unity does it for variables that are declared in the class scope, but not in method or lower scopes.
This is because the variables declared in the class scope can be re-assigned at any point in the run time. The compiler doesn't know that, so it assigns a default value to it.
When declaring variables but not initializing them and then using them in a method scope makes no sense for the compiler. Why declare something, but not initialize it and then try to use it? So it will complain about that. :)

So doing something like this in Unity/Mono will yield compile errors:

class myClass
{

void foo ()
{
int a;
int b;

// This yields compiler errors because a and b are not initiliazed.
int sum = a + b;
float product = a * b;
}
}


But this will not

class myClass
{
int a;
int b;

void foo ()
{
// this compiles fine, because the values of a and b can be changed/assigned by the time they are used by method foo. The compiler does not know that.
int sum = a + b;
float product = a * b;
}
}


Again, it could be that the VC# compiler is more or less forgiving about this, I wouldn't know as I've never tried it. :)

r_fletch_r
09-05-2011, 01:35 PM
man i hate it when your allowed to do shit like that. Whats the value in it, all it does is introduce bugs.

SpeCter
09-05-2011, 01:36 PM
Itīs commonly bad programming practice not to initialise variables with some dummy values.Most programming languages will do that for you in debug mode but not in release mode(C/C++ for example).
Forgetting to do so will lead to very unexpected behaviour when switching from debug to release mode.
Just saying...

Maph
09-05-2011, 01:41 PM
r_fletch_r: It makes sense for the compiler to allow you to define variables in the class scope but not in the method scope, because the variables declared in the class scope can be changed at runtime before they are used by anything/anyone. The compiler can not foresee that.
If they are used before they are assigned then, well.... You know, that's what they call runtime errors. :)

SpeCter: Agreed! I've learned to generally always init my vars with default values. And this rule of thumb holds for every language out there imho! Even more so for the loosely typed languages like Javascript.

r_fletch_r
09-05-2011, 04:17 PM
r_fletch_r: It makes sense for the compiler to allow you to define variables in the class scope but not in the method scope, because the variables declared in the class scope can be changed at runtime before they are used by anything/anyone. The compiler can not foresee that.
If they are used before they are assigned then, well.... You know, that's what they call runtime errors. :)


Those are generally initialised in the constructor though are they not? My experienced in this is Java, if I do this in eclipse it gives out to me.

Ben Apuna
09-05-2011, 10:00 PM
... Also it would be cool if you could add some hlsl or glsl stuff to the list as this would be useful for people getting into tech art.

I've added some links on various shader languages, their IDEs, a few tutorials, and a few random links in the first few posts.

It's not much more than what a Google search will get you though as I haven't studied the subject much myself yet and haven't accumulated many resource links.

If anyone has better links for this stuff then post them up and I will add then to the list.

Maph
09-06-2011, 12:56 AM
Those are generally initialised in the constructor though are they not? My experienced in this is Java, if I do this in eclipse it gives out to me.

I would assume so yes. :) Makes sense they get initialized under the hood when the constructor is called.

Edit: Question, does anyone know of a good alternative IDE for MonoDevelop on Mac? This monstrosity that gets shipped with Unity is a massive resource hog! I'm not looking for a complete Visual Studio alternative (because nothing to this date beats VS imho), but just something with intellisense and proper code analyzing/error messaging.

Calabi
09-06-2011, 06:05 AM
Thanks for the info Maph. I did notice, it depended on where I placed it whether I got the error or not, now I know why.

haiddasalami
09-06-2011, 06:59 AM
I've added some links on various shader languages, their IDEs, a few tutorials, and a few random links in the first few posts.

It's not much more than what a Google search will get you though as I haven't studied the subject much myself yet and haven't accumulated many resource links.

If anyone has better links for this stuff then post them up and I will add then to the list.

Nvidia Shader Library. (http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html)Good reference and code samples to learn from. They have cg and hlsl versions also.

r_fletch_r
09-06-2011, 10:48 AM
I would assume so yes. :) Makes sense they get initialized under the hood when the constructor is called.

Edit: Question, does anyone know of a good alternative IDE for MonoDevelop on Mac? This monstrosity that gets shipped with Unity is a massive resource hog! I'm not looking for a complete Visual Studio alternative (because nothing to this date beats VS imho), but just something with intellisense and proper code analyzing/error messaging.

You could try eclipse with the emonic plugin (http://emonic.sourceforge.net/) havent used the plugin myself but I can vouch for Eclipse. its a great program.
(Thinking about it i've never checked what resources eclipse uses)

Maph
09-06-2011, 01:42 PM
You could try eclipse with the emonic plugin (http://emonic.sourceforge.net/) havent used the plugin myself but I can vouch for Eclipse. its a great program.
(Thinking about it i've never checked what resources eclipse uses)

I like Eclipse, it's pretty lightweight, especially compared to Monodevelop. But it kinda handles it's projects in a much different manner then VS/Monodevelop. More like how Aptana does it (or more likely, Aptana copied it from Eclipse). Which is kind of a bummer when working in Unity. :(
Unless you happen to know a workaround to opening .sln files in eclipse?

G3L
09-06-2011, 04:04 PM
this is awesome! been waiting for something like this on polycount! so is most of the stuff useful if i just want to learn the basics?

i probably wouldn't go deep with programming since it's something i'd really have to learn and focus on, all the while i still have lots of catching up to do on the art side of things >_<

thanks once again everyone for contributing! i hope to one day be able to contribute myself :D

xXm0RpH3usXx
09-07-2011, 04:07 AM
You could try eclipse with the emonic plugin (http://emonic.sourceforge.net/) havent used the plugin myself but I can vouch for Eclipse. its a great program.
(Thinking about it i've never checked what resources eclipse uses)

may i humbly ask why you favour eclipse?

did a little course a few month back using eclipse.
i "used" (more like i tried too XD) netbeans at home before to get a feel for java and found it muhc more convenient.

error codes are way better, the interface a little more intuitive and such...

SpeCter
09-07-2011, 04:18 AM
I consider Netbeans&Eclipse equal, the only thing i like more about netbeans is that it feels faster(could just be me) and that it has a profiler build in.
Aside from that they feel just the same to me(didnīt use eclipse for months but i doubt that much has changed since then)

Elyaradine
09-07-2011, 03:00 PM
I'd pick Eclipse just because I can switch freely between Java and Python.

Now, if there were a way to debug Unity with Visual Studio... (apparently that's on their to-do list)

r_fletch_r
09-07-2011, 06:03 PM
may i humbly ask why you favour eclipse?

did a little course a few month back using eclipse.
i "used" (more like i tried too XD) netbeans at home before to get a feel for java and found it muhc more convenient.

error codes are way better, the interface a little more intuitive and such...

The Android SDK is integrated with Eclipse. and there are a load of fantastic plugins.

xXm0RpH3usXx
09-08-2011, 12:56 AM
Swing is implemented in Netbeans directly^^

(i'm sry, i'm not really qualified to say anything intelligent)

thx for clarifying. so there is the same discussion as with max/maya

SpeCter
09-08-2011, 01:48 AM
Nah not really, they are both great, i switch from time to time.
And swing is integrated in eclipse too, you only donīt have a gui builder as far as i know :P

Both are good IDEīs itīs just a matter of what you like more. Itīs not like with VS against other IDEīs where you can say it beats the crap out of the other ones.

CrazyButcher
09-08-2011, 02:06 PM
originated from a message conversation:

Especially Lua which seems more and more awesome the more I read about it. Do you know if Lua is used widely in the industry on the tech art or tools programming side of things?

My impression is that Lua is used mostly to add scripting features to engines, perhaps so that game designers can make easy edits to data without having to deal with C++.

yes it's popular with game scripting (realtime system integration), I use it a lot for all kinds of tasks (many people would use python for that, which I never got into).

Scripting languages like Lua are useful to "generate code", I've used Lua to generate maxscript code or shader code or other things. It can be used for a bit more complex "batch" tasks, parsing directories/files...

I rip out more and more from luxinia's original codebase into a leaner and looser framework for rendering experimentation https://github.com/CrazyButcher/luxinia2

Luajit2 is very very cool, it allows calling native code without bindings (C-api dlls) and manage raw-data structures. It can be extremely fast (and Lua is already the fastest interpreted language). People have shown that luajit for certain problems can beat a C implementation due to the nature of JIT being able to optimize depending on the data used.

python is more wide-spread, but next to its speed Lua is easier to integrate into c/c++ projects. Also its license is very liberal (MIT).

there is several lua plugins, for example luainterface provides a .net bridge, and there is also luapython to make python callable inside lua and vice versa. Although personally used lua with wxwidgets (Estrela is written in wxlua), that said .net ui is also cool to have.

all of luxinia's (non engine) code was done in lua (the games, the editor for the games, tools). Especially making editors/tools worked really well (if you have a good UI binding, luxinias ui is also written in Lua) friend and myself yet have to port the luxinia1 ui to luxinia2 sometime hehe

On the negative side, what comes to my mind compared to something like C# the lack of fixed types for variables of course means less convenience capabilities in IDEs. Debugging also requires some custom work, and the fact that variables are "global" by default is a bit sucky. No built-in unicode support... nevertheless it's a neat tiny language that is quite fast. And the ability to generate code/functions depending on data is lovely.

Despite python being "larger", one will find a lot of lua's plugin extensions in the "lua for windows" package prebuilt and ready to use and a healthy mailing list at lua-users.org

mini lua primer for the not so obvious stuff


-------------------------
-- tables are general container can be indexed by anything (numbers,
-- tables, strings, functions...)

local function blah() end
tab[blah] = blubb
tab.name = blubb -- is same as
tab["name"] = blubb


-- tables are always passed as "pointers/references" never copied
-- array index starts with 1 !!
-- they become garbage collected when not referenced anymore

pos = {1,2,3}
a = { pos = pos }
pos[3] = 4
pos = {1,1,1} -- overwrites local variable pos
a.pos[3] -- is still 4


-------------------------
--[[ multiline
comment ]]

blah = [==[ multiline string and comment
can use multiple = for bracketing]==]

-------------------------
--- multiple return values allow easy swapping
a,b = b,a

-------------------------
-- object oriented stuff
-- : operate passes first arg
a.func(a,blah) -- is same as
a:func(blah)

-- metatables allow to index class tables
myclass = {}
myclassmeta = {__index = myclass}
function myclass:func()
self --automatic variable through : definiton for the first
--arg passed to func
end


object = {}
setmetatable(object,myclassmeta)
object:func() -- is now same as
myclass.func(object)

-------------------------
--- upvalues for function specialization

function func(obj)
return function()
return obj * 2
end

end

a = func(1)
b = func(2)

a() -- returns 2
b() -- returns 4

--- non passed function arguments become nil automatically
function func (a,b)
return a,b
end
a,b = func(1) -- b is "nil"

--- variable args
function func(...)
local a,b = ...
--- a,b would be first two args
--- you can also put args in a table
local t = {...}
end


-------------------------
--- conditional assignment chaining
--- 0 is not "false", only "false" or "nil" are

a = 0
b = a or 1 -- b is 0, if a was false/nil it would be 1

c = (a == 0) and b or 2 -- c is 0 (b's value)

-- the first time a value is "valid" (non-false/nil) that value is taken
-- that way you can do default values

function func(a,b)
a = a or 1
b = b or 1

end

Maph
09-09-2011, 01:52 AM
Lua is cool! From the limited times I've used it, it kinda reminded me of a combo of Javascript and Pascal, although I hate the latter, I love the former. :)

Anyone used Love2d yet btw? It's a neat little 2D engine using Lua as it's scripting engine!
http://love2d.org/

cptSwing
09-15-2011, 05:20 AM
In your collective opinion, would it make sense to dive into C# directly, or to take a detour through Python-ville? I've done a teeny tiny bit of Python in school, have a very, very basic grasp on Javascript and (as seen somewhere above) Maxscript..

Then again i guess it depends on what i'd like to do with it in the end. Generally i think i'd like to be proficient with writing maxscripts and other pipeline tools to fit my workflow, possibly muck around in Unity (etc.) a little. Not aiming to code in ASM.

C# came to mind since it seems to be fairy versatile and "easy" to pickup? Any good book recommendations?

Calabi
09-15-2011, 05:32 AM
This one seems to be pretty good. The yellow book.

http://www.csharpcourse.com/

Lamont
09-15-2011, 05:35 AM
In your collective opinion, would it make sense to dive into C# directly, or to take a detour through Python-ville?

...<SNIP>...

C# came to mind since it seems to be fairy versatile and "easy" to pickup? Any good book recommendations?I think just getting into ANY language is a good start just to get your mind in that "mode". I find tons of resources on-line and reading theories of things helps as well. Just to read someone's thought process on a given subject can do wonders.

Lamont
11-09-2011, 07:00 PM
Here is a bit of code in C# for a quasi Active Reload in Unity3D. Put this on an object in the scene and run.

Can be used for anything that requires timing, use your imagination ;). More code for stuff on the way.

using UnityEngine;
using System.Collections;


//There are many ways to skin a cat, this is my way. Hopefully it will
//get someone on a different track and come up with something better.
//If you do, please share :).

public class ActiveReload : MonoBehaviour {

//The three rects used for the timer
public Rect targetRect;
public Rect ReloadRect;
public Rect TimeRect;
public float reloadSpeed;
public float relMove;
public int reloadState;
private float startTime;
private int allTime;
private int misses;
private int hits;
public float targetPos = 0.0F;

// Use this for initialization
void Awake ()
{
//Setting my ints for Awake
allTime = 0;
misses = 0;
hits = 0;
reloadSpeed = 5.0f;
reloadState = 3;
relMove = 20;
//Created rects using the Rect function below.
targetRect = MyRect(200, Screen.height/2, 400, 70);
TimeRect = MyRect(20, Screen.height/2, Screen.width-50, 70);
}

void Start()
{
//Reset timer will keep the time from when the function started vs the time of the game
ResetTimer();
//This is a FSM it will play and not use much resources. It's waiting for the int reloadState to change
StartCoroutine(ReloadState());
}
//All the update is doing is waiting for a keypress. It would be bad to put the functions for the FSM here.
void Update()
{
if(Input.GetKeyDown("space"))
{
if(InRect(ReloadRect,targetRect))
{
reloadState = 2;
}
else if(!InRect(ReloadRect,targetRect))
{
reloadState = 1;
}
}
if(Input.GetKeyDown("r"))
{
reloadState = 0;
}

}
//Resets the timer
void ResetTimer()
{
startTime = Time.time;
}

//FSM to control states. There are only 4 states to use. You will see that each state refers to a function.
public IEnumerator ReloadState()
{
while(true)
{
switch(reloadState)
{
case (0):StartReload();
break;
case (1):MissReload();
break;
case (2):Reload();
break;
case (3):WaitForReload();
break;
}

yield return null;
}
}

//States for the FSM
void StartReload()
{
relMove = 20*(GenericTimer(1.00f)*reloadSpeed);
ReloadRect = MyRect(relMove, Screen.height/2, 10, 70);
if(relMove>1176)
{
reloadState = 1;
}
}
void MissReload()
{
ReloadRect = MyRect(20, Screen.height/2, 10, 70);
//Debug.Log("Missed...");
reloadSpeed= 5.0f;
targetRect.width = 400;
targetRect.x=600;
hits = 0;
misses+=1;
reloadState = 3;
}
void Reload()
{
reloadSpeed+=5;
targetRect.x+=5;
if(targetRect.width>=20)
{
targetRect.width-=10;
}
hits+=1;
if(hits>=allTime)
{
allTime+=1;
}
Debug.Log("Perfect Reload!! " + reloadSpeed);
reloadState = 3;
}
void WaitForReload()
{
ResetTimer();
ReloadRect = MyRect(20, Screen.height/2, 10, 70);
}

//Generic Timer
public float GenericTimer(float myTime)
{
float TimeLeft = Time.time - startTime;
if (reloadState!=0)
{
startTime = Time.time;
TimeLeft = 0;
}
return TimeLeft;
}

//GUI Stuff
void OnGUI()
{
if (GUI.Button(new Rect(400, 20, 70, 30), "Reload"))
{
reloadState = 0;
}
if (GUI.Button(new Rect(400, 70, 70, 30), "Pop"))
{
if(InRect(ReloadRect,targetRect))
{
reloadState = 2;
}
else if(!InRect(ReloadRect,targetRect))
{
reloadState = 1;
}
}
GUI.Box(new Rect(400, 170, 200, 30),"Hits: " +hits+ " || All-Time "+allTime+" || Misses "+misses);
//This slider will move the target box
targetRect.x = GUI.HorizontalSlider(new Rect(400, 120, 100, 30), targetRect.x, 200.0F, 500.0F);
//These GUI Boxes use the MyRect function
GUI.Box(TimeRect, " ");
GUI.Box(targetRect, " ");
GUI.Box(ReloadRect, " ");
GUI.Box(new Rect(300, 500, 400, 90),"How to Play: \r\n Press R key to start the reload \r\n Hit spacebar when the slider is in the hit zone.\r\n Try to rack up a streak:) \r\n 2011 Lamont Gilkey");
}
//Return functions are very powerful. Learn to use them.
//This creates rects that can be passed around and used
public Rect MyRect(float xpos, float ypos, float wsize, float hsize)
{
Rect NewRect = new Rect(xpos, ypos,wsize, hsize);
return NewRect;
}

//This checks to see if the pos rect is within bounds rect and returns true or false
public bool InRect(Rect pos, Rect bounds)
{
Vector2 lockon = new Vector2(pos.x, pos.y);
//Debug.Log(lockon);
return(bounds.Contains(lockon));
}
}

Lamont
11-12-2011, 08:00 AM
Wanted to tile out an image in PS using save for web but max image size is 8100px or so. This script will cut the image up into how ever many tiles you want on the x and y. Feel free to modify this and make it presentable. I just need it for terrain database work. Uses flattened image. As always save your work before doing crazy scripting stuff.

//you NEED this, drove me crazy why my pixel values were fubar. you have to tell the script that you are using pixels/inches/cms to do stuff...
var defaultRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PIXELS;

if(app.documents.length > 0){
//Some boxes to collect data for slicing
var xColumns = parseInt( prompt("X Colums?", 2) );
var yColumns = parseInt( prompt("Y Colums?", 2) );
var newDocPrefix = prompt("Prefix for tiles?", "FileName");
//Gotta write the full path
var newDocLoc= prompt("Save location?", "Path");
//PS keeps track of the current active document
var doc = app.activeDocument;
//dimentions of the doc using units defined above
var docWidth = doc.width;
var docHeight = doc.height;
//simple math
var tileWidth = docWidth / xColumns;
var tileHeight = docHeight / yColumns;
// selection lasso coords starting upper left and going counter/anti clockwise
var x0 = 0;
var y0 = 0;
var x1 = 0;
var y1 = tileHeight;
var x2 = tileWidth;
var y2 = tileHeight;
var y3 = 0;
var x3 = tileWidth;
var all = 0;

//This goes from left to right top to bottom if you want to go from top to bottom left to right swap the x to the y so you sort the x first
for(yl = 0; yl < yColumns; yl++){
for(xl = 0; xl < xColumns; xl++){
selectedRegion = [[x0+(xl * tileWidth),y0+(yl * tileHeight)],[x1+(xl * tileWidth),y1+(yl * tileHeight)],[x2+(xl * tileWidth),y2+(yl * tileHeight)],[x3+(xl * tileWidth),y3+(yl * tileHeight)]];
doc.selection.select(selectedRegion);
doc.selection.copy();
var targetDoc = documents.add(tileWidth, tileHeight, doc.resolution, newDocPrefix+"_"+(xl+yl));
targetDoc.paste();
targetDoc = null;
var saveTarget = activeDocument;
saveTarget.flatten();
PSDSaveOptions = new PhotoshopSaveOptions();
saveFile = new File(newDocLoc+newDocPrefix+"_"+addZeros(all) );
saveTarget.saveAs(saveFile,PSDSaveOptions,true,Ext ension.LOWERCASE);
saveTarget.close(SaveOptions.DONOTSAVECHANGES);
doc.selection.deselect();
all++;
}
}
}
//This takes the number and pads it with leading zeros
function addZeros(number){
if(number<10){
number = "000"+number;
}else if(number<100){
number = "00"+number;
}else if(number<1000){
number = "0"+number;
}
return number;
}

Lamont
11-12-2011, 08:02 AM
I would like to add that you are using a lasso, and the array of arrays can be any shape you want using multiple points...

Ben Apuna
11-17-2011, 06:12 PM
Following on the heels of the Artificial Intelligence, Machine Learning, and Database courses offered this Fall, Stanford University is offering many new free courses this upcoming Spring.

Computer Science 101
http://www.cs101-class.org/

Natural Language Processing
http://www.nlp-class.org/

Software Engineering for Software as a Service
http://www.saas-class.org/

Human-Computer Interaction
http://www.hci-class.org/

Game Theory
http://www.game-theory-class.org/

Probabilistic Graphical Models
http://www.pgm-class.org/

Machine Learning
jan2012.ml-class.org (http://jan2012.ml-class.org/)

I'm currently taking the Machine Learning class this Fall which is the same as the one that will be offered in the Spring and I must say it's very awesome, even without a solid math background.

Lamont
11-22-2011, 07:12 AM
Ohhh, it's gonna be here soon....

Lamont
12-22-2011, 05:06 AM
Here we go: Chapter 1 of Unity Tetris in C#. All chapters are done, just some HTML work. Working on Centipede next. Will be posting a bunch of code to various things as well. A lot of people are thinking of going indie, so I want to help as much as possible.

http://www.gimpel3d.com/UnityTetris/chapt1.html

Also, all source art for Centipede will go up as well.

Nysuatro
12-22-2011, 12:45 PM
Brilliant, thanks for sharing Lamont!

Calabi
12-22-2011, 03:11 PM
Cool, Thanks Lamont.

Ben Apuna
01-21-2012, 09:32 AM
For all you ambitious types who want to run your own game portal site like Steam here's the source code for Desura:

https://github.com/lodle/Desurium

haiddasalami
01-21-2012, 10:00 AM
Been doing some WebGL and this site has been a good read figuring out stuff from HLSL to OpenGl lingo.

http://www.lighthouse3d.com/opengl/tutorials.shtml

cptSwing
05-17-2012, 06:17 AM
Not sure if these have been posted yet, but here are a couple of free online programming classes:

http://www.codecademy.com/
http://www.udacity.com/

animax
05-17-2012, 09:48 PM
Not sure if these have been posted yet, but here are a couple of free online programming classes:

http://www.codecademy.com/
http://www.udacity.com/

Thanks a bunch dude. Codeacademy is really good, i am starting to learn js now.:poly121:

cptSwing
05-18-2012, 10:52 AM
yeah, i need to sit down and start doing the courses as well ;)