Tutorial pages, can I add the solution?

I’m going through the tutorials and am doing some of the suggested exercises, can I add the solution to some of those I do in a spoiler tag? Useful to the less apt people that might be having a hard time!

1 Like

Oh the tag is not available… note with a spoiler warning?

I’ll be adding the solutions I resolve. It’s a bit unesthethical because there’s no spoiler tag and I might stretch out too long with the explanation, but I think it’s all good, personally.

If there are any objections simply delete the material!

Well the thing is the exercises are things for people to try to learn things. Giving them the solution I’m not sure if it helps them. It’s not like there is a right/wrong answer…either it looks good on the screen or it doesn’t but there are still potentially multiple correct ways to do quite a few of the exercises.

I guess a link to a separate page with potential solutions on it wouldn’t hurt though. What do people think?

Yeah, I thought of that, but if people are truly willing to learn, they’ll do the exercises and only see solutions for alternate ways it might’ve been done, and if they can’t do them after truly trying, they’ll check it and read the explanation.

I agree with you, but I think that who does want to learn will do them either way. Common thing’s that people see exercises, and because there’s no solution and they can’t find out how’s it done, they get frustrated and give up, whereas if there were solutions they’d study them abit to help them understand. (for example, Mathematics courses in college, where exercises have no solutions! atleast on mine.)

But yes, a separate page with the entire tutorial’s exercises done wouldn’t be a bad idea either.

Yeah, I think at the least it needs to be on a separate page. You can add a link after the list of exercises saying something like “user contributed solutions to the exercises, see how other people did it”. Could even link to a forum thread for that tutorial if you want a more “discussion” feel…thread or wiki page either works.

Meanwhile I’ll keep adding mine to the pages and when someone of power or whatever you want to know it, he can decide and change stuff around/delete, kay?

I’m just another user, don’t look at me :stuck_out_tongue: I’ve given my recommendation though.

Well surely no one is bothered by my approach, when someone comes along we see :slight_smile:

well, developers should give you separate wiki page, if you make everything good.

just wait, soon one of them will see this topic and decide.

myself i created topic with tutorial, so then developer told me to add it into docs.

You can add your own page to the wiki. Just type a wiki link that doesn’t exist (e.g https://wiki.jmonkeyengine.org/legacy/doku.php/jm3:solutions) and at the top of the page there should be a link called wiki. Then there’s a create this page sublink. Then you can edit that with all the benefits of the doku wiki. You can then link that page with a note or something. “spoiler contains answers, make sure you have attempted a solution first”

1 Like

Will do, thanks!

Is there no expandable/collapsable code container or something? Things look dirty because I suck at formatting >.>


Your solution to 3 is invalid. You need to store accumulated time in a float and add tpf to it. At the moment you are counting frames not time.

Yeah I know it’s not counting time, but it does work, I haven’t seen about time anywhere yet :<

Ahhh I understand how time is calculated! I’ll alter it, it’s more intuitive :slight_smile:

Feel quite dumb for not getting there myself lol


It’s not just about being more intuitive. Your solution was actually invalid since it was dependant on framerate. 500 frames on an empty scene on a fast computer can last around 1/6th of a second, whereas at 25 frames per second it would last 20 seconds!

Plausibly valid for the purpose of seeing stuff change for a beginner, that good? :slight_smile:

Thing is when I found the tpf thing and tried searching for a way to time things and measure time, all I came across was the Timer class which I could do nothing with hehe

So I did a little note-it with some rough estimations I used to get a second and all xD I knew about the frame rate dependent thing because it was written down on tutorials somewhere (they’re very good)

The current solution to 3 is valid - but there is an alternative approach as well that would be worth adding:

The code looks something like:

timeVar += tpf;

float scale = FastMath.sin(timeVar)/2 + 1f;


(No need for anything else).

Try it and see how different it looks and it would be worth having both in the solutions.