talrnu
180 posts
|
Topic: Programming /
nested loops...nevermind.
You have a few typos, e.g. “1 += 1”, but I understand. I need an array because I also need to calculate the variance of the whole sample, and I also need to calculate the quantiles; both processes require access to each of the numbers that were generated to create the mean (finding quantiles also requires sorting the list of values, easiest to do with Array.sort()). Otherwise, my implementation can’t get much simpler. And, since this is the actual program (I don’t intend to use it in any other program for any reason ever), I didn’t put it inside of a function.
|
| |
talrnu
180 posts
|
Topic: Programming /
nested loops...nevermind.
Wow. I hope I can blame my error on lack of sleep… there isn’t a trace function being executed in the inner loop. So it does work, I’m just not seeing it. Damn.
|
| |
talrnu
180 posts
|
Topic: Programming /
nested loops...nevermind.
Yes, I’m doing a statistical analysis on the actual randomness of numbers generated by Math.random(). So, the larger the sample size, the better.
I know the inner loop only runs on the final iteration of the outer loop, because my trace calls say so. The trace function in the outer loop executes every iteration, but the trace function in the inner loop executes only on the last iteration of the outer loop.
I should mention that I just realized that I’m not re-initializing the sample array for each iteration of the outer loop, but changing that doesn’t fix my problem. Still, I’ll edit the above code to include that.
|
| |
talrnu
180 posts
|
Topic: Programming /
nested loops...nevermind.
For some reason (which I’m sure stems from some noob mistake), when I make one for loop nested inside another, the outer loop executes fine, but the inner loop only executes on the last iteration of the outer loop. Here’s my code, which you can just assume is added to the first frame on the main timeline:
var sample: Array = new Array();
var numCount:uint = 0;
var sampleCount:uint = 0;
var sampleSum:Number=0;
var sampleMean:Number=0;
var newNum:Number;
for(sampleCount = 0; sampleCount < 100; sampleCount++){
trace("Sample "+(sampleCount+1)+": \n\t");
sample = new Array(); //this line added during POST EDIT 1
for(numCount = 0; numCount < 10000; numCount++){
newNum = Math.random();
sample.push(newNum);
sampleSum += sample[numCount];
}
}
sampleMean = sampleSum / sample.length;
trace("Sample mean for n="+sample.length+": "+sampleMean);
Does anyone see what could be going wrong here? Thanks in advance.
EDIT1: I added a line of code that was missing (see my next post for details)
|
| |
talrnu
180 posts
|
Topic: Programming /
AS3 - No support?
Games that report statistics to Kong are eligible for getting badges, or so I’ve heard. So if you write in AS3 and want badges, report relevant statistics (e.g. score at the end of each level) via the API.
|
| |
talrnu
180 posts
|
Topic: Programming /
Le Sigh
At the very least, if someone deletes their post, there should be a marker or empty post or something that tells observers that the content has been changed/deleted.
|
| |
talrnu
180 posts
|
Topic: Programming /
Suggestions
If you hit writer’s block, go play lots of other peoples’ games for inspiration. If you still can’t come up with anything original after an hour of playing a dozen or so games, find a simple one and try directly re-creating it. If you can re-create it, go on to improve it in some way, even if you don’t think it needs improving. Add features, or smooth the mechanics out, or something. Since it’s still inherently someone else’s game, you really shouldn’t try to publish or market it as your own even after changing it… but that’s not what this exercise was started for, so it shouldn’t bother you much.
It’s actually a good technique for any artistic endeavor. At the end, even if you still are without any original ideas to bring to life, at the very least you got very good practice in, and you also got some insight into how other people create things, which can change the way you look at problems in the future. In fact, I like doing this exercise just for these extra benefits, even if I’m not trying to find inspiration for a new project.
|
| |
talrnu
180 posts
|
Topic: Programming /
Le Sigh
Screw you guys, I love when people I’m posting with are afraid of looking like morons, remove their side of the conversation, and subsequently make me the moron (with schizophrenia, to boot).
|
| |
talrnu
180 posts
|
Topic: Programming /
Should I buy a Book?
The only way to know that would be to compare them to the livedocs; if you’re going to do that, you might as well rely on the livedocs from the getgo.
|
| |
talrnu
180 posts
|
Topic: Programming /
Much-Needed Kong Feature?
@FP: Says me! :P I mean that’s how it ought to work, IM_H_O. After all, the comment board isn’t exactly designed for public discussion. Of course it can be used that way, but it definitely seems like it’s designed for people to leave one comment. And since there are forums, it would make more sense to me for people to have discussions in the forums, rather than filling up comment boards with childish bickering that doesn’t always help the developer (which I believe is the chief use for comments).
At any rate, I don’t really care which comments are visible to the public and which aren’t; I just think you should have to give the game a rating before being allowed to view and contribute to the comment board. And in the same general area, I think you should only be able to vote once, and then if you change your mind later just retract your vote (instead of choosing a new value).
|
| |
talrnu
180 posts
|
Topic: Programming /
Should I buy a Book?
ActionScript books really are mostly useful for getting an introduction to the language; actually, most are written, it seems, to cater to people with minimal programming experience at all, regardless of language. Unless you enjoy wasting money, you will probably want just to get very comfortable with the livedocs and Flash help file. They not only contain explicit details on every part of ActionScript, but they provide many useful examples as well. Not to mention you can use the search function instead of thumbing through paper pages yourself. Plus, the livedocs, being “live”, tend to stay much more up-to-date than any paper literature.
|
| |
talrnu
180 posts
|
Topic: Programming /
[FAQ] Making Games. READ FIRST!
Did you even read the first few posts in this thread? Go do that; if you still have the same questions, you should give up Flash while you’re ahead. Well, I guess that would mean you’re without a head, but still…
|
| |
talrnu
180 posts
|
Topic: Programming /
Minor setback in Kong RPG game
It’s extremely difficult to help without specifics. When you say the shop appears elsewhere, where should it be in the first place? Is this problem occurring when you’re in a map mode, or during normal play? How does your program determine the location of the shop? Give us some more details.
|
| |
talrnu
180 posts
|
Topic: Programming /
bullet scripting
Think about how it works: no matter where the player’s ship is, whenever he presses the “fire” button, a bullet is shot from his ship straight upwards. That bullet travels from the ship until it either hits an enemy or leaves the play area.
This is one larger problem that can be easily solved if you break it into smaller problems. Some of the smaller problems include, “Where does the bullet start from?” and “Does the bullet need to disappear yet?” In this case, every one of the smaller problems are very easily solved by just looking at the live docs.
So think about it. If you can’t figure out what all the smaller problems are, ask your question again. If you figure out what all the smaller problems are, but you can’t figure out how they’re solved, then you need to go study tutorials.
|
| |
talrnu
180 posts
|
Topic: Programming /
Much-Needed Kong Feature?
...people can still change what they voted.
Regardless of what happens, this feature should be changed. To me, it seems to undermine the entire point of an anonymous voting system. You vote to express your educated opinion; if you need to change your vote, you shouldn’t have voted in the first place. Since nothing changes in the game, none of the facts change after you vote.
Well… I guess if a new version is uploaded, things could change significantly enough. So it might make sense to allow players to withdraw their votes… but allowing them to change the vote’s actual value is just silly.
|
| |
talrnu
180 posts
|
Topic: Programming /
Much-Needed Kong Feature?
If you want to implement a system like this, I think it’d be better for the developer to decide which comments will be displayed before any are actually displayed. That would definitely help weed out all the crap. And for anyone that thinks this is a bad idea in terms of free speech, remember: the comments area is there for players to give comments to the developer, and the forums are places for community discussion.
No matter how you choose to filter which comments are visible to the public, though, the main problem I see with the whole system is how it might affect someone’s rating of a game. You play a game you’re not super fond of, but it’s not a bad game either; many people then go down to read the comments, and end up either liking or disliking the game (and reflecting it in their rating) based entirely on these comments. I think there only needs to be one change made: you shouldn’t be able to make or read comments until you actually rate a game. Which comments are then visible beyond that point isn’t that important, IMHO.
|
| |
talrnu
180 posts
|
Topic: Programming /
I reckon I shoulda put it here in the first place...
Yeah, this doesn’t belong here, leave it in collabs.
|
| |
talrnu
180 posts
|
|
| |
talrnu
180 posts
|
Topic: Games /
A Good MMO
Hey bliss, you may be unaware (“bliss”fully, perhaps? XD) that you don’t actually need to hack Gunz in order to exploit bugs in the game mechanics. It’s usually called playing K-style, it involves rapidly entering control patterns to do things like fly or dodge bullets very quickly. It works by canceling character animations (e.g. the flip your character does when you jump off of a wall) with specific timings.
I love it! It makes the game entirely based on a player’s skill, not how long he’s been grinding rats in some cave. Then of course there’s the fact that you can use swords, as well as pistols and uzis and rocket launchers. It’s a very matrix-y experience.
|
| |
talrnu
180 posts
|
Topic: Games /
Strategy games
What about Warcraft 3 makes it your favorite?
|
| |
talrnu
180 posts
|
Topic: Games /
Strategy games
Thanks for your inputs, guys! Auto, I think you’re right, between votes from Kong and the MochiAds forums, I think I’ll be best off allowing the player to decide between them. I think in the long run this game will appeal as a whole more to micromanagement freaks, as I’m one myself (though not very good at it), but since they don’t exactly form the majority of the Flash gaming public, it would be silly of me not to include features that appeal to more casual gamers.
War_Wrecker, Warcraft isn’t free to play and accessible from any internet-enabled computer, though. Plus, that’s sort of like saying “why play Starcraft when I can play Warcraft?” They may work very similarly, but they are different games, different universes, etc. and I don’t think either is better than the other.
Not that my game will rival Warcraft. Though I can dream… :)
Keep voting folks!
|
| |
talrnu
180 posts
|
Topic: Programming /
Ok, Why do I need this ")" again?
First, read this code and make sure you understand how it works. Then, put this code into the first frame on your main timeline:
//AS2
//If you're trying to use left/right keys to animate a movieclip called myClip, do this:
this.onEnterFrame = function() {
if( Key.isDown(Key.RIGHT) ){
//the right key is down, so advance myClip to the next frame in its animation
myClip.gotoAndStop(myClip._currentframe+1);
}
else if( Key.isDown(Key.LEFT) ){
//the left key is down, so rewind myClip to the previous frame in its animation
myClip.gotoAndStop(myClip._currentframe-1);
}
}
Please ask questions about any part you don’t understand; if you just copy and paste this code without fully understanding it, you could mess up your game farther on down the line.
|
| |
talrnu
180 posts
|
Topic: Games /
Strategy games
What about the Starcraft AI do you like more than the AI in other games, like Warcraft or Age of Empires or any other ones you’ve played?
Supastaru, when I said “you are the AI” I meant “in B, you control the things that are controlled by AI in option A”.
|
| |
talrnu
180 posts
|
Topic: Programming /
how do i make a preloader?
Go here and look at the information for the Loader class. Also, Google “AS3 preloader” or “AS2 preloader”.
|
| |
talrnu
180 posts
|
Topic: Games /
Strategy games
A question for gamers: If you’re playing a real-time strategy game, do you prefer…
A: Very simple, limited controls, and good AI? This means you just tell your units to go into “attack” mode by clicking one button, and then they decide amongst themselves where to move, which enemies are most important to destroy, and who would be stronger against what. Or, you click “defend”, and they decide what’s most worth defending and who should defend what.
OR
B: High-detail controls and minimal AI? This means you control exactly where each unit stands, exactly who attacks exactly what and when, etc. There could be AI allowing your units to attack any enemies that come into their range, but otherwise nothing fancy; you are the AI, for the most part.
If it’s not obvious, I’m creating a RTS game, and am trying to decide how to set up the control scheme. If it helps you decide which you prefer, here are some details on how my game will work:
1. There are at least 4 or 5 different ways to win a level: some involve completely destroying enemy forces, others involve earning a certain amount of resources, etc.
2. You can build structures in certain locations (there are certain positions where you can build any structure, but you can’t build anything anywhere else), and you can also deploy as many as 20 different types of units. Units can be grouped, and each group responds to your commands as a single unit.
Now, vote! A or B? Let me know.
|