Recent posts by Levgre on Kongregate

Flag Post

Topic: Game Programming / Time spent on games

My current game I’ve worked about 1200 hours, although it’s my first big game so there’s been lots of learning. In then end I’ll probably spend 1600-1700 hours, before it is released.

 
Flag Post

Topic: AdVenture Capitalist / Do you have ideas for AdCap? Share them here!

Here’s an alternative setup I thought of for micro manage.

Instead of quitting, the manager just goes on vacation.

So the business still operates at full capacity. ‘But’ you can’t micro-manage, and for a pretty long time. Say 5-10 minutes. That would just be a bit more relaxed, in that you don’t have to watch and rehire them.

 
Flag Post

Topic: AdVenture Capitalist / We need a new update VERY soon!

Right now w/o kred multipliers I estimate it will take about 9-12 months to get to 2k of each. It’s about a month for 1800-1850, and I’m guessing it just continues to slow down.

So the game is essentially p2w at the moment (if winning is getting all achievements). 12 months I think is not a typical or reasonable time frame for an idle flash game. I don’t really care though, I’ll just continue to observe my meager progress with morbid curiosity. The game overhaul is coming soon anyways, I just hope progression is balanced with that update.

 
Flag Post

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

It takes a pretty long time, 10-30 seconds it seems, depending somewhat on if I alt-tab. It gets pretty annoying and can slow down coding at times. Is this something you just have to put up with? Would a computer with a faster cpu help?

 
Flag Post

Topic: AdVenture Capitalist / Do you have ideas for AdCap? Share them here!

A commodities, stock, whatever market where you try to buy low and sell high, to provide a way for active players to get more money and play around with their savings.

 
Flag Post

Topic: AdVenture Capitalist / This update!

I’d say the update isn’t balanced. I don’t have Kred bonuses yet I started at 1025 Newspaper (lot more in others) and I’ve nonstop been jumping from one upgrade/achievement boost to the next. So basically I get all second half (late game?) achievements/upgrades in about 12 hours.

There should be bigger gaps in between the uber x9 – x15 upgrades, and perhaps AI earning should slow down much more as the game progress… started out today getting x200 in 10 minutes, now I’ve doubled at least every hour, usually much less than that.

 
Flag Post

Topic: Game Programming / Using format for Textfield jumbles characters, no clue why

The problem went away when I got rid of embedfonts. I was figuring out how to do this just by googling answers on changing character size etc., and I seemed tp get compiler errors until I used embedfonts. But now it works without it, so hopefully problem solved :P

 
Flag Post

Topic: Game Programming / Using format for Textfield jumbles characters, no clue why

Oops, noDevText.defaultTextFormat = largeText; wasn’t actually twice in the code, I just pasted it twice because I thought I missed it.

I would think .size and .autosize don’t cancel each other out, because the former controls character size, I believe the latter controls the size of the TextField. However I have tried using just one modifier at a time, so both of those on their own. Pretty sure it’s not their conflict causing the jumbling/omission of letters.

 
Flag Post

Topic: Game Programming / Using format for Textfield jumbles characters, no clue why

This is fine


noDevText.width = 500;
noDevText.height = 500;
noDevText.border = true;
noDevText.multiline = true;
noDevText.wordWrap = true;
projectWindow.addChild(noDevText);
noDevText.x = 50;
noDevText.y = 50;
noDevText.text = “No Development Available”;

The code below makes it all go to crap. And I have tried to pinpoint the problem by taking out the .size, .letterspacing, .embedFonts, TextFieldAutoSize.LEFT;. None of this fixes it. Simply ‘applying’ the format jumbles everything. The only way I fix this is to have a ‘vanilla’ textfield, no format applied.

http://i.imgur.com/vpWN57V.png

var largeText:TextFormat = new TextFormat();
largeText.size = 20;
largeText.letterSpacing = 5;
noDevText.defaultTextFormat = largeText;
largeText.autoSize = TextFieldAutoSize.LEFT;
noDevText.embedFonts = true;
 
Flag Post

Topic: Game Programming / Coding tips for my strategy game map?

The game is turn-based, the map is split into about 40 different ‘sections’.

Each section will have 2 event listener types. Rollover for border/highlight and possible info popup. Click for opening the mission window.

Here’s a picture of the map (in progress)

The size is 3500×3100, the 40~ sections that make up the city are 1900×1900, surrounded by a non-interactive border, 800x on either side, x600 on top and bottom. The current file size is 840 kb, I imagine it will be about 2 MB at most.

http://i.imgur.com/l9RPFGU.jpg

There will also be weather overlay details (fall, winter, default is spring/summer).

I’m looking for advice on map scrolling, how to best split the map up, so on.

I’ve read that movieclips off-screen should be removed (with a buffer). Does this apply to my map size? ( bothdimensions and file size) How large should the buffer be? I think the largest ‘section’ dimension is 400 width/height.

If my map is not resource intensive enough to require the removing of off-screen assets…

Could I do just one large movieclip (or say 4-8 large ones), then have an event listener that adds a highlight movieclip or mission menu, based on mouse coordinates?

Any other tips/suggestions would be greatly appreciated, I’ll be searching the internet for tutorials to read in detail.

 
Flag Post

Topic: Game Design / What makes a great idle game?

I may design an idle game after my current strategy game project

Here are a few things, in my view, which enhance an idle game yet I haven’t seen utilized yet.

1. Different strategy paths

While a player is supposed to be able to be idle, that doesn’t mean everyone should have to go the same route.

I.E., if you had a civilization based idle game, a player could develop farming, trade, military, exploration, diplomacy, so on. Not only does it make the game seem deeper, it even allows fulfilling multiple play throughs.

2. A sense of progress/growth

In many idle games, early on it seems you are growing stronger and gaining more capabilities, while later on you get just one nearly identical buff after another. There are many ways to work around this, 1: upgrades don’t just add numbers, but add new ‘tools’, some of which give brand new capabilities (either replacing an upgrade path, or unlocking a new one).

I.E. If it was a civilization idle, when you reach a high enough farming level, you can start to develop urban areas. When you build ocean-worthy ships, the amount of exploration open to the player expands greatly.

 
Flag Post

Topic: Game Programming / Ideas for coding a really big random event system?

In my turn based strategy game, I plan to have at least 100-150 unique random events, if not a lot more (like 200-300).

So is the best way just a sort of terraced if else sequence?

I.E.

If eventFactor <=10

if eventFactor == 1

else if eventFactor == 2

etc. etc.

else if Eventfactor <=20

if eventFactor == 11

else if eventFactor == 12

etc.

The events aren’t simple enough to really have generalized generation, each has to be unique (although some of the events will further break down into random settings)

Is a terraced if else if system a good way to go about it?

 
Flag Post

Topic: Game Programming / Looking for advice for programming loot system

I would say 50 at a minimum, 70+ is quite possible, 100+ is not out of the question.

Could be something like
10 ranged weapons
10 melee weapons
10 armors
10 miscellaneous gear
10 base enhancing items
10 supply items
10 vehicle items
so on..

 
Flag Post

Topic: Game Programming / Looking for advice for programming loot system

In my strategy game, each zone of the map (there are 40 or so), will have custom loot.

Here are several ways I’ve thought to do it.

Loot arrays with 20+ elements for each zone, each being a loot item/small category (code may then add some randomness, such as quality)

Loot arrays with references to large categories, and then code chooses a specific item from those categories. This would reduce array length to maybe 4-10.

So basically, it seems to be picking a balance point between pre-set arrays determining the loot, and code determining the loot. My guess is larger arrays and less code would be less demanding. All the loot calculations will be done in one go, at end of turn. Or I suppose I could pre-set the ‘next loots’ mid-turn, when a player decides to go to a zone (they can go to multiple zones in one turn).

This is my first time making a random loot system, so any advice would be useful, especially letting me know if either a larger array system or larger logic sequence is ‘inferior’ or flawed :p.

 
Flag Post

Topic: Game Programming / AddChild... RemoveChild... Addchild... can't get object to front?

missionDisplay = the large white box.
memberBox = the 3 connected squares the bottom of missionDisplay. One movieClip.
Xbutton = the X in the corner of missionDisplay.

missionStart is the only function where these objects are added. All 3 objects , missionDisplay, xButton, and memberBox, are all instantiated identically, in the constructor. The code for these classes is identical.

There is no ‘mystery shape object’, my only guess is the disappearing object is missionDisplay. That’s strange though, since missionDisplay is obviously not a child of itself. It is added to stage, then the other 2 objects are added to missionDisplay.

If instead of using that while loop, I write
missionDisplay.addChild(memberBox)
missionDisplay.addChild(xButton)
Everything works completely fine when I run missionStart the 1st time, and every other time.

So, the problem must not be how I am adding/removing, OTHER than in that while statement. It is making missionDisplay unable to be shown, although it still exists, obviously. The other 2 objects are still being added to it, at the proper X-Y locations. It still is placed in the display list for the stage.

teamMenu(no current issues) is in the upper left corner.
The smiley faces are portraits of teamMember. As you see, there are two blue smileys, although they are different classes. By clicking on a character’s portraitA in the teamMenu, their portraitB is added to the memberBox. The while statement makes memberBox permanently disappear, also, even if I can still add portraitB instances to it.

 
Flag Post

Topic: Game Programming / AddChild... RemoveChild... Addchild... can't get object to front?

The first time, the 2 children of missionDisplay (memberBox and xButton) have index 1 and 2. After I remove everything and add them again, their indexes are one less, 0 and 1.

the index of huntDisplay is constant, it is at index 4 (of the stage) the first time, and 4 the second time.

The first time, the object for missionDisplay.getChildAt(0); is [object Shape]. The 2nd time, it is object xButton).

So it seems that it might be with how the huntDisplay object is instantiated in the code… I Guess I’ll review that. It’s like its serving a dual role as parent and child, but when I tried getChildIndex for it, it generated an error (as it wasn’t a child).

Or just being made a parent ‘changes’ it in some way…

I’m also looking at the properties of each object, they all seem to be movieClips with no differences, don’t see it yet though. It seems the issue is the while statement. I can add/remove things without issue, as long as I don’t use that while (or for) statement.

 
Flag Post

Topic: Game Programming / AddChild... RemoveChild... Addchild... can't get object to front?

Yup, teamMenu is indeed removed in different code, and they don’t overlap on the screen, either. teamMenu is just a smaller menu on the side.

I also tried that alternative for statement, same issue happened. Gonna read through the the relevant chapters in Essential ActionScript 3.0 book again..

 
Flag Post

Topic: Game Programming / AddChild... RemoveChild... Addchild... can't get object to front?

The background ‘is’ missionDisplay, itself. It is the parent I’m adding children too.

Regardless, removing missionDisplay and all its children shouldn’t make it permanently invisible from then on… from what I know. (setting it as visible does not help, it just cannot be seen).

What could make it permanently not-visible?

 
Flag Post

Topic: Game Programming / AddChild... RemoveChild... Addchild... can't get object to front?

Some of the stuff has to come and go, although not all of it. I could make logic statements to take out specific children, or I could just take all the children out of these menus, then re-add whichever ones are needed later. I’m not sure what I’ll end up doing, but from what I can tell this ‘should’ work.

I don’t like giving up on solving something, even if I redesign the code for missionMenu, I believe I’ll remove/re-add all children elsewhere(like memberBox, which uses a similar while loop, and has the same issue). Thanks for the suggestions, but I’m looking for technical help. It seems I’m missing something here, with that while loop.

 
Flag Post

Topic: Game Programming / AddChild... RemoveChild... Addchild... can't get object to front?

I read that visible can be more resource intensive… I would be happy to use it over remove/add where I could. My game is going to be pretty big, with at least half a dozen menus.

 
Flag Post

Topic: Game Programming / AddChild... RemoveChild... Addchild... can't get object to front?

I removed everything piece by piece, the problem code is here

while (missionDisplay.numChildren > 0)
			{
             missionDisplay.removeChildAt(0);
			}

I read in a book this would work, I guess it doesn’t work correctly here.

If I specifically say missionDisplay.removeChild(memberBox), etc., it causes no issues, so it is the while statement.

 
Flag Post

Topic: Game Programming / AddChild... RemoveChild... Addchild... can't get object to front?

That’s how it was before. I tried to fix it (or at least figure out what was wrong more easily) by putting everything within the same class.

So I tried that already, and this problem still occured.

The missionDisplay itself ‘is’ the background.

 
Flag Post

Topic: Game Programming / AddChild... RemoveChild... Addchild... can't get object to front?


public function missionStart()
		{	
			addChild(missionDisplay);
			//addChildAt(missionDisplay,numChildren);
			missionDisplay.addChild(xOut);
			xButton.x = 365;
			xButton.y = 2;
			missionDisplay.addChild(memberBox);
			memberBox.x = 15;
		        memberrBox.y = 280;
	            xButton.addEventListener(MouseEvent.CLICK,closeMissionMenu);
			var i = 0;
			addChild(teamMenu);
			huntDisplay.x = 80;
			huntDisplay.y = 25;
			trace(getChildIndex(teamMenu));
			trace(getChildIndex(MissionDisplay));
			

			for each (var item:portraitB in activeZone.missionTeam)
			{
			item.x = i;
			i =+ 45;
			}
			
			for each (var item2:portraitA in teamArray)
			{
			item2.addEventListener(MouseEvent.CLICK, addToTeam);			
			}
		}


		public function closeMissionMenu(e:MouseEvent)
		{
			while (missionDisplay.numChildren > 0)
			{
             missionDisplay.removeChildAt(0);
			}
			
			while (memberBox.numChildren > 0)
			{
             memberBox.removeChildAt(0);
			}
			removeChild(missionDisplay);
			closeMissionMenu();
		}

I get the same trace output for in both cases, but the 2nd time I add missionDisplay I can’t see it.

trace(getChildIndex(teamMenu)); = 5
trace(getChildIndex(MissionDisplay)); = 4

Here’s the before and after pictures

first time I open the mission menu, missionStart()

After closeMissionMenu() executes, then missionStart() executes again

xButton is being placed properly, on the top right. So is memberBox, which holds the smiley face… except you cant see the box outlines. missionDisplay is completely invisible. I want it to look the same, each time.

 
Flag Post

Topic: Game Programming / How to refer to 'parent object' of an instance variable?

Hm I’m not sure how that would solve referencing the parent class from the instance variable.

But I think I found a good solution?

In the teamMember class, I added

memberA.parentMember = this;

So now I can reference the class memberA is in, with memberA.parentMember. It seemed to have worked, so far..

 
Flag Post

Topic: Game Programming / How to refer to 'parent object' of an instance variable?

I have different ‘teamMember’ classes which adds a movieclip portrait, say ‘memberPortrait’.

So teamMember1.memberPortrait, teamMember2.memberPortrait, etc.

I need to add an eventListener to ‘memberPortrait’ which will dynamically call up the teamMember it belongs to, so I can then make that teamMember do something else.

For example…


teamMember1.memberPortrait.addEventListener(MouseEvent.CLICK, addToTeam);
public function addToTeam(e:MouseEvent):void
{
var activeTeamMember= e.currentTarget.parent;
stage.addChild(activeTeamMember.memberPortrait2);
}

e.currentTarget.parent is the line I’m concerned with… I’m trying to refer to the object that contains the e.currentTarget.