Thanks to the developers! (& suggestion for savegames)

nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Thanks to the developers! (& suggestion for savegames)

Post by nick »

I might have overlooked "struct NodeDatabase", which contains pointers to a Serializer::Writer and Serializer::Reader. I'm hoping this is not part of the savegame process, but used internally.

There is "class Node" and a bunch of derived classes that implement a virtual function "Save(NodeDatabase&)" that use the Serializer::Writer.

Class SaveVisitor (which derives from NodeVisitor) implements the virtual method "ApplyMatrixTransform" (which appears to be the only part involved by the save process).

The save process invokes it here:

Code: Select all

void Model::Save(Serializer::Writer &wr) const
{
	SaveVisitor sv(&wr);
	m_root->Accept(sv);
	...
}
where "Accept(sv)" then calls SaveVisitor::ApplyMatrixTransform, which calls Matrix4x4fToJson (which the linker has a problem with!)

I made great progress over the weekend until I came across this linker problem. I need to resolve this before I can continue.
Any suggestions/thoughts are most welcome :)
impaktor
Posts: 1008
Joined: Fri Dec 20, 2013 9:54 am
Location: Tellus
Contact:

Re: Thanks to the developers! (& suggestion for savegames)

Post by impaktor »

You are of course including the object file in the linking, or else there will be nothing to link to, right?

I suspect it could be easier to check you error if you have a github account and push your working branch to it, so others can check it out.
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Thanks to the developers! (& suggestion for savegames)

Post by nick »

Hmmm... I've not done anything to project settings (i.e. set linker to include the object file) because jsonUtils.h/.cpp is in the same folder as jsoncpp.h/.cpp so it should already be included in the project, but I'll look into this later this evening - thanks for the tip :)
Also - other cpp files find the functions in jsonUtils without a problem - it's just Model.cpp that causes the linker to moan.

Thanks,
Nick
impaktor
Posts: 1008
Joined: Fri Dec 20, 2013 9:54 am
Location: Tellus
Contact:

Re: Thanks to the developers! (& suggestion for savegames)

Post by impaktor »

You might want to checkout src/Makefile.

Also, please consider github, since I suggest you'll push your code to there once it is ready for review, or if you need further help. People can then see your code, and "hands on" try stuff out to see what the problem, and solution is.

If you're a stranger to github, come by IRC and we'll help you if you're having trouble with github. (although not today since I'm about to be be AFK for the rest of the evening/nigh, CET)
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Thanks to the developers! (& suggestion for savegames)

Post by nick »

Got it working!!! :D
I saw that jsonUtils.h/.cpp were under "pioneer" in Solution Explorer, so I dragged them to "json".

Will look into GitHub (although I'm a bit wary of causing conflict with my tortoisesvn set up).
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Thanks to the developers! (& suggestion for savegames)

Post by nick »

I've completed the JSON save/load system - currently chasing down a problem with loading the views (loads everything up to that point).

I've installed git-for-windows following the instructions in http://pioneerwiki.com/wiki/Using_git_and_GitHub
Made my origin repo. Now git-cloning a copy to my PC.

I'm likely to need a bit of help to get started with git :) I've got a question:

I'm using git bash. I navigated to the folder where I want to develop and executed the clone command, but so far it's just created "\pioneer\.git". I was expecting to see the pioneer source files - will I need to do a git-checkout or something to extract the files from the local repo .git ? And where will they go? If they'll go in /pioneer next to .git then that's great.
Excellent - the clone has created the pioneer master code. The thirdparty directory structure isn't part of the repo though, but I guess that doesn't matter and I just need to put a copy of thirdparty source in the correct relative directory to get pioneer to build.

Plan is to manually merge the files I've been working on into my git-managed working copy, fix the remaining bugs, then push (or is it pull?!) to origin repo for testing :)
impaktor
Posts: 1008
Joined: Fri Dec 20, 2013 9:54 am
Location: Tellus
Contact:

Re: Thanks to the developers! (& suggestion for savegames)

Post by impaktor »

Awesome.

I think it is best if you come by IRC, to get more direct help and feedback on this. I don't know which time zone you're in, but it's kind of dead during GMT 23:00-09:00, but otherwise we're there.

(you push code to a repo, and you pull code from a repo)

Also, you can move the pioneer root folder to where ever you want, since it is self contained, and it will not break your git; if that answers your question, which I might not have understood fully.
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Thanks to the developers! (& suggestion for savegames)

Post by nick »

Thanks impaktor :)
Will look into getting IRC next week.
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Thanks to the developers! (& suggestion for savegames)

Post by nick »

I've had a look at IRC. I can't say when I'd be able to set it up - seems a bit daunting, and work is full-on at the mo, so I don't think I can learn anything new right now :)

Plan is to:
(1) Manually merge the copy I've been working on with my local git copy (essentially just copy and paste the relevant code).
(2) Fix the bug in loading views (and anything else I find while testing)
(3) Push to my origin repo on github for review

I've installed git and followed the procedure in http://pioneerwiki.com/wiki/Using_git_and_GitHub up to defining "upstream" as main pioneer repo.

Has any save/load code been modified since I started work on the json save/load system? (I'll find any that has while I merge, but would be useful to know in advance).

When I get to (3) above, I'll probably need some help with the appropriate git command(s) to execute.

I'll try to learn git if I can, but I'm afraid I'm maxed-out right now. It would be a shame for me not to complete this, so I'll do (1), (2) and (3) above before too much time passes, and merges become difficult.
Developers for other platforms will probably need to add a few things (e.g. to Makefiles) to get it compiling on their platforms (not much I think, as JSON is platform independent).

A human-readable json save system (with nested json objects/arrays) will be convenient to work with, editable, more robust to changes in data, and be an easier starting point for future changes in the save/load data structure :)
nick
Posts: 85
Joined: Mon Sep 08, 2014 9:24 pm
Location: Plymouth, UK

Re: Thanks to the developers! (& suggestion for savegames)

Post by nick »

Something I should check before I continue:

I've merged "body.h" and "body.cpp" and found that the two "body.cpp" files are now binary equal, but the two "body.h" files have equal text, but are NOT binary equal.

This suggests that they have different encoding (e.g. end-of-line chars).
The copy I'm merging from came from downloading pioneer from github as a zip file.
The copy I'm merging to is from the git clone command (as described in http://pioneerwiki.com/wiki/Using_git_and_GitHub)
[Edit]I'm using Notepad++ to do the merges, because it has a handy side-by-side view.
[Edit] I've not actually opened the local git copy in MSVC yet (going to wait until the merge is done) - but maybe it would alter its encoding to match with the copy I've been working on?

When I installed git, I kept the default option to convert to windows encoding when downloading to local machine, but convert to unix encoding when uploading, so not sure what's happened here.

To my understanding, I can continue, and equivalent text will be sufficient.
Later I can normalise the local copy to whatever encoding is required.

Please let me know if I'm not correct, or in danger of messing up the merge :)
Post Reply