Author Topic: v1.3 Planning Thread  (Read 25018 times)

Adam Atomic

  • Founder
  • Key Contributor
  • *****
  • Posts: 852
  • Karma: +0/-0
  • new dad
    • View Profile
    • Adam Atomic
v1.3 Planning Thread
« on: Tue, Jul 14, 2009 »
NEW PLANS FOR 1.3:

1 - fix FlxButton
2 - fix FlxText
3 - other minor fixes from my internal 1.25+ codebase [DONE]
4 - expose tinting in FlxSprite [DONE]
5 - standardize initialization (current constructors for FlxEmitter, for example, are very clumsy)
6 - create a repo on GitHub [DONE]
7 - add some sprite variables to help with top-down games
8 - doublecheck the support visor (paypal, stumbleupon, etc)
9 - make FlxKong a special case of a generic metrics system
10 - figure out basic parenting issues (e.g. scrollfactor on emitters, or x and y positions on layers)
11 - either remove fullscreen support or make sure it works with AIR [REMOVED]
12 - return some kind of Sound object from FlxG.play
13 - completely rebuild the way mouse and keyboard work [DONE]
14 - add in Nitram's debug flag thing
15 - callbacks or checks for overlapping specific tile indices or coordinates
16 - accessors for altering tilemaps on the fly
17 - bind 'p' and 'pause' to the pause behavior [OBSOLETE?]
18 - likely a lot of private member vars that should be protected instead [IN PROGRESS]
19 - pass a reference to hitFloor, hitCeiling and hitWall [DONE]
20 - improve sitelocking stuff (debug flag should help with this)
21 - include a basic cursor graphic [DONE]
22 - try converting main collision routine to using hulls [DONE]
23 - default stage menu should not be turned off, that is dumb and annoying
24 - facing/specific-random frame problems
25 - function to draw one sprite onto another [DONE]
26 - static flag for better collisions [DONE]
27 - lightweight seeded pseudo-random number generator - FlxG.random() [DONE]

Sorry for the delays!

Once I have this fixed, nicer version of flixel up on github some things I'd like to add ASAP (And that the community can probably help with!) include:

1 - session/cookie support
2 - ability to generate simple FlxSprite bitmaps procedurally (lines, triangles, circles, squares)
3 - more debugging tools (sliders, better console)
4 - pathfinding utility
5 - some kind of line of sight or ray utility

NOTE: some sites that would be good to include in the generic metrics system would be mochi, kong, newgrounds, netlog, ummm maybe others?

OLD PLANS:

Quote
So I've been thinking some more about the next game I wanna make, and started narrowing down some of the tech that I'll need:

1 - Console Input
2 - Streaming Music
3 - Palette Swaps
4 - Mersenne Twister (seeded random numbers)
5 - Save Games via Sessions or Cookies or something
6 - Throttle framerate down to 5 or 10 or something while paused

EDIT - Rolled most of the other stuff that was listed here into the v1.25 patch!
« Last Edit: Wed, Dec 9, 2009 by Adam Atomic »

SeiferTim

  • Contributor
  • ****
  • Posts: 253
  • Karma: +0/-0
    • View Profile
    • Tim's World
Re: v1.3 Planning Thread
« Reply #1 on: Tue, Jul 14, 2009 »
What about a command to make a sprite 'move to' a location?
Although it could be used for several other things, I'm mostly thinking of like the camera: set an invisible sprite to be at point x1,y1, then have the camera follow it, and then say: "moveTo(x2,y2,speed)";

radix

  • Guest
Re: v1.3 Planning Thread
« Reply #2 on: Tue, Jul 14, 2009 »
@SeiferTim

What about acceleration and deceleration?

Adam Atomic

  • Founder
  • Key Contributor
  • *****
  • Posts: 852
  • Karma: +0/-0
  • new dad
    • View Profile
    • Adam Atomic
Re: v1.3 Planning Thread
« Reply #3 on: Tue, Jul 14, 2009 »
I think Tim is asking basically for Tweens, which i've definitely considered but I think might be overkill.  This is a really badass Tween library though:

http://blog.greensock.com/tweenliteas3/

And it should be fairly compatible with flixel!

SeiferTim

  • Contributor
  • ****
  • Posts: 253
  • Karma: +0/-0
    • View Profile
    • Tim's World
Re: v1.3 Planning Thread
« Reply #4 on: Tue, Jul 14, 2009 »
I think Tim is asking basically for Tweens, which i've definitely considered but I think might be overkill.  This is a really badass Tween library though:

http://blog.greensock.com/tweenliteas3/

And it should be fairly compatible with flixel!

Uhh... I dunno about Tween - seems like it's a lot more than what I'm looking for... :P basically, just a way to tell a sprite: "within your normal update() move a few pixels (based on speed) towards this coordinate", without having to go figure out the direction or anything (lazy!).

something like:
Code: [Select]
function moveTo(x:uint,y:uint,speed:int=5)
{
var dirX:int = 0;
var dirY:int = 0;
var done:Boolean = false;
if (this.x > x) dirX = -1;
else if(this.x < x) dirX = 1;
if (this.y > y) dirY = -1;
else if(this.y < y) dirY = 1;
do while (!done)
{
this.x += (speed * dirX);
this.y += (speed * dirY);

if(dirX == -1 && this.x <= x)
{
dirX = 0;
this.x = x;
}
if(dirX == 1 && this.x >= x)
{
dirX = 0;
this.x = x;
}
if(dirY == -1 && this.y <= y)
{
dirY = 0;
this.y = y;
}
if(dirY == 1 && this.y >= y)
{
dirY = 0;
this.y = y;
}
if(dirY==0 && dirX ==0) done=true;
}
}
But I would not want to stop the action while I run this - I'd kind of want to have the option of having each sprite autonomously go to it's defined location within update() (or wherever)... maybe I'm asking for too much ;P

Adam Atomic

  • Founder
  • Key Contributor
  • *****
  • Posts: 852
  • Karma: +0/-0
  • new dad
    • View Profile
    • Adam Atomic
Re: v1.3 Planning Thread
« Reply #5 on: Tue, Jul 14, 2009 »
With Tweenlite you would just do something like this:

Code: [Select]
new Tween(yourSprite, { x, y }, { 10, 10 }, 2);
I think!  It's been a while since I used it.  But that would tell 'yourSprite' to change its position to 10,10 and take 2 seconds to do it.  It's pretty rad!

lechuckgl

  • Active Member
  • ***
  • Posts: 118
  • Karma: +0/-0
    • View Profile
Re: v1.3 Planning Thread
« Reply #6 on: Tue, Jul 14, 2009 »
Pathfinding ?  ;D
I could do it myself...but it's easier if someone else does all the hard work :)

darthlupi

  • Active Member
  • ***
  • Posts: 241
  • Karma: +0/-0
  • All Smiles
    • View Profile
    • LupiGames.com
Re: v1.3 Planning Thread
« Reply #7 on: Tue, Jul 14, 2009 »
Have you all gone mad?   :o  No one has asked the important question!

Vat is this project you speak of? This so called game that needs streaming music and mystical sprite sheets to function???

Also, I wanted to say that the saving and loading of games via desert snacks (cookies) would be great!
I think the next game I'll be venturing into will need a nice way to save game!

Rock on man!
« Last Edit: Tue, Jul 14, 2009 by darthlupi »
To take care of that not so fresh feeling: #flixel on irc.freenode.net.

Use your favorite IRC client or  http://webchat.freenode.net/

Adam Atomic

  • Founder
  • Key Contributor
  • *****
  • Posts: 852
  • Karma: +0/-0
  • new dad
    • View Profile
    • Adam Atomic
Re: v1.3 Planning Thread
« Reply #8 on: Tue, Jul 14, 2009 »
Vat is this project you speak of? This so called game that needs streaming music and mystical sprite sheets to function???

 :-X

Is sort of secret-ish, mainly because in my head it seems doable but when I talk about it it comes out all grandiose and IMPOSSIBLE...but hopefully around christmas-time I will have something public!

Hideous

  • Guest
Re: v1.3 Planning Thread
« Reply #9 on: Wed, Jul 15, 2009 »
What happened to the sponsor SWFs? :(

Adam Atomic

  • Founder
  • Key Contributor
  • *****
  • Posts: 852
  • Karma: +0/-0
  • new dad
    • View Profile
    • Adam Atomic
Re: v1.3 Planning Thread
« Reply #10 on: Wed, Jul 15, 2009 »
If anybody has some I will happily add that in - I meant to add it in 1.2 but I couldn't find anybody that actually had one of those things that I could use to test with :P

nitram_cero (2bam)

  • Contributor
  • ****
  • Posts: 484
  • Karma: +0/-0
    • View Profile
    • 2BAM
Re: v1.3 Planning Thread
« Reply #11 on: Fri, Jul 17, 2009 »
Quote
4 - Mersenne Twister
It would be cool to be able to have have separate objects where you can define the seed or default-construct with the current time.
This way you can use the objects to procedurally generate levels, but that each time you play are the same.
Also a global random "helper" would be cool, in case you don't want to use Math.random();

I imagine something like this:
Code: [Select]
var myNum=FlxRandom.random(); // static global random

var myRandomizer:FlxRandom = new FlxRandom(seed)
myRandomizer.generate();

Quote
5 - Save Games via Sessions or Cookies or something
That would be awesome :)

Quote
10 - Seriously consider alpha and scaling options in FlxSprite
I've easily implemented scaling, but it looks like crap in non-power-of-2 sizes. PM me if you want the code.
Alpha is a must ;D



@ SeiferTim
You could use the velocity vector for that. Calculate the direction normalizing the difference vector between the destiation and the current position, and then multiplying that by the speed to make a velocity vector.
Then you could check if you reached destination by comparing values (although I do not recommend using the equal operator to avoid rounding errors. dx-EPSILON <= x && x <= dx+EPSILON is a betters solution)
This could be wrapped in a nice object.





Oh! almost forgot why I entered this thread:

I implemented a multiple non-"arrows/xc" input system.
The interface is really simple:
Code: [Select]
var P1Controls:Array = [38, 40, 37, 39, 17];
var P2Controls:Array = ['i', 'k', 'j', 'l', 'g'];
var numberOfCommands:uint = 5;
Input.init(this, numberOfCommands, P1Controls, P2Controls); //N° of players is implicit in the ammount of paramters

...

if(Input.pressed[playerNumber][Control.MOVE_RIGHT]) { ... }
if(Input.justPressed[playerNumber][Control.SHOOT]) { ... }
But I had to hack the library in order to NOT show anything related to controls in the GAME PAUSED screen.

1. A protected Boolean member to disable showing the icons/text or if "help()" is called with all nulls would be good ways to disable the icons completly.

2. a "hitSomething()" that get's called when either you hit: A wall/the floor/the ceiling would be nice
for games that do not have gravity.
I'm making a bomberman-like game ( http://www.swfcabin.com/open/1247854113 ), and it seems awkward having to override 3 different functions in order to do the same thing (make the cat explode xD)


3. Please add a SVN repository so I don't have to diff by hand my hacked version against the newer ones  ;D.
As this is opensource, I believe you can get an account at sourceforge, with SVN and stuff.


Regards
-Martín
« Last Edit: Fri, Jul 17, 2009 by nitram_cero »

SeiferTim

  • Contributor
  • ****
  • Posts: 253
  • Karma: +0/-0
    • View Profile
    • Tim's World
Re: v1.3 Planning Thread
« Reply #12 on: Fri, Jul 17, 2009 »
@ SeiferTim
You could use the velocity vector for that. Calculate the direction normalizing the difference vector between the destiation and the current position, and then multiplying that by the speed to make a velocity vector.
Then you could check if you reached destination by comparing values (although I do not recommend using the equal operator to avoid rounding errors. dx-EPSILON <= x && x <= dx+EPSILON is a betters solution)
This could be wrapped in a nice object.

Yeah, I was just hoping for something included in Flixel so I didn't have to do it myself ;)

Adam Atomic

  • Founder
  • Key Contributor
  • *****
  • Posts: 852
  • Karma: +0/-0
  • new dad
    • View Profile
    • Adam Atomic
Re: v1.3 Planning Thread
« Reply #13 on: Fri, Jul 17, 2009 »
Quote
4 - Mersenne Twister
It would be cool to be able to have have separate objects where you can define the seed or default-construct with the current time.
This way you can use the objects to procedurally generate levels, but that each time you play are the same.
Also a global random "helper" would be cool, in case you don't want to use Math.random();

I imagine something like this:
Code: [Select]
var myNum=FlxRandom.random(); // static global random

var myRandomizer:FlxRandom = new FlxRandom(seed)
myRandomizer.generate();

Quote
5 - Save Games via Sessions or Cookies or something
That would be awesome :)

Quote
10 - Seriously consider alpha and scaling options in FlxSprite
I've easily implemented scaling, but it looks like crap in non-power-of-2 sizes. PM me if you want the code.
Alpha is a must ;D



@ SeiferTim
You could use the velocity vector for that. Calculate the direction normalizing the difference vector between the destiation and the current position, and then multiplying that by the speed to make a velocity vector.
Then you could check if you reached destination by comparing values (although I do not recommend using the equal operator to avoid rounding errors. dx-EPSILON <= x && x <= dx+EPSILON is a betters solution)
This could be wrapped in a nice object.





Oh! almost forgot why I entered this thread:

I implemented a multiple non-"arrows/xc" input system.
The interface is really simple:
Code: [Select]
var P1Controls:Array = [38, 40, 37, 39, 17];
var P2Controls:Array = ['i', 'k', 'j', 'l', 'g'];
var numberOfCommands:uint = 5;
Input.init(this, numberOfCommands, P1Controls, P2Controls); //N° of players is implicit in the ammount of paramters

...

if(Input.pressed[playerNumber][Control.MOVE_RIGHT]) { ... }
if(Input.justPressed[playerNumber][Control.SHOOT]) { ... }
But I had to hack the library in order to NOT show anything related to controls in the GAME PAUSED screen.

1. A protected Boolean member to disable showing the icons/text or if "help()" is called with all nulls would be good ways to disable the icons completly.

2. a "hitSomething()" that get's called when either you hit: A wall/the floor/the ceiling would be nice
for games that do not have gravity.
I'm making a bomberman-like game ( http://www.swfcabin.com/open/1247854113 ), and it seems awkward having to override 3 different functions in order to do the same thing (make the cat explode xD)


3. Please add a SVN repository so I don't have to diff by hand my hacked version against the newer ones  ;D.
As this is opensource, I believe you can get an account at sourceforge, with SVN and stuff.


Regards
-Martín

For 'hitsomething' i usually just override the three hit functions to return the value from a generic hit() function that i put in that class, I think maybe one of the mode objects has that (bullet maybe?).  Otherwise I have to like detect which hit function you want to call from inside the collide function which is annoying.

Alpha and Scaling won't be that bad to implement, they'll just use the same code I use for rotation (I think) - I'm gonna look into a lighter, non-vector-renderer way of doing the alpha though!

Finally I am still kinda torn between having an SVN repo on google code or having an account on github - git is absolutely superior in every regard, but SVN seems to be more widely used...so not sure what to do about that yet :-/  In the meantime, it may not be totally ideal, but I'd recommend subclassing Flixel when you want to make big changes - so make NitramBlock extend FlxBlock and then do your mods.  It should make it much easier to update regardless of the source control service!

nitram_cero (2bam)

  • Contributor
  • ****
  • Posts: 484
  • Karma: +0/-0
    • View Profile
    • 2BAM
Re: v1.3 Planning Thread
« Reply #14 on: Sat, Jul 18, 2009 »
Great!

Yeah, the scaling can be put right next to the rotation code (dunno about alpha).

I can't always change stuff in that fashion (for example, to disable things shown in the game paused menu). But it's cool anyway :)

about hit():
You could do something like:
if hit*() by default returns false:  if(hitWall() || hit()) { colision-stuff }
if hit*() by default returns true:   if(hitWall() && hit()) { colision-stuff }

That way one can either use hitWall/Floor/Ceiling(), or "hit()" (Or both if you're a douche xD)



Another feature that would be so cool would be to be able to change colors in an image.
That way I can use the same sprite data, but easily change, for example, the tshirt and pants colors to make different enemies (golden axe, anyone? ;D)



Regards
-Martín

Adam Atomic

  • Founder
  • Key Contributor
  • *****
  • Posts: 852
  • Karma: +0/-0
  • new dad
    • View Profile
    • Adam Atomic
Re: v1.3 Planning Thread
« Reply #15 on: Sat, Jul 18, 2009 »

Adam Atomic

  • Founder
  • Key Contributor
  • *****
  • Posts: 852
  • Karma: +0/-0
  • new dad
    • View Profile
    • Adam Atomic
Re: v1.3 Planning Thread
« Reply #16 on: Sat, Jul 18, 2009 »
v1.25 is ready for testing!  http://flixel.org/forums/index.php?topic=184   It has a bunch of the stuff that was slated for 1.3, cuz I felt like accomplishing something :P  also has a bucket of bugfixes.  Thanks again for all your input guys!

PizzaBoy

  • Guest
Re: v1.3 Planning Thread
« Reply #17 on: Sun, Jul 19, 2009 »
Any chance for 1.4/1.5 we could see a FlxSocket?

Bjorgen

  • Member
  • **
  • Posts: 59
  • Karma: +0/-0
  • Party hats ftw!
    • View Profile
    • Project Morsel
Re: v1.3 Planning Thread
« Reply #18 on: Sun, Jul 19, 2009 »
You can always use Flash.Net.Socket or Flash.Net.XMLSocket if you need network stuffs. Flash tends to be pretty picky about network code especially when going across domains.

I know its kinda hacky but in the past I've used the an OpenFire xmpp/jabber server and their XIFF API. It was nice cause I got authentication, friends, chat, and bunch of other stuff for free. You just make a conference room for the game to game/server communication. It worked pretty well for the prototype i put together.

vonWolfehaus

  • Active Member
  • ***
  • Posts: 247
  • Karma: +0/-0
    • View Profile
    • Cold Constructs
Re: v1.3 Planning Thread
« Reply #19 on: Sun, Jul 19, 2009 »
6 - Throttle framerate down to 5 or 10 or something while paused

Can you not remove the listener for the game's main update loop? Sorry if it's a dumb question, I haven't delved into the source enough yet. I just remove the loop listener when the mouse move off the stage (my games are mouse-focused), works really well.

I know its kinda hacky but in the past I've used the an OpenFire xmpp/jabber server and their XIFF API. It was nice cause I got authentication, friends, chat, and bunch of other stuff for free. You just make a conference room for the game to game/server communication. It worked pretty well for the prototype i put together.
Dude that's a frakkin RIGHTEOUS idea! *googles a little* Oh, snap, XIFF is hawt! Cheers for the lead mate!
« Last Edit: Sun, Jul 19, 2009 by vonWolfehaus »
Meet Obama every day at #flixel on irc.freenode.net.
Use your favorite IRC client or  http://webchat.freenode.net/