World Border

Hopefully this is a simple question to answer. Is there any way to put a border around a map so a player cannot walk off of the edge of the map into the black void?

yes. there’s lots of ways to achieve this depending on how your game is set up.

@icamefromspace I am using a height map to generate my terrain so in theory when the player or an enemy reaches the edge of the heightmap terrain they can go no further.

If this sort of setup is possible could you suggest a solution?

Test the player’s location on each update, and if it’s too close to the edge of the terrain, bump the player back toward the center.

plane collison shape?

2 Likes
@Empire Phoenix said: plane collison shape?

If you’re already using Bullet physics then that would be the simplest solution. To spell it out for the OP: four rigid body controls, one for each edge of the terrain, each with a vertical plane collision shape.

@sgold I will try to use the PlaneCollisionShape although I am a little confused as to how to set it up in the way that I need. Is there any documentation on PlaneCollisionShapes?

Next time do a little bit of research instead of just asking, you will get worse/no answers if you do not put any effort into the question. It takes under 10 seconds to find this documentation if you just use common sense :confused:

More specifically to the plane collisionshape itself
https://www.google.co.uk/search?q=jmonkey+javadoc+planecollisionshape&ie=utf-8&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb&gws_rd=cr&ei=1TPLUsiMGMK2hQfQqoCoCA

EDIT: Sorry to be an asshole but it really is necessary

http://hub.jmonkeyengine.org/javadoc/com/jme3/bullet/collision/shapes/PlaneCollisionShape.html

Dan: it wasn’t necessary; it was your choice.

@sgold It is necessary in order to make the OP more independent over his own code, it is necessary in order to stop questions like ‘can i do this’ and ‘how do I do that’ when it takes seconds to find the documentation, a waste of everyone’s time. As the old saying goes, give a man a fish and he will be fed for a day, teach a man to fish and he will be fed for a lifetime. So, yes, in my opinion it was necessary.

1 Like

@javagame, there are ways to suggest searching the docs without sounding like an asshole.

The OP’s last question was addressed to me specifically, yet you chose to intervene, apparently to forestall further questions in the same vein. If replies like yours actually put an end to the posts which vex you, that would be something. But they don’t. These forums have been running for years, and the questions keep coming, often from folks who’ve already been told once or twice to RTFM.

It seems to me that teaching someone to fish involves a lot more than just yelling directions to the nearest tackle shop. Teaching requires patience. It benefits from an attitude of curiosity about why another person is having difficulties. It’s a weird thing … concepts you regard as common sense may prove quite confusing for people who come from different backgrounds.

Nine months ago I was a JME3 newbie without the ability to post to the forums. I clearly remember how hard it was to solve problems by reading and googling the documentation. There’s a steep learning curve, and few (if any) who struggle with it are lazy in my view. It’s fine if you don’t want to “waste time” on them. You can save even more time and effort by ignoring them.

@sgold of course I remember that too. I always asked common sense questions because I couldn’t/didn’t think to read the docs, but now I can and do go there first because normen and others were assholes to me, and that taught me not the go straight to the forums but read the docs instead. I did try to be nice as possible in my post and even apologized. It obviously took much more time for me to make those images, edit, upload and post them then it would have to just ignore or post documentation, so no I don’'t think it’s ‘not worth my time’, I think it is a solution which, in the long run, will benefit OP more. I did try to get the balance right between asshole and helpful, and even apologized at the end. Sorry again.

@sgold said: @javagame, there *are* ways to suggest searching the docs without sounding like an asshole. Nine months ago I was a JME3 newbie without the ability to post to the forums. I clearly remember how hard it was to solve problems by reading and googling the documentation. There's a steep learning curve, and few (if any) who struggle with it are lazy in my view. It's fine if you don't want to "waste time" on them. You can save even more time and effort by ignoring them.

This is kind of randomly off topic but it’s interesting how this sort of thing ebbs and flows. I’ve kind of kept half an eye on your posts because they’ve become really helpful to the newly joining ‘newbs’. There always seems to be a point in one’s journey where ‘enough is enough’ and they also start ignoring the two sentence questions. Usually it starts by posting messages consisting just of one javadoc link (which I do all the time and people claim is rude). I’m sure you will last longer than most. :slight_smile:

A game engine attracts an interesting variety of people. It’s different than something like Tomcat or JBoss. Most of the people posting to groups like that are already there because they’ve been doing Java and are now at a point where they need something. It’s not like they just woke up one day thinking “I want to code something for jboss!!”

However, games are exactly like that. “I played this game and now I want to make one. What do you mean I have to learn to code first?!?” Few communities have as many people trying to go from 0 to infinity in such a short time. After a while, it wears on the people who stay a while and we may ignore 50 posts before finally responding to one… rudely, I guess.

And that’s where the ebb and flow comes from. There seem to be periods of time where the former-newbs all get fed up in unison and stop filling the gap. Or just get busy with their projects (like the rest of us) and don’t have as much time to read/respond. Usually you see this when you notice one or two “bump” posts over a period of days. (Lately it’s been pretty well trucking, though.) Those of us who still refresh the ‘latest posts’ page 100 times a day then feel the need to step in and sometimes it’s not pretty.

I think if we didn’t have an SDK it would be different. At least my experience in the libs without an easy pointy-clicky path to trouble seem to not attract so many ‘new coders’.

The advice to ignore posts is a good one in general, though. I wish I took it more.

Dan, I begin to understand where you’re coming from. Thanks for the reply.

Thank you for that perspective, @pspeed.

@Connor14: If you’re still stuck, tell me where you’re at and I’ll try to help.

btw theres been times where ive googled for stuff and i couldnt find any resources besides forum posts of people saying “google it” :smiley:

the real waste is if the post doesnt contain an actual answer. thus creating a searchable forum thread with no information.

@icamefromspace said: btw theres been times where ive googled for stuff and i couldnt find any resources besides forum posts of people saying "google it" :D

the real waste is if the post doesnt contain an actual answer. thus creating a searchable forum thread with no information.

It does help that at least the forum search is working again. It was hell while that was busted because it wasn’t even reasonable to expect people to google it.

@icamefromspace said: btw theres been times where ive googled for stuff and i couldnt find any resources besides forum posts of people saying "google it" :D

the real waste is if the post doesnt contain an actual answer. thus creating a searchable forum thread with no information.

Also, this being said, I have no special magic powers other than foreknowledge. Half the time I respond to someone, I did it after doing a quick google search for the answer. Usually, if I tell someone to search the forum then it’s because I just tried it and got a bunch of reasonable places to start in the first few pages.

Really, if someone is allergic to google then they might as well stop their game dev career right now and find a different hobby.

The best posts are the ones that show they genuinely tried to search. Sometimes it’s just a matter of having the proper keywords. If a poster doesn’t provide anything about what they’ve tried already then I routinely try to answer in as few words as possible, assuming that they have put similar effort into it.