Make $750 and help jMonkeyEngine at the same time!

Honestly I’d show the code sooner rather than later. Any re-factoring needed will be less painful on the unpolished version.

1 Like

Ok, the second chapter is almost finished; up until now, all programmed by myself:
[video]

[/video]

<cite>@zarch said:</cite> Honestly I'd show the code sooner rather than later. Any re-factoring needed will be less painful on the unpolished version.

Yep, you´re right. I’ll upload the project when I’m back at the computer.

3 Likes

looking good so far, good job :slight_smile:

@m41q said: Ok, the second chapter is almost finished; up until now, all programmed by myself:

Yep, you´re right. I’ll upload the project when I’m back at the computer.

Hey this is super cool! You can use googleCode or any other repo:
Create your repo: Google Code Archive - Long-term storage for Google Code Project Hosting.

Example repo: https://code.google.com/p/jme-simple-examples/

Also you will be able to add there commiters if you need to review the code. :slight_smile:

<cite>@mifth said:</cite> You can use googleCode

I had a look at googleCode and it looks cool, but I don’t really have experience with those versioning systems and I belive this project is little enough to live without those tools. :slight_smile:

Anyway, I uploaded the file here:
MonkeyBlaster.zip
Anyone who is experienced in jME is welcomed to have a look at!

You can pm me if you have any critcisms or suggestions.
After all, this project can help me to write cleaner and more stable code as well :wink:

I can’t recommend learning versioning tools strongly enough. Once you get used to them they make a massive difference, even for small personal projects.

2 Likes
@zarch said: I can't recommend learning versioning tools strongly enough. Once you get used to them they make a massive difference, even for small personal projects.

I strongly concur with zarch. Learn some version control system… it will save you years on your life and keep you from being branded “instance newb” no matter what your experience level. My teams tend to flat turn down any job applicants without version control experience no matter what the rest of their CV/resume says… how experienced could they be if they’ve never worked with a safety net?

I would definitely agree they are useful. But I only really started using them properly when I went into a team-based professional environment, last year. And if I didn’t work there, I probably still wouldn’t be using them. On my personal projects, I use them just as you said, a “safety net”, incase I screw things up completely, and want to revert to a previous version. So I’m using them no better than just copy/pasting the entire folder every so often, or using windows history, which I used to do over a year ago. I rarely diff stuff, or scan through to make sure i’m committing everything I need (for my own stuff). I get enough of that at work, and have had no problems with it so far.

So I think you’re potentially turning away some good candidates, based on a relatively minor aspect which can be learnt quite easily

It handles the keeping a copy and organising those copies. While you may rarely use the diff/revert features when you do use them they save a lot of pain.

Really anyone who’s done serious professional software development will have used a VCS and if they haven’t that’s an indicator of extreme newness. (Being new is not a bad thing but if someone is claiming experience they don’t have lack of VCS experience indicates a lack of professional software development experience).

they are definitely better for organisation of history + other features, and an experienced professional software developer should know how they operate, and they are vital for team-working. But blindly turning away someone who hasn’t used one, I don’t think is fair, especially if they have all the other skills required for the job.

If I ever hire someone, its gonna based on the passion they have for the subject, the willingness to learn new things, how hardworking they are, and how easily they will fit into the team. Over time, I think they will be a better employee

@wezrule said: they are definitely better for organisation of history + other features, and an experienced professional software developer should know how they operate, and they are vital for team-working. But blindly turning away someone who hasn't used one, I don't think is fair, especially if they have all the other skills required for the job.

If I ever hire someone, its gonna based on the passion they have for the subject, the willingness to learn new things, how hardworking they are, and how easily they will fit into the team. Over time, I think they will be a better employee

VCS is a required skill for anything but an entry level programming job. If you claim “years of experience” and haven’t actually used VCS then you are likely falsifying your information and I have better things to do with my time than to prove it. :wink: It’s as much of a red flag as someone who has never opened a command prompt. I consider them about equal on the “skills one must have” to be a competent developer.

Be friendly around m41q, he never claimed to be a professional programmer, or any level of expertise actually.

On team status: After some looking into code, we concluded that we’re probably on too different priorities to work well together. Currently each is pursuing his own implementationn, with an occasional peek over the fence to steal the good ideas.

You can see my work on https://bitbucket.org/toolforger/monkeyblaster/src .
Ignore anything outside the src/ subdirectory, that’s just Eclipse&Gradle stuff that I haven’t properly decoupled from my work environment yet.

The program currently just shows a black screen.
Haven’t found out why yet; I assume it’s either a coordinate/viewport/camera mixup, or an invisible Picture object.
So there’s nothing to see yet except the sources.

@toolforger said: Be friendly around m41q, he never claimed to be a professional programmer, or any level of expertise actually.

Yeah. Just to make it clear, we are no longer badgering the OP but just arguing the merits of hiring someone with improper skills. :slight_smile:

omg, there was quite a conversation while I was asleep XD

And nope, I am not really professional since I’m just a few months out of school.
I’ve been programming 3D applications for about 6 years now, but since it was simply a hobby, I never really worked with a team and therefore without VCS.
(besides those projects in school, but they were simple, neither 3D nor OpenGL nor multiplayer or anything)

Soooo… I’m sure you all are right and it will open my eyes once I learn VCS; I’ll have a look at it some time in the future, ok? :wink:

As for the project:
Programming has been fun until now and I’ll be sure to finish at least the gameplay (it isn’t that much anymore).
And everyone who knows the “best practices” is still welcome to check my code out! (even if its not in a VCS :wink: )

Sorry guys I seem to derail threads a lot. I guess everyone’s recruitment process is different. Good luck with the independent tutorials!

@m41q check out my code at the link I gave above if you want to see the code of an “old fart” who’s been around in IT since 40+ years.
I’m not claiming perfection (that’s too much effort and a diminishing-returns problem), merely that it should be in the top third :smiley:

@toolforger said: @m41q check out my code

Yep, I´ve checked it out already.
I have to admit the three methods of yours are extensively commented and clear to read.

I think I tend to be more “easygoing” with the code; for example
[java]
final boolean flipY = false;
TextureKey textureKey = new TextureKey(texturePath, flipY);
[/java]
I`d simply do:
[java]
TextureKey textureKey = new TextureKey(texturePath, false);
[/java]

Anyways, on the topic of “good code”:
The author of the tutorial uses static literally everywhere. This is NOT the way to do it, I guess?
Even if it may simplify the tutorial due to a lot less references.

I’m having a problem that I don’t understand at all.

The object hierarchy is rootNode->Node->Picture, which carries a 40x40 png file, centered on the Picture via .setPosition(-20,-20).
I’m positioning the thing by modifying the intermediate Node. Which works fine as long x stays below 26 and y below 25 - at x=26 or y=25, the image simply vanishes… :-?

This looks like clipping gone wrong, but I have no idea what might be causing it - I have ripped out all camera initialization code, so everything should be on default settings.

Here’s the code that creates the thing:
[java] public Entity(AssetManager assetManager, String name, Node rootNode,
float x, float y, float radius) {
// Texture
final String texturePath = “Textures/” + name + “.png”;
final boolean flipY = false;
TextureKey textureKey = new TextureKey(texturePath, flipY);
Texture2D texture = (Texture2D) assetManager.loadTexture(textureKey);
float width = texture.getImage().getWidth();
float height = texture.getImage().getHeight();
// Picture
final boolean useAlpha = true;
Picture picture = new Picture(name);
picture.setTexture(assetManager, texture, useAlpha);
picture.setWidth(width);
picture.setHeight(height);
picture.setPosition(width / -2.0f, height / -2.0f);
// Node
node = new Node(name);
node.attachChild(picture);
rootNode.attachChild(node);
// Position
// setPosition(x, y);
setPosition(25, 24);
// radius
this.radius = radius;
}

final private Node node;

private void setPosition(float x, float y) {
    node.setLocalTranslation(x, y, 0);
}[/java] 

Maybe Picture isn’t the right thing to use for stuff under rootNode? (I’m seeing it’s in the Gui bucket, which isn’t entirely wrong but not what I would have expected.)

<cite>@m41q said:</cite>I think I tend to be more "easygoing" with the code; for example [java] final boolean flipY = false; TextureKey textureKey = new TextureKey(texturePath, flipY); [/java] I`d simply do: [java] TextureKey textureKey = new TextureKey(texturePath, false); [/java]

The problem with booleans is that you don’t see what that false in the call means. The final boolean is just an attempt to give that thing a name that makes sense in the caller’s context. I was doing that because it’s going to be read by people who just see the web site and don’t have the SDK where they can mouse-over and see what the second parameter means.

In my day-to-day work, I tend to write that only for those one-off functions that not everybody knows by heart, and if there are many such parameters so mouseover doesn’t work well enough.

Alternatively, I could have documented the parameter on the call itself, like in

[java]
TextureKey textureKey = new TextureKey(
texturePath, // path
false); // flipY
[/java]

That requires three lines instead of the two, so I tried making it a local constant.
I’m not 100% happy because it obscures the overall flow a bit, but ah well it’s not

<cite>@m41q said:</cite>The author of the tutorial uses static literally everywhere. This is NOT the way to do it, I guess? Even if it may simplify the tutorial due to a lot less references.

It doesn’t even simplify the tutorial, it’s just bad code.
Though one has to be careful with such judgements. The original is C#, and the trade-offs are slightly different there.
But I think he’s trying to do an entity system and largely missing the point. Classical case of doing good design “by recipe”, not really knowing WHY a certain design rule was invented and what benefits it’s supposed to give. As far as I have seen his code, he’s losing most of the benefits of an entity system with his statics - not that it would matter at all with such a small program anyway.

To me, it looks like I’ll be doing an entity system but drop the entity manager because the JME data structures do fine already (scene graph for positions, controller for behaviour - behaviour is simple enough that I haven’t seen a need to split it up into separate entities).
I might be misinterpreting the nature of an entity system though. I read the papers on entity systems, but I haven’t really understood how their construction makes their benefits happen, so I might be missing a point myself here. I guess I’ll see that once my code becomes complex :slight_smile:

@toolforger said: (I'm seeing it's in the Gui bucket, which isn't entirely wrong but not what I would have expected.)

If Picture is automatically putting itself into the Gui bucket then that’s pointless and should be fixed. I remember making the same fix once to BitmapText.

In the mean time, you can revert it to Inherit if that’s really the case. Not sure it will solve your issue but it jumped out at me.