The Daily Click ::. Downloads ::. Demo ::. Discaster 2
 

Discaster 2
Author: Disthron Submitted: 22nd October, 2009 Favourites:0
Genre: Demo Downloads: 493
Rated:


Edited By Disthron on 2/9/2011

Edited By Disthron on 10/26/2009

Edited By Disthron on 10/22/2009

Hi every one.

I've continued working with the Ray Casting object and have figured out how to make walls that can be demolished and doors that can be unlocked with switches.

To make the breakable walls, at the start when the walls are being loaded for the collision detection I checked the Material ID (the number for the texture) for the wall that was being loaded. If the Material matched the one I had decided would be breakable instead of using the normal wall segment I created an active object to act as the wall instead. Then I loaded the walls x and y coordinates into a couple of the variables.
When the player shoots the wall, it takes the x and y coordinates stored in the object and changes that walls texture. Then destroys the object so the player can walk through.

For the switches/doors. Again, when the walls are being loaded in I check to see if the Material ID corresponds to one of the switches in the level. So in this demo there are 4 separate switch textures that all look the same but open different doors. When a Material ID matches one of the switches I create an active object in place of a wall, like with the destructible walls, this time I put the texture ID of the door I wont the switch to open.

When the door is loaded, if it's texture corresponds to one of the locked doors I load it's Material ID into the door object and set a "locked" property so the door will not open until it is "unlocked".

Finally, when the player activates the switch it searches through all the doors looking for a matching Material ID. Unlocking all the doors that have it.

Well that's a brief overview of how I did it. I hope that helps. Also, the source is included so you can take a look at that too. I'd be really interested to here any feedback from you guys and galls. What you liked, what you didn't like.

I uploaded a video of it to youtube if you'd like to check that out.
http://www.youtube.com/watch?v=72lhe2y4nyE

------------------------ [EDIT] ------------------------
I have been told that the downloads for my Discaster demos are down. So I have comiled them into 1 zip and re-uploaded them. Discaster 1-4 all point to the same download witch has all the demos.

Review This Download



 


http://www.megaupload.com/?d=XSRBXS4K (1.70 mkb )



Posted by Kisguri 22nd October, 2009

Super Duper Wuper Awesome!
 
Posted by UrbanMonk 22nd October, 2009
Rated :

How long does this door shooting thing take to set up?

Also: Make a tutorial please.
 
Posted by alastair john jack 23rd October, 2009

not bad. For the background it would be good if it wasn't static, would be a lot nicer if it moved.
 
Posted by JustinC 23rd October, 2009

I could walk through basically any wall by just pushing up against it briefly. Not sure if this is a bug in the programming or with the extension itself.
Comment edited by JustinC on 10/23/2009
 
Posted by Disthron 23rd October, 2009

Thanks for the feedback everyone.

UrbanMonk, well I've put a lot of info into my comments to help people figure it out. I'll think about doing a proper tutorial on how to do it.

alastair john jack, thanks, I'm not quite sure how to make the background move with the environment. As it is just a static background right now. I tried mucking around with the rAngle veriable but I didn't get anywhere with that.

JustinC, this is a problem that has come up very intermittently. I had thought it was only doors that this happened on. The bug would be in the programing though. There is no collision detection in the extension itself. What happens is, when a wall is loaded from the map file it places an active object onto the frame at the same X-Y coordinates and pasts it to the background as an obstacle. So when it comes to programming everything besides the Ray Casting extension itself it's kind of like making an overhead game. Dose that make seance.
 
Posted by Pisarz Ksiazkowicz (Maciej Janiszewski) 23rd October, 2009

It crashes sometimes.
 
Posted by JustinC 23rd October, 2009

I tried it again, the problem doesn't come up when going right up against a wall, but it happens in every single corner I pushed up against. Maybe that will help.
 
Posted by Disthron 23rd October, 2009

JustinC, I went and turned off fine detection in my copy and I have not had it happen since. However it was hardly ever happening before anyway. I tryed it with the download version and I had to try it for like 20min for it to happen. So your saying it happens each time you go head into a corner? Is anyone else having this problem?

Pisarz Ksiazkowiczz, I had it crash on me when I was trying to change how the gun fires, but I didn't start working on that until after I released it. So it might be a separate problem. Can you tell me when it crashes?
 
Posted by UrbanMonk 23rd October, 2009
Rated :

It happens in certain corners every time. Play around in it and you'll find em.
 
Posted by Fanotherpg 24th October, 2009

Don't worry Dishtron the same bug is in The Staff and original examples even in Wolfenstein 3D.
 
Posted by JustinC 24th October, 2009

First room you start in, went by the knight in the corner and was able to go through. As far as I can tell it happens in every corner I push against.
 
Posted by Rhys D 24th October, 2009

is your frame big enough for the 2D level to fit in? there is a problem with collisions if your frame doesn't fit the level, it states that in the raycaster example file
 
Posted by Disthron 24th October, 2009

JustinC, you didn't change the detentions of the frame did you?

[edit]
It seems Rhys D beat me to the punch. I made all my levels probably way bigger than they needed to be, because I couldn't be bothered to figure out how big they needed to be.

So did you make them smaller? Becouse MMF2 will not check for background collisions that happen outside of the frame. I can't even walk into the corner where the knights are. The Knights are blocking my path.
Comment edited by Disthron on 10/24/2009
 
Posted by Rhys D 24th October, 2009

no thats what I meant, they need to be big enough so the background collisions can take place, if thats already the case...then I have no idea!

oh and any chance you can upload it to mediafire? filefront wont load it for some reason
Comment edited by Rhys D on 10/24/2009
 
Posted by JustinC 24th October, 2009

Nah I didn't change anything, I don't even have mmf2, I'm just playing with the exe.

First room, you're facing a knight and a clear window. If I walk towards the window I slide towards the knight and then behind it. Then I can go straight through the corner.

Or just walk out the first room, then push against the corner between the glass door and the wall and I pop out there too.
 
Posted by Disthron 25th October, 2009

Hi JustinC, I don't know what to tell you. I tried what you said and I couldn't get it to glitch. I have been able to slip past things and past walls before but it dose not seem to wont to do it now that I'm trying.
 
Posted by JustinC 25th October, 2009

Could you upload a version with the fine detection turned off? You said you turned it off and haven't had the problem happen since. Maybe that is the difference in what we're comparing.
 
Posted by Disthron 26th October, 2009

JustinC, done.
 
Posted by bigredron 26th October, 2009
Rated :

Cool example. I also can go through the wall. The It seems that your collision object can squeeze past the armoured knight and the wall and then goes through the wall into the next room. This was with the armour on the right of the jail cell wall.
 
Posted by Disthron 26th October, 2009

I still can not get this dam glitch to occur. Well, the sorce code is in the zip file, so anyone who is having this problem can try and fix it themselves. If you press tab on the second level it brings up the map.

All it dose is make the ray casting objects invisible so you can see the actual level beneath. Those brown squares are what's used for the collision detection of the barrels and so fare all the other sprites that you can't walk through. So there shouldn't be enough space for the player to get through. I mean if anything they should get stuck. I don't know.
 
Posted by bigredron 26th October, 2009
Rated :

Hmm wierd, i tried at home now and I cant go through the wall either. When I tried it earlier I was on my work PC. Is there a chance its to do with framerate? Maybe its skipping some frames or something and the collision detection doesnt pick it up?
 
Posted by Disthron 26th October, 2009

Possibly, I get a consistent 30-40 frames pre second on my PC. What is the frame rate on yours. You can see it in the second level it's the top number in the right hand corner.
 
Posted by JustinC 26th October, 2009

Still happening to me in the new version. The top number in the first frame shows about 17-22. The second frame it shows 11-15.

I'm wondering if the problem could be the multiple layers of the raycasting object? Like the underneath layer doesn't have an obstacle so it's ignoring the one on the other layer?

Are there any timed events relating to collision?

I'm probably out of ideas until I get mmf2. . .
 
Posted by Disthron 26th October, 2009

JustinC, sorry but I don't think that's it. There are no timed events relating to collision. At the start of the level it loads all the walls and stuff from 1 file. Even though I use 3 Ray Casting objects with 3 maps I load all the walls from the same map. So it's not like there are some walls that are loaded in one map and some walls that are loaded from another. I can only guess that a drop in the frame rate causes a glitch in the collision detection.

Unfortunately I'm not sure how to fix that. Other than using only 1 ray caster. Maybe if I tried fiddling around with the collision detection. But since I can't get it to glitch on my machine I won't know if anything I'm doing is working. I'll have to rely on feed back from others.
 
Posted by JustinC 27th October, 2009

I might have to get ahold of the demo that comes with the raycaster extension to see if it still happens. It's sounding like a glitch with the extension itself, although there must be some way to fix it without a new version. . .
 
Posted by Chrisbo 28th October, 2009

I am having the exact same problem as JustinC...every single corner it happens. Cool little shooter though.
 
Posted by Pisarz Ksiazkowicz (Maciej Janiszewski) 30th October, 2009

Yes, It's problem with gun. Always, when I press left button, it crashes.
 
Posted by Disthron 30th October, 2009

Pressing the left mouse button doesn't do anything for me.

I'm working on another demo and as I've added more stuff I've found that I'm getting the wall collision bug too now. It seems to happen in specific places where if you try to squeeze past a sprite you get pushed through the wall.
 

 



Author

Favourite



Advertisement

Worth A Click