So is there real-time debugging/coding/tuning?


(John Andersson) #1

Because having to start the game and watch for my traces, then close the game, re-code some parts, restart the game takes a long time.

Would be so ultra-sweet if there was real-time coding whilst having the game open. Any ways? If not, then get to it, Zach :stuck_out_tongue: This feature would make flashpunk extremely amazing (more than it already is)


(rostok) #2

If compile time takes too long maybe it is because of the assets being processed. I strongly recommend to avoid embedding in dev and debug mode. Instead you can open assets in real directly from files. Unfortunately I use my custom solution but Jacobalbano has released his FLAKit media library that should do the thing just right.


(Jean) #3

I don’t think that it’s possible, not because of FP, but of Flash, and because how programs works.

Not even Visual Studio, that has nice features for debugging is capable of that IIRC.

Make some checkpoints, or try to make a “save game” feature to save time when testing things that have a long workflow.


(rostok) #4

Actually VS has this feature for very long time, at least since ver. 6.0. Flash can also be compiled in runtime with projects like as3eval or Tamarin compiler. However I think it is just a waste of time to dive into this madness. Having savegame system is a very good approach though.


(John Andersson) #5

I still think live coding would be amazing :stuck_out_tongue: It would be better than using other solutions, even if savestates are a good idea. Any ideas on how hard it would be to implement this for Zach? Haha


(Jacob Albano) #6

If you’re talking about something like edit-and-continue, it’s absolutely impossible. You’d have to be able to compile the swf and load the new bytecode, which is something we don’t have access to. The closest I can think of is building your game out of multiple swfs, building them separately, and loading/reloading them on the fly, but that won’t work with Flashpunk and wouldn’t help your compile time anyway.


(John Andersson) #7

Damn.

So what rostok said, is that something else? (Compiling in runtime)


(rostok) #8

I am not expert on this but from what I understand you pass the string with source, compile to the bytecode and execute it. I dont know if it is being run in the same machine though and how one could acess global variables. I also think that since dynamic function compile and change is doable in C# than it should be doable in as3 as well. Take a look at this project https://code.google.com/p/as3scriptinglib/ But again as with every requirement there should be some seroius reasoning. And if it comes to reducing compile time there are number of ways to achieve it: external assets, having some code in swc, savestates. To observe changes in realtime you could also edit live parameters instead of code (already mentioned in FP forums) or have some logic in external scripting system like Lua. I also think that it is more a topic of flash development than FP library.


(Jacob Albano) #9

This scripting library looks interesting but I can almost guarantee it doesn’t create new as3 bytecode, as Adobe’s security layer wouldn’t allow for it. It may create some sort of custom bytecode format, but not to the extent that the swf would be modified or native functions would be replaced.

It looks like you can give it access to specific variables to read, and I’m sure there’s a way to set them too. As3’s introspection is pretty limited though, so it’s unlikely that it can automatically become aware of all your global variables.