Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411539 Posts in 69383 Topics- by 58439 Members - Latest Member: isabel.adojo

May 02, 2024, 03:06:08 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)TutorialsIntermediate-level programming tutorials?? (making commands/algos)
Pages: [1]
Print
Author Topic: Intermediate-level programming tutorials?? (making commands/algos)  (Read 1688 times)
baconman
Level 10
*****


Design Guru


View Profile WWW
« on: March 05, 2012, 05:00:13 AM »

Generally, the Tuts section is a great resource full of materials for people just getting their feet wet in new programming languages, and Technical is great for discussing nifty trickery that advanced developers can use. Seems kinda tough to find a great bridge-building thing between the two, however.

Okay. So I'm at the point where I know things ranging from integers/booleans/factors or multiples, the general flow of most commands (IF THEN ELSE AND OR, Select Case, Case, etc.); data structures like lists, tables, multidimensional arrays, and indexes. I also know how to make scripts do cool things once there's a scripting algo in place; and I know things about classes and stuff on that level.

I'm just kinda choking on the steps between them - like the part where you make a syntaxed command and arguments that then reference your data structures and scripts, and then produce the systematic outputs they're designed to.
____________________

The level chunker scripting Q thread is a perfect example of this... "missing gear" in my developer brain that really seems to be my downfall in actual production. And a lot of the project I'm working on revolves around this level of coding:

-I'm shuffling an array of player-style sprites, assigning each "role object" in the game a different spriteset based on the outcome of the shuffle.

-I'm using math to determine the range of x/y-axis for determining where everything's biomes are at; and using that to determine the internal spacing of level chunk tiles.

-I'm shuffling another array of screen themes, which will then determine each biome's hotposts, like where boss and miniboss positions are, where to find a weapon or mystery container, and even which screen is a food hideaway. This takes a few "hotspots" mapped to each level chunk/screen, and determines what kinds of objects are placed in them.

-Shuffling a list of food effects, and then having their outcome be determined by their corresponding image_index frame. Also, shuffling an array of weapon/magic pickups, and then placing them in a particular order throughout the weapons boxes.

Making and shuffling these lists and arrays, I can do. Making the objects and their behaviors, I can also (mostly?) do. (Deeper AI is probably gonna take some hit-and-miss.) What's perplexing me is how to correlate the two to get the desired outcome. And it's not just GML, that's pretty much the same wall I hit in C#, XNA, LUA, just about everything I mess with.
____________________

Are there resources around here for bridging that technical gap that is intermediate-level programming?
Logged

ishlilith
Level 0
**


View Profile WWW
« Reply #1 on: March 07, 2012, 06:45:31 AM »

You can check http://www.algo-class.org/ it's an online course from Stanford focusing on algorithms. It seems simple enough, but I suppose it can be very valuable for those of us without a great knowledge of programming.
It starts on the 12th BTW.
Logged

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


Also known as रिंकू.


View Profile WWW
« Reply #2 on: March 07, 2012, 06:55:21 AM »

i'd suggest not following tutorials at your level and instead downloading open source games (preferably in the language(s) you use) and read through their code and learn from how others did things that way
Logged

baconman
Level 10
*****


Design Guru


View Profile WWW
« Reply #3 on: March 07, 2012, 07:40:09 AM »

That's kinda what I'm trying to find. Rogue's, Spelunky's, and Red Rogue's is kinda close to what I'm trying to do, but instead of creating different objects with the strings (which is how they work), I'm just trying to either change the frame of a single object to the output (in case of levels), or base the effects of a particular frame on the outcome of a shuffled array.

Say I have 5 potions and 5 effects. I've shuffled an array of the 5 effects, and I'm trying to relate each effect to a different frame of the "potion" object - IE: first post-shuffled effect = potion on frame 0. I'd love to reference source code for that... but I don't think it exists yet. ~.~'
Logged

ubik
Level 0
***


View Profile
« Reply #4 on: March 20, 2012, 05:36:03 PM »

You could use function pointers for the potion effects.

My suggestion would be for you to work through some programming classes on Youtube.  There are a number of MIT and Stanford and Berkeley classes on there that are excellent and free.

This is one of those situations where what looks like the hard, roundabout way is in fact the simplest and arguably fastest way.  Until you do this, you're going to be continually running into problems that look intractable.  I think a systematic way of studying it is best.

Programming is hard.  There's a reason why people go to school for it.  You could argue that game programming is the hardest type of programming that there is because it's performance dependent, it requires lots of device porting, it requires math and sometimes heavy math...

My guess is that after a week or so of doing those classes you'll already have been benefited by them.  I've been programming for a long time now and they cover some things in there that I hadn't run into before (especially Structure and Interpretation of Computer Programs...)
Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #5 on: March 20, 2012, 07:08:28 PM »

> Seems kinda tough to find a great bridge-building thing between the two, however.

You can probably learn this somewhat through tutorials, but in my experience it's mostly just practice and will be idiosyncratic as well as paradigm and genre specific. At a guess I've probably written over 100,000 lines of code, and somewhere along the way things started making sense. My computer science education never really connected the dots between low-level concepts like sorting lists etc. to building complex systems like games.
Logged

ubik
Level 0
***


View Profile
« Reply #6 on: March 20, 2012, 08:58:20 PM »

The problem with tutorials (and "how to program games" books) is that they represent a piecemeal approach that teaches you how to deal with a tiny fraction of the problem space you will be encountering when programming.

A foundation of algorithms in particular will be very helpful when considering problems.  What class of problem does this fit into?  What sorts of algorithms are well suited to this class of problem?

A great example is the collision detection pitfall.  It works fine with 100 objects but with 300 objects it all bogs down.  Why is that?

Algorithms and Data Structures and algorithmic analysis explains why these things happen and how to correct them.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic