Recent posts by Aesica on Kongregate

Flag Post

Topic: Game Programming / Words are Hard

^ I’ve always converted both strings to lower case for the simple reason that I dislike anything in all caps, even if nobody else sees it. This, however, changes everything.

 
Flag Post

Topic: Game Programming / Words are Hard

Technically, a proper title should capitalize the first letter of everything that isn’t a word like “the” “and” “or” etc: “Never Gonna Give You Up.” Thus, if the game’s creator wanted capitalization on certain words, he’s doing it all wrong. But yeah, as mentioned, anyone who doesn’t apply a toLowerCase() (or toUpperCase()) to user-defined strings is making a subpar product in most cases. Try answering the ones that aren’t broken with AlTeRnAtE CaPiTaLiZaTiOn to see if that breaks it. If so, problem found.

 
Flag Post

Topic: Game Programming / Tile Array Size Change Problems

Well your approach to this seems…unusual and kind of hard to follow, but maybe I’m just tired. An easier way to iterate through elements of a 1d array in 2d would be something like this:

		public static function test():void
		{
			// the following creates a 1d array meant to hold 2d info  (3x2)
			var aSomeArray:Vector.<uint> = new <uint>[1, 8, 3, 24, 12, 666];
			var iWidth:uint = 3;
			var iHeight:uint = 2;
			
			var i:uint;
			var iLength:uint = iWidth * iHeight;
			var iCurrentX:uint;
			var iCurrentY:uint;
			
			for (i = 0; i < iLength; i++)
			{
				iCurrentX = i % iWidth; // determine where we're at on the pseudo-X axis of our array
				iCurrentY = Math.floor(i / iWidth); // as above, but for y -- and yes, we divide by the width, not height
				trace("Index [" + i.toString() + "]: '" + aSomeArray[i].toString() + "' (" + iCurrentX.toString() + ", " + iCurrentY.toString() + ")");
			}
			
			/* Output is:
Index [0]: '1' (0, 0)
Index [1]: '8' (1, 0)
Index [2]: '3' (2, 0)
Index [3]: '24' (0, 1)
Index [4]: '12' (1, 1)
Index [5]: '666' (2, 1)
			 */
		}

Adjusting to new height should be a lot easier this way. (if new width is smaller, splice out the surplus. if new height is larger, add new elements to the end) As for width though, there’s really no easy way around making a new array, even if it’s only a temporary one that you will then iterate through and copy over the contents to your primary array.

 
Flag Post

Topic: Game Programming / Tile Array Size Change Problems

It looks to me like you’re trying to store a 2d grid in a 1d array. As someone who has dealt with this same problem recently, I highly suggest switching to 2d arrays before you get too far into your project. With 2d arrays, increasing or decreasing the width/height becomes a lot simpler.

 
Flag Post

Topic: Game Programming / How to make the simplest p2p

Originally posted by player_03:

Then… maybe they aren’t that shitty after all.

Successful free to play games tend to have good game design at the core, buried underneath all those incentives to spend money.

Fair enough…but only to a degree. The game I was struggling with semi-addiction to is Rise of Mythos. I’ll admit I really do like the design behind its core mechanics: Place your units on a battlefield. These units advance each round and use their abilities in an extremely predictable manner, making proper placement critical to victory. I’ve been thinking of (after other projects that I never seem to get around to…ha!) making a standard flash game based on that mechanic, but doubt I actually will.

Anyway, there’s more to their design than just getting you to spend money, and some games (Wartune, League of Angels) really are crappy games, yet somehow, they dangle enough carrots in front of people’s faces to keep them coming back, day after day. I’m really not sure how they do as well as they do. The underlying concept of both is that you do a bunch of painfully-repetitive daily tasks to make your character stronger so it can kill stronger things. In wartune, the actual control of your character in combat is limited, and in league of angels, you don’t get to control your character at all. I’m not sure what the drive to keep people playing those two in particular is, but it seems to be pretty strong, even if the actual gameplay is…lacking.

 
Flag Post

Topic: Game Programming / Scratch

Originally posted by Draco18s:

By the way, this thread is 3 years old.

Oh FFS, I need to get better at checking post dates. All the old names should’ve been a warning flag…

 
Flag Post

Topic: Game Programming / Scratch

^ You may be underestimating what future artificial superintelligence resources will be capable of.

 
Flag Post

Topic: Game Programming / How to make the simplest p2p

@EndlessSporadic: You’re thinking of “free to play” which, in the context of MMOs, is cancer and should be treated as such. Free to play, pay to actually do anything meaningful. It’s really an interesting (and despicable) game model to me, as for awhile, I’ve been fighting a slight addiction to one right here on this site. Thankfully, I’m too cheap to actually give the game my money, but it still fascinates me from a game developer’s perspective that such shitty games can somehow manage to have such a strong hold over people once they get going. Even those of us who never pay a dime.

When I see the phrase “pay to play” I think of more honorable mmos, such as world of warcraft.

 
Flag Post

Topic: Game Programming / Scratch

Originally posted by Drakim:

But somehow, people got the idea that they should be able to make games without having to learn how to make games. They want a machine that they can just tell how the game should be like and have the machine work for them. This will never exist, ever. And people need to understand that.

Never…until we create AI advanced enough to program (and do most other forms of work) for us. Then we can say, “make me a top down shooter with giant robots and puppies” and it will comply.

 
Flag Post

Topic: Game Programming / Best way to store ingame level?

Bumping this thread because, as my technique has been evolving, I find the method I previously mentioned less useful and less practical. I mean sure, it's acceptable if your level design is extremely basic, but once you start working with dozens of different tiles and once you start working with multiple layers/parallax effects/etc, the bitmap method becomes...insufficient and eventually, overly cumbersome. Reason being that as the number of available tiles increases, human readability and remembering which color represents what decreases. You can kind of see that happening in the second tilemap I posted in my previous post. (Each color represents a wall (white) or different description/event/etc (other colors)

I'm probably going to change my level formats from the aforementioned bitmaps to something involving XML. Probably along these lines:

Edit: I guess even pre tags don't like xml content. Try here (and don't mind the fact I forgot to close one of the xml tags)

Obviously at this point, you'd want to make yourself a custom level editor, but making even a basic one shouldn't take too long.
 
Flag Post

Topic: Game Programming / Tips on code organization

In my earlier projects, I always put all my “statics” in a single class. Don’t do that, as it only harms the potential reusability of your code.

 
Flag Post

Topic: Game Programming / Сinematic mode problem

I don’t think cinematic mode is supposed to do any resizing; its main purpose is merely to make the game stand out by fading the rest of the page. Personally, I hate using it because clicking anywhere outside the game window exits cinematic mode.

Edit: Cinematic mode is a site feature. My memory could be off, but I think the only control developers have over it is the option to disallow it when uploading a game.

 
Flag Post

Topic: Game Programming / smoke

Smoking gives you cancer.

 
Flag Post

Topic: Game Programming / Totally lost with Bitmaps and BitmapData

Those calculations will be made no matter what you use, since they kind of have to. Standard displayobjects don’t get to rotate for free, but it’s easy to forget that since rotating is so easy to do when working with them. If you’ve ever tried load testing, you’d see that nonrotated displayobjects don’t put as much drag on the flash player as rotating ones do. With blitting, even if you force the calculations every frame, what you end up with is still going to be faster than easy-rotating through standard displayobjects.

I’m working on this right now (crappy graphics are subject to change and are only for testing purposes) and it is 100% blit-based. There are 3 things going on in this image that attempt to optimize rotations in 3 different ways. The shuriken-things use animation frames to fake a rotating appearance, meaning the rotated images have already been drawn out and are part of the sprite sheet. The skulls are rotated only once, when initially fired, and the rotated image is then cached into a bitmapdata that is then rendered through copypixels. Finally, the blue beam segments rotate every frame (creating the arching appearance) through draw, which of course puts the heaviest load on the engine.

Once you get the hard part of figuring it all out and make a good library, you never have to think about the bad stuff again—only the good. :)

Edit: I don’t mean to seem like I’m twisting your arm, by the way. Just that, as someone who used to think displayobjects were fine, I’ve since come to realize that blitting is so much better once you take the time to learn it. I won’t even touch displayobjects for game sprites/particles anymore. Use whatever works for your project (of course) but keep an open mind at the same time.

 
Flag Post

Topic: Game Programming / Totally lost with Bitmaps and BitmapData

Oh, I assumed ship was a bitmapdata object. You could always cache it to a bitmapdata using draw upon initialize or when rotated, then use copypixels for the frame-based movement. Without using copypixels, you really aren’t taking full advantage of blitting’s performance advantage over standard displayobject manipulation.

 
Flag Post

Topic: Game Programming / Totally lost with Bitmaps and BitmapData

A few things:

1) I could be wrong, but I read somewhere that using this.someVar is actually a tiny bit slower than just someVar so there’s no real reason to use this at all. While it sounds ridiculous, this is actionscript, so who knows, it could be accurate.

2) Why are you using stageDrawingData.draw instead of stageDrawingData.copyPixels? The copyPixels function is a lot faster, so unless you need the rotation/scaling/increased flexibility (and increased headache when using spritesheets with draw) I advise you to use copypixels. I’ll elaborate below.

With copyPixels, one of the params you pass in is a rectangle representing where in the spritesheet your desired sprite is. It’s easy to use and quite clean. On the other hand, draw’s clipRect works differently and imo, is a fucking nightmare. Draw’s clipping rectangle, when provided, represents a rectangle of what to show on the bitmapdata you’re drawing to, not a rectangle of what to copy from the spritesheet itself. Once you throw in scaling and especially rotation, it becomes a massive headache.

Edit: Here’s how a typical enterframe blitting cycle might appear:

private function FrameHandler(e:Event):void
{
	bmpCanvas.lock(); // objects referencing this bitmapdata won't be visually updated until unlocked
	bmpCanvas.fillRect(bmpCanvas.rect, 0ff000000); // fill entire canvas with black, wiping last frame's contents away
	bmpCanvas.copyPixels(blitObject.spriteSheetBMD, blitObject.spriteRect, blitObject.screenLocation, null, null, true); // copypixels version
	// or for draw:  bmpCanvas.draw(blitObject.spriteSheetBMD, blitObject.matrix, null, null, blitObject.clippingRect);
	bmpCanvas.unlock(); // objects referencing this bitmapdata will now show the newly updated version
}
 
Flag Post

Topic: Game Programming / Is this using too much memory?

@player_03: Damn, I had a feeling compressed png being stored in memory as uncompressed bitmaps was part of the problem. I could change my spritesheet class to disable alpha for sheets that don't need it, such as background tile layouts, but other than that, I make pretty solid use of alpha. The good news though is that many of my spritesheet pngs are quite large (in dimensions) but relatively blank since I left room to add things to them later. Thus, the memory size may not grow as much as I thought it would as I continue to add things.

@EndlessSporadic: I don't have any audio assets implemented yet. That's usually the last thing I add since it slows down compile times by a lot.

@archipel1: Is it? Part of why I posted this is because I'm curious about that. Is ~130mb or so too much for a flash game to be using?
 
Flag Post

Topic: Game Programming / Is this using too much memory?

First I tried running a copy of the same level with the background graphics omitted and only saw a ~5mb decrease. When I commented out the background spritesheets entirely, it dropped another ~12mb. In light of this, I suspect that a lot of my “memory bloat” is coming from how my assets are being managed.

When the game first loads, basically takes this:

[Embed(source = "../lib/images/ss-background-layouts.png")]
private static const BackgroundLayouts:Class;

And turns it into this:

public static var ssBackgroundLayouts:SpriteSheet;
// ...several other spritesheet vars are initialized in the same manner

public static function Init():void
{
	ssBackgroundLayouts = new SpriteSheet(new BackgroundLayouts());
	// ...same treatment for the rest of the spritesheet vars
}

Since each spritesheet instance contains the bitmapdata relevant to it, I can see how that might get pretty big pretty quickly. I’m just unsure how I could make it any smaller since, no matter what I do, an instance of the sprite sheets in question is going to need to exist in some form or another. Even more frustrating is that the entire contents of my lib/images folder is only about 2.7mb.

 
Flag Post

Topic: Game Programming / Is this using too much memory?



So yeah, as the subject implies, I’m wondering if this is using too much memory. I’ve seen it peak as high as 130mb, but there isn’t any kind of leak going on because eventually (presumably when garbage collection happens) it drops back down to about 80mb.

There’s no lag issues or anything like that, I’m just concerned about the memory usage because, as I add more things (like proper graphics, and later, sound effects and music) I can only see that number growing even larger. What do you guys use to keep a leash on that sort of thing?

 
Flag Post

Topic: Game Design / [Feedback] Tile Shmup

Since nobody else has responded in this thread, I will.

First of all, the controls are kind of yucky on several levels.

a) I should be able to choose between mouse and keyboard, and for keyboard, should have the choice for custom keybinds. Not every keyboard out there is set up in a way that has the wasd keys in the same place (azerty keyboards, for example) while some prefer arrow keys and others prefer mouse controls.

b) The slippery controls add a sort of heavy-handed difficulty increase. The biggest threat isn’t the level layout itself, but the sloppy nature by which the ship moves through everything.

c) The firing direction changing as the ship moves right or left might make sense from a physics standpoint, but it only further adds to the frustration created by problem B.

Now I realize that, by correcting all of those “issues” the game becomes too easy. This is where you, as the developer, introduce new and interesting tiles/blocks for the player to tackle that will slide the difficulty back up a bit. Blocks that explode when shot at, blocks that split into smaller, faster-falling blocks, etc.

I guess my point is that you want to ramp up the difficulty through creative encounters in each level rather than by making the player controls feel clumsy.

 
Flag Post

Topic: Game Design / My First Game, Feedback please.

For a first game, this is pretty good, however as others have said, there’s a lot of room for improvement.

1) Foreground/background. These need to be more distinguishable, as I tried to jump on what I thought was a platform but was part of the background instead. Look at how other games makes the two easier to distinguish—typically they employ things such as lower color saturation, lower contrast, darker, a bit of blur, etc. Try them out and see what works.

2) Touching the water kills the player. Sure, that’s fine if a) they fall into a bottomless pit or b) the water is actually flesh-destroying acid or lava. However no, it’s just plain water, but the mere act of touching it makes the player fade and the level restart—even if you manage to wall-jump your way out of it.

3) The graphics aren’t “bad” per say, but they seem unfinished and inconsistent. (This was a mistake I made in my first game, too)

4) Nothing is overly hard except for what feels like game mechanics failures. For example, I keep dying on the second level when I’m supposed to hop from one vine to the next not because I keep missing the second vine, but because I must not be hitting it at just the right angle or…something. Players hate this kind of stuff, so address it.

5) The game needs some kind of backstory, or at least a basic reason we’re here. Who are we controlling and what his/her/its goal?

6) What is the point of collecting the coins and totems? Is there going to be an upgrade shop I can spend them in? Does collecting some arbitrary amount give me an extra life, level me up, or unlock a new area/ability/etc?

7) What about interesting power-ups? Things that changes the gameplay slightly, such as the ability to shoot or fly or explore underwater rather than die instantly can really add to a game like this.

8) Enemies. The one you have so far is good—simple, easy to defeat, yet still has just enough unpredictability to catch you off guard if you’re too lazy. Needs more enemies with varying behavior patterns.

 
Flag Post

Topic: Game Programming / Adobe's latest IDE questions

If your primary concern is a better coding environment, then you’re going to get more out of FlashDevelop than Flash Pro. I don’t use it much, so someone else feel free to correct me, but it’s my understanding that Adobe’s IDE is only worth using if you need access to the vector graphic tools and timelines, the ability to work with .fla files, or prefer to manage library assets the Adobe way.

 
Flag Post

Topic: Game Programming / Can you make flash games with gamemaker to put onto kongregate?

This topic is almost 5 years old. Oh well, better late than never!

 
Flag Post

Topic: Game Programming / What do you use to make a particle engine in openfl

@Shalmezad: 12,000 bullets with no lag, not bad. In your first example, you’re copying them onto the bitmapdata, then the bullet object itself ceases to be relevant, right? (I assume that’s what you mean by “shifting”)

 
Flag Post

Topic: Game Programming / What do you use to make a particle engine in openfl

Originally posted by player_03:

The draw() function is pretty slow, specifically because of the matrix transformations and blending. I’m not sure how it compares to Flash’s normal sprites, but I imagine it’s about the same or slightly slower.

Have you considered switching over to Starling entirely? As long as all your sprites are Starling sprites, you’ll have full control over which ones are in front.

Back when I first decided to give blitting a try, I made this thing. When I turn on rotations, draw outperforms traditional sprites. Assuming the scale/rotation doesn’t need to change on every single frame, you could use draw only when needed, caching the modification for use with copyPixels