Recent posts by Draco18s on Kongregate

Flag Post

Topic: Game Programming / Battle pirates MMO

Originally posted by Tt_games:

How would it be possible to bring “Battle pirates” the MMO to kongregate?

1) Contact the developer
2) Wait

 
Flag Post

Topic: Game Programming / Kongregate not respecting the width/height I entered

Originally posted by player_03:

Is it possible that you compiled the game with those other dimensions?

Unity webplayer files don’t have a size. The whole “I compiled it with X size” just changes the embed dimensions in the HTML file it generates.

 
Flag Post

Topic: Game Programming / Load .png without premultiplying alpha channel?

Not in Flash AFAIK

 
Flag Post

Topic: Game Programming / In-game Events: Storing the target as a variable or passing it each time

Simply:

You need a finite state machine. Each “GameEvent” is one state of that state machine.

 
Flag Post

Topic: Game Programming / In-game Events: Storing the target as a variable or passing it each time

Events happen to objects. If, for example, the character gets stunned, then the character should have a component attached to it that says its stunned. The event is merely the piece of code that attaches that “stunned” component to the character. Another event (duration expired) removes it.

http://www.kongregate.com/forums/4-game-programming/topics/338362-deeper-topic-part-3-events-to-the-rescue

For something that happens at a game level, the event will fire, the main script will hear it and do something. Probably switching states and doing the random encounter code/display, etc.

Events themselves shouldn’t be considered objects (although there will be a codewise object that represent the event data, but it should be treated as a temporary object that as soon as the event has finished execution1 is destroyed).

1 by which I mean that it should last less than 1 frame. It may have continuing effects, but they are not the event itself, but they are not handled by the event object.

 
Flag Post

Topic: Game Programming / Some Advice Against Unity

Originally posted by Darvious:

Think about it: The net has been popular for roughly 15 years now. Assuming that the average child wanted a computer / laptop between the ages of 10 and 12, what sort of computers do you think that these children received from their parents? Hand me downs.

This is hilariously untrue.

The kinds of families that this statement alludes to are the kinds of families that wouldn’t have HAD a computer 15 years ago. More likely, kids these days are getting on at school (where computers are of an indeterminate age, but generally less than 8 years old1). At home they’re likely to either have a single family machine that is strictly regulated (“You only get X amount of computer time a week, after homework”) or a mobile device (iPad, etc.) that belongs to them, or no access at all.

I had to work for and save up my money to buy my own computer as a kid. We had two computers at the time, an old 486 that was good enough for internet browsing at the time (we still have it in the basement, I have no idea why), and a newer Compaq presario—midrange home computer for the time.

I’ve replaced my hardware twice since then, my parents have also replaced their machine at least twice (the Compaq died and then down-graded to a free machine they got somewhere for a while (it was enough for email) before getting a new one—I think the one they have now is even newer than that, but it’s a bit fuzzy).

So really, no. “Kids these days” are not going to be running on hand-me-down hardware. It would be neigh unusable unless they and the machine’s previous owners actually knew how to keep it free of malicious software and maintain it. Which is absurdly unlikely, as it would imply a greater knowledge of computers than their low-income status would allow for (on account of not being around the technology 24/7).

1 I worked as an IT desktech at a school. They had some old computers, but they were kept in good shape by doing a complete wipe, reformat, reinstall every 6 months. It was hardware that was simply aging, but if something actually failed, the machine was replaced. New machines were bought in bulk once a year, generally going to faculty. Those machines were then wiped and replaced even older machines on down the chain. So the oldest of the oldest were only about 12 years old (there was one computer lab with these ancient relics, everything else was newer).

 
Flag Post

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

AFAICT, TLF textfields are awful. I have not found a good reason to use them over classic textfields yet.

 
Flag Post

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

Yes, there is a reason – me going crazy because of memory leak and discarding all possible sources. I never set variables to null like this usually.

Creating new pbullet()s every frame IS your memory leak.

By the way:

public class Global extends EventDispatcher {
//blah blah blah
	var curw = Global.curturner.curweapon;

You don’t need to do this. var curw = curturner.curweapon works just as well. And there’s a larger problem of increasing RAM usage by 1 pointer in order to save a single dot-lookup not really being worth it.

Ditto goes for all other Global.[whatever] because the current class IS the Global class. You can actually find-replace “Global.” with an empty string and it’ll compile just fine (same goes for “this.” although the compiler strips that out automagically, as it’s there for the programmer).

There’s also no need to set local variables to null at the end of the function, function returns automagically clean up their local variables. Setting null actually causes an extra instruction on the CPU.

 
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)