Recent posts by Lucidius on Kongregate

Flag Post

Topic: Game Programming / GiTD #39 - Congratulations Zoib!

Darkscanner – Find the lost trolls 3/5
You got the makings of a good game here – at the very least its shell. You’ve got optimized ambient lighting at the cursor at 60fps? – not bad. Throw in hordes of well-drawn, differing speed moving zombies and, later on, creatures out of mans worst nightmare, maybe some guns, some bullets, maybe a custom-made-shader that reacts to the ‘light’ and paints the borders of the bitmapdatas of the creatures and other objects relative to the cursor by merely bitwise-shifting the R G B A values. Call it “Our First Punishment.” ????. Profit.

Zoib – Mapworlds – 4/5
You made this yourself? Wow, I am impressed. Immediately I liked the feel of it. Reminiscent of some early 90s first person games for example Tribes RPG mod of Starsiege: Tribes. Even without initial direction, I remember seeing something like a map prior in the thread and put two and two together. Wandered a little bit in the bubble section, thought the oldschool method of always hugging right wall would work. At some point I could see something blue over the wall and dammit, I wanted to see the whole thing. Lost it. Got lost. The end. I remember hearing footsteps at just the right sound level every now and then, well played. Anything 3D comes with increased difficulties in certain areas vs 2D, for example AI and collision detection, good job. At some point I wanted more speed, tried some keys, nah. Maybe a little jump? Nah. I lost interest thinking some kind of monster would be perfect right about now, an untouchable phantasm that moves slow but walks through walls, one not long after start and another one for each crystal found. Maybe an ethereal sword that with each swing, dims your vision and slows you down, and eerily enough, begins to resemble crystal more and more…call it “Crystal Souls.” ????. Profit.

Lots of good suggestions in this thread. The incense-lighting or some other kind of visual created by player would definitely hold more attention, if the ambience was kept right. You could always include the maze as an optional bonus in your future game, for the more hardcore gamers. Throw in a minotaur lol. Some backstory: the minotaur is the planes’ greatest architect, and greatest warrior. But he cared not for goings on in the rest of the dungeon, for this was his land, and to intrude upon it meant to court death.

Flag Post

Topic: Game Programming / GiTD #39 - *Lost*

I guess it was kind of dumb of me to assume I could port my framework over to Haxe, AND make a game on top of that in ten days. Only just yesterday got back to the point where I was with AS3 (developing by iteration, i.e. only a few bugs here or there per iteration, versus the 500 at a time [due to changes in scope] I got while converting my framework ~ about 1500 total!) and got my top-down-world base class up and running optimally, in a demo-shell environment…

With the dayjob today and tomorrow (Friday) I don’t think I’ll actually get much work on my entry done – though I did write up a sizeable game design doc and thus have a dev roadmap all set out. If I didn’t work at a non-computer-related dayjob 32 hours a week I probably would have an entry. Sorry guys. I’ll definitely participate in the voting though. And GITD will be mentioned as sparking the inspiration behind this game when it does get finished! (I’ll not be sidetracked into making it my main project like I have been doing with my gitd attempts lol).

I was thinking of writing up a detailed blog post about my experiences with changing over to Haxe and highlighting what were for me, the greatest hurdles. In this way others who change over – or are thinking about it – may hopefully benefit, and thus not feel so ‘lost’ as I, admittedly at times, felt while making the switch.

Flag Post

Topic: Game Programming / Haxe/OpenFL primer -- If Flash dies, this is your lifeboat

Having a passing interest in Haxe since hearing about it, I have become increasingly wary of the future of Flash, and Adobes’ plans for it as they go back on their word repeatedly. Their donating Flex to Apache, the cancelling of ActionScript 4 aka Next (and the performance upgrades we all crave), dropping support of Air Linux, etc. all seem to be careful timed steps away from the Flash platform. Being a self taught developer for the last 4 years or so I find all of this disheartening, to say the least, being literal months from releasing my first ‘real’ game after a year of development. I am jumping onto Haxe as it seems to really have potential in being able to target many platforms NATIVELY, and thus has a degree of ‘futureproof’ though of course time will tell.

With that said, three days after ‘going for it’ I am still in the process of converting my entire self-made framework and game over to it, haha. 50K+ lines of code with 1000+ syntax errors to go (after the initial wave of errors such as int to Int and Number to Float, and Array typing, about 1K total)! It says 352, down from 500+ but you know how it do.. Lets hope this is worth it. After consulting the haxe ref a few times to clarify what syntax I should use (in particular for:
- for loops – now for(i in 0…array.length)
- static consts (now static inline var)
- my use of null to answer a boolean conditional (you must now actually specify != or == null, rather than say if(tempPanel.stage)
- the requirement of having to cast all my floats to ints (or should i say, Int) using cast(datFloat, Int)), for any comparison to or assignment to an Int variable

I can say it all is starting to make sense, and that Haxe is raising the bar on coding practices enforced for me. With any switch to a diff language there are hurdles, but in this case it is a LOT less painful than I had anticipated (unless after I clear this batch of errors it tells me all my code is void lol!, but looking at the code examples in the ref, it literally looks almost identical to AS3, and though I cannot state this as fact until the errors are all clear, I have had to change around 2% of my code, and merely syntatically, at that.

I respect your work Lars and have been following you guys since DQ1, keep up the good work and thanks for trying to help all us other developers out! :)

update: its proving to be fairly hard, only because I had to learn a lot of new stuff in a short amount of time. No more embedding assets anymore using the [Embed] tag and I am having trouble getting assets to load properly. Other than that – done refactoring the code – turned out to be more like 4% of the code had to be refactored, and maybe 1% changed enough to qualify as re-written.

Flag Post

Topic: Game Programming / GiTD #39 - *Lost*

making the jump to Haxe as well, lets see if I can pull this off lol :) GL HF everyone

Flag Post

Topic: Game Programming / GiTD #39 - *Lost*

Wow, this is a good one. I’m in. Going to make a game and fit it into the same ‘universe’ as my main project. A side quest if you will. ;)

Flag Post

Topic: Game Programming / Tilesheet w/ Blitting

Well rendering may not have been the right word. If you dont use lock() then when you change the instance of BitmapData, all objects that reference that BitmapData, such as Bitmap objects containing it (the canvas), are updated each time it is changed. With lock(), no objects that reference the BitmapData are updated/changed until you call the unlock()

In reference to the above, in my own games my problems come not from the blitting rendering engine per say, but from other things ~ oftentimes unnecessary copyPixel calls, too many draw() calls (using matrixes to place/rotate, and/or bitmapfilters to add special effects), objects outside of camera being render()’d (easily fixed with a function inCameraBounds(object with worldX and worldY to query) function!), etc. Qwerber is definitely right though ~ cant fix a bottleneck by fixing something else.

P.S> pathfinding is my biggest performance killer! @_@’’ one of the few wheels I opted out of reinventing…

Flag Post

Topic: Game Programming / Tilesheet w/ Blitting

Welcome to the wonderful world of blitting lol :D

Unfortunately, copying specific tiles to specific places on the canvas must be done with individual copyPixels calls, however, copyPixels due to its nature is very fast and you will still see a significant improvement over every other rendering method. However you will be out using special filters, rotations, and the like (i.e. all the benefits of DisplayObject) because the pixels of the original bitmapData ref are copied and thats it – unless of course you modified it beforehand (though not every frame! as you will end up cost-wise where you started, or even worse due to doing it for every time a tile is copied!)… or you can use the filter / mask etc on the entire canvas, AFTER all the copyPixels are complete. Several canvases may be in order for more specific / limited effects applications (i.e. blurring your fore and backgrounds and leaving your blitted sprites untouched during an epic skill sequence ;) )

Anyways, first thing to remember is to lock(), do all copyPixels calls, then unlock() your canvasBitmapData, otherwise flash WILL render for every copyPixel call, rather than just once after unlock() come frame-time.

Initialized class-variables help a lot too with optimization (i.e. re-using an instance of Rectangle for copyPixels’ sourceRect, reusing a point for destPoint, etc)

I forget who it was that pointed out that erasure is done fastest with fillRect() as well.

Assuming you are using some sort of tiled animation somewhere, in some sort of class (say, BlitObject or BlitSprite) you can gain a huge optimization by only copyPixels to ITS bitmapData when the time comes for the next tile – that is when animation delay is up, say, one walk-tile every 10 frames or so. And otherwise just copying from its bitmapData to your game//layer canvas once each frame and occasionally twice (again, due to its animation delay)

if you need special things like rotations (who eventually doesnt?) then BitmapData.draw() becomes your friend, as well as its inseparable buddy matrix

Anyways good luck and enjoy!

Flag Post

Topic: Game Programming / [AS3] RIGHT_MOUSE_UP

maybe its simple…

// Right Mouse Up Function That's Not Working
stage.addEventListener(MouseEvent.RIGHT_MOUSE_UP, rightMouseIsUp);

//needs to be
mapHolder.addEventListener(MouseEvent.RIGHT_MOUSE_UP, rightMouseIsUp);

I had problems long ago with this same issue, with mouse events. It is because the way events go through the display list; they go up through the display list hierarchy, though I am not sure if they hit stage – that is, if stage counts. I quit messing with listeners / refs to stage anyways except for the main controller class, but thats a tangent. One thing to remember is that they dont go sideways through display-list hierarchy’s. I think what happened here, to cause your problem, is that by adding the listener to stage, stage never recieves the event because the mouse event is hitting the mapHolder display object, not the stage on which everything is on-top of.

Another caveat is to make sure that the mapHolder has the stage focus / or that there isnt another display object on top of it, that isnt part of its display list hierarchy

Flag Post

Topic: Game Programming / GiTD #36 Has begun, the theme is Backwards!

Damn…just couldn’t find the time had a great idea and everything ><

Flag Post

Topic: Game Programming / AS3 Tips and Tricks

a few off the top of my head:

  • use vectors instead of arrays.
  • iterate backwards through vectors instead of forwards.
  • when iterating through an vector, but before the loop, instantiate a var tempClass:Class where class is the type of object your vector contains. At the beginning of each loop, set tempClass to tempVector[i] where tempVector is the vector you are iterating through. From then, just use tempClass.function() or tempClass.variable etc rather than tempVector[i].function() or tempVector[i].variable. In this way you minimize the number of retrievals.
  • if dealing with a lot of objects on screen (such as bullet hells) look into object pooling. This is where you have a pool of instances of say, Bullet, already instantiated and ready for use. You have two (or more) vectors, the most conventional setup being an activePool:Vector and an inactivePool:Vector (both, of type Bullet, formatting prevents me from showing such here). As you need bullets, you pop from the inactive pool into the active, and as they hit or otherwise expire (such as go off screen or whatever) you pop that specific one from the active pool and put it back into the inactive pool. An activate() and deactivate() function may be helpful in your Bullet class, in this case, or at the very least the ability to reset needed vars (such as a lifeTime:int variable, worldX/Y, dx/dy)
  • most of your processing is eaten up via your rendering. Focus on this first. For example, dont render something if it is off the screen or outside of your camera bounds. However, DO update its position, state, etc.
  • when rendering a sprite containing a tile sheet of sorts (or, preferable, a reference to a common tile sheet for all other instances of its ‘type’ of creature), that has a delay between its various frames (for example, a delay of 5 ticks between each tile of its “walk-state”), do not render its current bitmapData tile UNTIL it is actually changing tiles, or only on instantiation. (Where current bitmapData tile is what is copied to the game canvas or camera). And again, ONLY if it is in camera bounds. i.e.
    if (GameControllerClass.inCameraBounds(tempBlitSprite)) tempBlitSprite.renderCurrentTile()
Flag Post

Topic: Game Programming / Wobbly rotation

Currently on phone at work myself still, so im not 100percent sure…but maybe it is something to do with the rotation and rounding? I encountered that problem once when converting a radian to degrees and was using the default result of such operations (rounding when casting as int). Fixed it by using math.floor instead for the rotation:Number param of DisplayObject

Flag Post

Topic: Game Programming / Wobbly rotation

If indeed there is difference between last and current points (ie it isnt trying to find the angle of a line of zero length, which ofc has multiple results) then check if you have any controls on rotation per frame. For example it could be a target angle of 100, with current angle 98 but it moves in increments of say 5, so on next tick it is 103, then it moves back down to, 98, etc producing wobble

Flag Post

Topic: Game Programming / Wobbly rotation

Check to make sure there is a difference between current point and last point. I assume you got it following your mouse or some such? Went thru the same prob when i started coding. One quick fix is to change at which distance the mouse moves to a new position (that is, when your real mouse has moved enough away
from it)

Flag Post

Topic: Game Programming / Building a linked chain

You could always create a function called inCamera(link:ChainLink):Boolean that checks each links-tile’s world x and y (using whatever maths) to see if it should be drawn or not. Even with the maths it would still be massively cheaper than drawing all of them all the time. Inversely, you could create a function that returns only the tiles that fall into a defined range (say, by a virtual camera)

It also boils down to how aware the player is going to be, of the rest of the chain. If it never comes into the picture, then why bother drawing them at all? invisible chains for the win, as long as they are functional (dont know if you are doing some sort of nextLink:ChainLink and previousLink:ChainLink within each ChainLink instance, and working maths on that)

Flag Post

Topic: Game Programming / Composing Game Audio?

Welp, on topic…:

Like programming, and art, music is something you get better at through the time you put in it. Listening to a lot of different music and developing a mind for rhythm and (I think more importantly), melody, will definitely help you. Its video game music you are after, why not listen to a lot of it? Go on youtube and look up top video game music’s of all time and you will find a few quality channels. My casual listening library is at around 2000 and counting, and there is a TON of good music from games you’ve never even heard of. After some time you will find yourself hearing the music in your head (if you dont already) and good practice is to think of how you could improve upon it, or add another instrument with your own melody, all this in your head. You create a good one in your head then find yourself a keyboard (online or a physical one, easy to come by a cheap electric one these days) and find the keys to the melody on it and write them down. Then also randomly mess around on the keyboard (on your comp or a physical one, again) This will make you better at making music. But only if you put in time and effort, again like programming and art it doesn’t come easy, to anyone.

WITH that said, look into Reason (PC) or GarageBand (iOS) both programs in their free forms should be sufficient for your needs.


Or, if you want to go oldschool straight legit, find yourself a free chiptune maker or check out this site

You can even try to get into music tracking, oldschool music making process much explained here

Personally, I prefer the capabilities of Reason or FLStudio, but thats just me. Good music does NOT depend on the medium!

Here are some free alternatives as well, contemporary composition process:

Have fun and good luck! :D

Flag Post

Topic: Game Programming / FlashDevelop Debug Suddenly Running Slow

Sometimes I have this problem too. I built a ‘system profiler’ class which runs at the very beginning of my games, and I can tell right away if the debugger is lagging. Still no idea what is causing it. Sometimes it is there other times it goes away, but it definitely feels like a problem with FD because it doesnt matter what project I happen to be running, new ‘clean slate / template’ projects or old projects, or even whether or not I am running the profiler ~ the lag is instantaneous.

Flag Post

Topic: Game Programming / level editor?

Mappy is also a good one. I like how it has multiple layer level editing, as well as the ability to export to actionscript (or other languages) with a -1 (or whatever you want) modification to all values.

Flag Post

Topic: Game Programming / GiTD #34 Has begun, the theme is "Creation/destruction"

Gonna enter this time, starting right now. So far I got a game title: Encroachment. Think its high time to show what I have learned over the years since my last game I actually published! :) Good luck everyone!

Flag Post

Topic: Wartune / [Promotion] It Pays to Consume!

Got screwed by the last recharge event – was within the time frame (both personal and server time) etc; It does not surprise me they keep on screwing people. Their customer service is horrendous at best, and the ticket system should be removed entirely, since using it obviously has no effect!

Flag Post

Topic: Game Design / Game genres - Is there anything new under the sun?

My start with TD’s came with the original Starcraft. Around year 2000? So many good maps on there, one could glean a lot of ‘new’ game design ideas from that period, as well as from Warcraft III’s custom maps (DotA being a prime example of starting the MOBA). For like 5 years thats all I played were custom maps from those two games with friends and strangers alike…a golden age of innovative game design to be sure, with much lost to the ages (never?) to reach its true potential due to its underground nature. :D

Flag Post

Topic: Spiral Knights / How do you login with your Kong account using the real SK download?

I took the time to message them through their website by submitting a technical support ticket – their response was that they do not offer the service of converting a kongregate account to any other account type (the other two that I know of, being Standalone Client account type, and Steam account type). So special promotions (especially on the Steam version) we are exempt from. Sorry. Bad customer service if you ask me, especially since the Standalone Client runs much faster/better. :(

Flag Post

Topic: Game Programming / Very very strange problem with trigonometry (SOLVED)

Dont forget that because flash’s coordinate system is upside down on the y axis (y increases as you move down) that you switch cos and sin

vx = Math.cos(angleRads) * speed;
vy = Math.sin(angleRads) * speed;

Flag Post

Topic: Game Programming / What music do you like listening to while programming?

All about video game music! :D (snes and genesis era mostly, plus some notables from the few competent game music composers today, oldschool examples (i.e. almost the entire soundtracks are good) → Chrono Trigger, Tales of Phantasia, Terranigma, Final Fantasys 2/4, 5, and 3/6, 7, 8, 10, and 12, Treasure Hunter G, Live A Live, Shining Force 2, Breath of Fire 2, Radical Dreamers, Seiken Densetsu 3 (Secret of Mana 2) Donkey Kong Country 2, Lufia 2, Bahamut Lagoon, just to name a few from the older era… in other words Yasunori Mitsuda, and Nobuo Uematsu)

‘mid’ to new era examples:
Electricity – SimCity 4 OST (HQ) –
Epicenter – SimCity 4 OST (HQ) –
Umineko no Naku Koro ni – dreamenddischarger –
Nora to Toki no Koubou : Kiri no Mori no Majo – Everyday Lifestyle –
Command & Conquer: Tiberian Sun – Lone Trooper
Cladun: This is an RPG OST – Knight of a Foreign Country –

some ABSOLUTE listens:
Chrono Cross OST – Chrono Cross ~ Scars of Time (Opening Theme) –
Eschatos – Point of No Return –
Final Fantasy X OST – Omen –
FINAL FANTASY XII OST 3-04 – Seeking Power –
My Top 25 RPG Final Boss Themes #4- Digital Devil Saga 2 –

gotta stop myself there…barely scratched the surface! have programming to do…

Flag Post

Topic: Game Programming / Interest for GiTD #28? Date: Dec. 27th, 10 day jam!

Im down for anything beyond Xmas week (Dec 27th looks good for example). 10 day preferred as the dayjob gets in the way. I could swing a three day if it falls on my days off (which are quite random, usually mid-week tho) but I understand most here got weekends off so yeh

Flag Post

Topic: Game Programming / GiTD [#27] Entries and Discussion

What a great time to catch a cold after not being sick for a year _’’ sorry guys. I def will be voting / reviewing though. :) And finishing the game up afterward.