BobJanova
443 posts
|
Topic: Game Programming /
mofunzone.com STEALING your GAMES?!!!
You must, must, must ask the developer (the copyright holder) for permission before copying his work. That’s a basic feature of copyright.
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
AS3 Preloader [Yes, another one]
Yep, you need to put the ‘big stuff’ in a separate frame because Flash won’t display a frame until it’s completely loaded. The FlashDevelop standard preloader pattern is quite a good starting point; it puts the content in frame 2 and dynamically loads the class once the preloader detects that frame 2 is loaded.
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
Microsoft to halt SilverLight development; Adobe ceases developing mobile browser Flash
“Things are going into the cloud” … wasn’t that the future of computing in, like, 1999?
The Silverlight position is not as clear as MS are stopping development, they’re just refusing to answer the question at the moment.
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
Speed question - float vs fixed-point/int arithmetic
Flash doesn’t give me access to the GPU, though, right? Or not without some serious hackery anyway.
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
Speed question - float vs fixed-point/int arithmetic
Okay, so as some of you probably know I have a functional 3D engine which I used for bZone. It is true 3D with transformation matrices for each object (nested in the case of weapons and other attached items), using floating point arithmetic. It works, but it seems kind of slow, compared to some other similar looking games on here (Vector Runner etc), though they might be using some shortcuts to true 3D. The time is mostly (more than half) in the ‘project’ phase which is where most of the heavy maths happens.
My question is: is integer arithmetic sufficiently faster that I should bother with the effort of converting the core classes to use integers internally (and only store things to an accuracy of 16 bits, I suppose, so multiplication works)? Are particular operations much faster (e.g. divide or mod) and others where it doesn’t matter?
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
Normalization
How big is the map?
A Gaussian or similar type of spread function should do what you want. For 1D it’s unlikely that there will be a problem with too much data.
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
[AS2] Scorekeeping unreliable =\
If you’re splicing out of something you’re iterating over, you must loop through the collection backwards, i.e.
for (x = good.length - 1; x >= 0; --x){
good[x]._y += gravity;
checkHitGood(good[x]);
}
Otherwise some checks are missed out. They shouldn’t get run twice, though, so I’m not sure that’s the only problem.
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
PHP question
PHP is JIT compiled like a lot of VM languages, it’s not stupidly slow these days.
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
Socket Programming in Flash?
Actually I believe you can get Mono on the Mac now. (You can: see here.) But the code runs on P.IO’s servers, so you just need a C# environment to test on if you want to do things locally (which you will).
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
Socket Programming in Flash?
Remember that the server needs to be the same as where the game was downloaded from (pretty much impossible if you want to host on Kong) or you need a cross domain policy file to allow access. (I guess player.IO has this already.) You’ll also need quite a lot of available bandwidth if you want more than about 10 people to be able to connect at once.
The Socket class does work, I made a proof of concept translation of my C# socket library/protocol and it works well enough to reach a lobby area, but I never actually got around to making a game.
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
FlashDevelop - "Build failed" [Solved]
If you’re getting ‘build failed’ without compilation errors in the output, you probably haven’t correctly pointed FD at the compiler – though since you were already using it I guess that isn’t the case.
Did you link the main class as a compilation target? (Right click always compile, or add it to a -frame compiler directive if you’re using a preloader.)
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
AS3 -> MySQL
Yes, using PHP to do the data access would be my suggestion as well. Remember that if you want to host the game on Kongregate and the data on your own server you’ll need to provide a cross-domain policy file so Flash can talk to your server.
(You can use any server-side web technology language, like Ruby or ASP.net or Perl or JSP or whatever. But PHP is one of the easiest for this kind of task, imo.)
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
Creating a pointer to a primitive
Yes, wrapping it in the class is the closest thing to the ‘right way’, i.e.
class Integer { public var Value:int; }
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
Google AI Challenge 2011
AS3 is close enough to Java/C#/etc (not C++ because of the garbage collection element) that anyone serious about the competition should be able to use one of those no problem anyway.
Thanks for the link, this looks like a good way to waste some time ;)
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
Turn based?
It should apply to every application, but you can write a functional action game in enterFrame handlers of stage objects, and a lot of Flash tutorials take you that way. With a turn based game, you really need to have a proper data model with state and entity classes completely separate from what is happening on the screen (though, obviously, your graphical objects need to refer to the data model in order to know what to display).
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
Game Development Room (GDR)
Allotted bandwidth = the amount you’re allowed to use with Player.IO? I was suggesting a separate HTTP storage/retrieval, so the only message you’d need to send through p.io would be a URL.
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
Game Development Room (GDR)
Can’t you just use a normal web host with a flash cross-domain access file so the game can upload to it? I find it hard to believe that the demand for image sharing would be so high it would do your host damage (particularly if files only lasted a short time … even minutes would be enough for what people want to do here, I think).
|
|
|
BobJanova
443 posts
|
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
Shared Object not working. sadface.png
Yes, my guess is that you’re resetting awardArray’s contents at some point before loading the new game, and that’s resulting in the SO’s copy being overwritten too. It’s kind of weird that SOs retain ‘live’ copies of the objects in this way. If you’re putting arrays (or other reference types which are live references within your game, i.e. not created with a new() and assigned only to the SO) into an SO then you want to clone them first.
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
Game controls
Here is a class that gives you the Key.isDown so beloved of AS2 programmers. That’s really useful for continuous control keys.
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
[General] Factory Pattern
Old and seen it before, but still worth a chuckle, and anyone who’s not seen it before is done a service by the repost :)
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
[AS3] Temporarily disabling subcontrols of a whole panel
I’m currently writing a level editor. That, obviously, has lots of buttons, which are in the tab order, inside a control panel container sprite. When I test a level, I want to leave the editor open in the background, but temporarily stop focus being able to reach any of the editor controls.
For mouse input it’s trivial (place an overlay), but tab is still able to select those buttons, so the keyboard events on them can still fire (which means they can get ‘clicked’ by game action keys like the space bar).
Is there a simple (one line, ideally) way to temporarily turn off keyboard focus capabilities for a whole container sprite, without hiding or removing it? The best I have so far is to remove all the buttons from the tab order and then re-add them all again later, but that seems very inelegant.
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
[AS3] What's wrong with this code for a button with a RNG?
You never declare randomNumber. Try declaring (and assigning) it, as you thought. e.g.
var randomNumber:Number = f1_GenerateRandomNumber(10);
By the way since you seem to be generating integers I recommend declaring the result type of the RNG as Integer. Also, what’s with the f1_ prefix?
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
GiTD [#17] Voting
Hm, I guess it’s hard to difficulty test your own game :p. I’ll try to make the ramp a bit less steep.
I couldn’t finish the 1-2 or 2-1 (failed at first jump itself, again and again).
You need to upgrade (inside the box!) to make those jumps.
I guess I will sit out a contest or two and try to actually wrestle this into a finished game!
|
|
|
BobJanova
443 posts
|
Topic: Game Programming /
GiTD [#17] Entries and Discussion
Did you guys refresh/reload after Skyboy’s initial post? I can’t get it to fail like that any more, and I definitely fixed the issue Senekis is talking about.
I posted a new version which now displays the version text so you can tell :P
and since you disallow moving backwards, you can actually remove anything that goes completely off the stage on x, further improving performance as the level goes on
This is actually the case already. I’m also not creating the sprites until they are within range (I’m using a model-view-controller type system with the visible sprite as the View). I think the issue is probably in my collision detection loop and I might need to start looking at spatial partitioning. But I still need a profiler :p
|