12-27-2011, 01:38 AM
I noticed thiaZ done some work on the vehicle manager for 3.0. Its unfinished however and since it hasn't been worked on for quite a few weeks I'd like to take over it.
Obviously however, a few things need to be discussed.
Wrapping
SA-MP doesn't really have many vehicle functions. For example, if we wanted to change a vehicles spawn position we would have to destroy it and re-create it. This can be quite messy. SetVehiclePos does not work if a vehicle is empty.
To give us more control in the longrun I'm proposing that we handle vehicles on our own. EG when a vehicle is respawned or "dies", we destroy it completely and just create a new one. Exceptions will, however, obviously be added for things such as NPC driven vehicles.
The disadvantage of doing it this way is efficiency vs organisation. It's obviously much more efficient to just leave a vehicle in after it respawns and let SA-MP do the rest.
It may also be useful when writing the wrapper method for creating the vehicle to add additional parameters for mods, number plates, and anything else mentioned in the list below.
External
I think vehicle data should be stored externally. This makes it possible for staff to modify various vehicle flags in the future and add and amend vehicles 'on the fly'.
Potential flags to save:-
Vehicle model ID
Vehicle current location + world(?)
Vehicle spawn location + world
Vehicle mods, such as spoilers, nitro, etc.
Vehicle number plate
Vehicle status (i.e. locked/unlocked) (?)
Vehicle owner - this can be discussed at a later date.
Is there anything else that needs to be tracked? I was thinking about vehicle alarms for example, but I'm not sure how we could use these.
In addition, how should this data be saved? The easy solution is a MySQL database, but a more thought-out answer maybe an SQLite database because:-
- Such vehicle data is only required locally to the server
- No need to thread the queries so it makes code organisation much easier
- Very little / No notable performance changes since these queries will potentially only run upon gamemode initialization / exit.
Management
As previously iterated it would be much more effective if staff members could modify vehicle attributes on the fly and amend the vehicle layout as they see fit.
What level of staff members should be able to control this data?
Should current vehicle attributes such as vehicle mods and colour save, or should these be forgotten about after a vehicle respawns? Perhaps this could be an option for the player saving the data?
Other features
Anything to add? I'm not sure if people had some ideas for things like speedometers, realistic fuel or random vehicle spawning.
Obviously however, a few things need to be discussed.
Wrapping
SA-MP doesn't really have many vehicle functions. For example, if we wanted to change a vehicles spawn position we would have to destroy it and re-create it. This can be quite messy. SetVehiclePos does not work if a vehicle is empty.
To give us more control in the longrun I'm proposing that we handle vehicles on our own. EG when a vehicle is respawned or "dies", we destroy it completely and just create a new one. Exceptions will, however, obviously be added for things such as NPC driven vehicles.
The disadvantage of doing it this way is efficiency vs organisation. It's obviously much more efficient to just leave a vehicle in after it respawns and let SA-MP do the rest.
It may also be useful when writing the wrapper method for creating the vehicle to add additional parameters for mods, number plates, and anything else mentioned in the list below.
External
I think vehicle data should be stored externally. This makes it possible for staff to modify various vehicle flags in the future and add and amend vehicles 'on the fly'.
Potential flags to save:-
Vehicle model ID
Vehicle current location + world(?)
Vehicle spawn location + world
Vehicle mods, such as spoilers, nitro, etc.
Vehicle number plate
Vehicle status (i.e. locked/unlocked) (?)
Vehicle owner - this can be discussed at a later date.
Is there anything else that needs to be tracked? I was thinking about vehicle alarms for example, but I'm not sure how we could use these.
In addition, how should this data be saved? The easy solution is a MySQL database, but a more thought-out answer maybe an SQLite database because:-
- Such vehicle data is only required locally to the server
- No need to thread the queries so it makes code organisation much easier
- Very little / No notable performance changes since these queries will potentially only run upon gamemode initialization / exit.
Management
As previously iterated it would be much more effective if staff members could modify vehicle attributes on the fly and amend the vehicle layout as they see fit.
What level of staff members should be able to control this data?
Should current vehicle attributes such as vehicle mods and colour save, or should these be forgotten about after a vehicle respawns? Perhaps this could be an option for the player saving the data?
Other features
Anything to add? I'm not sure if people had some ideas for things like speedometers, realistic fuel or random vehicle spawning.
