Forum Games [SOLVED] General Direction Help (game engines)

Discussion relating to game development with Flash

[SOLVED] General Direction Help (game engines)

Postby SelfPossessed » March 20th, 2011, 12:53 am

In the end, I decided to traverse a linked list and set primitive values only in a modified version of FlashPunk. I've been planning it out to be reasonably efficient (flags for hasChanged in each object, a master linked list that traverses all objects even if recycled, etc). Hopefully it will turn out well.


Well, I've finally got enough free time and did a bunch of reading, theorizing, and testing said theories. I've also asked and gotten help from different people (big thanks to them!).

I've reached a point where I need general direction help. Advice is welcome.

The Situation:

I'm looking to do rollback netcode. Since there is no limit on the number and types of objects a player can produce, I therefore need the ability to clone ENTIRE game states.


The primary cloning method I've found online uses serialization via ByteArrays. I'm not sure if its faster than manually looping through the properties of an object, but it is easier on the coder.

Does anyone know which is faster? An answer to this will help determine my next step which is...


I lack the knowledge necessary to make a fast game engine in Flash, so it's more ideal to use existing ones. If I had such knowledge easily accessible, I'd make an attempt at one myself that fits my needs better. was recommended to me when I asked about speed in Flash and I'm going through it now.

The primary two engines I've looked at are Flixel and FlashPunk. I've been reading through their source code to get a bit more familiarized with their inner workings, but I'm still no expert. I do like them both quite a bit though. Very cool stuff.

Note: With both engines, I'll have to implement my own rollback for sounds (sounds are not part of Flixel's FlxState or FlashPunk's World) and perform floating point precision checks (they both use the Number type a lot), so that won't help me decide on what to do next.


If I go with Flixel, I will need to dig through the source to fix its documented memory leak issues on releasing states. This will be extremely difficult given my inexperience. If the person working on fixing the memory leaks does finish and commit his code, a decision would be significantly easier. It's less of a concern, but I'll also have to run through it to remove its numerous features that I don't need (pausing, sprite physics, etc).


If I go with FlashPunk, I'll have to modify the engine with complex clone functions. This is because FlashPunk uses linked lists to store its objects, not arrays like Flixel, and numerous testing has shown that linked lists do not play nice with the serialization cloning method.


Any suggestions? Working with either engine or making my own will be difficult and time consuming, so general advice on how to proceed would be greatly appreciated. Maybe something I haven't thought of altogether?

Posts: 33
Joined: June 29th, 2010, 4:22 am

Re: [SOLVED] General Direction Help (game engines)

Postby Oliver » March 21st, 2011, 5:41 am

My advice, if you're just starting out, is to skip all the complicated stuff like rollback and such and just focus on gameplay and getting the game to feel good. You can get very far without having to implement all the complex stuff, and cheating in terms of multiplayer synching is something to be proud of, not embarrassed about :-)

- Oliver
User avatar
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Return to Games