Recent posts by Gengii on Kongregate

Flag Post

Topic: Game Programming / best way to draw an array of moving overlapping objects?

This is a project for mobile, so I need to avoid as much resource hog and brute force methods as possible. Using AS3/AIR

The project is a bejeweled type of game with overlapping tiles. If I simply draw the objects from top to bottom everything looks fine. It’s when things start to move that it becomes an issue.

With single tile movements I can easily check for an adjacent overlapping tile and redraw it. The issue is when a match has been made and many tiles are moving.

First, I need to avoid redrawing the entire array(vector) of tiles each frame. There are 7 rows by 14 columns. It runs slow no matter what method I tried, GPU drawing is enabled, Testing is on two different phones. The result was unacceptable. But this isn’t the issue. I came up with a method that works without the overlapping tiles. I have 3 full screen bitmap datas. When some movement happens all the tiles are redrawn onto separate layers. one BMD for tiles that are not moving, the 2nd for tiles that are moving. The 3rd BMD is for display. I just change the matrix value and redraw the two bitmap data. Works just fine and cuts down on the number of draws needed.

Now with the overlapping elements it’s a mess. This is where the issue is. I thought up two possible methods, but would like some feedback on what sort of mess I’d be making, and wondering if there’s something better I should be doing.

The first method would be to have 14 smaller BMDs. Two for each row(seven rows). one for stationary tiles. The 2nd for moving tiles. Then draw them to the display BMD row by row so that the images ‘stack’ without problem.

The 2nd method would be to have 4 full screen BMDs. Two for non-overlapping tiles. Stationary & Moving. The other 2 for overlapping tiles. The overlapping elements don’t overlap each other. So there’s no issue of their 2 layers causing any clipping.

The first method would be the same BMD size overall, but a lot more draws. The second method would be double the BMD size, and only 2 more draws. I’m unsure which is more costly. additional draws? or additional BMD?

I don’t know much about drawing on the Z axis. But could that be another possibility to keep the overlapping tiles above the normal tiles? I’d imagine that I’d need to redraw the majority if not the entire array each frame however.

 
Flag Post

Topic: Game Programming / bending bitmap data 90 degree?

Ooh, writing my own… I knew this was possible but never considered actually doing it, till now. Is there any documentation you could direct me to, to learn more?

 
Flag Post

Topic: Game Programming / bending bitmap data 90 degree?

Originally posted by Ace_Blue:

From what I understand of the OP, you have an image of width W and height H and you want to deform it so that… and that’s where I got stuck.

That would be the topic title. deform it so that it could bend 90 degree. The image, like a rainbow, or a racetrack of a fixed width, would bend at some point mid screen and end in any direction as much as 90 degree’s from it’s originating point. Or to simplify, draw a gradient going left to right. y200 would become y0 and x200 would become x0 resulting in a 90degree bend.

And yea a displacement map (not distortion) doesn’t seem to work very well. Simply applying a perfect grey distortion map causes a slight change in the pixels position. There is no number that exists perfectly between 0 and 255. 127 isn’t it, 128 isn’t either. yea one does look much better then the other, but it isn’t perfect. and as far as I know, there is no hex color value for 127.5. I understand that the mid point of the effect would be pinched and ruin any idea’s of ‘pixel perfect’. I get that, however that is not what I mean by pixel perfect. The horizontal length of 200 pixels along the top would be a mess compared to the initial 200 vertical pixels that it began with. There are only 128 color values to work the displacement in the positive or negative direction. If you want to bend an image that is greater then 128 pixels, the difference between each pixel’s value results in a blurred and inconsistent mess. This is why a distortion map is not capable of a pixel perfect effect.

I don’t know if a transformation matrix is capable of such an effect, I haven’t had much experience with them. Was curious if anyone knew of any other methods. I’m guessing not.

 
Flag Post

Topic: Game Programming / bending bitmap data 90 degree?

Why I need a pixel perfect effect doesn’t matter. It’s just what I want to do. As I said, it’s not a racetrack or a rainbow, those are examples. I’d suggest you re-read the full topic to grasp the concept. Is there is a technique that would work is all I’m after. Does such a thing exist? or does it not? I’m not looking for a workaround. Actual images of my WIP would do nothing to change that. Thanks

 
Flag Post

Topic: Game Programming / bending bitmap data 90 degree?

Hmm. I suppose I could describe it like a race track. I know that doesn’t help since you could use multiple tiles for each bend, or draw the shape and use a texture fill. My content is more detail oriented. I just want to be able to bend the ‘track’ in various angles and turns. Too numerous to be worth pre-rendering all the possibilities. Yea, I could limit the number of angles and just work within those limits, but I’d like to have a free form effect.

 
Flag Post

Topic: Game Programming / bending bitmap data 90 degree?

Hmm the api is basic for my needs. I’m over simplifying by calling it ‘colored lines’. But it does give me a thought I can work with.

Drawing the pixels seems worth a shot. I’m a bit too left brained when it comes to working out the math.

But I have something to work with now. Thanks!

 
Flag Post

Topic: Game Programming / bending bitmap data 90 degree?

Yea, it’s an effect for during run-time. Each of the lines are created via 2d array. The array is parsed and each segment drawn. Without modifying the array and the game’s logic I figure it would be easier to just modify the visual.

The issues I find with a distortion map is that even at perfect grey, there is still a visible offset. And when things are moved a sizable distance they are no longer pixel perfect. And making an object rotate 90 degree? I can imagine that it’s possible to calculate the difference in color and the offset value, but I also imagine that there should be an easier way.
 
Flag Post

Topic: Game Programming / bending bitmap data 90 degree?

Say I have a number of colored lines going left to right, I would like to bend that visual in a gradual turn and end up vertical. I don’t mean where it uses a matrix to gradually shift in degree. But instead like a rainbow, where you could visibly see the lines beginning in one direction, bending, and ending in a different direction. I’ve thought about a distortion map, but the degree of distortion isn’t very uniform, or maybe I’m just not thinking about it hard enough. Are there any other ways to achieve the effect?

 
Flag Post

Topic: Game Programming / Adding decimals at 2 points equals a magically long decimal?!?

I feel like I just got an achievement.

 
Flag Post

Topic: Game Programming / Adding decimals at 2 points equals a magically long decimal?!?

When two decimals go through an operation, on occasion it results in some magically long decimal.

I have a lengthy solution, however I’d like to know if there’s anything better I could do before I dive in and make a lengthy/messy implementation.

EXAMpLE.
a:Number = Math.floor(Math.random()*100)/100; //.33
c:Number = 19.45
c += a
trace © //returns 19.780000000002.

SOLUTION.
var a:Number; //we want to keep this number in case of multiple operations
var b:int; //used to round trailing numbers
var c:Number; //used for operations between ‘a’ and this
a = BID; //BID is a positive number with a decimal
c = LOOT; //LOOT is a positive number with a decimal
c += a; //the magical operation, that results with the long decimal.
b = c*100; //‘b’ is an int which will round off the magical trailing decimals
c = b/100; //is our result back in decimal form, without the magical decimals
LOOT = c; //The resulting correct dollar decimal form used for display.

I’m not looking so much for code or a function with the same results, rather, I’d like to know why this is happening and if there is a better way to work with dollars and cents in a game without storing it as an int *100.

 
Flag Post

Topic: Game Design / Critique my Dialog layout

Thanks for the critique’s! I’m not hurt by anything said. It is what I asked for, and I’m looking to improve a thing or two.

On the font issue, I know there are a few individuals who feel the same way as you both do. It’s a habit of mine to use additional and/or fancier fonts. I’m always trying to experiment. In places where I have worked, font selection was always an issue. Mostly because I was dealing with an audience where bad eyesight was common and any style beyond a serif was usually met with a ‘no’. I got in the habit of presenting all my work with both a ‘fancy’ and ‘regular’ font. Sometimes the fancy was accepted and received with much praise. So, I’m not likely to change my idea of multiple fonts from just your critiques alone. This is something I’ll be asking and getting many opinions on when the game is being tested. I want to test the issue as being a majority or minority. I’d then consider another game option for ‘multiple’ or ‘uniform’ fonts, or just going with one or the other based on results.

I thought about using the same text box for dialog options, but I didn’t like it in games I’ve played. I like being able to see the last thing said while I select my response. With this game, only the NPC uses the large text box, Unless it’s a self monologue and no NPC’s are present. Your dialog options never begin a long speech from your character. I hated that lack of detail in some modern games where what I selected to say was nothing like the speech the character gives. Instead, each option you have to choose in this game is exactly what your character says. There needs to be a clear distinction between the NPC and your character, either with separate dialog boxes, and/or with font. I went with both so that there would be no mistake.

The text box size is a good point. Back when I first built this game for a GITD The text boxes had come straight out of another project, which had come from a previous project where the character’s images were to the immediate sides and made good use of the space. They haven’t been entirely worked over to fit this game. I was leaving some room for additional artwork, but the artistic space used for text is one of those ‘why didn’t I think of that’ ideas.

I’m not likely to change everything as suggested, But will be trying several new things. Thanks!

 
Flag Post

Topic: Game Design / Critique my Dialog layout

None of the suggestions really nailed it, but they did get me thinking of a few different things. I did want to clarify that I’m using different fonts to denote who is speaking. I want to keep vertical space minimal to allow the player to see the characters facial expressions. If I were to put too many options or increase the gap between options I’d need to implement a scroll bar, which would hide options from being seen. I want to avoid covering up options and/or characters.

I ended up moving the [skills] to the right which allowed the text to center. Changed a word and gave the [skills] a uniform width to allow as much white text as possible within the box. I’m happy with it for now, thanks

http://i.imgur.com/7ITboAR.jpg

 
Flag Post

Topic: Game Design / Critique my Dialog layout

I’m not happy with my dialog layout. Mainly the centering of lines of text with the [skill] tag words.

http://imgur.com/a/kUc4K

- The numbers at left denote what key you can press on the keyboard for that option.

- I tried left or right aligned, looks horrible.
- I tried leaving the white text centered as the normal text field, but it easily overlaps.
- I could just center the ‘normal’ dialog layout as the others, but I could use that space for text.
- I need some way to show what dialog options are using a skill.

 
Flag Post

Topic: Game Programming / Trading graphic skills for programming lessons

Don’t forget GDR!
http://www.kongregate.com/games/UnknownGuardian/game-development-room-gdr?acomplete=game+development

Chat with other coder’s and post code if/when you need help. Just be patient when you post, usually people are working on other things.

 
Flag Post

Topic: Game Programming / possible to turn MouseEvent.CLICK off after receiving an event?

Yea, I was only removing the dialog option buttons before I create the button for the dialog to advance. I’ll try removing the listeners then the buttons.

I was just reading the adobe website and changed the dialog options to be (MouseEvent.CLICK, buttonFunction,false); and the dialog itself to (MouseEvent.CLICK,dialogFunction,true);
I don’t understand enough about AS3 to know what the different phases are, but this works.

 
Flag Post

Topic: Game Programming / possible to turn MouseEvent.CLICK off after receiving an event?

I have a menu and some dialog, you can activate the menu options with the keyboard or mouse.

The dialog window isn’t very large, so you need to press space or mouse click it to advance the text.

The problem is when you mouse click a dialog option, and following is a long dialog that should would wait for a MouseEvent.Click. The dialog will advance as if it’s already received a click. There is no button overlap between the two. Only by using a trace or the keyboard commands can I see that the text does display correctly. It’s only when using the mouse that it ‘skips’. It feels like the event is carrying over the previous MouseEvent.Click from clicking a dialog option. No idea why it’s doing this. So I’m curious if there is a way to turn off the MouseEvent state after receiving that first click.

I’m not willing to post and explain extensive code. Just asking if such a thing is possible and how. Thanks.

 
Flag Post

Topic: Game Programming / GiTD [#29] Voting

Keybinding could be an option. Let me clarify a bit. I think I was too brief explaining. Some dialog’s will have up to 10 responses. the 1,2,3~0 key’s would allow you to select your dialog response from the keyboard rather then selecting with the mouse. Many RPG’s use this method and number the responses. That’s what I’m aiming for. My thought is just to make it possible to play entirely from the keyboard. Laptop’s rejoice! Here’s the list so far:

W,A,S,D or Arrows to move. Up and Down will be to enter/exit buildings.
Space or LeftMouse to advance/end dialog
1,2,3,etc or LeftMouse to select your response
[I] or right click to bring up your [I]nventory. Possibly an icon in one of the corners as well.
[P] to use your cell[P]hone from the inventory or mouse click.

 
Flag Post

Topic: Game Programming / GiTD [#29] Voting

Thanks Aesica & Solsund. I’ll implement a 2nd click to skip the typing effect. And the option to press space instead of click. I suppose I could go the PC RPG route and have 1,2,3, key’s for dialog responses as well. I don’t want to implement a (Skip) button because the game is story based. I did shorten the intro dramatically. I hope no one still feels the urge to skip.

Sorry, to clutter your thread UG, and grats to the winner/runner up.

Maybe the next GiTD could be advertised in:
http://www.reddit.com/r/IndieGaming/
&/or
http://www.reddit.com/r/gamedev/

 
Flag Post

Topic: Game Programming / GiTD [#29] Voting

shortly* aww such fail… Thanks for the screenshot.

AMD_Paulius_J several big names made both of those games as well as Wasteland, and the Fallout series. Hope you’re not developing anything at the moment. That game has ton’s of content! Enjoy~

 
Flag Post

Topic: Game Programming / GiTD [#29] Voting

Solsund, you can click anywhere on the text box to advance the dialog. If this isn’t true in your case could you post some browser/OS details?

Anyone mentioning that all the test isn’t all there can you post a screenshot? I’m certain the fonts were embedded.

AMD_Paulius_J, Yes! I’ve played that game and the sequel, I still have a screenshot of the man holding the chain. Beautiful stuff. I like the dialog system in that game, not sure if it’s been an influence however. I’d like to recommend back Planescape:Torment. Roll a character with high INT and WIS. I swear it’s changed the way I think and who I am.

Sorry everyone for the game breaking bugs. It was put together in only 5 days. I didn’t have any graphics till the final day. the clock was at 2 hours remaining and I didn’t even have the NPC class… A graphical intro would be a good addition, but I’ve already changed it. What makes it a ‘bad day’ doesn’t need to be said. The player will experience it all soon enough as the story develops. Which includes why everything rotates. Though, if you run around the world once and speak with the man next to the clock, he should tell you.

 
Flag Post

Topic: Game Programming / GiTD [#29] Voting

We’ve pretty much presented a what we have so far. 10 days isn’t much. Some of us started late. It was a fun experience. Doing more of these is good programming/planning practice.

>1 BobJanova, I don’t like tower defense, but it does use the GiTD theme very well and is a unique twist on the genre which interests me. If you could grow so far as to invade the enemy where it’s dark underground, would be fun! As mentioned above, still a lot that’s being worked on. I didn’t like that the ‘day’ was still counting by while you were reading, or that the reading will automatically advance for you. I died on the first night. My second attempt was better. Pressing the ‘X’ to close building box is difficult.

>2 I’m still at a tie between the other two If there’s a draw I’ll choose one over the other, but at this point I cannot.

- Aceeri’s does have a use for night. But it’s quite slow and I’d only play it while I walk away to do something else. I think it doesn’t run at all unless it’s the active window?? I tried to let it idle and check on it occasionally. I can clearly see there’s more that can be done to improve. Priority being time control. or ‘end phase’ Night time doesn’t need to last 5 minutes, resolve the battle and move on. I want to play before my own day turns to night.

- feartehstickman can be left running as an idle game in the daytime phase. I don’t see any use for night as it is currently. I left it running and returned to nearly 5000 cows and my 1000+ townsfolk were all determined to walk to the one cow at the edge of the herd. I’m happy they didn’t decide to eat us instead. I’d like to know what else is planned for this game. because I don’t see how it fits the theme currently.

- Thanks for the critique on my own entry. Yes, much of what’s been said is planned or is already in place. However you’d need to talk with the NPC’s to advance the story. I do plan to develop it to completion.

 
Flag Post

Topic: Game Programming / GiTD [#29] Entries and Discussion (started!)

http://www.fastswf.com/urkRTdY (last minute edit, enabled the intro)

That’s what you get for a GiTD starting 5 days late. No music, no sound, not much testing other then the lotto. but hey, it mostly works. Thought time was up, manged to get NPC’s working in 2hours! That was more intense then any game I’ve played in months.

Sprites are ripped from the GBA game TheWorldEndsWithYou, CastleVania, and Google Images of Watches and Gears. Majority of the code (dialog, transtions, parallax scrolling) are from a current game in progress. All the dialog was written during the 5 days.

The math needs work, More scripted events and building interiors. The Bum in the evening will bug out because they are supposed to be in an interior where and event checks and updates variables. Any other bug’s reported are appreciated.

 
Flag Post

Topic: Game Programming / GiTD [#29] Entries and Discussion (started!)

I only found out about it Tuesday night.. Have been grinding like mad. 1 day to go… I really need those days I missed. This thing might be playable from start to end.

 
Flag Post

Topic: Collaborations / ideas for games first one to say the want it gets it

You do realize that’s a catch 22? Laying out an idea in it’s length IS making it something tangible according to your own definition.

OP is obviously new to this, and is trying to get into the scene. He’s not some dying creature who ‘cannot make all his ideas’. You can justify yourself all you like, and laugh at whatever you please. Form a committee to try and prove me wrong. But I will not stand to watch you make up what the f* values to intimidate the guy to give up his ideas. I know a vulture when I see one.

(Correction – you didn’t make up the values, I’ve seen it copy/pasted elsewhere across the web. Vultures will be vultures, what can I say)

Living in society means you need to earn something to survive. Give me a place where I can freely live and I’ll fill this world with free idea’s. Until then OP should keep his idea’s secret, keep them safe and learn what he needs to make something of his own idea’s. No one else is going to do it for you, for your benefit. So beware of the vultures looking for a free meal at your expense.

 
Flag Post

Topic: Collaborations / ideas for games first one to say the want it gets it

“What you should be doing is laying it out so people could pick it up with the least amount of hassle as possible.” <- Thats just plain rude and unacceptable.

I wouldn’t lay out an entire epic film script for just anyone to do with as they please. Idea’s DO have value. But I will agree in part, you have to learn to do something with your idea’s. Just having them isn’t enough. Making something from them is what makes us artists, musicians, writers, and programmers.