Recent posts by BobJanova on Kongregate

Flag Post

Topic: Game Programming / Flash socket programming (Android Game Dev.)

You can write server side logic in any language you can run on a server. As far as I know that doesn’t include ActionScript, though if you want something similar you can write a server in Javascript and run it under Node.js.

If you don’t have a server that the host will let you run arbitrary servers on, and you can’t do what you want through HTTP/AJAX (most turn based or slow paced games don’t actually need a persistent TCP/UDP channel) then you probably want to look at something like Player.IO (which uses C# iirc).

 
Flag Post

Topic: Game Programming / OpenFL coming to game consoles

I wonder if I should learn HaXe at some point … been doing AS3 because that’s more ‘native’, but perhaps it is better to be non-native to several platforms.

No questions your honour, just a musing.

 
Flag Post

Topic: Game Programming / GiTD #45 *Creating Skeletal Wasps*

Oh nuts I just saw this, been checking for GITDs for a while but I got out of the habit of it.

 
Flag Post

Topic: Game Programming / How to make the simplest p2p

I’m just going to set aside the tangent for a moment and point the OP at this: https://gamesnet.yahoo.net – which is what Player.IO turned into.

 
Flag Post

Topic: Game Programming / Any FREE game making programs

Since you’re on a Flash games site I’m going to answer this with FlashDevelop. If you want to make anything good you’re going to have to learn to program and you might as well do it properly with an IDE and not with some simplified tool that will just frustrate you.

 
Flag Post

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

Something which makes sense as a 2D grid of pixels, store as an image; that way you can edit it in normal image editors. That includes actual images like parallax backgrounds or sprites and sprite sheets for in game entities (though if you’re using the Flash studio then you can make those in there), maps for platform, RTS and other tile-based or 2D games, textures for 3D models.

Things which can’t realistically be stored as images should be in some format that an external editor can edit (possibly one you’ve written). I don’t like XML but given AS3’s excellent support for it, it usually makes sense to use that.

 
Flag Post

Topic: Game Programming / Fastest way to compute Square Root? [solved/nvrmnd]

However, the code must check every-single-object in the map per game tick

Sounds like this is your problem and you should look into spatial partitioning (probably an octree or quadtree) if you’re running into performance issues.

 
Flag Post

Topic: Game Programming / Question about alpha/transparency in general

In paint.net, there’s an option for Additive in the Blend dropdown for whatever painting tool you’re using. In Stage3D use context3D.setBlendMode. Not sure about how to do it with DisplayObjects.

 
Flag Post

Topic: Game Programming / Question about alpha/transparency in general

Pixels are overlaid, not combined. So if you put a pixel with 50% alpha on top of an existing pixel, the RGB values are summed based on the alphas of both pixels, and the alpha value is the old alpha plus the proportion of what’s left (255-old alpha) given by the new pixel.

If you use additive blend mode (SRC_ALPHA, DEST_ALPHA) you should get what you want.

 
Flag Post

Topic: Game Programming / Load .png without premultiplying alpha channel?

Hi all, I’m trying to embed a PNG image with alpha channel information. Is it possible to do that without the RGB channels being pre-multiplied by the alpha? I want to see the actual ARGB values stored in the file. (I’m using the image as a Stage3D texture and the alpha channel is for specular smoothness.)

It’s okay if I can’t use BitmapData and have to [Embed] with a different format, though ideally I just want to turn off premultiplying on BitmapData..

 
Flag Post

Topic: Game Programming / In-game Events: Storing the target as a variable or passing it each time

This depends on the association between events and characters.

If an event is associated with a single character or group of characters, the target can’t change, and it involves more than just a change to the character’s attributes (strength, resistances, speed, whatever), it should be an object which refers to the character.

If an event is just modifying attributes of the character, then characters should hold events, not vice versa.

If events are associated with an area of the map, or some other way of selecting characters which is changable between frames, then events should be given either the map or a function that lets them pick characters.

 
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.