Using the Billions Source Code
So you have installed 3DVIA Studio and are now looking at the source code for the Billions game. Here are a few tips to help you fond your way around.
First: if you are not already familiar with 3DVIA Studio, we strongly recommend that you take a look at the support website, where you’ll find video tutorials, articles, online documentation and other useful information to help you dive into the core concepts of the product.
Next: it’s time to take a first look at the billions code. (If you haven’t already, click here to download the source code). In 3DVIA Studio, go to the project editor and see how the game is split in several stages. Keep in mind that what you’re looking at is the result of a six weeks rush to get the game running for its GDC introduction, with no prior experience using the technology or training, and a largely unfinished documentation. In other words, this should not be seen as the ultimate guide to using 3DVIA Studio, but rather a useful starting point for making your own experiments. We hope you’ll like the idea of playing around with the core concepts of the game and participate in its further development by contributing with suggestions on the Billions blog.
Anyway, back to the project editor, you will see that we used stages to separate the game into components. Some stages contains only media assets (like GameEnv1, which hosts the game background environment), others contain cube geometry or behavior templates that can be attached to cubes created by the player. Others may be dedicated to specific aspects of the game, like the “visual fx” stage, which contains all the basic particle emitters.
One central stage to the project is the “managers” stage. This is where most of the game’s code can be found, organized in singleton behaviors dedicated to specific tasks. For instance, the LevelMgr is in charge of loading XML descriptions of levels, builds the levels accordingly, destroys at the end of the game or even provides functions to detect nearby cubes. Viewing all the managers should provide a better picture of how the code works. Start with “GameMgr.” This behavior is a basic state machine, orchestrating the various game screens, including the central “play level” state. This manager will, for instance, invoke the LevelMgr to create the level, then the PlayerMgr to initiate the player character, then the InputMgr to handle the gamepad or mouse, etc…
As you navigate around those scripts, you will see that it exclusively uses VSL. This is not a rule of thumb nor a requirement, it’s just us, the Billions dev team, who felt more comfortable with VSL than schematics. In fact, with such a tight schedule, we figured we couldn’t spend the required quality time to become productive with both VSL and schematic. If we had to redo the project, we might take a different path for certain tasks (for instance, schematic is probably more appropriate than VSL for implementing the bad guys state machines). The great thing about the behavior paradigm 3DVIA Studio uses is that you can mix both approaches as you please.
Aside from being a learning resource, we hope you’ll enjoy the access to this source code as a way to mess around with the game concepts we’ve used in Billions. Here’s a few things that can easily be done to change the game:
- Create your own levels: if you’re not a great 3D artist, or not even an artist at all (like myself), you can still have lots of fun just coming up with funky levels for Billions, changing the provided XML description. Hopefully at some point we’ll have time to package the little level editor we’re using internally and make it available to the community.
- Change the character designs: you’re good at creating characters and animating them? Well you should be able to replace the ones we put in fairly easily.
- Create additional cube visuals: the code structure enables easy integration of more cubes. That’s another area for experimentation and crazy ideas (we’re sure someone out there doesn’t like our cute little pink cubes and would rather see some heroic fantasy style levels
- Code some new behaviors for cubes in the levels: that’s probably the most challenging way to modify the game, but maybe also the most rewarding. What if we had “tower defense” cubes that shoot at the player to dispose him of his Mogaloos? You like the idea…well go ahead and make it happen
We’ll be delighted to see all the crazy stuff you can do with the game and post on 3DVIA.com.
With all these possible ways to modify this source code, it would be difficult to precisely describe steps to get there in this paper, but we’ll be happy to discuss them with you on the Billions blog and help you get going (as soon as we have recovered from the roller coaster ride of the last few weeks).
We’re having lots of fun working on this innovative game project with such a promising dev tool. So, join the party on Billions.3DVIA.com and help us make this Facebook game something unique.








super 3d thanks
Hi. I tried to download the code, but i still get the “COMING SOON” page when I click on the link above
(
Hi,
I delivered the source code to the 3DVIA folks shortly before GDC, along with this post. There was supposed to be a little cleaning up on the file structure to make it easier to get into before it gets posted. I’ll check with them to see if we can get a date for the source availability (shouldn’t be long, though).
François
We are just working out some of the last details – soon, very soon!
Is it soon yet???
this is great
Hi Francois! Your post is very interesting. I have not seen this on Facebook. But I’ll check on it. Do you have any updates on this? Thanks.
Cody Felton
Webmaster of Laminator Machine
Hi! yes you are right i am not familiar with 3DVIA Studio, thanks for sharing this wonderful update.
Yep, having trouble downloading to
Hello Francois, this post is informative. Actually I have no idea when it comes to 3DVIA Studio. But after reading this post, it makes me wonder about the Billions game you are talking about. Is this some kind of RPG? I will try this one out on Facebook.
Hi, no it’s not an RPG, it’s an action game. Think of it as Mario Galaxy meets Tetris. Enjoy it on facebook
François
[...] Image credits: Michael Kalus, Frederic Poirot, Silicon Angle, Billions [...]
[...] Image credits: Michael Kalus, Frederic Poirot, Silicon Angle, Billions [...]