| Welcome to the world of Pakka Pets! Raise your very own pet by concocting special treats, getting to know their needs, and loving them to bits. Explore the Pakka world to meet new friends, find lost treasure, and to give your pets the experiences of their lives. | |
Hello! I'm Thomas Uster, and I'm the programmer on Pakka Pets.
I'm going to dive right into all the naughty tech that's going into this game, so if you want more game design details check out my Townhall post
here. Or check back on this thread for posts from Willem Rosenthal the designer and artist.
And now the Badass Tech Stuff! Yea Baby!
Some StatsPakka Pets is written in Haxe with dependencies on
OpenFL,
minject, and
msignal.
The rendering is currently done with lot of our own infrastructure. The lowest level code hits OpenFL TileSheets(A single texture spritesheet API) designed for speed.
It's also written with my own flavor of an entity system framework. A ton of ideas being pulled from Richard Lord & Alec Mceachran on this.
I even had to write my own bitmap font parser (OH MY JESUS).
PerformanceHaving a sexy eye on performance has kept Pakka Pets fast and lean. Because Haxe has a flash build target I can profile it with Adobe Scout, a tool I have experience with that's easy on the eyes.
Profiling of Pakka Pets in Adobe Scout
One of the things this allowed us to do is help us tune our clarity of a time simulation. We don't want the app sucking up your battery while your not playing, so it doesn't actually run as a background process when you close the app like other pet games. What this means is that if you turned off your phone, it doesn't matter. We run a simulation to process what happened to the pet as if it was living when you were away. We can do it pretty damn well within a few seconds. Because you're still in a load, we can disable the main game rendering systems, and crank up the number of logic system cycles per frame. This way you still get a smooth loading screen while we're plowing down on the CPU. To simulate the game we're literally running the game but with bigger time slices at a faster rate. The outcomes are pretty awesome sometimes, and this method keeps the door open for new possibilities if you leave your pet unattended with an item they might get into trouble with.
"You can handle huge time slices?! Does that mean you can see your game in fast motion if you wanted to?"
Hell yea bro! Check it.
Increasing time speed on the fly
Tests!"What the?! I know what this is, are you serious Tom?" Yes, I'm very serious, as you can see.
High level integration tests beat the shit out of most unit tests that I have.
For example,
This test was written with TDD but has a big assumption on my source code.
What not to do most of the time...
@Test
public function shouldNotEvolveIfSystemDisabled():Void {
game.makeSystem(EvolveSystem);
game.disableSystem(EvolveSystem);
time.updateInDays(1);
Assert.isFalse(pet.isState(WalkToEvolutionPosition)); //!!! Inflexible test!
}
See my assertion? This means that I MUST have a state called WalkToEvolutionPosition even though my feature only really cares whether the pet evolves or not.
What to do most of the time...
@Test
public function testFingerReleasingFood():Void {
grabBowlOfRice();
clicker.mouseMoveUp(0, 350);
gravityModel.gravity = 2;
time.updateInSeconds(1);
var box:Rectangle = rendering.getBox(rice);
Assert.isTrue(box.bottom == 350 + 2);
}
This test is making sure that if you were moving a bowl of rice into the game with your finger, that if you released it should be affected by gravity. This is a great test because it assumes very little about implementation.
Okay that's it for my first post. I'll leave you with some funny class names in our game...
- PoopingSystem
- NewBabyCommand
- GhostFactory
- KillCommand
- ShotPopulater
- LoadSpreader
- AutoSimulate
@PakkaPets