Hi guys, a few questions about 2D games, databases, classes and objects in unity

Hi guys new around here and looking for a bit of direction.

Im working on a racing team management game similar almost to the football manager games for anyone familiar with that.

I plan on using unity because it allows for multi-platform easily, is an intuitive editor when combined with something like ngui for ui’s (seeing as my game is pretty much entirely 2D and very menu heavy) and is easy to develop with. However im trying to come up with the best way to tackle implementing my game.

At the moment i’m leaning towards some form of sqlite interpretation. Databases for the drivers, the teams, cars, car parts, staff, tracks, finances, sponsors etc. I’ve seen mono sqlite which looks good but i’m not sure if thats what i need.

For the moment i’m just focusing on getting a race simulated with some hard coded values to see if this is all actually going to work

In the first place but i have a bit of a problem.
What i need to do is

Take a series of values of a driver and a set of values from a car
Test them against the type of corners of the track (eg the first part has 2 slow corners, 3 medium corners and a long straight)
Get a overall speed value for that part of the track
Do the same for the next two parts of the track
Then do this 50 or so times.

The math as to how i’m going to calculate it i have somewhat figured out, with a bit of variance from the driver, eventually taking into account component ware on the car, tires, fuel load etc, again all just a bunch of numbers, spreadsheets with a nice ui lol.

This will all be calculated to spit out a ‘sector time’ for each of the 3 parts of the track, which will then be added together to give the overall lap time on a timing board (along with 24 other drivers as well)

Now where my problem stems from is that as far as i know in unity your scripts have to be attached to something? i dont really have anything tangible except the timing board, but i will have a 2D track map on screen as well, on this there will be dots representing each car, which will follow the road (through itween or something) and give a visual representation of the race.

So my question basically is where on earth would i start in unity on something like this, i know the logic of how its going to work, how i want it all to work but im stumped on where to start, i just want to get some values and run through my algorithms, should i have drivers as a class which can create objects with the different stats for different drivers which i can then loop through? how do i go about setting up classes and objects for things you don’t necessarily see (my idea for the map is to just take the laptime and tween the dot across that amount of time on the line.)

But anyway i think this is a bit of a unique problem that lends itself to some community input from a programing sense i know we all love tackling problems haha so heres something a bit different, excuse the wall of text and its much appreciate if anyone can offer some input, i’m not requesting slabs of code, mainly direction but some small scripts to point me in the right direction wouldn’t hurt at all!

I can’t answer most of your questions, but you can just attach a a script to an empty game object. Or any other game object in the scene.

You can build classes and objects in the same way you would go about it in any other application. Classes don’t need to derive from MonoBehaviour or Component; instances don’t need to be attached to a GameObject.

The best practice is use prefabs name as reference to actual resources, so you will create an object by reading string with prefab name from database and instantiate by calling GameObject.Instantiate(… if you look for multi-platform and specially WebPlayer (monosqlite doesn’t support) you have to use SQLiteKit.