Creating a new project

Jul 8, 2012 at 5:13 AM

I was wondering when creating a new project should I be using the ScreenSystem and Drawing system as have seen some other examples that made use of the ConvertUnits class or are there some classes from the samples that I should use. Just a bit confused since ConvertUnits was used in other examples I found online and wasn't sure if it's something that I need to use the engine properly. Any advice and suggestions will be greatly appreciated.

Jul 8, 2012 at 12:49 PM
Edited Jul 8, 2012 at 12:50 PM

The Samples have a pretty good ScreenSystem, Input, Asset management and Camera. That would save you a lot of time and might just be enough for a simple game. Also show you how to integrate the DebugView and later on you can extend it easily with your own shaders and whatnot.

ConvertUnits is fundamental because you need to use the mks system for the physics and not pixels as units. ConvertUnits+Camera are classes you would need to write no matter what anyway.

I would also recommend something different - start by making a TestBed sample (that draws automatically with the DebugView) and integrate it into the TestBed project. This is extremely easy - make a copy of some test that is similar, change the class name, add new TestEntry and take it from there.

Once you made all your physics work properly the way you want it and have the physics class structure and logic set up then all you need to do is port it into the screensystem and code the drawing bits. Or you can make a scenegraph. But whatever you do you will know that the physics is working.

I personally also write the GUI stuff in a separate project and integrate it afterwards hooking the gui events to the logic (Model-View-Controller design pattern). The reasoning is to split the tasks into more manageable modules for debugging, testing and tuning since a complete game is quite complex and can be overwhelming.

Jul 8, 2012 at 7:24 PM

Hi Jerry thanks for the advice as I really appreciate it. I also have another question about the ragdoll sample as was wondering how would I go by making the ragdoll smaller as want to make something like the Shoot U! game that is on Android and will need the ragdoll to be smaller.

Jul 9, 2012 at 9:28 PM

You have a few options:

- Scale the physics ragdoll. This is not recommended. I don't actually know how big is the ragdoll but if it's up to real world size then it's the right size. Physics object should be within the 0.1-10 scale

- Change the pixel-to-meter ratio (scale the graphics). This is the preferred approach and is very easy (check ConvertUnits.cs).

- Zoom out with the camera