Recent posts by Draco18s on Kongregate

Flag Post

Topic: Game Programming / This piece of code causes memory leak. Unsure, why.[as3]

I’m not sure if I’m reading your code right, but are you really recreating every bullet every frame (or recreating your HUD every frame)? If so, then the lag is most likely coming from the GC itself since it’s a very VERY slow process.

Pretty much that. You’re rebuilding your HUD from scratch every frame rather than just changing what needs to be changed, so you’re garbage collecting a TON of stuff every frame.

 
Flag Post

Topic: Game Programming / Time spent on games

I spend way to much time and never finish anything :p

 
Flag Post

Topic: Game Programming / Unity

That’s why I said Shader Forge. Shader Forge was built to be for artists and remove all the “magic” of having to write shaders by hand. I put that image up as an example of what I managed to accomplish in only a couple of hours utilizing only some texture files that came with Shader Forge and a ridged perlin noise map off Google.

I’ve worked in chader code a couple of times and every bloody time it’s been a mess of “so if I declare the variable as a myVert and give that custom class a normals property, it comes into my function like magic?” *compile* “….apparently so.”

Long story short: the default shaders will look boring and flat no matter what you do. Get some good ones. There’s a bunch of free packs out there, but don’t expect them to have everything.

 
Flag Post

Topic: Game Programming / Unity

I have this thread on optimizing rendering in Unity. A couple of them are pro-only, but its still a good reference.

I also suggest picking up Shader Forge (video of the dev talking about why he made it) when you can afford it. It only took me a couple of hours (across two days) to do this:

Until then, go snag as many free shader packages as you can, the more non-default shaders you use the less people will recognize that you’ve used unity. I picked up Shader Forge when it was half-off and am very glad I did so.

 
Flag Post

Topic: Game Programming / The future of flash

/me reads title
/me sighs, another one of these threads

Flash is not dead, mobile gaming is on the rise, and while other development options are increasingly powerful and cross platform, Flash is still very good for web deployment. Having those skills on your resume will look good. If I’m doing something 2D, Flash is where I’d start unless the needs of the project will not support Flash.

 
Flag Post

Topic: Game Programming / What is a 'package'?

A package is the same thing as a namespace.

It’s basically the location of where the class resides in a hierarchical file structure.

So when you import flash.events.MouseEvent or caurina.transitions.Tweener you’re importing a package…flash.events and caurina.transitions (and then two specific classes within those packages) and the class files themselves live at [arbitrary path location]/flash/events/MouseEvent.as and [arbitrary path location]/caurina/transitions/Tweener.as

 
Flag Post

Topic: Game Programming / Any ways to speed up exporting of SWF when debugging movie in Flash?

Unity → iOS is a nightmare for me, not just because of compile times, but because it can ONLY be done on a Mac (because XCode).

So the process is:

1) Copy 300 mb project to a flash drive
2) Copy 300 mb project onto the Mac
3) Open project in Unity.
4) Get lunch as it recompiles small assets
4b) Check settings, etc.
5) Compile for iOS
6) Eat lunch, its going to be a while
7) Check up on it, discover that it ran and ran out of memory and crashed. Go to 4b

 
Flag Post

Topic: Game Programming / Any ways to speed up exporting of SWF when debugging movie in Flash?

Wait until ypur compiling for the iPad with unity. Swear to good it takes 20 minutes.

 
Flag Post

Topic: Game Programming / No blank screen, debugging mode or trace statements seen

Originally posted by Gamerboy98:

Alright, perhaps that’s a better method to rage-restart.

God, I react to programming like how I react to Math questions that I’m stuck on. But then again, the rage feels similar.

…And now I want to know why you’re trying to get into programming. Programming is nothing but math questions that will stump you.

 
Flag Post

Topic: Game Programming / No blank screen, debugging mode or trace statements seen

Yup.

 
Flag Post

Topic: Game Programming / Any ways to speed up exporting of SWF when debugging movie in Flash?

Originally posted by Draco18s:

30 seconds! The horror!

Come compassion when ypur compile times hit 3 to 5 minutes.

A gayer cpu will always help.

Oh gods, the autocowreck.

Should be:

Come complain when ypur compile times hit 3 to 5 minutes.

A faster cpu will always help.

 
Flag Post

Topic: Game Programming / Can Anyone Recommend A C++ IDE?

Eclipse/Java has put my standards at “unrealistic” when looking at other editors.

 
Flag Post

Topic: Game Programming / Any ways to speed up exporting of SWF when debugging movie in Flash?

30 seconds! The horror!

Come compassion when ypur compile times hit 3 to 5 minutes.

A gayer cpu will always help.

 
Flag Post

Topic: Game Programming / No blank screen, debugging mode or trace statements seen

and FD doesn’t open a blank window anymore

That window isn’t actually blank, its just that there’s nothing on the stage of the swf, so it looks blank. FD wouldn’t have removed “a useless blank window” because it isn’t blank or useless.

You not getting it means that there was a compile error and your movie didn’t run.

 
Flag Post

Topic: Game Programming / Problem with loop and buttons

You have 11 elements in your array, not 10. So either you need f<10 or f<=9.

The problem is that when I try to reffer to the button ( m+number) I have no idea how to do it dinamically :S

This is one of those “weird and not well documented, and really kind of bad practice, but Flash lets you do it” things. (AFAIK it’s a form of reflection ).

this["m"+f].visible = true; //assuming that "this" contains the movieclips you wish to show.

But yes. You should use an array of movieclips and do…

clips:MovieClip[] = ...;
...
clips[f-3].visible = true;
 
Flag Post

Topic: Game Programming / Using or sybmols in if conditions

Originally posted by AshAbeAdd:

The point for these conditions is that there will be 5-25 words that would only be allowed as answers. I don’t know if they would want to capitalizes all of their letters or have them lower cases. That’s why I’m allowing words to be as, “hot”, “Hot”, and “HOT”. Rereading your codes, I realized what you really meant.

If you force the user’s answer into all-caps, then you don’t have to match “hot” “Hot” “hOt” “hoT” “HOt” “HoT” “hOT” and “HOT”. Ditto for all of the rest of your words.

Am I suppose to include a library so I can use Uppercase?

No, use the string class.

var answer:String = NumArrayFull.join("");
answer = answer.ToUpperCase();

For the pluses, do you mean to put down commas?

No, I did not mean to use commas. I am using the + operator. "a" + "b" == "ab" You do not need to escape any of the doublequotes. DO NOT ALTER IT. I want to know what that trace statement yields.

It should look like this:
HOT == HOT: true
or
Hot == HOT: false

 
Flag Post

Topic: Game Programming / Using or sybmols in if conditions

trace(NumArrayFull.join("") + " == HOT" + ": " + (NumArrayFull.join("")== "HOT"));

(Your “or” operator is correct, the error is somewhere else)

 
Flag Post

Topic: Game Programming / Deleting letters

Originally posted by dragon_of_celts:

Oh. I thought you were being sarcastic.

Oh not at all.

I <3 System Beep

 
Flag Post

Topic: Game Programming / Deleting letters

While ordinarily 0×07 produces the bell sound, there is, in fact, a glyph for that code

I know :P

 
Flag Post

Topic: Game Programming / Flash Drag and drop question

Originally posted by Draco18s:

Note:
I do not handle help requests via PM.

Everything from the link I have provided is easily translated into AS3.

 
Flag Post

Topic: Game Programming / Flash Drag and drop question

While this is technically for dragging Unity GUI objects, it is easily replicated in AS3. I was able to apply the code in that post to moving around GameObjects rather than Gui objects, so applying it to movieclips would be trivial.

My code didn’t use the Event system, either, just checked for mouse-up and mouse-down (lit. Input.GetMouseButton(0)), so don’t be turned off by that.

 
Flag Post

Topic: Game Programming / Deleting letters

Originally posted by dragon_of_celts:


The first 31 characters are control characters, which are not normally printable — however, they do, in some cases, have a printable glyph. You would need to test and substitute when you receive keystrokes (so if you receive a backspace keystroke, you don’t push that character onto your array, but pop one off and discard both the backspace and the popped character).

…assuming I understand what you’re trying to do and what your problem is…

My fav is 0×07

It’s totally a printable character.

 
Flag Post

Topic: Game Programming / Split my project into multiple files

If it’s impossible to maintain, it’s not an option :P

Just saying that just because it looks like an option might be more convenient, it might not actually be.

 
Flag Post

Topic: Game Programming / Pointers On Cutting Code

Some compilers can even in-line some functions. That is, it unwraps them in the translation to bytecode.

 
Flag Post

Topic: Game Programming / Kreds

This is not the forum you are looking for.