MCMic {l Wrote}:hiker {l Wrote}:[*]It would save us some work if you could follow our coding style guides, esp. using "{' on a new line, and perhaps the maximum line length of 80 (admittedly there is a lot of code that does not adhere to the latter).
Oh, yeah, sorry about that, didn't cross my mind :-/
No big deal, just thought to point that out

hiker {l Wrote}:[*]If you add a new function parameter with a default, try to add it to the end (so that it's less likely that any other code might provide suddenly incorrect parameters), e.g.:
- {l Code}: {l Select All Code}
- void loadTrackModel (World* parent, unsigned int mode_id=0);
+ void loadTrackModel (World* parent,
+ bool revert_track = false,
+ unsigned int mode_id=0);
Hum, I searched in files and it seemed that this parameter was never used, that's why I added my parameter before it. (And if I add my parameter in the end, I'll have to fix the value of the other one when I call the function and want to set the value of my parameter.)
Yes, you are right, it's not used atm - sorry, I missed that. The parameter is actually intended to allow you to select from various modes for one track. E.g. imagine a city track, where we might have 5 different ways of racing through them, but still only one main model. Or (my original intention) one mode could be the reverse mode (assuming that reverse driving is implemented as a different mode, and not automatically done as you have done it). But agreed, in this case your order was better.
[*] I don't understand why you have to revert the quads. Ideally this shouldn't matter, but there might be a bug ... or I might be missing something

But I would prefer fixing any bugs we might have, than working around them

If I just reverse the order of quads and not there direction, rank is wrong when two karts are on the same quad. (the kart that is behind the other is shown first in the kart list)
Good point, I'll have a look at that.
[*]I don't think that simply reversing the quads will work - as soon as you have a short-cut/alternative way, it won't work anymore. Also there are some (at least one

) internal data structure which will likely not be correct anymore (the bouncing ball has information about what path to use to reach a kart that might be on a short cut). The right way would be to reverse the graph, since it's the graph that determines the order in which the quads must be driven. If you need additional explanation here, let me know!
Yeah, I thought about these shortcut problems and things, but I don't know STK graph system enough to sort this issue out.
[*] Just reverting the order of the check-structures is not good enough, it will (most likely) work if we have a simple linear list of check-structures, but not all tracks have that. Have a look at math class, which has two additional check lines to the left and right of the start line (which are (iirc) necessary if a kart crosses the line to far to the left, but still under the bridge). I didn't try, but with your change it should be possible to cross the lap line on the very far left, then you can drive back, cross to the right, drive back, .... Let me know if you want some additional explanation of this.
I know reverting the order of the check-structures won't work for all tracks, but I did not got any better idea.
Yes, this should be fixed to work with as many tracks as possible.
That's why there is this "revert_available" flag for tracks.
Well, I'd say that flag should only be used for tracks that can't be driven backwards, e.g. a track that has a jump in one direction that can't be driven the other way - iirc Crescent Crossing has that problem (when leaving the house).
I think tracks that have a more complicated check system should have a second check system for the revert version of the track.
I think it should be possible to automatically reverse the order. Perhaps we might want to store more information (iirc the check structures store the 'next' check structure, perhaps it would be easier if they would also store the previous structure). Not sure, we would need to study the code in more detail.
So, what should I do now?
I'm not sure if I'm familiar enough with STK code to improve the reverting that much.
There's nothing you can't learn

The most important information is on the wiki:
http://supertuxkart.sourceforge.net/The ... line_ModelIgnore the blender details (the two 'antennas' to indicate start etc), but read the rest. Especially the section "Detailed concept: QuadGraph ", it even contains a reverse graph as an example.
It might be as simple as just reversing the order in which a graph in the edge is defined, e.g.:
- {l Code}: {l Select All Code}
m_all_nodes[from]->addSuccessor(to);
could simply become:
- {l Code}: {l Select All Code}
if(reverse)
m_all_nodes[to]->addSuccessor(from);
else
m_all_nodes[from]->addSuccessor(to);
So if a reverse flag is defined, just swap from and to (that's from quad_graph.cpp, around line 161, but there are a few more places that add a successor that need to be changed). But this is just a quick thought from me, so a good look at the code is still necessary.
And besides I'm not sure on which version of the code I should work on (I think I should switch to the svn branch you created and send patches for this version, but I'm not sure about that)
I created the branch hoping that you would want to continue working on that - I would then just give you write permission to that branch, and once you are done we merge this back into trunk. It's unlikely that there will be any conflicts with any of the other work happening atm - auria is busy with overworld, I am with the physics. If you are interested in finishing this, just email me your sourceforge account name (I assume that you are familiar with SVN).
I've applied the first half of your patch (r10767 ) - so it kind of sets up the infrastructure, but does not do any actual reversing. There should be some differences in naming, so expect a few conflicts when you try merging this with your current code. Best would probably be to go to a clean version of the branch, and then start working on the graph etc. You could start by fixing the GUI (following Auria's comment about adding a text to a check box), then looking at the graph structure and fixing this (which would allow the AIs to drive backwards, though lap counting wouldn't work), and in the final step then doing the checklines (which then enables proper lap counting).
Cheers,
Joerg