Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: blowfish on March 30, 2008, 11:41:05 pm
-
I noticed that in CVS, ship.cpp versions go up to 2.440, but in SVN, they only go up to 2.336.2.86. This effectively eliminates ship templates. I just wanted to ask - is there a reason for this?
-
It's a difference in stable/unstable trees. HEAD in CVS is unstable, but in SVN it's stable. We did that because too many people were getting confused and using the wrong code tree. The version numbers you list are a dead giveaway of the change, with "2.336.2.86" indicating that it's from the stable code that was branched at HEAD version 2.336. That doesn't preclude any particular bit of code from being from a post 2.336 HEAD version also being the stable tree, but it would only be in both if the coder committed to both, which isn't the case with Turey's ship template feature.
-
I see...
-
HEAD = stable?
-
HEAD = stable?
There is actually no longer a "HEAD" like we had with CVS. In the SVN trunk there is "fs2_open", which is the stable code tree, and "fs2_open-unstable", which is for unstable code.
-
Yeah, that terminology alone sounds like it should really help clear up a lot of the confusion. Plus I like SVN more anyway. Makes me all warm and fuzzy inside.
-
I could cross-commit if someone actually needed the code...
or someone else could do it, it's not complicated code.
-
Is the ship template code stable?
-
Is the ship template code stable?
I previewed it before it ever hit CVS and I thought it was good enough for stable. If you want to do up a patch of that code for SVN stable then I can go ahead and commit it.
-
Is the ship template code stable?
I previewed it before it ever hit CVS and I thought it was good enough for stable. If you want to do up a patch of that code for SVN stable then I can go ahead and commit it.
I'll see if I have time later this week.
-
Is the ship template code stable?
I previewed it before it ever hit CVS and I thought it was good enough for stable. If you want to do up a patch of that code for SVN stable then I can go ahead and commit it.
Wow. I thought that this would only involve moving a few blocks of code from the CVS branch to the SVN one (or whatever). I never realized that I would have to move large blocks of code around and between functions :shaking: Well, anyway, I did it, and it not only compiles and doesn't cause my computer to explode, but it actually seems to work. I don't know how to commit (and probably shouldn't be, considering how new I am to this whole SCP thing), but the required source files are attached ( required_string_4 had to be added to the parse files).
EDIT: I hope I removed all the weird all caps comments I use to navigate around the code :nervous:
[attachment deleted by ninja]
-
Wow. I thought that this would only involve moving a few blocks of code from the CVS branch to the SVN one (or whatever). I never realized that I would have to move large blocks of code around and between functions :shaking: Well, anyway, I did it, and it not only compiles and doesn't cause my computer to explode, but it actually seems to work. I don't know how to commit (and probably shouldn't be, considering how new I am to this whole SCP thing), but the required source files are attached ( required_string_4 had to be added to the parse files).
Had time to give it a better look, so...
1) Please always diff rather than sending already patched code. Otherwise we have to diff it first and it just makes everything more difficult since if the files are out of sync then a lot of changes will get identified which aren't related to anything that you did.
2) There is a LOT more in there that has nothing to do with ship templates, about 15 to 20 times more. Please only include what is necessary to add in ship templates. Other changes should be in separate diffs, so that if something causes a problem we don't have to rip out all of the code to fix it. It also makes it significantly easier to review the diff if it's all for one particular set of changes and doesn't include so much unnecessary stuff.
-
1) I see the problem here, but how do I diff?
2) I didn't purposefully make any changes that didn't need to be made for the ship template code to work. What had to be done is moving a very large chunk of code into a new function (I was looking at how it was done in the unstable branch code, this looked like the best way to do it - the new function is parse_ship_info. If it was not in a new function, that huge block of code would have to appear twice) as well as adding a few functions that the code required. EDIT: Worth noting that file comparison programs usually cannot make sense of changes like this. Everything is basically set up the same way it was in the unstable branch code, but with the changes made to the stable code since it was branched. What code specifically are you talking about?
-
1) I see the problem here, but how do I diff?
"svn diff"
2) I didn't purposefully make any changes that didn't need to be made for the ship template code to work. What had to be done is moving a very large chunk of code into a new function (I was looking at how it was done in the unstable branch code, this looked like the best way to do it - the new function is parse_ship_info. If it was not in a new function, that huge block of code would have to appear twice) as well as adding a few functions that the code required. EDIT: Worth noting that file comparison programs usually cannot make sense of changes like this. Everything is basically set up the same way it was in the unstable branch code, but with the changes made to the stable code since it was branched. What code specifically are you talking about?
If you diff it you will see all that is changed. Also remember that the unstable branch is older compared to the stable branch, so things are seldom newer or better in there.
-
I know that the unstable branch is older. I used the stable branch code, but put into a format similar to that of the ship template stuff in unstable branch (its difficult to explain this). It needs to be in this format for the ship template code to work. Let me try to explain. The "meaty" part of the ship parse code needs to be used both to parse ships and templates, and also needs to be accessed from different parts of ship.cpp. This requires it to be put into a new function (parse_ship_data). Rather than just copying the parse_ship_data function from the unstable code, I took the ship parse code from the stable code and transplanted it into parse_ship_data (with minor changes required for ship templates). This change, when interspersed with other minor changes, seems to cause file comparing programs (I used File Merge, I have been having a little trouble getting svn diff to work :nervous:) to misinterpret the change, showing the large chunks of code to be added or removed, rather than just moved.
EDIT: How do I use svn diff to compare two files? It won't let you compare a path to a url, so I can't compare my copy to the one in SVN, and it won't let you compare a non-versioned copy, so I can't compare a copy on my comp to another copy on my comp.
-
User here. I'd love to use Turey's ship template code (soon, if possible) so if you're waiting for someone to use it, I am.
It's for the Star Wars mod, so we can have Imperial and Rebel repaints and rearmaments of the same ship class, like the Nebulon B.
-
I would love to see it too. That's why I'm trying to get it into the stable branch, but my n00bishess seems to be getting in the way :nervous:
-
Odd. If I put my version on the left side in FileMerge instead of the right, then it doesn't show all of the weird random changes that I didn't make (but still shows a bunch of spacing differences I am not responsible for).
-
Umm ... taylor, could you please elaborate on the kind of random changes that appeared that you said had nothing to do with ship templating? When I compare them, I get 274 differences (of which at least 90% are spacing changes I didn't make), and the rest are stuff that has to do with ship templates. I can understand if you are getting a little frustrated with me right now, but if I'm missing something obvious, then I'd like to know about it.
-
I've been out of town, so I haven't had a chance to go back over it again. I'll have to get back with you about it in a day or two when I get more time to work on FSO stuff.
-
:bump:
Anyone else wanna help get the ship template code committed?
-
:bump: again
I finally figured out how to create a diff. I went through it, and it looks like almost all of it actually pertains to ship templates (the rest is not my fault). Anyway, here it is:
[attachment deleted by admin]
-
Is this tested and working now?
-
Yes. It works fine for me.
I haven't *tried* to break it though.
-
Try.
If you can't break it with anything current I'll add it to the 3.6.10 branch.
-
All right. I've gone through this a little, and I haven't been able to break it really.
There is one small thing though. This really applies to all ships, though it could mean something different in the context of ship templates. If a template that a ship is supposed to use is not found (or hasn't been loaded yet), you will get nothing but a warning and everything will continue. This might result in a ship missing vital data, such as POF file, which will crash the game later. I'm not sure if this is really worth fixing though, as the same would apply to a ship that didn't have any values (like pof file) defined (one that didn't use ship templates).
Otherwise, this code seems pretty stable to me.
-
Has this been forgotten? :(
Sorry if I'm being annoying, but I really want to see this committed (unless there's a reason why you think it shouldn't be committed :nervous:).
-
Actually it's on my list to do today at some point. I just wanted to commit the stuff from my last recent build before doing so. (It's been sitting around as a NEW post for the last couple of days so I didn't forget it).
-
Actually it's on my list to do today at some point. I just wanted to commit the stuff from my last recent build before doing so. (It's been sitting around as a NEW post for the last couple of days so I didn't forget it).
Sorry, I didn't know :nervous:
-
No need to apologise. Anyway it's committed now. :)
-
THANK YOU KARA!!!
for committing this. And thank you phreak for teaching me how to make diffs, and thank you taylor for giving me the idea to do this in the first place ... sometimes I just want to thank the whole SCP team!!! :)
EDIT: And almost forgot turey, for writing this code in the first place ;)