Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Top down shooter

Author
Message
BeastDeath
13
Years of Service
User Offline
Joined: 7th Jul 2011
Location:
Posted: 26th Sep 2011 01:23
Hello again, (sorry for the same titles, 2 posts) but I think it would be best to post it in here.

I'm a blitzbasic coder and I've decided to move to darkbasic pro, I'd like to ask how the 2d/3d works in dbp?

In 2d If I want to make the level bigger than the screen itself, is there a camera in 2D that will allow me to move so I can see the rest of the level or do I have to move the background itself and not the player?

Is it better to do a top down shooter in 3d, but make it look like 2d, is there any support with the camera for that?

I'm trying to make a top down shooter which contain a level with collisions such as SAS zombie assult, what would be the best way to do this?

Thanks,
BeastDeath
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 26th Sep 2011 06:19
The best way would be to to it in 3D, you can use a shader to make it look 2D.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 26th Sep 2011 18:02
Quote: "In 2d If I want to make the level bigger than the screen itself, is there a camera in 2D that will allow me to move so I can see the rest of the level or do I have to move the background itself and not the player?"


There is no camera with 2D. Typically, making worlds that are larger than the screen are done by creating an array that holds image values and the image values are pasted on the screen. If you search for "2D tile" (minus the quotes) you should be able to find something to help you with that.

Quote: "Is it better to do a top down shooter in 3d, but make it look like 2d, is there any support with the camera for that?"

I agree with Mr. Bigg here, but really it is a personal preference. To me it would be easier to simply move the camera above the player/enemies/world than it would be to move sprites.

BeastDeath
13
Years of Service
User Offline
Joined: 7th Jul 2011
Location:
Posted: 27th Sep 2011 00:49
Is there anything out here that can do 2d in 3d? any pre-made functions/tutorials for 2d inside a 3d world?

Are there any functional map editors for 3d to look like 2d.
Webber
13
Years of Service
User Offline
Joined: 27th May 2011
Location:
Posted: 27th Sep 2011 04:33
If your going to make it 2D then use sprites, and just move the background.
But if you want a down view with 3D, then you can just adjust the positions of the 3D camera.

I suggest 3D, the game will come out much better, and in some ways it will be easier to do.

Just rotate the camera so it has a down view on the 3D world.
The game will have a 2D feel to it, but the graphics will be 3D.

I like games, and stuff.
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 27th Sep 2011 13:57 Edited at: 27th Sep 2011 14:16
I'm not sure why everyone is telling you to do it in 3D. I looked at numerous videos of SAS Zombie Assault & SAS Zombie Assault 2 (didn't look at 3 yet); and without a doubt, I would do the game in 2D. If anything, I might mix some 3D in, but I just don't understand why everyone thinks that it will automatically "LOOK" better in 3D.

To me it would all come down to how proficient you are as a sprite artist. This type of game, IMHO, looks better with high quality 2D sprites, than it would with 3d models shot from above. But maybe that's just me.

I for one like the 2D Street Fighter games over the 3D... (And I personally think the sprite games look better)... even with the fact that Capcom did and "extraordinary" job getting the 3D to look superb in keeping the high standards and details from the spritework that they are renowned for.

I think that the Metal Slug series looks awesome and better than if it were done purely 3D. More closely related to your game... I think Smash TV and Total Carnage look and play amazing, and I never... not even today think or wish that they were done in 3D.

I could see jazzing up the game with some particle fx.


How the game would be built and move in 2D
Any hoot, the map would be built from tiles. stored in a multi-dimensional array (layers).. and you would only display what is actually on the screen. You would have a certain area on the screen for the player to move in (so the player is not stuck in one place the entire time). When the player reaches the threshold of the that invisible bounding rectangle,, then you start smooth scrolling the world behind him, and the character animates in place.

That's how I would do it!

******


Back to this 3D vs 2D
Now back to the 3D vs 2D. I honestly think you will get better results with doing sprites. I'm not sure of your modeling, texturing, and animating skills; But, I think that unless you can come close to what Capcom was able to achieve, your game will look and play better in 2D. I think people have negative thoughts about 2D work, because many people don't put in the time required to create engaging 2d sprites (or perhaps don't have the skill).

This game can look bad in 2D as easily as it can look bad in 3D. Same goes for it looking good... but I just think there is a better chance of getting the detail and action down (from the gameplay I watched) in 2D. Going 2d will keep the feel of the game you are inspired by. I don't really see it as being more difficult, except that there is a lot of drawing and 2D Animation to be done.

Perhaps it's easier to create a halfway decent model, move some limbs around, take some keyframe animations or whatever, get a decent texture on it, and you'll have a decent 3D top down shooter,, that everyone after the fact will wonder why it's not in 1st or 3rd person view. But I think if you have the 2d skills,, you have a chance to create something really special here.

I know that last paragraph is full of my bias and assumptions. But they are my oppinions. I may not be right... but in my gut I feel that this could be a true 2D winner!!!!

Bottom line
3D does not equal a better game in the end
2D does not equal or guarantee a better game in the end
It will all depend on you and your abilities as a coder, an artist, a level designer, a storyteller, an illusionist/magician etc... Good luck with whichever way you go.

Thanks for letting me throw in my .98 cents!!!

Your signature has been erased by a mod please reduce it to 600 x 120.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 27th Sep 2011 14:57
You can render your scene in orthographic using Cloggy's D3D dll here:
http://forum.thegamecreators.com/?m=forum_view&t=69221&b=5

The command is "D3D_SET_ORTHO_PROJECTION"... I have been using it on a top down RTS I'm making in AGK. I personally only use it to create my 2D sprites as AppGameKit is 2D only at present. You could use d3d to do your whole game in 3D but look 2D.

The only reasons I would consider doing this would be:
1-If you are used to coding in 3D
2-If there are certain lighting / FX you want to use

The difference will only be noticeable between 2D and 3D if you are using special lighting or effects, otherwise it's not worth it. Here is an example of the sprites I made for my RTS rendered in 3D to create 2D sprites (two new utilities are about to be released by TGC which might help with this):


zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 27th Sep 2011 15:40
@baxslash, I can agree some of what you said. And yes, dynamic or special lighting/shadow fx I (even with my limited 3D experience would be easier), but I'd still trade that off for what I could gain "potentially" by pixel pushing and some trickery.

I like your 3d rendered sprite,, albeit the limb movement being a ittle exagerated for my tastes;(Though without the background and knowing the context and the actual speed... it may be spot on) .

For me personally, the way that I would use this would be in assisting me with animation. In other words I would use those frames as reference for the movement, and then I would rework each and every frame pushing pixels. Maybe not every pixel (I'm not a die-hard purist Pixel Art) but definately all the outlines and anything else I'm not happy with.

I'd still do the game in 2D. =)

Your signature has been erased by a mod please reduce it to 600 x 120.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 27th Sep 2011 15:55
Quote: "but I'd still trade that off for what I could gain "potentially" by pixel pushing and some trickery"

Quote: "I'd still do the game in 2D. =)"

Me too. That's why mine's 2D

Quote: "I like your 3d rendered sprite,, albeit the limb movement being a ittle exagerated for my tastes;(Though without the background and knowing the context and the actual speed... it may be spot on) ."

It's a Bond1 zombie model from one of the model packs for FPSC. Looks fine in action to me.

Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 28th Sep 2011 06:01
You could use 3D planes. You would get the camera advantages of 3D and the 2D advantage of "sprites". Just texture the plane with your sprite.
BeastDeath
13
Years of Service
User Offline
Joined: 7th Jul 2011
Location:
Posted: 28th Sep 2011 18:49
I guess I'll do it in 2d with sprites. Can someone start me off with loading an image and being able to rotate it with the mouse position on the screen?
BeastDeath
13
Years of Service
User Offline
Joined: 7th Jul 2011
Location:
Posted: 29th Sep 2011 23:09
Ok I was able to find some code to rotate the sprite of the mouse position.

Currently I have a player(gun attached with the image) whenever I move my player to the mouse cursor it will start to spin crazy. I'm guessing I would have to split the gun and player to their separate images, how would I parent the sprites, and would it solve the problem?

Another problem is the co-ordinate system I have in place, x and y. When I want to move my sprite I use the move sprite command: move sprite, player.id, 1

How would I make it so that the player.x and player.y are correct whenever I move the object?

Also I couldn't find a move left/right command? the move sprite would only move forward/backward?

Thanks
BeastDeath
13
Years of Service
User Offline
Joined: 7th Jul 2011
Location:
Posted: 30th Sep 2011 00:23
Sorry about triple posting, I solved my co-ordinate system with the x and y, along with the player spinning around with the mouse. I called the sprite id, x, y, img command in the main loop again and just changed the x, y values with the keys.
nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 30th Sep 2011 23:46
Basically, there are 2 ways to aproach a top-down game when it comes to controls. Either the old-fashioned posX, posY method or the ROTATE SPRITE and MOVE SPRITE method (E-Z-er). By using sprite rotation, you only need to be able to move your sprite forward and back as direction is then controlled by rotation.
AS FOR TEH GUN: you simply need to make its coordinates and rotation relative to your player using the SPRITE X()/SPRITE Y() commands to obtain the player location, then place the gun accordingly. With the correct use of alpha channels in your images, it'll look great! Remember that sprite rotation uses the corner to rotate on so drawing your weapons diagonally may make life easier (depending on your aproach).
Hope this info is of some use to you and good luck with your project!

No matter how much you know, you'll always have far more left to learn... (My head hurts)
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 1st Oct 2011 03:17 Edited at: 1st Oct 2011 03:25
Quote: "You could use 3D planes. You would get the camera advantages of 3D and the 2D advantage of "sprites". Just texture the plane with your sprite."


I like this approach. I've only tested the basic concepts of this technique in the past. I would like to get more proficient at using it and exploring more complex ideas.

I think I stayed with actual sprites mainly because I was reliant on the animated sprites commands, and I already had my color cycling routine tied to actual sprites.

Your signature has been erased by a mod please reduce it to 600 x 120.
BeastDeath
13
Years of Service
User Offline
Joined: 7th Jul 2011
Location:
Posted: 1st Oct 2011 18:15
Ok I'm at the stage were I'm shooting bullets. What would be the correct way to do this? Currently I do an if statement to check whether the mouse is clicked = 1 then call sprite

My way now:
bullets x, y co-ordinates is the same as the players
bullet.id, bullet.x, bullet.y, bullet.img

I also rotate that bullet to the same as the players angle
I also calculate the center of the image and offset it
then I make the bulletExist variable to equal true and end the statement.

then I make a new if statement directly under this one to check if the bulletExist is equal to true, and then move the sprite by 2.

Why it doesn't work
This doesn't work at the moment because it can only create one bullet, whenever you click it will move the original back to the start, if you hold down the left mouse button the sprite will also freeze.

any tips?
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 2nd Oct 2011 19:35
There are a few ways to handle this. I would probably need to do a little research myself to see what the best approach is. Off the top of my head I can think of 2 scenarios.

1. You actually create each individual bullet, animate it, keep track of it's "life-cycle", do collision checking on it, "kill" it at the end of the life-cycle. You would have to create New bullets, never duplicating a sprite that already exists. Once a bullet no longer exists, you could then utilize that sprite number again.

2. You create an animation and the appearance of numerous bullets, but in reality you are not tracking each individual bullet for precise collisions. Rather you have a determined range of kill, and anything in that range is considered a hit.

It all depends on if you actually need to detect precise collisions with each indiviual projectile. I think I would use a combination of the two dpending on the particular weapon. Certain weapons would be more akin to a particle emiitter effect and I would have a kill range, other weapons I would track individual projectiles. Maybe after some research I will find a better solution that isn't coming to me right now.

So your code needs to incorporate this.

Your signature has been erased by a mod please reduce it to 600 x 120.
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 2nd Oct 2011 21:05
After reading more into it... I think I would stick with number 2. above for a top-down shooter. Either using a circular range of kill, or a simplified ray casting method. This is one of those times that what appears to be happening visually and what is actually going on under-the-hood is not one in the same. I think it would just be daunting, slow, and uncessary to track every bullet and it's mulititude of possible collisions in a game like you describe.

Your signature has been erased by a mod please reduce it to 600 x 120.

Login to post a reply

Server time is: 2024-11-24 01:51:07
Your offset time is: 2024-11-24 01:51:07