Merge HaxePunk with FlashPunk?


(Mike Evmm) #41

Nope, only flash in debug/release mode does this. Neko and windows work fine. Removing spaces or restarting didn’t work either. :pensive:


(Darrin) #42

Please comment on this. We all want to know what game engine we can develop on to multiple devices over the next 10 years. We want the games to be seen everywhere. And most importantly, we love flashpunk.

So how do we get there? What is the right engine?

  • HTML5 does not have the penetration in portals that flash has.
  • AIR seems to covers iOS and Android and standalone for flashpunk.
  • Phaser.io gives iOS Android, and HTML5.
  • Haxepunk gives iOS, Android, and HTML5.
  • Phaser and Haxepunk do not give Flash portal penetration.
  • Unity 5 gives iOS, Android, HTML5, and Consoles (not handhelds).
  • Unity 5 does not give Flash portals.
  • Flashpunk does not have 3D acceleration.
  • Starlingpunk has 3d acceleration but has limited flash penetration
  • Starlingpunk’s feature set currently limited–one guy basically needs some love.

So currently FlashPunk’s weaknesses for the future are:

  1. No 3D Acceleration / switch on or off.

  2. Integration onto mobile seems to have a bit of a barrier.

  3. No console support.

A) So what is the solution for 3D?

  • Merging with StarlingPunk.
  • Buying Stage3dPunk and make it open source.
  • Redoing Stage3dPunk as opensource.
  • Need someone to write the 3D layer.

B) What is the solution for mobile?

  • More tutorials I guess. Thoughts?

C) What is the solution for consoles?

  • Unknown. Not even sure where to begin on this.

Actionscript will be around for a long time. Edit Zach has pointed out the compiler has recently been updated (just no rebranding to version 4).

Anyway, I’d love to know your thoughts.

Darrin


(Zachary Lewis) #43

The solution for 3D acceleration lies in the community. Someone will need to rewrite parts of the library to support Stage3D rendering.

This doesn’t really make sense to me. That’s like saying, “C++ will be around for a long time. It just isn’t getting updated to C+++.” Adobe just released AIR 15 with the ActionScript Compiler 2, which greatly enhances the runtime performance.


(Darrin) #44

Zach,

Thank you for the comment and clarification about Actionscript. It is hard to sift through all of the doom and gloom about Flash and Actionscript 4. I agree AIR seems to be alive and kicking and from the white paper from Adobe it is the way forward. Important to remember.

As for 3D acceleration, yeah someone has to do it. I don’t have the skill set. :frowning: How much work is it?


(Zachary Lewis) #45

Probably some work. You’d need to do these things.

Framework Changes

  1. Abstract all the rendering code in the FlashPunk framework.
  2. Create a switch to set the desired rendering mode.
  3. If using the old rendering mode, perform the old rendering process.
  4. If using the new rendering mode, perform the new rendering process.

New Rendering Method

  1. Create a Stage3D quad for each image to draw.
  2. Position the quad where the image should be drawn, applying any rotations.
  3. Draw the image texture to the quad.

So, not a lot of fun, and lots of knowledge with both FlashPunk and 3D rendering and matrix math.


(Martí Angelats i Ribera) #46

I’m really interested in this project. Even if i don’t have enogh time to do it by myself, I would love to collaborate if someone want to do it.


(Zachary Lewis) #47

It would be awesome if @Ultima2876 open-sourced his version, but I realize he currently has a corner on the market and it would be stupid to do so (from a business perspective).

If people want to get familiar with Stage3D and work through a few tutorials, that would be the best area to gain expertise in.


(Ultima2876) #48

As much as I’d seriously love to do so, it’s unfortunately out of my hands - I received serious investment from a third party which gave me the time to do the project, and all of the rights to the stage3d portion of the code are theirs. However, that doesn’t stop me from providing advice about my experiences with developing it if someone wanted to take up the reigns and push this forward :smile:

Not only that, but some of the code in there is frankly embarrassing!


(Martí Angelats i Ribera) #49

Since i saw this i became interested in stage3D.

I’ve played a bit in my own and i think is relativly easy to create the support for stage3D. Would you like me to try to make it? And also, if it’s made, should FP support the graphics the way it’s done now?


(Darrin) #50

What would be the difference? The main reason for supporting both is the fact that flash sites don’t like Stage3D for advertising reasons. If nothing changes I’m sure it is fine. We just need some sort of switch.


(Zachary Lewis) #51

If you’d like to contribute to FlashPunk, that’s great! Just fork the repo and submit a pull request when you’re ready for us to take a look at it.

I’m not really sure how Flash handles Stage3D without specific rendermode support. If it has an automatic fallback, that’s fine. If we just have two versions of the library (one software-rendered and the other using Stage3D), that’s fine, too. It’s also fine if you want to try to put it all in the same library.

Now that I’ve written it out, it wouldn’t be a terrible idea to have separate libraries targeting separate render modes, but it might make sense to have them in the same library to make using a software-fallback more convenient.


(Martí Angelats i Ribera) #52

I’m thinking about doing something in the engine constructor like

public function Engine(width:uint, height:uint, frameRate:Number = 60, stage3D:Boolean = true, fixed:Boolean = false)

So you could enable/disable it easaly.

What do you think about it?


(Jacob Albano) #53

Changing parameter order is never acceptable, especially when the new parameter is the same type as the one it replaces. Consider:

super(640, 480, 60, true);

Right now this will create a new Engine running in fixed-framerate mode. With your new parameter added, it’ll instead create a new Engine running in variable framerate mode, with Stage3d mode enabled instead.

Backwards compatibility is crucial unless you’re explicitly changing the API.


(Zachary Lewis) #54

It’s fine to add it in the constructor, just put it at the end.


(Martí Angelats i Ribera) #55

Oh OK. I didn’t thought about that (I’m not used to make/change APIs :smile:).

BTW, I have in hold a push request. Can i make another one or i have to wait until that one is resolved?

Edit: I did a new brach and reversed to the last commit before that modifications.


(rostok) #56

I have a general question regarding rendering pipeline in Stage3D. Will it (or does it in Stage3dPunk) allow to overwrite render methods and use net.flashpunk.utils.Draw.as?


(Jacob Albano) #57

There’s nothing to prevent the Draw class from working. It won’t be as efficient since you’re uploading vertices every frame (though that might be normal for Stage3d anyway), but it’s certainly possible. What I do in my C# engine is just add vertices for each line to an array every frame and draw that vertex array during the render step.

Overriding render methods should be possible too, and the API should be designed with the possibility in mind.


(Martí Angelats i Ribera) #58

In Stage3D you have to upload the mesh every time (and also upload the program that the video card uses).

Another thing to be careful with is the fact that if two or more faces are in the same plane (in this case it is the plain z = 0) the first to render is the one that will be finally shown. That makes me think. Maybe i will implement a way to change the z so you can have different render priorities.


(Jacob Albano) #59

Like the layer property?


(Martí Angelats i Ribera) #60

More a less. I’m making the code and i already implemented the layers but be able to modify a value for that directly may be a good thing to do (it’s a Number so can be used in mathematical functions). I have to create that variable anyway so allow the user to modify it isn’t that bad.