Kaltsu Posted November 30, 2008 Share Posted November 30, 2008 There's a topic already related to the same subject but I couldn't reply there as it belongs to an archived forum section: https://forum.multitheftauto.com/viewtopic.php?f=96&t=21611&start=0&st=0&sk=t&sd=a Anyway, what do you think? Do we have better chances in getting this kind of feature implemented now as the MTA:SA source is open? Link to comment
darkdreamingdan Posted November 30, 2008 Share Posted November 30, 2008 it's always been a possibility, but never been a priority. As far as open-sourcing goes, if anyone does write code for synced lights, i'm sure the team would be happy to add it to the trunk. Link to comment
paul527 Posted December 26, 2008 Share Posted December 26, 2008 I said it before, and I'll say it again. The lights should either be turned off altogether, or, turned all at the same time with the same color across the entire map. Anything else would take up too much bandwidth, or take too much time to code. Sure, you could code just ONE intersection to have synched lights, but who wants to race at the same damn light each time? So then you'll say "why can't you make the nearest intersection synched with a command or something?" My answer to that is : Holy crap I bet that's hard to code! Link to comment
DiSaMe Posted December 26, 2008 Share Posted December 26, 2008 I said it before, and I'll say it again. The lights should either be turned off altogether, or, turned all at the same time with the same color across the entire map. Anything else would take up too much bandwidth, or take too much time to code. Really? What about making groups of lights? The minimum number could be 2. It wouldn't take up much bandwidth. Link to comment
darkdreamingdan Posted December 26, 2008 Share Posted December 26, 2008 I dont know, its one of those things like Garage doors. They're synced in 1.0 but its because R* conveniently assigned them all IDs which can be used to easily retrieve them. In the case of traffic lights, its highly unlikely they'd bother tagging them individually. Instead there's probably an overall system that takes nearby lights. That's just a guess, but it immediately makes it more problematic to start trying to figure out how to retrieve each set of traffic lights so that they can be set. Link to comment
Kaltsu Posted March 25, 2009 Author Share Posted March 25, 2009 The traffic lights change in turns, depending if they are pointing more towards North/South or more towards West/East. No matter where in the map the light is located, they still change at the same time depending on their direction (tested in Map Editor). So basically there are 2 different sets of traffic lights that would need to be synced. Here is the timeline for the loop: 0:00 - Set 1 turns green / Set 2 stays red 0:12 - Set 1 turns red / Set 2 turns green 0:22 - Set 2 turns red / Set 1 stays red 0:31 - Set 1 turns green / Set 2 stays red Total: 31 seconds * Set 1 = Pointing towards North/South * Set 2 = Pointing towards West/East Both of the lights stay red for the last 9 seconds of the loop, because that's the only period in the loop when the pedestrian lights for both sets turn white. However, at the moment it seems that the sync of the traffic lights between two players depends on their FPS. Link to comment
SugarD-x Posted April 3, 2009 Share Posted April 3, 2009 Well what about syncing the clients' sets to ones defined by the server? That way their lag to the server would define the sync, which is pretty much how everything works at the moment with any multiplayer client. Link to comment
Gamesnert Posted April 4, 2009 Share Posted April 4, 2009 I guess people should be reminded of what Talidan said before in this topic: ...In the case of traffic lights, its highly unlikely they'd bother tagging them individually. Instead there's probably an overall system that takes nearby lights. That's just a guess, but it immediately makes it more problematic to start trying to figure out how to retrieve each set of traffic lights so that they can be set. This means that it's just very hard to get all (or some) of the traffic lights. We need to wait for someone to find a way to get them, before there should be discussed about bandwidth, synch etc. Link to comment
Kaltsu Posted April 4, 2009 Author Share Posted April 4, 2009 This is what lucasc190 noted in the Mantis report (http://bugs.mtasa.com/view.php?id=4120). I found the function addresses, 0x49dab0 (if ret is written, all traffic lights go blank (including pedestrian walk lights), and 0x156e5bc (if ret is written, the traffic ignore the traffic lights (in the origional game)). Maybe someone can have a look around at these addresses and find the memory addresses that they read from. Or maybe just write ret to 0x49dab0 (to keep them all blank) just for now until they are synced. Maybe if someone finds the memory addresses, a script function can be made that sets them, then someone can make a resource with a timer to set them at specific intervals. (There is no real need to sync them to a player because its much simpler to use a server-side timer) I can't really say much about this, since I'm not very experienced in scripting etc. but at least to me this looks like somekind of a step forward... ( ) Link to comment
Gamesnert Posted April 4, 2009 Share Posted April 4, 2009 He only talked about making them blank, which isn't really what we want I guess. However, when they're blank, I think you can use Corona's (createMarker) to simulate the traffic lights. Will be a bit weird when the light has collapsed, but might be a temp solution? Link to comment
darkdreamingdan Posted April 4, 2009 Share Posted April 4, 2009 He only talked about making them blank, which isn't really what we want I guess.However, when they're blank, I think you can use Corona's (createMarker) to simulate the traffic lights. Will be a bit weird when the light has collapsed, but might be a temp solution? Yeah. I'll assign you to work out every single light position . Link to comment
Gamesnert Posted April 4, 2009 Share Posted April 4, 2009 Yeah. I'll assign you to work out every single light position . I must say that the task should be incredibly easier now with the new Map Editor, but not easy enough for me! D: I might be able to do about 2 traffic lights by next year though. Link to comment
DiSaMe Posted April 4, 2009 Share Posted April 4, 2009 Yeah. I'll assign you to work out every single light position . It's possible by making a program that reads IPL files, finds traffic lights and writes light positions to a file Link to comment
Gamesnert Posted April 4, 2009 Share Posted April 4, 2009 How many types of traffic lights are there in SA? If it's only one, then your method should make it a piece of pie with the help of my good 'ol buddy Trigonometry. Otherwise, it's a smaller piece of pie. And I want moar pie! Link to comment
skybon Posted April 4, 2009 Share Posted April 4, 2009 How many types of traffic lights are there in SA? If it's only one, then your method should make it a piece of pie with the help of my good 'ol buddy Trigonometry.Otherwise, it's a smaller piece of pie. And I want moar pie! Well... maybe you mean geometry, not trigonometry? (or you really mean sin, cos, tg, ctg etc.?) Link to comment
Gamesnert Posted April 4, 2009 Share Posted April 4, 2009 Rotations are involved. Sin, cos and maybe a few others might be needed to that that into account. Link to comment
skybon Posted April 8, 2009 Share Posted April 8, 2009 Well, maybe trigonometry won't be needed. I've got better idea. What if smb creates a traffic lights map with all traffic lights marked with all of the properties. Link to comment
SugarD-x Posted June 11, 2009 Share Posted June 11, 2009 If you map them and prepare, they will come...oh...excuse me, they will work! *Cough* lol... Link to comment
Recommended Posts