Recent posts by BobJanova on Kongregate

Flag Post

Topic: Game Programming / PlayerIO lifespan

They’re updated their price policy and integrated it with their own games channel, so I would guess they’re intending on keeping it supported for quite a long time.

 
Flag Post

Topic: Game Programming / Should I start making flash games?

If you think it will be fun, then yes, otherwise no, like any hobby ;)

Sticky threads are there for a reason, there’s lots of help in there.

I use FlashDevelop which is free and pretty good, though you have to create your art, music etc in another program.

 
Flag Post

Topic: Game Programming / Artist for hire

You might want to post this in Collabs, though I see you are quite active there already in other threads.

 
Flag Post

Topic: Game Programming / Procedural Generation

I hadn’t heard of simplex noise, thanks for the tip, I’ll be sure to look into that next time I’ve got some procedural generation to go at.

 
Flag Post

Topic: Game Programming / Procedural Generation

Perlin noise is the way a lot of procedurally generated ‘natural’ environments are built.

 
Flag Post

Topic: Game Programming / Fun with Math

You can’t have the appearance of random noise and guarantees about separation (obviously, random noise is, well, random), so you probably need to be more precise about the requirements on that front.

I would start with the peaks a periodic continuous function in X and Y (e.g. sin/cos) and then pseudo-randomly perturb it until it looks ‘random enough’.

 
Flag Post

Topic: Game Programming / Overriding the + Operator

Yeah hopefully. I have the same thing with vector and matrix classes, the C# version is really nice to use and the AS one a bit ugly, but we just have to put up with it.

 
Flag Post

Topic: Game Programming / (True === False) ???

If he’s coming from C++ he’s leading you up the garden path with regard to AS. In C and C++, the constant ‘NULL’ represents a literal 0, so true > NULL. That’s not true in object based languages with a true null, like AS – in these languages the definition of what a comparison operator should do is arbitrary.

 
Flag Post

Topic: Game Programming / (True === False) ???

It’s just the definition that AS has chosen to use. There isn’t really a deeper reason.

 
Flag Post

Topic: Game Programming / (True === False) ???

I’m glad to see an explanation for this snippet which isn’t decompiling, which is what it looked like … although I’m still suspicious, _loc_1 isn’t the kind of name that any actual person would name anything.

In terms of the actual snippet, I’d say he’s screwing with you a little. But it’s easy enough to follow the logic: true===false is self-evidently false, so it evaluates to false<null, and I think any arithmetic comparator with a null returns false (like it does with NaN).

 
Flag Post

Topic: Game Programming / Interfaces vs Inheritance

Another place that interfaces are very useful is creating a boundary between modules – this is what you are getting at with ‘make sure the other programmers know that the object extending the interface requires myMethod() to be declared’ but it’s more generally useful than just dealing with other people. Whenever you create a module where all its dependencies or external couplings are interfaces, not concrete classes, you can isolate that module and test it in isolation; also, you can easily switch out the dependencies if you want to later on.

For example let’s imagine a typical 2D game scenario where you have some objects in the game world that you want to control, either with the keyboard/mouse or by AI interactions. The temptation is to write control code directly referring to the player character and write AI movement code directly in ‘enemy’ types. But if you instead delegate it through a Controller interface, suddenly you can
- test that your player movement reacts to control events (e.g. ‘go right’) correctly, by plugging in a test implementation of the controller which sends well known control events;
- allow the player to take control of different characters by replacing their controllers with a keyboard/mouse one, for example some kind of body-switching powerup
- allow the computer to take control of the player character, for example a berserk effect;
- have the same type of character act differently depending on other circumstances (by having different controllers) – e.g. you can persuade them to fight on your side

Interfaces are very useful when you get to software engineering as opposed to hacking stuff together, because this kind of boundary between components is important for team working and for testability.

 
Flag Post

Topic: Game Programming / Custom Embed Width and Height on KONG

Build a SWF which is already scaled down and submit that. If you want different versions at different sizes you should be able to script the build process to do that, though I’m not quite sure how to do that from FD.

 
Flag Post

Topic: Game Programming / Statistics doesn't work in preview mode ?

I don’t think it does, it’s so long since I uploaded a game with stats I forget though.

 
Flag Post

Topic: Game Programming / FlashDevelop's flawed Features

I didn’t know about that, thanks. It still doesn’t autocomplete it for you like it does any OO method in scope, though.

 
Flag Post

Topic: Game Programming / Multiplayer as3

And do you have server hosting, backup of user data, load balancing and so on?

I actually agree that writing serverside code is not at all hard – it’s basically just a message serialiser and deserialiser and management of connections on the server side. But the infrastructure costs money and probably a lot more money than you pay to Player.IO or its friends.

 
Flag Post

Topic: Game Programming / FlashDevelop's flawed Features

Looking for getTimer(), for instance? just starting to type it won’t cut it, unless you’re already importing it in that class.

Yeah that’s the one thing that’s annoyed me about it (same for describeType and other static non-OO functions).

 
Flag Post

Topic: Game Programming / Find the error

Looks like this is in the property setter for the enemyBox property for the B3 class (that looks like a very bad name btw)? Post that property code.

 
Flag Post

Topic: Game Programming / Graphic Filters/Shaders

Have you looked into Stage3D? Despite the name, it’s just a graphics pipeline which drops through to accelerated hardware where available, and you can write shaders for that (look up AGAL).

 
Flag Post

Topic: Game Programming / Need easy object comparison?

Not on Kongregate I’m not … elsewhere … perhaps :P

 
Flag Post

Topic: Game Programming / Need easy object comparison?

Nice.

Does it work on arrays?

I have something similar in my unit test library but it doesn’t bother going through all the fields and properties, it relies on the fact that I set the toString to something meaningful on my custom objects.

 
Flag Post

Topic: Game Programming / Essential AS3 help again -- random "b"

Originally posted by truefire:

Worth noting: try/catch is really slow. It shouldn’t be relied on for the execution of your program. That is, try/catch should only be used to detect unknown errors, not as part of regular program flow. [etc]

I don’t fully agree with this, and it’s a matter of some debate in the wider development world – there’s no clear answer. You shouldn’t use try/catch for control flow, i.e. you shouldn’t use a try block when you expect the exception to be thrown in ordinary usage. But for exceptional cases it is fine (imo) to use exception handling to deal with inappropriate input. If you are selecting items out of an array then the normal input is requests within the valid index range, and I’d be quite happy letting an exception be thrown if the input is exceptional by being outside the range.

A good rule of thumb is that if your if statement is going to display some kind of message to indicate an error condition to the user, it’s okay to throw (or permit library code to throw) an exception there, as long as you have exception handling in place to handle it gracefully higher up.

Try/catch is slow, but not so slow that you shouldn’t use it. Actually throwing and catching an exception is slow (order of ms I guess) so you shouldn’t do it repeatedly, for example in a tight loop. But throwing exceptions in exceptional situations and handling them high up the call stack is fine to me.

 
Flag Post

Topic: Game Programming / Accurate Circle Collision

		public override function Collides(other:CollisionHull, secondPhase:Boolean = false) : CollisionResponse {
			if (other is CircularHull) {				
				var ds:Vector2 = parent.location.Subtract(other.parent.location);
				var or:Number = CircularHull(other).r;
				if (ds.Mag2 < (r + or) * (or + r)) {
					ds.Mag = (r + or) - ds.Mag;
					var cr:CollisionResponse = new CollisionResponse();
					cr.CVec = ds;
					cr.GlobalPosition = parent.location.Add(ds, 1, r / ds.Mag);
					return cr;
				}
				else return null;
			}
			else return super.Collides(other, secondPhase);
		}

This gives you a collision vector which is the direction in which the force is applied on this circle (obviously the opposite is applied to the other one). Look up ‘Zero Momentum Frame’ for how to calculate the whole thing algebraicly including the exit velocities.

 
Flag Post

Topic: Game Programming / FlashDevelop/AS3 and Local Images

If you don’t embed things in the SWF then they won’t be available when you give the SWF to someone else. Putting something in the bin directory doesn’t magically make it go into the SWF – you’d have to give the image files to them as well. Having things in the project directory makes them available to the compiler when building your SWF, but if you don’t embed them then they’re not in the SWF.

“Including local files into an SWFis embedding.

If not, why the crap would you ever use local, unembedded files?

Good question. I don’t see the purpose in that and I can’t see how it can ever work outside the context of installing a SWF plus a bunch of auxiliary files.

If you want to minimise embedded assets then you have to stream things, which is no less resource intensive but it does distribute it. You can put things in later frames and use an intelligent preloader/status system to let you know when certain tracks of music (usually what is the large asset) are available for a similar effect without relying on other files being available (images are usually essential for the game and need to go in frame 2 so they are loaded by the preloader, but I think you can put music holding assets in frame 3, 4 etc and start ‘the game’ without them – I haven’t actually tried this though).

 
Flag Post

Topic: Game Programming / GiTD #35 Congratulations Reaper_Guy!

Sorry meant to vote but I haven’t had time to review.

Frictionless Fury: A good interpretation of the theme, and about the right level of difficulty I think. Enough polish to make it a playable game and not obviously a quick half finished project.

Ultimate Survival Lab: Well executed and good use of the 10 second mechanic. I find it quite boring though and give up playing after a couple of minutes. Is there only one level?

Bullet Time: I don’t really like this type of game so it’s difficult to give it a fair shake. Inventive use of the theme and seems to be well made, though it could use more variety and a gentler lead in to the boss – if you’re not a bullet hell player it’s not really a playable level.

In Ten Seconds …: Possibly a good idea in here trying to get out, along the lines of Four Second Fury (remember that?). But you haven’t managed to make it yet; in particular having to replay all the levels to get back to the one you failed is annoying. Could be worth pursuing though.

Hungry Dream: Seems like it’s not finished enough to really play, I don’t know what the mechanic or game objectives are.

No name: obviously unfinished and sticky walls make it impossible to control. I guess it’s supposed to be a maze game but I can’t get far enough to really see what the 10 seconds is about.

Guild of Brothers: I really like this one, although I can’t complete it in a couple of attempts; maybe it’s too easy to take damage when attacking? Or it’s too hard to get feedback that you’re taking damage? Good use of the theme.

Ten Second Dash: Not bad. I think you need some kind of lives or save points system, once you start having screens where you can die easily it is just irritating to go back to the start. The movement feels really sluggish too.

Jetpack Nemesis: A good start to a great game. Unfortunately because of the time limit there’s no powerups, progression, variety to terrain or feeling of purpose.

Just Another Game: Seems like a really good game but it’s so laggy/low frame rate I really can’t play it, particularly as the controls seem to be very sensitive. I’m not sure if that’s Unity’s fault or something to do with all the tiles. Up/W should definitely be jump too.

First: Guild of Brothers
Second: Jetpack Nemesis

Generally a comment on this competition: some really good entries came out of combining it with LD. I don’t think the theme was very good for GitD though, we’ve got a lot of similar survival games. Good work everyone, don’t think I’d have won this one if I’d entered!

 
Flag Post

Topic: Game Programming / Is there any smart way to make user interface?

Originally posted by feartehstickman:

Ok then. It seems as if I’m at least on the right track. Perhaps I should sacrifice speed for usability and identify all my functions via strings rather than by ints in an Array…

You can put functions directly into an array (or a vector).