Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[READY] vehicle overmap tracking. #4234

Merged
merged 12 commits into from Nov 16, 2013

Conversation

Projects
None yet
4 participants
@axujen
Copy link
Contributor

commented Nov 9, 2013

Addresses #3866

The player can now track vehicles on the overmap after installing a craftable tracking device that requires a little bit of skill with electronics, the player is also required to carry a PDA in order to see the vehicles on the overmap.

The tracking device consumes 6 power from the vehicle, twice as much as a headlight, so this should make it pretty balanced.
tracking can be turned on/off through the vehicle control menu just like headlights so you can save power when you're not intending to use it.

As of now i have not noticed any bugs related to this, (except #4292), but if you would like to test this and find any bugs please report them here so i can attempt to fix them.

Here is a screenshot, click to expand.
screenie

@axujen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 10, 2013

I think this is (almost) ready, i need some testing/feedback.

@axujen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2013

I have noticed a bug while testing this, when you try to look at a map note when the player is in a different overmap the map note is not shown, this is probably due to the cursx and cursy coordinates being translated for the diffrent overmap, the problem is the same for vehicles since they display the vehicle name the same way as notes, im not sure if i should try to fix this for both or just vehicles since notes are out of the scope of this pull request.

EDIT: I've decided not to fix any of them since it has something with the way cursx and cursy is calculated and passed to overmap::draw, any attempt of a fix within the scope of this pr will be a hack, instead im opening a seperate issue for it.

@axujen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 13, 2013

adding a gps tracking module requirement for vehicles and the player must carry a pda to track vehicles.

axujen added some commits Nov 9, 2013

Initial commit, vehicle overmap tracking.
Add enable/disable gps entry to vehicle control menus
Implement basic tracking that works for up to 3 overmap tiles away,
after that the vehicle note will follow the player around.
Vehicles save their overmap location.
Vehicles will save their own overmap location using the levx and levy
fields + the omap_x() and omap_y() fields.
It still needs work however as it is not updated correctly when the
player teleports away.
Use om_vehicle struct to track vehicle overmap coords
Create new struct om_vehicle that tracks a vehicles overmap coordinates
and name, this seperates vehicle overmap data from the vehicle itself
allowing the overmap to save/load it independently from vehicle
instances.

om_vehicle structs are stored in a map using their id as key, the id
also stored in the corresponding vehicle instance so it serves as a link
between the two.

Add 1 new methods for the overmap class, overmap::add_vehicle which
takes a vehicle instance, creates a new om_struct instance and generates
an id for it, then it is stored in the vehicles list and the id is
returned.

overmap::remove_vehicle has been updated to handle the new vehicles map
and now it takes an id instead of a vehicle instance.

overmap::has_vehicle and overmap::print_vehicles has been modified to
use the new om_vehicle structs but nothing else has been modified.

Add 2 methods for the vehicle class, vehicle::update_map_x() and
vehicle::update_map_y() which along with updating the vehicles own map
coordinates update their correspoding om_vehicle struct (if it exists)
coordinates.
Add gps module item required for vehicle tracking.
Add a recipe, item and vehicle part for a vehicle gps tracking unit that
is required to track the vehicle on the overmap.
@axujen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 13, 2013

And done (again)

@JayThirtySeven

This comment has been minimized.

Copy link

commented Nov 13, 2013

I really like this feature, though it may need a different name/explanation at some point. A few google searches reveal a general consensus that the GPS network would be completely inaccurate within the week if ground crews stopped uploading weather and telemetry corrections. The situation in CDDA seems pretty widespread and thorough; it could easily have killed off or displaced all of the teams responsible for those corrections.

Of course there might be some group out there who is secure enough to maintain the satellite network; anybody with ships or aircraft would really want the GPS network to stay up, and it works for everybody if it works at all.

It could also be that the near-future GPS network in CDDA is self-supporting. If you can have autonomous combat robots, you might have satellites that can make their own corrections.

Like I said, great feature. Just the "GPS" name gave me a little bit of a pause.

@axujen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 13, 2013

@JayThirtySeven GPS stands for Global Positioning System, there are actually GPS tracking units that use radio signals or cellular networks, not just satellites. As it turns out they still need a satellite to determine their location.
https://en.wikipedia.org/wiki/GPS_tracking_unit
But im open to suggestions if you have a better name, because i couldn't come up with any.

@JayThirtySeven

This comment has been minimized.

Copy link

commented Nov 13, 2013

I dunno, something like "Locator Beacon" or "Tracking Device" are descriptive without being very specific about the technology. If you feel the need to explain how it works, a radio-based system can pretty easily determine distance between the beacon and the receiver, and you can determine a precise location by taking multiple readings from different locations. It's plausible that a PDA or similar device with RF capability could automatically track beacon locations relative to the character by sending a radio pulse every few minutes and comparing the responses to previous data. It would have a limited range at that point, especially in urban areas, but would still have the "last known location" if you went out of range.

On the other hand, since this is more of a gameplay/interface convenience, I don't know if it needs to be justified in-game as being anything. The vehicle controls could just have a "remember location" option that doesn't require any items to work. The player/character already has the ability to accurately map his surroundings by sight and always knows where he is on that map; it's not much of a stretch to think he always remembers where he parked his favorite rocket powered shopping cart if he decides it's important.

@axujen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 13, 2013

I like the item requirements for gameplay balance, i like the idea of a radio signal however even that requires two static signals (eg radio towers) so it can map its location, but i guess assuming radio towers still operate is better than assuming satellites/gps still works.
https://en.wikipedia.org/wiki/Automatic_vehicle_location this article describes all kinds of vehicle tracking systems

@JayThirtySeven

This comment has been minimized.

Copy link

commented Nov 13, 2013

If I have a special tracking device on my car, and a paired transmitter that I can carry, I can determine my distance to the car based on the time it takes to send a signal and receive a response. It would take some fairly precise timers/processors to measure radio travel time, but it's nowhere near the complexity of a working laser rifle.

If I measure my distance to the car from one location, I know that the car's location is one of infinite points along a circle with that radius. If I measure my distance again from another location, I know that the car's location is one of two points where the circles intersect. If I measure the car's distance again from a third location, I will have determined its location as the only point where all three circles intersect. This is just trigonometry; If I have three known points and distances from those to some unknown point, I can calculate the exact location of that unknown point.

So if I use my device to record my position and distance to the car from three different locations, I can easily determine the location of the car. You could force the player to do this manually, or just assume that the device does this on its own.

The main limitation is terrain, because solid objects between you and the car will slow the radio signal by an unkowable amount, which will give inaccurate distances. Not to mention it's pretty easy to block that signal entirely when you're transmitting from ground level. Still, with enough measurements you can overcome the interference and narrow down the location of the vehicle more than enough to find it (and its location will become clearer as you approach).

And even though the system could make sense, I still don't really see any balance issues with just letting the player remember vehicles for free. I could add/delete map notes every time I get in or out of vehicles, so doing it automatically doesn't give me any advantage; it just makes the game less tedious (and thus more fun). Are we going to require the player to find a pencil and paper before he can use the map feature?

Rename gps device to more generic tracking device.
It is less likely that a gps system is still active after the cataclysm,
so a more generic tracking device is used instead.
@axujen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 13, 2013

I suppose if the vehicle is stationary that would be possible

And even though the system could make sense, I still don't really see any balance issues with just letting the player remember vehicles for free. I could add/delete map notes every time I get in or out of vehicles, so doing it automatically doesn't give me any advantage; it just makes the game less tedious (and thus more fun). Are we going to require the player to find a pencil and paper before he can use the map feature?

I think the fact that it is automatic is enough, sure you don't need a pencil and paper to mark a map location, but then again you dont need to update the note everytime that location changes because well it doesn't. You see my point here?

@JayThirtySeven

This comment has been minimized.

Copy link

commented Nov 14, 2013

When do vehicles move without player intervention? Aside from jumping out of a moving vehicle, I can't think of any way for a vehicle to move without me driving/dragging it at the time.

@axujen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 15, 2013

I never said anything about vehicles moving without the player in them, what im saying is that each time you do unmount the vehicle, the player will have to make a note of the vehicles new updated location.

@JayThirtySeven

This comment has been minimized.

Copy link

commented Nov 15, 2013

So the tracking device just saves me from typing [m][D][Y] when I get into a vehicle, and [m][N][V][:][ENTER] when I get out?

If the tracking device is effectively the same as setting/deleting my own notes, there is no "balance" issue here. It doesn't enable an ability that the player doesn't already have, it just enables a more convenient way of applying existing abilities.

To put it another way: This is a game about surviving after the apocalypse but the tracking device only exists to help the player avoid tedium. If you want the player to expend effort and resources locating/installing this item, it should help him survive.

@axujen

This comment has been minimized.

Copy link
Contributor Author

commented Nov 15, 2013

@JayThirtySeven You have to earn it.

@yobbobanana yobbobanana merged commit cfabcbe into CleverRaven:master Nov 16, 2013

1 check passed

default Merged build finished.
Details
@yobbobanana

This comment has been minimized.

Copy link
Contributor

commented Nov 16, 2013

i merged it as is now, seems to work sensibly enough to me.

there were some vague ideas about trains at one point, and vehicle trailers that drag behind other vehicles. Also you never know, maybe someone someday will give NPCs the ability to drive. Then when one steals your car, you'll be able to find it again :).

for now, it's a handy convenience.

@axujen axujen deleted the axujen:veh_tracking branch Nov 16, 2013

@JayThirtySeven

This comment has been minimized.

Copy link

commented Nov 16, 2013

Ah well, still doesn't seem like it should need an item but in any case it's settled for now ^^.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Nov 18, 2013

I agree actually, I'm going to look at patching out the requirement for the
device.

On Sat, Nov 16, 2013 at 1:50 PM, JayThirtySeven notifications@github.comwrote:

Ah well, still doesn't seem like it should need an item but in any case
it's settled for now ^^.


Reply to this email directly or view it on GitHubhttps://github.com//pull/4234#issuecomment-28634247
.

@JayThirtySeven

This comment has been minimized.

Copy link

commented Nov 18, 2013

@kevingranade I'll certainly enjoy the feature more that way. Requiring the items has sort of a more realistic feel and might be right for some games, it just doesn't seem like a great fit for this game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.