Recent posts in Game Programming on Kongregate

Subscribe to Recent posts in Game Programming on Kongregate

avatar for Senekis93 Senekis93 2873 posts
Flag Post

Topic: Game Programming / Which is better? To load from XML or JSON?

He did. And it’s a beast.

 
avatar for BrainStormer BrainStormer 367 posts
Flag Post

Topic: Game Programming / Which is better? To load from XML or JSON?

Worth noting that latest SDK and Flash Player versions natively support JSON. Usage syntax is the same except method names: JSON.stringify(data:Object) instead of JSON.encode(data:Object) and JSON.parse(string:String) instead of JSON.decode(string:String).

EDIT: Worth noting again that you can write your own JSON parser/stringifier that may be much more efficient than the native one. Skyboy, you did that if I remember correctly, right?

 
avatar for Pimgd Pimgd 1655 posts
Flag Post

Topic: Game Programming / AS3 or AS2

Back when I wanted to convert my pascal game into flash, I wanted to do so quickly.
So what I did was watch a video where someone used the IDE I was gonna use to code some basic thing so I could see where all the buttons where and what keywords I should be googling for…

And then I just googled what I needed.
All the text besides the code was irrelevant until I had seen the code. Cause there’s so much crap on the internet (like here) that is basically a meta discussion and not what I needed at the time.
Copy-pasta woo my button works.
I fiddled around with it to see how it actually works.

When you have been programming before, all these tutorials are annoying crap. I know how to program, thanks. I just don’t know what the syntax for an if statement is in your language. So if you could please tell me, that would be great.
That’s why I, personally, would close anything lengthy.

These days, when I have to look something up, I look things up in 2 styles. One of them is “I want to remember how to use X”, which is usually looking up syntax (Interfaces work how?). The other one is “I want to learn how to use X”, which is usually looking up features (How do I save a shared object to a specific path?). When looking for syntax, I don’t care for page long tutorials. When looking for features, I look for page long tutorials because I want to prevent falling in a stupid trap because the default settings are not compatible with situation Y.

The difference that is being advocated here on this thread is learning by “book”, or learning by problem.
Learning by problem is “I want to make button” → Google → Copy Pasta → “Yay it works so that’s how to make button”. These people want to make a game, but struggle to do so.
Learning by book is “I want to learn making games with flash” → Google → Read a lot → Try something out. These people want to learn how to make games, and will try to understand what’s going on.

The only people willing to read a lengthy tutorial on the use of variables is the second group. The first group says “well idk, maybe some other link works better”.

If you would place both tutorials in front of average people (beginners), and ask them to rate it for usefulness, I think that the lengthy, detailed tutorial will get a lower score. Probably the most general response for the lengthy tutorial would be “well, yeah, I suppose it’s useful, but not for me”.

If your tutorials were games, you’ld be looking at low play counts because people don’t want to read 5 pages of instructions before starting to play.
This is important. Very important. Everywhere on the internet, the style of content delivery is changing to “right now”.
People whine about 15 second advertisements on games. People whine about 5 second page loadtimes.
People want their content 5 minutes ago.

Should these lazy people be catered? Personally, I’d say yes. Not to teach them to make games, but to help them see how making a game goes. Once these people are hooked, they’ll read more. 5 pages before the usage of variables is too much. 5 pages before the usage of the Strategy pattern doesn’t sound like too much (but good luck filling them, I guess).

The first run of making games should be done with supporting advice. Don’t tell people they are going at it the wrong way – tell them how to solve their problems.
An example:
Here’s Bob. Bob wants to make a 2D mining game. He’s a huge fan of motherload (from xgenstudios) and thinks a 2-player version would be totally awesome, since it’s either him or his friend playing, and if they could play splitscreen, that would be just awesome.

So Bob wants to know a couple things. How to make the miner move, how to make the level, etc. I personally can see a million things going wrong already – 2D Mining game as a first game… gonna be hard.
Bob likes playing games on Kongregate, and Kongregate has some sort of programming forum. So lets make a post.

“Hey guys I want to make a mining game what do I need”
Hi My name is Bob and I like motherload and i want to make a game like motherload but for 2 players
my dad has adobe CS5 so i asked him if I could install flash and he said yes so i installed adobe cs5 flash

my friend says he knows how to program in ass2 or whatever that is but he lost his copy of flash so we’re gonna make it on my pc
what else do I need for making a game like this
end post.

I imagine that the amount of hate posts dumped on this thread would be enormous.
First off would be “Make a smaller game”.
Next up is “Use AS3.”
Then comes the legal advice, “Don’t copy motherload it’s illegal”
followed up by the suggestion to change IDE’s so the friend can program on his pc aswell “Use flashdevelop you can get it here”.

Now, depending on his friend, this thing fails or succeeds. But if Bob were on his own, this would be a failure. Whilst all the advice offered is helpful, it’s not helping Bob.
What would help him was asking him to write out his idea, and once he had done that, explaining what he would have to make for each of the things. Then you can stick a nice warning sign at the end of the list “This is a lot, so if you’re not sure about this I don’t suggest doing it”.
Then sort the list on what is easy to make and what is hard to make. That way, Bob will have a consistent feeling of progress. For each of these things, he can google. You can hide away the hard stuff with “once you’ve made all this come back and show us”.

Now I don’t claim to know it all here. I also don’t claim that Bob will be able to make his game – it’s gonna be very likely that he won’t be. It’s too big. What you can do is help him experience programming and making games. Do this on a large scale, and you’ll see that some people will meet their goals.

The second run, after someone has made a game, can be used for telling them how to properly make a game. They know it was hard, they had problems and stuff, and what you’re gonna tell them will solve those problems. They want to listen because when you’re talking about a cure for their problems it’s interesting to them. On the first run, they didn’t know that the problems exist and would most likely have ignored the advice.

I spent 90 mins writing this… dumping it now.

 
avatar for DrYoshiyahu DrYoshiyahu 270 posts
Flag Post

Topic: Game Programming / I'm getting security errors and I dunno how to fix it (AS3)

I want to use MochiAds for my game and I’m getting a security error, I’ve been all over google and no one has the answer.

I copied+pasted the code from the mochimedia website but the ad wasn’t appearing. Then I added in the code below and it started to work.

Security.allowDomain("http://x.mochiads.com");

But once it tries to access a function in a Class I downloaded from mochimedia; I get this error and the ad freezes.

*** Security Sandbox Violation ***
Connection to  halted - not permitted from http://x.mochiads.com/ctr/MochiAdsContainerCDN.swf?v=abc123
-- Remote SWFs may not access local files.

The ad has a built in play button which will call a pre-determined function, also in the MochiAds Class, once I click play the error message appears again, exactly the same, and the game goes blank.

Does anyone know how to fix this? :/

PS. My apologies if this isn’t appropriate to ask on Kong.

 
avatar for NineFiveThree NineFiveThree 961 posts
Flag Post

Topic: Game Programming / Noob question!

Originally posted by qwerber:

Derp, don’t you realize he was looking for direction in terms of rotation.

Which -as I said- requires both objects to be in the same coordinate space.

 
avatar for saybox saybox 2083 posts
Flag Post

Topic: Game Programming / AS3 or AS2

Originally posted by Vallentain:

If people want to learn they CANT be lazy. If they don’t understand it, then ask around, try another tutorial, there are some very easy to follow step-to-step beginner tutorial out there, google it.

You’re saying that people who tries to help are doing it wrong and they should baby lazy programmers, pacify them with copy-paste friendly tuts? Ow yeah they should do it.

Please encourage people to be lazy, I don’t like competition.

NOBODY is telling nubs they should run marathon before learning to walk, I learned AS3 100% from avoider tutorial and reading gameuniv pdf (several months ago, ming you). If they can’t do anything that isn’t copy paste then… well it’s nobody’s fault!

Lol. there’s that “lazy” word again, just because you think people should all learn the same way you did. And I never mentioned copy pasting, so I don’t know where you got that from.

Here’s a story for you instead, since you don’t seem to be understanding anything else i’m saying.

Once upon a time the other day, I happened to be talking to a Kong member who’s made a few “games” in AS2. By “games” I mean he knew how to use gotoAndStop, and startDrag().

Anyway, he needed help with something in a new game he was trying to make. He’d added some code to make a ball move, but needed a way to make the ball start or stop moving depending on the game’s state.

Sounds simple, right? Set a variable and check what its set to to see if the ball should be moving or not.

Well, that’s almost exactly what I said to him. The problem was that while the tutorial he’d read on variables had told him all about Boolean variables, and how true / false is the same as 1/0, and what types of variables he could use, and how to name them, and blah blah blah, none of that relates to what he wants to do at all.

The use of variables is not intuitive to most non-programmers.

Now look at the AS3 variables tutorial that NineFiveThree linked.

Section 1 has 5 paragraphs telling you about variables in maths and programming, conventions, a few exceptions to the conventions, loop conventions, and a link to Wikipedia to read even more about them.

Section 3 has 8 paragraphs about how to name your variables. 8 paragraphs! And then 5 links out to more about naming them.

The tutorial doesn’t get round to actually setting a value to a variable until 1,264 words in. In real terms, that’s 5 sides of typed A4 paper, not including pictures. All that to achieve two lines of code. Oh and they haven’t typed the variable at that point, so it’s not even well written code.

That is the wrong way to teach a beginner. The fact that a few people might struggle through the 2,426 words it takes to create, type, and debug a variable doesn’t make it a good tutorial. And if they manage the entire thing, which is almost 5,000 words (20 pages of typed A4, plus pictures), they’ll have a button that doesn’t do anything “real” when it’s clicked. Why would any new programmer inflict that sort of torture on themselves when they see quite clearly how easy it is to do the same thing in AS2, through one of the “low quality” tutorials Mr NineFiveThree is so critical of?

 
avatar for orandze orandze 127 posts
Flag Post

Topic: Game Programming / GiTD [#24] Voting

Ok, going in according to importance/relevance to the thread:

My Votes:

1st) Level Quest
2nd) Just Another Shadow

Analysis:

Organize a GiTD – Short and sweet. All the standard aspects of a game/story are included: protagonist, enemies, weapons, and an objective. However, it’s mostly just a skeleton as it is. The thing I like most about this game is the developer’s enthusiasm for the contest. Keep up the good work :)

Wizard’s Quest – To me, a standard Gauntlet-esque action game. However, there were many flaws I encountered in the gameplay itself. My first try at it, I leveled up four times within 30 seconds, then got swarmed by enemies and could barely move. They didn’t actually seem to be doing any damage to me though, until I leveled up again. Then I died. I continued to retry the game several times and each time whenever I would start taking damage, I would lose health so quickly that I wouldn’t even have time to get my cursor over to a potion. That being said, it does seem to have the foundation blocks for something very awesome and unique.

Looper – So… freaking… hard… I don’t know how you even managed to play test this, but from what I experienced, it was very solid with some pretty nice graphics. It could definitely do with a few checkpoints throughout, or at least one or two. I forced myself to attempt this several times, but ended up quitting out of frustration each time. I don’t think that’s necessarily a bad thing though. Take for instance Meatboy or MoneySeize.

Level Quest – In my opinion this was the most comprehensively innovative interpretation of the theme. I was laughing the whole way through the game. Also, for some reason the graphics and the music felt somewhat like Donkey Kong. All in all, very original and well put together.

Pinky’s Dungeon Escape – I enjoyed this game for a good while. It’s a well-built puzzle platformer that could keep me entertained for hours, save for a few things that bugged me on nothing more than a superficial level. The music got a tad annoying after a few minutes but the game felt so bare without it. The pixel precision would have been a little more tolerable had the controls been just a smidge more accurate, but this didn’t diminish from the gameplay in any way. Finally, I thought the gem circles looked like giant hairballs and got a little grossed out every time I saw one and was slightly dismayed when I found out I had to touch it in order to progress to the next section. No offense, though. It really was quite good.

Just Another Shadow – I thought this was really excellent in terms of game design. It was a totally new experience for me to have to play against my previous self. With some minor things adjusted, like the text not stopping you, being skippable, or even moving a bit quicker, and just some things being erased from several stages ago that aren’t visible anymore just to prevent lag, I think this would be on par with Shift.

Invader Breaker – Definitely a unique concept. I just couldn’t manage to get the hang of it though. I know it’s just me, but I just couldn’t focus on all that was going on. It felt a bit like I was playing MultiTask.

Millenium Pork in Castle Crisis – A very nice entry indeed. I had a lot of fun blasting around the castle. The controls were pretty smooth, although a little touchy at times. The graphics were wonderful, and the music never got old. I was pleasantly surprised whenever I first noticed that the castle walls were deteriorating with each hit. That added a completely new aspect to this type of game.

Clown Death – Clown death indeed. Clown deaths galore! Clowns dying everywhere!! But seriously, I started this game up and I smiled. I fired the confetti cannon and I laughed. I saw the lions and I died… I waited… I saw the lion population increase with considerable growth. I saw them charging forth in massive pride! … and I cried.

The Floor is Lava – I had a lot of fun making this. And in case not everyone got the memo, it was inspired directly from Heatman’s stage in Megaman 2. Whenever I enlisted ktluvsice for this project, I gave her the link to a youtube video of the level and said, “I want to make that part with the disappearing blocks.” I think she did an excellent job, and without her this game wouldn’t have been possible. (If you enjoyed the graphics, please be sure to let her know )

Fight Scene – I really enjoyed the concept of this game. The final boss fight is always the best and most epic. I can’t remember the number of Final Fantasies I’ve started up and immediately gotten excited to encounter the final boss. There were two crucial downsides to this game however: the tediousness in the amount of clicking involved, and the inability (at least for me) to defeat the third boss. I just couldn’t heal enough to account for the amount of damage he was dealing. Due to this, I sadly have not yet played it all the way through.

Bob the Blob – This was very well contrived. The different abilities Bob had reminded me a bit of Dibbles. I eventually was stopped from progressing when I encounter the hall where there were alternating spikes on top and bottom. A simple control mechanism where the player doesn’t jump to full height if the jump key is just tapped could have allowed me to pass, but I just couldn’t find a way around it.

Now for some responses to comments on TFiL:

Found 1 “problem”, you are counting 1 second more per minute.

I apologize, this is a known bug that I haven’t yet figured out how to fix. Well, I know how to fix it in theory, but in practice it just refuses to work.

I’m getting flashback of Heatman’s stage in Megaman 2. You know, the part where everyone just uses the jet sled instead of jumping on the blocks?

Dammit, why did I NEVER think to do that?

I think instead of just one small box to work with, the game could’ve been really successful with a randomly generated map to run along.

During development, ktluvsice actually suggested turning this into a runner, so we actually will be starting on this concept for the sequel at some point in the near future. I’d like to think we could get this sponsored.

One last response and some shameless self-promotion:

The music is probably the best part of this game. It was quite nice to just listen to it

Thank you to everyone who game me such wonderful feedback on the music. I actually started teaching myself to program a year ago mainly to make games that would promote my music, and it seems like I have succeeded :)

I’d like to point out again that for anyone working on a submission for ANY GiTD in the indefinite future, all you have to do is PM me, and I’ll gladly provide completely custom music and SFX to you free of charge. Besides that, pricing is very negotiable, so if you’re working on something non-GiTD related, PM me anyways, and I’m sure we can work something out :)

I also have a website in the works where I’ll have many many royalty free songs available for download, so be on the lookout!

 
avatar for UnknownGuardian UnknownGuardian 6220 posts
Flag Post

Topic: Game Programming / Game Development Room (GDR)

Testing a new version that drops 23 characters, a font tag with size, per message. (Over a few hundred messages, that’s a lot!) It also keeps the font size standard (so larger time stamps) but it should be faster rendering.

EDIT Forgot about the info tag is replaced with profile tag. Click on a user’s name to go to the profile panel and click the profile tab to go to their Kong profile.

 
avatar for Vallentain Vallentain 21 posts
Flag Post

Topic: Game Programming / AS3 or AS2

Saybox you’re making me laugh.

If people want to learn they CANT be lazy. If they don’t understand it, then ask around, try another tutorial, there are some very easy to follow step-to-step beginner tutorial out there, google it.

You’re saying that people who tries to help are doing it wrong and they should baby lazy programmers, pacify them with copy-paste friendly tuts? Ow yeah they should do it.

Please encourage people to be lazy, I don’t like competition.

NOBODY is telling nubs they should run marathon before learning to walk, I learned AS3 100% from avoider tutorial and reading gameuniv pdf (several months ago, ming you). If they can’t do anything that isn’t copy paste then… well it’s nobody’s fault!

 
avatar for Moshdef Moshdef 487 posts
Flag Post

Topic: Game Programming / GiTD [#24] Voting

 
avatar for DrYoshiyahu DrYoshiyahu 270 posts
Flag Post

Topic: Game Programming / GiTD [#24] Voting

Haha I’m definitely not an artist, which is why the character is just a few circles. :P

 
avatar for qwerber qwerber 3904 posts
Flag Post

Topic: Game Programming / GiTD [#24] Voting

nice graphics, so similar too!

 
avatar for DrYoshiyahu DrYoshiyahu 270 posts
Flag Post

Topic: Game Programming / GiTD [#24] Voting

Originally posted by oscarwilld:

Just another shadow: Not actually an original idea, but this was still the only game I played for a decent amount of time. You definitely need to make it so it doesn’t pause whenever text appears, and you need to either add some more variety or remove a few levels because I started to get bored and quit before the end.

What an amazing coincidence! That game’s exactly the same concept with less features. But I’ve never seen it before. :O

 
avatar for TheAwsomeOpossum TheAwsomeOpo... 1001 posts
Flag Post

Topic: Game Programming / AS3 or AS2

Originally posted by Amibtious:

I began to learn AS3 last year, and didn’t notice any of that. I particularly didn’t notice a ’don’t use these use vectors you fool’ warning on array tutorials, which I kinda wish I had. I have not seen ANY (and teaching myself I’ve read a lot) low end tutorials that “are written from the point of view of “Will other expert AS3 coders think this is the best way to write code?”,”. If there are beginner as3 tutorials out there that teach bitwise operations as default, I haven’t noticed.
You may be projecting a little, do many people really think AS2 coders are lazy/stupid? I don’t.
Are newcomers really choosing to learn AS2 instead of 3? I hope not….mebe there’s no reason for someone who already knows AS2 to waste time learning AS3 when they’re only planning to make low-processor use games…but advising people from the start that as2 may be the better option seems extremely questionable.

Lol… when I get to actually doing tutorials on my website, I am going to put such a tutorial… the section for Arrays would say something like this: “Don’t use them. Use these instead.” lol.

 
avatar for Amibtious Amibtious 28 posts
Flag Post

Topic: Game Programming / AS3 or AS2

I began to learn AS3 last year, and didn’t notice any of that. I particularly didn’t notice a ’don’t use these use vectors you fool’ warning on array tutorials, which I kinda wish I had. I have not seen ANY (and teaching myself I’ve read a lot) low end tutorials that “are written from the point of view of “Will other expert AS3 coders think this is the best way to write code?”,”. If there are beginner as3 tutorials out there that teach bitwise operations as default, I haven’t noticed.
You may be projecting a little, do many people really think AS2 coders are lazy/stupid? I don’t.
Are newcomers really choosing to learn AS2 instead of 3? I hope not….mebe there’s no reason for someone who already knows AS2 to waste time learning AS3 when they’re only planning to make low-processor use games…but advising people from the start that as2 may be the better option seems extremely questionable.

 
avatar for hok0003 hok0003 24 posts
Flag Post

Topic: Game Programming / GiTD [#24] Voting

1st – Bob the Blob
2nd – Pinky’s Dungeon Escape

I also enjoyed Just Another Shadow, but it felt like a lot more than one level to me.

 
avatar for saybox saybox 2083 posts
Flag Post

Topic: Game Programming / AS3 or AS2

Originally posted by NineFiveThree:
Originally posted by saybox:

Neither of those tutorials solve the problems I was talking about. Not sure if you didn’t read my post properly or if I didn’t explain well enough :P

I said that it requires a minimum amount of effort people are willing to put into it.
If they don’t have it, it’s clear that independent from the language, tutorial, teacher, they will never create game in the end, because it requires dedication to do it.

You were talking about people asking for buttons. If buttons are all they want, they are part of the category mentioned above.
If they want more, they actually want to learn programming. The tutorial examples are great for exactly that.

Those are no use at all to someone totally new to programming. They’re very good novice / intermediate tutorials, but they’re not beginner tutorials. They won’t come up in a Google search, and they spend too long telling you about how they work and why it’s the “right” way to program something, without mentioning much about what they’re useful for.

Most AS3 tutorials are being written for an audience of people like you, people convinced that if someone doesn’t understand them then they must somehow be lazy or not putting the effort in. It’s all about efficiency, logic, and structure for you, so you judge tutorials according to your own standards of programming.

But you’re wasting your time. You guys are the ones trying to make them dance before they can walk. The tutorials are written from the point of view of “Will other expert AS3 coders think this is the best way to write code?”, instead of “Is this what a new programmer is asking?” It’s a self-centric approach that excludes many of the people who are just starting to learn by themselves.

So what happens? People choose the AS2 tutorials that actually appear relevant to them instead. And while you make post after post complaining about how “lazy” they are, they’re getting on with making something in AS2 instead, and that works out just fine for them.

Your (collective) inflexibility on how beginners “should” learn is what’s making so many of them choose AS2, and why so many AS2 coders stick with it. The attitude many of the better AS3 programmers take towards AS2 users makes it more likely they won’t switch. If you want to start convincing more people to start with AS3, or switch to it, then drop the obsession with performance, lose the attitude towards AS2 users, and start helping them in a way that makes sense to someone new.

 
avatar for qwerber qwerber 3904 posts
Flag Post

Topic: Game Programming / Noob question!

Originally posted by NineFiveThree:

Note that both given codes require target and you/source to be within the same coordinate space to work properly.

Derp, don’t you realize he was looking for direction in terms of rotation.

 
avatar for skyboy skyboy 5926 posts
Flag Post

Topic: Game Programming / Odd issue with two identical, simultaneously attached, objects

Originally posted by Draco18s:

Exactly, which is why I don’t understand what’s going on.

try the vector then, if it works flawlessly file a bug report with Adobe

 
avatar for oscarwilld oscarwilld 78 posts
Flag Post

Topic: Game Programming / GiTD [#24] Voting

Organise a GiTD: Far too short, needs a lot more content.

Wizard’s Quest: I’m not sure what the objective was, my wizard seemed to be invincible and I just wandered around a never ending dungeon picking up the occasional chest. I think I must have been missing something because I’m not sure why so many people voted it first otherwise.

Looper: The best looking game, and a nice idea, but far far too hard. You need to tighten up the controls and tweak the hitboxes, don’t make it too easy but at least make it possible. I really wanted to like this game but ended up rage quitting pretty quickly.

Level Quest: Cleverest use of the “only one level” theme, but a bit repetitive. I got bored and quit before the end.

Pinky’s: I wasn’t able to play this because I accidental set all the controls to the left arrow key. Needs an “are you sure you want to make this changes?” prompt.

Just another shadow: Not actually an original idea, but this was still the only game I played for a decent amount of time. You definitely need to make it so it doesn’t pause whenever text appears, and you need to either add some more variety or remove a few levels because I started to get bored and quit before the end.

Invader Breaker: Good concept, but hard to tell what was going on sometimes. I kept dying without even realising I was being hurt.

Millennium Pork: Difficult to control, kept falling down the pits. Looked very nice though.

Clown Death: Same as Millennium Pork.

The Floor is Lava: I liked this, but needs more variety. It got a bit samey quite quickly.

Bob the Blob: Really nice concept, let down by the lack of polish. The controls aren’t great, the camera’s jerky, it really needed a bit more time.

- My votes -
1st Just Another Shadow
2nd The Floor is Lava

 
avatar for player_03 player_03 904 posts
Flag Post

Topic: Game Programming / Write a game in flash[haxe] and compile that same code to windows, linux, mobile iOS, flash, and Android into native code

NME does seem to be pretty cool. I was going to suggest you look it up, but then I realized you were already using it.

 
avatar for khezoow327 khezoow327 151 posts
Flag Post

Topic: Game Programming / GiTD [#24] Voting

1st The Floot is Lava
2nd Wizard’s Quest… also, pretty nice games all :D

 
avatar for qwerber qwerber 3904 posts
Flag Post

Topic: Game Programming / Help with Python 3.2

Results is not a list; it is a dictionary, basically you can assign values to strings.

 
avatar for Attila0413 Attila0413 311 posts
Flag Post

Topic: Game Programming / android games sdk eclipse

Probably it’s not the best forum to ask Android sdk related stuff, as it’s mainly focused on Flash programming.

Anyway, I wrote some introductory tutorials about the Android SDK some months ago, here: http://www.attiliocarotenuto.com/android

 
avatar for GameBuilder15 GameBuilder15 7858 posts
Flag Post

Topic: Game Programming / Just a little WTF moment haha funny

I’m sorry to say I lol’d. :P